fw.c 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2010 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  17. * Contact Information:
  18. * wlanfae <wlanfae@realtek.com>
  19. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  20. * Hsinchu 300, Taiwan.
  21. *
  22. * Larry Finger <Larry.Finger@lwfinger.net>
  23. *
  24. *****************************************************************************/
  25. #include "../wifi.h"
  26. #include "../pci.h"
  27. #include "../base.h"
  28. #include "../core.h"
  29. #include "reg.h"
  30. #include "def.h"
  31. #include "fw.h"
  32. #include "dm.h"
  33. static void _rtl8821ae_enable_fw_download(struct ieee80211_hw *hw, bool enable)
  34. {
  35. struct rtl_priv *rtlpriv = rtl_priv(hw);
  36. u8 tmp;
  37. if (enable) {
  38. rtl_write_byte(rtlpriv, REG_MCUFWDL, 0x05);
  39. tmp = rtl_read_byte(rtlpriv, REG_MCUFWDL + 2);
  40. rtl_write_byte(rtlpriv, REG_MCUFWDL + 2, tmp & 0xf7);
  41. tmp = rtl_read_byte(rtlpriv, REG_MCUFWDL);
  42. } else {
  43. tmp = rtl_read_byte(rtlpriv, REG_MCUFWDL);
  44. rtl_write_byte(rtlpriv, REG_MCUFWDL, tmp & 0xfe);
  45. tmp = rtl_read_byte(rtlpriv, REG_MCUFWDL);
  46. }
  47. }
  48. static void _rtl8821ae_fw_block_write(struct ieee80211_hw *hw,
  49. const u8 *buffer, u32 size)
  50. {
  51. struct rtl_priv *rtlpriv = rtl_priv(hw);
  52. u32 blocksize = sizeof(u32);
  53. u8 *bufferptr = (u8 *)buffer;
  54. u32 *pu4byteptr = (u32 *)buffer;
  55. u32 i, offset, blockcount, remainsize;
  56. blockcount = size / blocksize;
  57. remainsize = size % blocksize;
  58. for (i = 0; i < blockcount; i++) {
  59. offset = i * blocksize;
  60. rtl_write_dword(rtlpriv, (FW_8821AE_START_ADDRESS + offset),
  61. *(pu4byteptr + i));
  62. }
  63. if (remainsize) {
  64. offset = blockcount * blocksize;
  65. bufferptr += offset;
  66. for (i = 0; i < remainsize; i++) {
  67. rtl_write_byte(rtlpriv, (FW_8821AE_START_ADDRESS +
  68. offset + i), *(bufferptr + i));
  69. }
  70. }
  71. }
  72. static void _rtl8821ae_fw_page_write(struct ieee80211_hw *hw,
  73. u32 page, const u8 *buffer, u32 size)
  74. {
  75. struct rtl_priv *rtlpriv = rtl_priv(hw);
  76. u8 value8;
  77. u8 u8page = (u8)(page & 0x07);
  78. value8 = (rtl_read_byte(rtlpriv, REG_MCUFWDL + 2) & 0xF8) | u8page;
  79. rtl_write_byte(rtlpriv, (REG_MCUFWDL + 2), value8);
  80. _rtl8821ae_fw_block_write(hw, buffer, size);
  81. }
  82. static void _rtl8821ae_fill_dummy(u8 *pfwbuf, u32 *pfwlen)
  83. {
  84. u32 fwlen = *pfwlen;
  85. u8 remain = (u8)(fwlen % 4);
  86. remain = (remain == 0) ? 0 : (4 - remain);
  87. while (remain > 0) {
  88. pfwbuf[fwlen] = 0;
  89. fwlen++;
  90. remain--;
  91. }
  92. *pfwlen = fwlen;
  93. }
  94. static void _rtl8821ae_write_fw(struct ieee80211_hw *hw,
  95. enum version_8821ae version,
  96. u8 *buffer, u32 size)
  97. {
  98. struct rtl_priv *rtlpriv = rtl_priv(hw);
  99. u8 *bufferptr = (u8 *)buffer;
  100. u32 pagenums, remainsize;
  101. u32 page, offset;
  102. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "FW size is %d bytes,\n", size);
  103. _rtl8821ae_fill_dummy(bufferptr, &size);
  104. pagenums = size / FW_8821AE_PAGE_SIZE;
  105. remainsize = size % FW_8821AE_PAGE_SIZE;
  106. if (pagenums > 8) {
  107. RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
  108. "Page numbers should not greater then 8\n");
  109. }
  110. for (page = 0; page < pagenums; page++) {
  111. offset = page * FW_8821AE_PAGE_SIZE;
  112. _rtl8821ae_fw_page_write(hw, page, (bufferptr + offset),
  113. FW_8821AE_PAGE_SIZE);
  114. }
  115. if (remainsize) {
  116. offset = pagenums * FW_8821AE_PAGE_SIZE;
  117. page = pagenums;
  118. _rtl8821ae_fw_page_write(hw, page, (bufferptr + offset),
  119. remainsize);
  120. }
  121. }
  122. static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
  123. {
  124. struct rtl_priv *rtlpriv = rtl_priv(hw);
  125. int err = -EIO;
  126. u32 counter = 0;
  127. u32 value32;
  128. do {
  129. value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
  130. } while ((counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT) &&
  131. (!(value32 & FWDL_CHKSUM_RPT)));
  132. if (counter >= FW_8821AE_POLLING_TIMEOUT_COUNT) {
  133. RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
  134. "chksum report faill ! REG_MCUFWDL:0x%08x .\n",
  135. value32);
  136. goto exit;
  137. }
  138. RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
  139. "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
  140. value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
  141. value32 |= MCUFWDL_RDY;
  142. value32 &= ~WINTINI_RDY;
  143. rtl_write_dword(rtlpriv, REG_MCUFWDL, value32);
  144. rtl8821ae_firmware_selfreset(hw);
  145. counter = 0;
  146. do {
  147. value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
  148. if (value32 & WINTINI_RDY) {
  149. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
  150. "Polling FW ready success!! REG_MCUFWDL:0x%08x .\n",
  151. value32);
  152. err = 0;
  153. goto exit;
  154. }
  155. udelay(FW_8821AE_POLLING_DELAY);
  156. } while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);
  157. RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
  158. "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
  159. value32);
  160. exit:
  161. return err;
  162. }
  163. static void _rtl8821ae_wait_for_h2c_cmd_finish(struct rtl_priv *rtlpriv)
  164. {
  165. u8 val;
  166. u16 count = 0;
  167. do {
  168. val = rtl_read_byte(rtlpriv, REG_HMETFR);
  169. mdelay(1);
  170. count++;
  171. } while ((val & 0x0F) && (count < 1000));
  172. }
  173. int rtl8821ae_download_fw(struct ieee80211_hw *hw, bool buse_wake_on_wlan_fw)
  174. {
  175. struct rtl_priv *rtlpriv = rtl_priv(hw);
  176. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  177. struct rtl8821a_firmware_header *pfwheader;
  178. u8 *pfwdata;
  179. u32 fwsize;
  180. int err;
  181. bool support_remote_wakeup;
  182. enum version_8821ae version = rtlhal->version;
  183. rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN,
  184. (u8 *)(&support_remote_wakeup));
  185. if (support_remote_wakeup)
  186. _rtl8821ae_wait_for_h2c_cmd_finish(rtlpriv);
  187. if (buse_wake_on_wlan_fw) {
  188. if (!rtlhal->wowlan_firmware)
  189. return 1;
  190. pfwheader =
  191. (struct rtl8821a_firmware_header *)rtlhal->wowlan_firmware;
  192. rtlhal->fw_version = pfwheader->version;
  193. rtlhal->fw_subversion = pfwheader->subversion;
  194. pfwdata = (u8 *)rtlhal->wowlan_firmware;
  195. fwsize = rtlhal->wowlan_fwsize;
  196. } else {
  197. if (!rtlhal->pfirmware)
  198. return 1;
  199. pfwheader =
  200. (struct rtl8821a_firmware_header *)rtlhal->pfirmware;
  201. rtlhal->fw_version = pfwheader->version;
  202. rtlhal->fw_subversion = pfwheader->subversion;
  203. pfwdata = (u8 *)rtlhal->pfirmware;
  204. fwsize = rtlhal->fwsize;
  205. }
  206. RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
  207. "%s Firmware SIZE %d\n",
  208. buse_wake_on_wlan_fw ? "Wowlan" : "Normal", fwsize);
  209. if (IS_FW_HEADER_EXIST_8812(pfwheader) ||
  210. IS_FW_HEADER_EXIST_8821(pfwheader)) {
  211. RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
  212. "Firmware Version(%d), Signature(%#x)\n",
  213. pfwheader->version, pfwheader->signature);
  214. pfwdata = pfwdata + sizeof(struct rtl8821a_firmware_header);
  215. fwsize = fwsize - sizeof(struct rtl8821a_firmware_header);
  216. }
  217. if (rtlhal->mac_func_enable) {
  218. if (rtl_read_byte(rtlpriv, REG_MCUFWDL) & BIT(7)) {
  219. rtl_write_byte(rtlpriv, REG_MCUFWDL, 0x00);
  220. rtl8821ae_firmware_selfreset(hw);
  221. }
  222. }
  223. _rtl8821ae_enable_fw_download(hw, true);
  224. _rtl8821ae_write_fw(hw, version, pfwdata, fwsize);
  225. _rtl8821ae_enable_fw_download(hw, false);
  226. err = _rtl8821ae_fw_free_to_go(hw);
  227. if (err) {
  228. RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
  229. "Firmware is not ready to run!\n");
  230. } else {
  231. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
  232. "Firmware is ready to run!\n");
  233. }
  234. return 0;
  235. }
  236. #if (USE_SPECIFIC_FW_TO_SUPPORT_WOWLAN == 1)
  237. void rtl8821ae_set_fw_related_for_wowlan(struct ieee80211_hw *hw,
  238. bool used_wowlan_fw)
  239. {
  240. struct rtl_priv *rtlpriv = rtl_priv(hw);
  241. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  242. struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
  243. /* 1. Before WoWLAN or After WOWLAN we need to re-download Fw. */
  244. if (rtl8821ae_download_fw(hw, used_wowlan_fw)) {
  245. RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
  246. "Re-Download Firmware failed!!\n");
  247. rtlhal->fw_ready = false;
  248. return;
  249. }
  250. RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
  251. "Re-Download Firmware Success !!\n");
  252. rtlhal->fw_ready = true;
  253. /* 2. Re-Init the variables about Fw related setting. */
  254. ppsc->fw_current_inpsmode = false;
  255. rtlhal->fw_ps_state = FW_PS_STATE_ALL_ON_8821AE;
  256. rtlhal->fw_clk_change_in_progress = false;
  257. rtlhal->allow_sw_to_change_hwclc = false;
  258. rtlhal->last_hmeboxnum = 0;
  259. }
  260. #endif
  261. static bool _rtl8821ae_check_fw_read_last_h2c(struct ieee80211_hw *hw,
  262. u8 boxnum)
  263. {
  264. struct rtl_priv *rtlpriv = rtl_priv(hw);
  265. u8 val_hmetfr;
  266. bool result = false;
  267. val_hmetfr = rtl_read_byte(rtlpriv, REG_HMETFR);
  268. if (((val_hmetfr >> boxnum) & BIT(0)) == 0)
  269. result = true;
  270. return result;
  271. }
  272. static void _rtl8821ae_fill_h2c_command(struct ieee80211_hw *hw,
  273. u8 element_id, u32 cmd_len,
  274. u8 *cmdbuffer)
  275. {
  276. struct rtl_priv *rtlpriv = rtl_priv(hw);
  277. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  278. u8 boxnum = 0;
  279. u16 box_reg = 0, box_extreg = 0;
  280. u8 u1b_tmp = 0;
  281. bool isfw_read = false;
  282. u8 buf_index = 0;
  283. bool bwrite_sucess = false;
  284. u8 wait_h2c_limmit = 100;
  285. /*u8 wait_writeh2c_limmit = 100;*/
  286. u8 boxcontent[4], boxextcontent[4];
  287. u32 h2c_waitcounter = 0;
  288. unsigned long flag = 0;
  289. u8 idx = 0;
  290. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "come in\n");
  291. while (true) {
  292. spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
  293. if (rtlhal->h2c_setinprogress) {
  294. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
  295. "H2C set in progress! Wait to set..element_id(%d).\n",
  296. element_id);
  297. while (rtlhal->h2c_setinprogress) {
  298. spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock,
  299. flag);
  300. h2c_waitcounter++;
  301. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
  302. "Wait 100 us (%d times)...\n",
  303. h2c_waitcounter);
  304. udelay(100);
  305. if (h2c_waitcounter > 1000)
  306. return;
  307. spin_lock_irqsave(&rtlpriv->locks.h2c_lock,
  308. flag);
  309. }
  310. spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
  311. } else {
  312. rtlhal->h2c_setinprogress = true;
  313. spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
  314. break;
  315. }
  316. }
  317. while (!bwrite_sucess) {
  318. boxnum = rtlhal->last_hmeboxnum;
  319. switch (boxnum) {
  320. case 0:
  321. box_reg = REG_HMEBOX_0;
  322. box_extreg = REG_HMEBOX_EXT_0;
  323. break;
  324. case 1:
  325. box_reg = REG_HMEBOX_1;
  326. box_extreg = REG_HMEBOX_EXT_1;
  327. break;
  328. case 2:
  329. box_reg = REG_HMEBOX_2;
  330. box_extreg = REG_HMEBOX_EXT_2;
  331. break;
  332. case 3:
  333. box_reg = REG_HMEBOX_3;
  334. box_extreg = REG_HMEBOX_EXT_3;
  335. break;
  336. default:
  337. RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
  338. "switch case not process\n");
  339. break;
  340. }
  341. isfw_read = false;
  342. u1b_tmp = rtl_read_byte(rtlpriv, REG_CR);
  343. if (u1b_tmp != 0xEA) {
  344. isfw_read = true;
  345. } else {
  346. if (rtl_read_byte(rtlpriv, REG_TXDMA_STATUS) == 0xEA ||
  347. rtl_read_byte(rtlpriv, REG_TXPKT_EMPTY) == 0xEA)
  348. rtl_write_byte(rtlpriv, REG_SYS_CFG1 + 3, 0xFF);
  349. }
  350. if (isfw_read) {
  351. wait_h2c_limmit = 100;
  352. isfw_read =
  353. _rtl8821ae_check_fw_read_last_h2c(hw, boxnum);
  354. while (!isfw_read) {
  355. /*wait until Fw read*/
  356. wait_h2c_limmit--;
  357. if (wait_h2c_limmit == 0) {
  358. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
  359. "Waiting too long for FW read clear HMEBox(%d)!\n",
  360. boxnum);
  361. break;
  362. }
  363. udelay(10);
  364. isfw_read =
  365. _rtl8821ae_check_fw_read_last_h2c(hw, boxnum);
  366. u1b_tmp = rtl_read_byte(rtlpriv, 0x130);
  367. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
  368. "Waiting for FW read clear HMEBox(%d)!!! 0x130 = %2x\n",
  369. boxnum, u1b_tmp);
  370. }
  371. }
  372. if (!isfw_read) {
  373. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
  374. "Write H2C register BOX[%d] fail!!!!! Fw do not read.\n",
  375. boxnum);
  376. break;
  377. }
  378. memset(boxcontent, 0, sizeof(boxcontent));
  379. memset(boxextcontent, 0, sizeof(boxextcontent));
  380. boxcontent[0] = element_id;
  381. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
  382. "Write element_id box_reg(%4x) = %2x\n",
  383. box_reg, element_id);
  384. switch (cmd_len) {
  385. case 1:
  386. case 2:
  387. case 3:
  388. /*boxcontent[0] &= ~(BIT(7));*/
  389. memcpy((u8 *)(boxcontent) + 1,
  390. cmdbuffer + buf_index, cmd_len);
  391. for (idx = 0; idx < 4; idx++) {
  392. rtl_write_byte(rtlpriv, box_reg + idx,
  393. boxcontent[idx]);
  394. }
  395. break;
  396. case 4:
  397. case 5:
  398. case 6:
  399. case 7:
  400. /*boxcontent[0] |= (BIT(7));*/
  401. memcpy((u8 *)(boxextcontent),
  402. cmdbuffer + buf_index+3, cmd_len-3);
  403. memcpy((u8 *)(boxcontent) + 1,
  404. cmdbuffer + buf_index, 3);
  405. for (idx = 0; idx < 4; idx++) {
  406. rtl_write_byte(rtlpriv, box_extreg + idx,
  407. boxextcontent[idx]);
  408. }
  409. for (idx = 0; idx < 4; idx++) {
  410. rtl_write_byte(rtlpriv, box_reg + idx,
  411. boxcontent[idx]);
  412. }
  413. break;
  414. default:
  415. RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
  416. "switch case not process\n");
  417. break;
  418. }
  419. bwrite_sucess = true;
  420. rtlhal->last_hmeboxnum = boxnum + 1;
  421. if (rtlhal->last_hmeboxnum == 4)
  422. rtlhal->last_hmeboxnum = 0;
  423. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
  424. "pHalData->last_hmeboxnum = %d\n",
  425. rtlhal->last_hmeboxnum);
  426. }
  427. spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
  428. rtlhal->h2c_setinprogress = false;
  429. spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
  430. RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "go out\n");
  431. }
  432. void rtl8821ae_fill_h2c_cmd(struct ieee80211_hw *hw,
  433. u8 element_id, u32 cmd_len, u8 *cmdbuffer)
  434. {
  435. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  436. u32 tmp_cmdbuf[2];
  437. if (!rtlhal->fw_ready) {
  438. RT_ASSERT(false,
  439. "return H2C cmd because of Fw download fail!!!\n");
  440. return;
  441. }
  442. memset(tmp_cmdbuf, 0, 8);
  443. memcpy(tmp_cmdbuf, cmdbuffer, cmd_len);
  444. _rtl8821ae_fill_h2c_command(hw, element_id, cmd_len, (u8 *)&tmp_cmdbuf);
  445. }
  446. void rtl8821ae_firmware_selfreset(struct ieee80211_hw *hw)
  447. {
  448. struct rtl_priv *rtlpriv = rtl_priv(hw);
  449. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  450. u8 u1b_tmp;
  451. if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) {
  452. u1b_tmp = rtl_read_byte(rtlpriv, REG_RSV_CTRL+1);
  453. rtl_write_byte(rtlpriv, REG_RSV_CTRL+1, (u1b_tmp & (~BIT(3))));
  454. } else {
  455. u1b_tmp = rtl_read_byte(rtlpriv, REG_RSV_CTRL+1);
  456. rtl_write_byte(rtlpriv, REG_RSV_CTRL+1, (u1b_tmp & (~BIT(0))));
  457. }
  458. u1b_tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN+1);
  459. rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN+1, (u1b_tmp & (~BIT(2))));
  460. udelay(50);
  461. if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) {
  462. u1b_tmp = rtl_read_byte(rtlpriv, REG_RSV_CTRL+1);
  463. rtl_write_byte(rtlpriv, REG_RSV_CTRL+1, (u1b_tmp | BIT(3)));
  464. } else {
  465. u1b_tmp = rtl_read_byte(rtlpriv, REG_RSV_CTRL+1);
  466. rtl_write_byte(rtlpriv, REG_RSV_CTRL+1, (u1b_tmp | BIT(0)));
  467. }
  468. u1b_tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN+1);
  469. rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN+1, (u1b_tmp | BIT(2)));
  470. RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
  471. "_8051Reset8812ae(): 8051 reset success .\n");
  472. }
  473. void rtl8821ae_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode)
  474. {
  475. struct rtl_priv *rtlpriv = rtl_priv(hw);
  476. u8 u1_h2c_set_pwrmode[H2C_8821AE_PWEMODE_LENGTH] = { 0 };
  477. struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
  478. u8 rlbm, power_state = 0;
  479. RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "FW LPS mode = %d\n", mode);
  480. SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, ((mode) ? 1 : 0));
  481. rlbm = 0;/*YJ,temp,120316. FW now not support RLBM=2.*/
  482. SET_H2CCMD_PWRMODE_PARM_RLBM(u1_h2c_set_pwrmode, rlbm);
  483. SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode,
  484. (rtlpriv->mac80211.p2p) ?
  485. ppsc->smart_ps : 1);
  486. SET_H2CCMD_PWRMODE_PARM_AWAKE_INTERVAL(u1_h2c_set_pwrmode,
  487. ppsc->reg_max_lps_awakeintvl);
  488. SET_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(u1_h2c_set_pwrmode, 0);
  489. if (mode == FW_PS_ACTIVE_MODE)
  490. power_state |= FW_PWR_STATE_ACTIVE;
  491. else
  492. power_state |= FW_PWR_STATE_RF_OFF;
  493. SET_H2CCMD_PWRMODE_PARM_PWR_STATE(u1_h2c_set_pwrmode, power_state);
  494. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
  495. "rtl92c_set_fw_pwrmode(): u1_h2c_set_pwrmode\n",
  496. u1_h2c_set_pwrmode, H2C_8821AE_PWEMODE_LENGTH);
  497. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_SETPWRMODE,
  498. H2C_8821AE_PWEMODE_LENGTH,
  499. u1_h2c_set_pwrmode);
  500. }
  501. void rtl8821ae_set_fw_media_status_rpt_cmd(struct ieee80211_hw *hw,
  502. u8 mstatus)
  503. {
  504. u8 parm[3] = { 0, 0, 0 };
  505. /* parm[0]: bit0=0-->Disconnect, bit0=1-->Connect
  506. * bit1=0-->update Media Status to MACID
  507. * bit1=1-->update Media Status from MACID to MACID_End
  508. * parm[1]: MACID, if this is INFRA_STA, MacID = 0
  509. * parm[2]: MACID_End
  510. */
  511. SET_H2CCMD_MSRRPT_PARM_OPMODE(parm, mstatus);
  512. SET_H2CCMD_MSRRPT_PARM_MACID_IND(parm, 0);
  513. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_MSRRPT, 3, parm);
  514. }
  515. void rtl8821ae_set_fw_ap_off_load_cmd(struct ieee80211_hw *hw,
  516. u8 ap_offload_enable)
  517. {
  518. struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
  519. u8 u1_apoffload_parm[H2C_8821AE_AP_OFFLOAD_LENGTH] = { 0 };
  520. SET_H2CCMD_AP_OFFLOAD_ON(u1_apoffload_parm, ap_offload_enable);
  521. SET_H2CCMD_AP_OFFLOAD_HIDDEN(u1_apoffload_parm, mac->hiddenssid);
  522. SET_H2CCMD_AP_OFFLOAD_DENYANY(u1_apoffload_parm, 0);
  523. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_AP_OFFLOAD,
  524. H2C_8821AE_AP_OFFLOAD_LENGTH,
  525. u1_apoffload_parm);
  526. }
  527. void rtl8821ae_set_fw_wowlan_mode(struct ieee80211_hw *hw, bool func_en)
  528. {
  529. struct rtl_priv *rtlpriv = rtl_priv(hw);
  530. struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
  531. u8 fw_wowlan_info[H2C_8821AE_WOWLAN_LENGTH] = {0};
  532. RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "enable(%d)\n", func_en);
  533. SET_8812_H2CCMD_WOWLAN_FUNC_ENABLE(fw_wowlan_info,
  534. (func_en ? true : false));
  535. SET_8812_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(fw_wowlan_info,
  536. ((ppsc->wo_wlan_mode & WAKE_ON_PATTERN_MATCH) ? 1 : 0));
  537. SET_8812_H2CCMD_WOWLAN_MAGIC_PKT_ENABLE(fw_wowlan_info,
  538. ((ppsc->wo_wlan_mode & WAKE_ON_MAGIC_PACKET) ? 1 : 0));
  539. SET_8812_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(fw_wowlan_info, 0);
  540. SET_8812_H2CCMD_WOWLAN_ALL_PKT_DROP(fw_wowlan_info, false);
  541. SET_8812_H2CCMD_WOWLAN_GPIO_ACTIVE(fw_wowlan_info, 0);
  542. SET_8812_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(fw_wowlan_info, 1);
  543. SET_8812_H2CCMD_WOWLAN_GPIONUM(fw_wowlan_info, 0);
  544. SET_8812_H2CCMD_WOWLAN_GPIO_DURATION(fw_wowlan_info, 0);
  545. RT_PRINT_DATA(rtlpriv, COMP_POWER, DBG_DMESG,
  546. "wowlan mode: cmd 0x80: Content:\n",
  547. fw_wowlan_info, H2C_8821AE_WOWLAN_LENGTH);
  548. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_WO_WLAN,
  549. H2C_8821AE_WOWLAN_LENGTH,
  550. fw_wowlan_info);
  551. }
  552. void rtl8821ae_set_fw_remote_wake_ctrl_cmd(struct ieee80211_hw *hw,
  553. u8 enable)
  554. {
  555. struct rtl_priv *rtlpriv = rtl_priv(hw);
  556. struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
  557. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  558. u8 remote_wake_ctrl_parm[H2C_8821AE_REMOTE_WAKE_CTRL_LEN] = {0};
  559. RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
  560. "enable=%d, ARP offload=%d, GTK offload=%d\n",
  561. enable, ppsc->arp_offload_enable, ppsc->gtk_offload_enable);
  562. SET_8812_H2CCMD_REMOTE_WAKECTRL_ENABLE(remote_wake_ctrl_parm, enable);
  563. SET_8812_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN(remote_wake_ctrl_parm,
  564. (ppsc->arp_offload_enable ? 1 : 0));
  565. SET_8812_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(remote_wake_ctrl_parm,
  566. (ppsc->gtk_offload_enable ? 1 : 0));
  567. SET_8812_H2CCMD_REMOTE_WAKE_CTRL_REALWOWV2_EN(remote_wake_ctrl_parm,
  568. (rtlhal->real_wow_v2_enable ? 1 : 0));
  569. RT_PRINT_DATA(rtlpriv, COMP_POWER, DBG_TRACE,
  570. "remote_wake_ctrl: cmd 0x4: Content:\n",
  571. remote_wake_ctrl_parm, H2C_8821AE_REMOTE_WAKE_CTRL_LEN);
  572. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_REMOTE_WAKE_CTRL,
  573. H2C_8821AE_REMOTE_WAKE_CTRL_LEN,
  574. remote_wake_ctrl_parm);
  575. }
  576. void rtl8821ae_set_fw_keep_alive_cmd(struct ieee80211_hw *hw,
  577. bool func_en)
  578. {
  579. struct rtl_priv *rtlpriv = rtl_priv(hw);
  580. u8 keep_alive_info[H2C_8821AE_KEEP_ALIVE_CTRL_LENGTH] = {0};
  581. RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "Enable(%d)\n", func_en);
  582. SET_8812_H2CCMD_KEEP_ALIVE_ENABLE(keep_alive_info, func_en);
  583. /* 1: the period is controled by driver, 0: by Fw default */
  584. SET_8812_H2CCMD_KEEP_ALIVE_ACCPEPT_USER_DEFINED(keep_alive_info, 1);
  585. SET_8812_H2CCMD_KEEP_ALIVE_PERIOD(keep_alive_info, 10); /* 10 sec */
  586. RT_PRINT_DATA(rtlpriv, COMP_POWER, DBG_TRACE,
  587. "keep alive: cmd 0x3: Content:\n",
  588. keep_alive_info, H2C_8821AE_KEEP_ALIVE_CTRL);
  589. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_KEEP_ALIVE_CTRL,
  590. H2C_8821AE_KEEP_ALIVE_CTRL_LENGTH,
  591. keep_alive_info);
  592. }
  593. void rtl8821ae_set_fw_disconnect_decision_ctrl_cmd(struct ieee80211_hw *hw,
  594. bool enabled)
  595. {
  596. struct rtl_priv *rtlpriv = rtl_priv(hw);
  597. u8 parm[H2C_8821AE_DISCONNECT_DECISION_CTRL_LEN] = {0};
  598. SET_8812_H2CCMD_DISCONNECT_DECISION_CTRL_ENABLE(parm, enabled);
  599. SET_8812_H2CCMD_DISCONNECT_DECISION_CTRL_USER_SETTING(parm, 1);
  600. SET_8812_H2CCMD_DISCONNECT_DECISION_CTRL_CHECK_PERIOD(parm, 30);
  601. SET_8812_H2CCMD_DISCONNECT_DECISION_CTRL_TRYPKT_NUM(parm, 3);
  602. RT_PRINT_DATA(rtlpriv, COMP_POWER, DBG_TRACE,
  603. "disconnect_decision_ctrl: cmd 0x4: Content:\n",
  604. parm, H2C_8821AE_DISCONNECT_DECISION_CTRL_LEN);
  605. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_DISCONNECT_DECISION,
  606. H2C_8821AE_DISCONNECT_DECISION_CTRL_LEN, parm);
  607. }
  608. void rtl8821ae_set_fw_global_info_cmd(struct ieee80211_hw *hw)
  609. {
  610. struct rtl_priv *rtlpriv = rtl_priv(hw);
  611. struct rtl_security *sec = &rtlpriv->sec;
  612. u8 remote_wakeup_sec_info[H2C_8821AE_AOAC_GLOBAL_INFO_LEN] = {0};
  613. RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
  614. "PairwiseEncAlgorithm=%d, GroupEncAlgorithm=%d\n",
  615. sec->pairwise_enc_algorithm, sec->group_enc_algorithm);
  616. SET_8812_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(
  617. remote_wakeup_sec_info,
  618. sec->pairwise_enc_algorithm);
  619. SET_8812_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(remote_wakeup_sec_info,
  620. sec->group_enc_algorithm);
  621. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_AOAC_GLOBAL_INFO,
  622. H2C_8821AE_AOAC_GLOBAL_INFO_LEN,
  623. remote_wakeup_sec_info);
  624. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_TRACE,
  625. "rtl8821ae_set_global_info: cmd 0x82:\n",
  626. remote_wakeup_sec_info, H2C_8821AE_AOAC_GLOBAL_INFO_LEN);
  627. }
  628. #define BEACON_PG 0
  629. #define PSPOLL_PG 1
  630. #define NULL_PG 2
  631. #define QOSNULL_PG 3
  632. #define ARPRESP_PG 4
  633. #define REMOTE_PG 5
  634. #define GTKEXT_PG 6
  635. #define TOTAL_RESERVED_PKT_LEN_8812 3584
  636. #define TOTAL_RESERVED_PKT_LEN_8821 1792
  637. static u8 reserved_page_packet_8821[TOTAL_RESERVED_PKT_LEN_8821] = {
  638. /* page 0: beacon */
  639. 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
  640. 0xff, 0xff, 0x00, 0xe0, 0x4c, 0x02, 0xe2, 0x64,
  641. 0x40, 0x16, 0x9f, 0x23, 0xd4, 0x46, 0x20, 0x00,
  642. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  643. 0x64, 0x00, 0x20, 0x04, 0x00, 0x06, 0x64, 0x6c,
  644. 0x69, 0x6e, 0x6b, 0x31, 0x01, 0x08, 0x82, 0x84,
  645. 0x8b, 0x96, 0x0c, 0x18, 0x30, 0x48, 0x03, 0x01,
  646. 0x0b, 0x06, 0x02, 0x00, 0x00, 0x2a, 0x01, 0x8b,
  647. 0x32, 0x04, 0x12, 0x24, 0x60, 0x6c, 0x00, 0x00,
  648. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  649. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  650. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  651. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  652. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  653. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  654. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  655. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  656. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  657. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  658. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  659. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  660. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  661. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  662. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  663. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  664. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  665. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  666. 0x10, 0x00, 0x28, 0x8c, 0x00, 0x12, 0x00, 0x00,
  667. 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00,
  668. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  669. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  670. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  671. /* page 1: ps-poll */
  672. 0xa4, 0x10, 0x01, 0xc0, 0x40, 0x16, 0x9f, 0x23,
  673. 0xd4, 0x46, 0x00, 0xe0, 0x4c, 0x02, 0xe2, 0x64,
  674. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  675. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  676. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  677. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  678. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  679. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  680. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  681. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  682. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  683. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  684. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  685. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  686. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  687. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  688. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  689. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  690. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  691. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  692. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  693. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  694. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  695. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  696. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  697. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  698. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  699. 0x18, 0x00, 0x28, 0x8c, 0x00, 0x12, 0x00, 0x00,
  700. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  701. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  702. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  703. 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  704. /* page 2: null data */
  705. 0x48, 0x01, 0x00, 0x00, 0x40, 0x16, 0x9f, 0x23,
  706. 0xd4, 0x46, 0x00, 0xe0, 0x4c, 0x02, 0xe2, 0x64,
  707. 0x40, 0x16, 0x9f, 0x23, 0xd4, 0x46, 0x00, 0x00,
  708. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  709. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  710. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  711. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  712. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  713. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  714. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  715. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  716. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  717. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  718. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  719. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  720. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  721. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  722. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  723. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  724. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  725. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  726. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  727. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  728. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  729. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  730. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  731. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  732. 0x1A, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00,
  733. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  734. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  735. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  736. 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  737. /* page 3: qos null data */
  738. 0xC8, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7,
  739. 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  740. 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00,
  741. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  742. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  743. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  744. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  745. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  746. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  747. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  748. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  749. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  750. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  751. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  752. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  753. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  754. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  755. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  756. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  757. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  758. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  759. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  760. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  761. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  762. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  763. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  764. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  765. 0x3C, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00,
  766. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  767. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  768. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  769. 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  770. /* page 4~6 is for wowlan */
  771. /* page 4: ARP resp */
  772. 0x08, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7,
  773. 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  774. 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00,
  775. 0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x08, 0x06,
  776. 0x00, 0x01, 0x08, 0x00, 0x06, 0x04, 0x00, 0x02,
  777. 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02, 0x00, 0x00,
  778. 0x00, 0x00, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  779. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  780. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  781. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  782. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  783. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  784. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  785. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  786. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  787. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  788. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  789. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  790. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  791. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  792. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  793. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  794. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  795. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  796. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  797. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  798. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  799. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  800. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  801. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  802. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  803. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  804. /* page 5: H2C_REMOTE_WAKE_CTRL_INFO */
  805. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  806. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  807. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  808. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  809. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  810. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  811. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  812. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  813. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  814. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  815. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  816. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  817. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  818. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  819. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  820. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  821. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  822. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  823. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  824. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  825. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  826. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  827. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  828. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  829. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  830. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  831. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  832. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  833. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  834. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  835. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  836. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  837. /* page 6: Rsvd GTK extend memory (zero memory) */
  838. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  839. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  840. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  841. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  842. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  843. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  844. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  845. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  846. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  847. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  848. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  849. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  850. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  851. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  852. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  853. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  854. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  855. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  856. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  857. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  858. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  859. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  860. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  861. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  862. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  863. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  864. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  865. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  866. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  867. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  868. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  869. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  870. };
  871. static u8 reserved_page_packet_8812[TOTAL_RESERVED_PKT_LEN_8812] = {
  872. /* page 0: beacon */
  873. 0x80, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
  874. 0xFF, 0xFF, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  875. 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x60, 0x00,
  876. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  877. 0x64, 0x00, 0x20, 0x04, 0x00, 0x03, 0x32, 0x31,
  878. 0x35, 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x0C,
  879. 0x12, 0x18, 0x24, 0x03, 0x01, 0x01, 0x06, 0x02,
  880. 0x00, 0x00, 0x2A, 0x01, 0x02, 0x32, 0x04, 0x30,
  881. 0x48, 0x60, 0x6C, 0x2D, 0x1A, 0xED, 0x09, 0x03,
  882. 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  883. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  884. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D,
  885. 0x00, 0xDD, 0x07, 0x00, 0xE0, 0x4C, 0x02, 0x02,
  886. 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  887. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  888. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  889. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  890. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  891. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  892. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  893. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  894. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  895. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  896. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  897. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  898. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  899. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  900. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  901. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  902. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  903. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  904. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  905. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  906. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  907. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  908. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  909. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  910. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  911. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  912. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  913. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  914. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  915. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  916. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  917. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  918. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  919. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  920. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  921. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  922. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  923. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  924. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  925. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  926. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  927. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  928. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  929. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  930. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  931. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  932. 0x10, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00,
  933. 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00,
  934. 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  935. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  936. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  937. /* page 1: ps-poll */
  938. 0xA4, 0x10, 0x09, 0xC0, 0x84, 0xC9, 0xB2, 0xA7,
  939. 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  940. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  941. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  942. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  943. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  944. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  945. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  946. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  947. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  948. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  949. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  950. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  951. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  952. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  953. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  954. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  955. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  956. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  957. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  958. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  959. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  960. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  961. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  962. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  963. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  964. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  965. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  966. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  967. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  968. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  969. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  970. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  971. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  972. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  973. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  974. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  975. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  976. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  977. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  978. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  979. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  980. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  981. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  982. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  983. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  984. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  985. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  986. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  987. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  988. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  989. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  990. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  991. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  992. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  993. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  994. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  995. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  996. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  997. 0x18, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00,
  998. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  999. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1000. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1001. 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1002. /* page 2: null data */
  1003. 0x48, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7,
  1004. 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  1005. 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00,
  1006. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1007. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1008. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1009. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1010. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1011. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1012. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1013. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1014. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1015. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1016. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1017. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1018. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1019. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1020. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1021. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1022. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1023. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1024. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1025. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1026. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1027. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1028. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1029. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1030. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1031. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1032. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1033. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1034. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1035. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1036. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1037. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1038. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1039. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1040. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1041. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1042. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1043. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1044. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1045. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1046. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1047. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1048. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1049. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1050. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1051. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1052. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1053. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1054. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1055. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1056. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1057. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1058. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1059. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1060. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1061. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1062. 0x1A, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00,
  1063. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  1064. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1065. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1066. 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1067. /* page 3: Qos null data */
  1068. 0xC8, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7,
  1069. 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  1070. 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00,
  1071. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1072. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1073. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1074. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1075. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1076. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1077. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1078. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1079. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1080. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1081. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1082. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1083. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1084. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1085. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1086. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1087. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1088. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1089. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1090. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1091. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1092. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1093. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1094. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1095. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1096. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1097. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1098. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1099. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1100. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1101. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1102. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1103. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1104. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1105. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1106. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1107. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1108. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1109. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1110. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1111. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1112. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1113. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1114. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1115. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1116. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1117. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1118. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1119. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1120. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1121. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1122. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1123. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1124. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1125. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1126. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1127. 0x3C, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00,
  1128. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  1129. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1130. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1131. 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1132. /* page 4~6 is for wowlan */
  1133. /* page 4: ARP resp */
  1134. 0x08, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7,
  1135. 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  1136. 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00,
  1137. 0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x08, 0x06,
  1138. 0x00, 0x01, 0x08, 0x00, 0x06, 0x04, 0x00, 0x02,
  1139. 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02, 0x00, 0x00,
  1140. 0x00, 0x00, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02,
  1141. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1142. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1143. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1144. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1145. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1146. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1147. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1148. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1149. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1150. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1151. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1152. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1153. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1154. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1155. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1156. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1157. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1158. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1159. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1160. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1161. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1162. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1163. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1164. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1165. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1166. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1167. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1168. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1169. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1170. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1171. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1172. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1173. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1174. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1175. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1176. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1177. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1178. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1179. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1180. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1181. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1182. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1183. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1184. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1185. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1186. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1187. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1188. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1189. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1190. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1191. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1192. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1193. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1194. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1195. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1196. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1197. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1198. /* page 5: H2C_REMOTE_WAKE_CTRL_INFO */
  1199. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1200. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1201. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1202. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1203. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1204. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1205. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1206. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1207. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1208. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1209. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1210. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1211. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1212. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1213. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1214. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1215. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1216. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1217. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1218. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1219. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1220. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1221. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1222. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1223. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1224. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1225. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1226. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1227. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1228. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1229. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1230. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1231. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1232. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1233. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1234. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1235. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1236. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1237. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1238. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1239. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1240. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1241. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1242. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1243. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1244. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1245. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1246. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1247. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1248. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1249. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1250. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1251. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1252. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1253. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1254. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1255. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1256. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1257. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1258. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1259. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1260. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1261. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1262. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1263. /* page 6: Rsvd GTK extend memory (zero memory) */
  1264. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1265. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1266. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1267. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1268. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1269. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1270. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1271. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1272. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1273. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1274. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1275. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1276. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1277. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1278. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1279. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1280. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1281. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1282. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1283. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1284. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1285. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1286. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1287. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1288. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1289. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1290. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1291. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1292. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1293. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1294. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1295. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1296. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1297. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1298. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1299. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1300. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1301. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1302. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1303. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1304. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1305. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1306. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1307. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1308. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1309. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1310. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1311. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1312. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1313. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1314. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1315. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1316. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1317. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1318. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1319. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1320. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1321. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1322. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1323. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1324. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1325. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1326. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1327. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1328. };
  1329. void rtl8812ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
  1330. bool b_dl_finished, bool dl_whole_packets)
  1331. {
  1332. struct rtl_priv *rtlpriv = rtl_priv(hw);
  1333. struct rtl_mac *mac = rtl_mac(rtlpriv);
  1334. struct sk_buff *skb = NULL;
  1335. u32 totalpacketlen;
  1336. bool rtstatus;
  1337. u8 u1RsvdPageLoc[5] = { 0 };
  1338. u8 u1RsvdPageLoc2[7] = { 0 };
  1339. bool b_dlok = false;
  1340. u8 *beacon;
  1341. u8 *p_pspoll;
  1342. u8 *nullfunc;
  1343. u8 *qosnull;
  1344. u8 *arpresp;
  1345. /*---------------------------------------------------------
  1346. * (1) beacon
  1347. *---------------------------------------------------------
  1348. */
  1349. beacon = &reserved_page_packet_8812[BEACON_PG * 512];
  1350. SET_80211_HDR_ADDRESS2(beacon, mac->mac_addr);
  1351. SET_80211_HDR_ADDRESS3(beacon, mac->bssid);
  1352. if (b_dl_finished) {
  1353. totalpacketlen = 512 - 40;
  1354. goto out;
  1355. }
  1356. /*-------------------------------------------------------
  1357. * (2) ps-poll
  1358. *--------------------------------------------------------
  1359. */
  1360. p_pspoll = &reserved_page_packet_8812[PSPOLL_PG * 512];
  1361. SET_80211_PS_POLL_AID(p_pspoll, (mac->assoc_id | 0xc000));
  1362. SET_80211_PS_POLL_BSSID(p_pspoll, mac->bssid);
  1363. SET_80211_PS_POLL_TA(p_pspoll, mac->mac_addr);
  1364. SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(u1RsvdPageLoc, PSPOLL_PG);
  1365. /*--------------------------------------------------------
  1366. * (3) null data
  1367. *---------------------------------------------------------
  1368. */
  1369. nullfunc = &reserved_page_packet_8812[NULL_PG * 512];
  1370. SET_80211_HDR_ADDRESS1(nullfunc, mac->bssid);
  1371. SET_80211_HDR_ADDRESS2(nullfunc, mac->mac_addr);
  1372. SET_80211_HDR_ADDRESS3(nullfunc, mac->bssid);
  1373. SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(u1RsvdPageLoc, NULL_PG);
  1374. /*---------------------------------------------------------
  1375. * (4) Qos null data
  1376. *----------------------------------------------------------
  1377. */
  1378. qosnull = &reserved_page_packet_8812[QOSNULL_PG * 512];
  1379. SET_80211_HDR_ADDRESS1(qosnull, mac->bssid);
  1380. SET_80211_HDR_ADDRESS2(qosnull, mac->mac_addr);
  1381. SET_80211_HDR_ADDRESS3(qosnull, mac->bssid);
  1382. SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1RsvdPageLoc, QOSNULL_PG);
  1383. if (!dl_whole_packets) {
  1384. totalpacketlen = 512 * (QOSNULL_PG + 1) - 40;
  1385. goto out;
  1386. }
  1387. /*---------------------------------------------------------
  1388. * (5) ARP Resp
  1389. *----------------------------------------------------------
  1390. */
  1391. arpresp = &reserved_page_packet_8812[ARPRESP_PG * 512];
  1392. SET_80211_HDR_ADDRESS1(arpresp, mac->bssid);
  1393. SET_80211_HDR_ADDRESS2(arpresp, mac->mac_addr);
  1394. SET_80211_HDR_ADDRESS3(arpresp, mac->bssid);
  1395. SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1RsvdPageLoc2, ARPRESP_PG);
  1396. /*---------------------------------------------------------
  1397. * (6) Remote Wake Ctrl
  1398. *----------------------------------------------------------
  1399. */
  1400. SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1RsvdPageLoc2,
  1401. REMOTE_PG);
  1402. /*---------------------------------------------------------
  1403. * (7) GTK Ext Memory
  1404. *----------------------------------------------------------
  1405. */
  1406. SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(u1RsvdPageLoc2, GTKEXT_PG);
  1407. totalpacketlen = TOTAL_RESERVED_PKT_LEN_8812 - 40;
  1408. out:
  1409. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD,
  1410. "rtl8812ae_set_fw_rsvdpagepkt(): packet data\n",
  1411. &reserved_page_packet_8812[0], totalpacketlen);
  1412. skb = dev_alloc_skb(totalpacketlen);
  1413. memcpy((u8 *)skb_put(skb, totalpacketlen),
  1414. &reserved_page_packet_8812, totalpacketlen);
  1415. rtstatus = rtl_cmd_send_packet(hw, skb);
  1416. if (rtstatus)
  1417. b_dlok = true;
  1418. if (!b_dl_finished && b_dlok) {
  1419. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
  1420. "H2C_RSVDPAGE:\n", u1RsvdPageLoc, 5);
  1421. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_RSVDPAGE,
  1422. sizeof(u1RsvdPageLoc), u1RsvdPageLoc);
  1423. if (dl_whole_packets) {
  1424. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
  1425. "wowlan H2C_RSVDPAGE:\n", u1RsvdPageLoc2, 7);
  1426. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_AOAC_RSVDPAGE,
  1427. sizeof(u1RsvdPageLoc2), u1RsvdPageLoc2);
  1428. }
  1429. }
  1430. if (!b_dlok)
  1431. RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
  1432. "Set RSVD page location to Fw FAIL!!!!!!.\n");
  1433. }
  1434. void rtl8821ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
  1435. bool b_dl_finished, bool dl_whole_packets)
  1436. {
  1437. struct rtl_priv *rtlpriv = rtl_priv(hw);
  1438. struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
  1439. struct sk_buff *skb = NULL;
  1440. u32 totalpacketlen;
  1441. bool rtstatus;
  1442. u8 u1RsvdPageLoc[5] = { 0 };
  1443. u8 u1RsvdPageLoc2[7] = { 0 };
  1444. bool b_dlok = false;
  1445. u8 *beacon;
  1446. u8 *p_pspoll;
  1447. u8 *nullfunc;
  1448. u8 *qosnull;
  1449. u8 *arpresp;
  1450. /*---------------------------------------------------------
  1451. * (1) beacon
  1452. *---------------------------------------------------------
  1453. */
  1454. beacon = &reserved_page_packet_8821[BEACON_PG * 256];
  1455. SET_80211_HDR_ADDRESS2(beacon, mac->mac_addr);
  1456. SET_80211_HDR_ADDRESS3(beacon, mac->bssid);
  1457. if (b_dl_finished) {
  1458. totalpacketlen = 256 - 40;
  1459. goto out;
  1460. }
  1461. /*-------------------------------------------------------
  1462. * (2) ps-poll
  1463. *--------------------------------------------------------
  1464. */
  1465. p_pspoll = &reserved_page_packet_8821[PSPOLL_PG * 256];
  1466. SET_80211_PS_POLL_AID(p_pspoll, (mac->assoc_id | 0xc000));
  1467. SET_80211_PS_POLL_BSSID(p_pspoll, mac->bssid);
  1468. SET_80211_PS_POLL_TA(p_pspoll, mac->mac_addr);
  1469. SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(u1RsvdPageLoc, PSPOLL_PG);
  1470. /*--------------------------------------------------------
  1471. * (3) null data
  1472. *---------------------------------------------------------i
  1473. */
  1474. nullfunc = &reserved_page_packet_8821[NULL_PG * 256];
  1475. SET_80211_HDR_ADDRESS1(nullfunc, mac->bssid);
  1476. SET_80211_HDR_ADDRESS2(nullfunc, mac->mac_addr);
  1477. SET_80211_HDR_ADDRESS3(nullfunc, mac->bssid);
  1478. SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(u1RsvdPageLoc, NULL_PG);
  1479. /*---------------------------------------------------------
  1480. * (4) Qos null data
  1481. *----------------------------------------------------------
  1482. */
  1483. qosnull = &reserved_page_packet_8821[QOSNULL_PG * 256];
  1484. SET_80211_HDR_ADDRESS1(qosnull, mac->bssid);
  1485. SET_80211_HDR_ADDRESS2(qosnull, mac->mac_addr);
  1486. SET_80211_HDR_ADDRESS3(qosnull, mac->bssid);
  1487. SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1RsvdPageLoc, QOSNULL_PG);
  1488. if (!dl_whole_packets) {
  1489. totalpacketlen = 256 * (QOSNULL_PG + 1) - 40;
  1490. goto out;
  1491. }
  1492. /*---------------------------------------------------------
  1493. * (5) ARP Resp
  1494. *----------------------------------------------------------
  1495. */
  1496. arpresp = &reserved_page_packet_8821[ARPRESP_PG * 256];
  1497. SET_80211_HDR_ADDRESS1(arpresp, mac->bssid);
  1498. SET_80211_HDR_ADDRESS2(arpresp, mac->mac_addr);
  1499. SET_80211_HDR_ADDRESS3(arpresp, mac->bssid);
  1500. SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1RsvdPageLoc2, ARPRESP_PG);
  1501. /*---------------------------------------------------------
  1502. * (6) Remote Wake Ctrl
  1503. *----------------------------------------------------------
  1504. */
  1505. SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1RsvdPageLoc2,
  1506. REMOTE_PG);
  1507. /*---------------------------------------------------------
  1508. * (7) GTK Ext Memory
  1509. *----------------------------------------------------------
  1510. */
  1511. SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(u1RsvdPageLoc2, GTKEXT_PG);
  1512. totalpacketlen = TOTAL_RESERVED_PKT_LEN_8821 - 40;
  1513. out:
  1514. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD,
  1515. "rtl8821ae_set_fw_rsvdpagepkt(): packet data\n",
  1516. &reserved_page_packet_8821[0], totalpacketlen);
  1517. skb = dev_alloc_skb(totalpacketlen);
  1518. memcpy((u8 *)skb_put(skb, totalpacketlen),
  1519. &reserved_page_packet_8821, totalpacketlen);
  1520. rtstatus = rtl_cmd_send_packet(hw, skb);
  1521. if (rtstatus)
  1522. b_dlok = true;
  1523. if (!b_dl_finished && b_dlok) {
  1524. RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
  1525. "Set RSVD page location to Fw.\n");
  1526. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
  1527. "H2C_RSVDPAGE:\n", u1RsvdPageLoc, 5);
  1528. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_RSVDPAGE,
  1529. sizeof(u1RsvdPageLoc), u1RsvdPageLoc);
  1530. if (dl_whole_packets) {
  1531. RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
  1532. "wowlan H2C_RSVDPAGE:\n",
  1533. u1RsvdPageLoc2, 7);
  1534. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_AOAC_RSVDPAGE,
  1535. sizeof(u1RsvdPageLoc2),
  1536. u1RsvdPageLoc2);
  1537. }
  1538. }
  1539. if (!b_dlok) {
  1540. RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
  1541. "Set RSVD page location to Fw FAIL!!!!!!.\n");
  1542. }
  1543. }
  1544. /*Should check FW support p2p or not.*/
  1545. static void rtl8821ae_set_p2p_ctw_period_cmd(struct ieee80211_hw *hw, u8 ctwindow)
  1546. {
  1547. u8 u1_ctwindow_period[1] = { ctwindow};
  1548. rtl8821ae_fill_h2c_cmd(hw, H2C_8821AE_P2P_PS_CTW_CMD, 1,
  1549. u1_ctwindow_period);
  1550. }
  1551. void rtl8821ae_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state)
  1552. {
  1553. struct rtl_priv *rtlpriv = rtl_priv(hw);
  1554. struct rtl_ps_ctl *rtlps = rtl_psc(rtl_priv(hw));
  1555. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  1556. struct rtl_p2p_ps_info *p2pinfo = &rtlps->p2p_ps_info;
  1557. struct p2p_ps_offload_t *p2p_ps_offload = &rtlhal->p2p_ps_offload;
  1558. u8 i;
  1559. u16 ctwindow;
  1560. u32 start_time, tsf_low;
  1561. switch (p2p_ps_state) {
  1562. case P2P_PS_DISABLE:
  1563. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_DISABLE\n");
  1564. memset(p2p_ps_offload, 0, sizeof(*p2p_ps_offload));
  1565. break;
  1566. case P2P_PS_ENABLE:
  1567. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_ENABLE\n");
  1568. /* update CTWindow value. */
  1569. if (p2pinfo->ctwindow > 0) {
  1570. p2p_ps_offload->ctwindow_en = 1;
  1571. ctwindow = p2pinfo->ctwindow;
  1572. rtl8821ae_set_p2p_ctw_period_cmd(hw, ctwindow);
  1573. }
  1574. /* hw only support 2 set of NoA */
  1575. for (i = 0 ; i < p2pinfo->noa_num ; i++) {
  1576. /* To control the register setting for which NOA*/
  1577. rtl_write_byte(rtlpriv, 0x5cf, (i << 4));
  1578. if (i == 0)
  1579. p2p_ps_offload->noa0_en = 1;
  1580. else
  1581. p2p_ps_offload->noa1_en = 1;
  1582. /* config P2P NoA Descriptor Register */
  1583. rtl_write_dword(rtlpriv, 0x5E0, p2pinfo->noa_duration[i]);
  1584. rtl_write_dword(rtlpriv, 0x5E4, p2pinfo->noa_interval[i]);
  1585. /*Get Current TSF value */
  1586. tsf_low = rtl_read_dword(rtlpriv, REG_TSFTR);
  1587. start_time = p2pinfo->noa_start_time[i];
  1588. if (p2pinfo->noa_count_type[i] != 1) {
  1589. while (start_time <= (tsf_low+(50*1024))) {
  1590. start_time += p2pinfo->noa_interval[i];
  1591. if (p2pinfo->noa_count_type[i] != 255)
  1592. p2pinfo->noa_count_type[i]--;
  1593. }
  1594. }
  1595. rtl_write_dword(rtlpriv, 0x5E8, start_time);
  1596. rtl_write_dword(rtlpriv, 0x5EC,
  1597. p2pinfo->noa_count_type[i]);
  1598. }
  1599. if ((p2pinfo->opp_ps == 1) || (p2pinfo->noa_num > 0)) {
  1600. /* rst p2p circuit */
  1601. rtl_write_byte(rtlpriv, REG_DUAL_TSF_RST, BIT(4));
  1602. p2p_ps_offload->offload_en = 1;
  1603. if (P2P_ROLE_GO == rtlpriv->mac80211.p2p) {
  1604. p2p_ps_offload->role = 1;
  1605. p2p_ps_offload->allstasleep = 0;
  1606. } else {
  1607. p2p_ps_offload->role = 0;
  1608. }
  1609. p2p_ps_offload->discovery = 0;
  1610. }
  1611. break;
  1612. case P2P_PS_SCAN:
  1613. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN\n");
  1614. p2p_ps_offload->discovery = 1;
  1615. break;
  1616. case P2P_PS_SCAN_DONE:
  1617. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN_DONE\n");
  1618. p2p_ps_offload->discovery = 0;
  1619. p2pinfo->p2p_ps_state = P2P_PS_ENABLE;
  1620. break;
  1621. default:
  1622. break;
  1623. }
  1624. rtl8821ae_fill_h2c_cmd(hw,
  1625. H2C_8821AE_P2P_PS_OFFLOAD, 1, (u8 *)p2p_ps_offload);
  1626. }
  1627. static void rtl8821ae_c2h_ra_report_handler(struct ieee80211_hw *hw,
  1628. u8 *cmd_buf, u8 cmd_len)
  1629. {
  1630. struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
  1631. u8 rate = cmd_buf[0] & 0x3F;
  1632. rtlhal->current_ra_rate = rtl8821ae_hw_rate_to_mrate(hw, rate);
  1633. rtl8821ae_dm_update_init_rate(hw, rate);
  1634. }
  1635. static void _rtl8821ae_c2h_content_parsing(struct ieee80211_hw *hw,
  1636. u8 c2h_cmd_id, u8 c2h_cmd_len,
  1637. u8 *tmp_buf)
  1638. {
  1639. struct rtl_priv *rtlpriv = rtl_priv(hw);
  1640. switch (c2h_cmd_id) {
  1641. case C2H_8812_DBG:
  1642. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "[C2H], C2H_8812_DBG!!\n");
  1643. break;
  1644. case C2H_8812_RA_RPT:
  1645. rtl8821ae_c2h_ra_report_handler(hw, tmp_buf, c2h_cmd_len);
  1646. break;
  1647. case C2H_8812_BT_INFO:
  1648. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
  1649. "[C2H], C2H_8812_BT_INFO!!\n");
  1650. if (rtlpriv->cfg->ops->get_btc_status())
  1651. rtlpriv->btcoexist.btc_ops->btc_btinfo_notify(rtlpriv,
  1652. tmp_buf,
  1653. c2h_cmd_len);
  1654. break;
  1655. default:
  1656. break;
  1657. }
  1658. }
  1659. void rtl8821ae_c2h_packet_handler(struct ieee80211_hw *hw, u8 *buffer,
  1660. u8 length)
  1661. {
  1662. struct rtl_priv *rtlpriv = rtl_priv(hw);
  1663. u8 c2h_cmd_id = 0, c2h_cmd_seq = 0, c2h_cmd_len = 0;
  1664. u8 *tmp_buf = NULL;
  1665. c2h_cmd_id = buffer[0];
  1666. c2h_cmd_seq = buffer[1];
  1667. c2h_cmd_len = length - 2;
  1668. tmp_buf = buffer + 2;
  1669. RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
  1670. "[C2H packet], c2hCmdId=0x%x, c2hCmdSeq=0x%x, c2hCmdLen=%d\n",
  1671. c2h_cmd_id, c2h_cmd_seq, c2h_cmd_len);
  1672. RT_PRINT_DATA(rtlpriv, COMP_FW, DBG_LOUD,
  1673. "[C2H packet], Content Hex:\n", tmp_buf, c2h_cmd_len);
  1674. _rtl8821ae_c2h_content_parsing(hw, c2h_cmd_id, c2h_cmd_len, tmp_buf);
  1675. }