adapter.h 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/adapter.h#5
  3. */
  4. /*! \file adapter.h
  5. \brief Definition of internal data structure for driver manipulation.
  6. In this file we define the internal data structure - ADAPTER_T which stands
  7. for MiniPort ADAPTER(From Windows point of view) or stands for Network ADAPTER.
  8. */
  9. /*
  10. ** Log: adapter.h
  11. **
  12. ** 01 15 2014 eason.tsai
  13. ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
  14. ** Merging
  15. **
  16. ** //ALPS_SW/DEV/ALPS.JB2.MT6630.DEV/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...@2327720
  17. **
  18. ** to //ALPS_SW/TRUNK/KK/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...
  19. **
  20. ** 01 09 2014 eason.tsai
  21. ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
  22. ** fix turn off AC definition build error
  23. **
  24. ** 01 15 2014 eason.tsai
  25. ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
  26. ** Merging
  27. **
  28. ** //ALPS_SW/DEV/ALPS.JB2.MT6630.DEV/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...
  29. **
  30. ** to //ALPS_SW/TRUNK/KK/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...
  31. **
  32. ** 12 27 2013 eason.tsai
  33. ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
  34. ** update code for ICAP & nvram
  35. **
  36. ** 08 22 2013 tsaiyuan.hsu
  37. ** [BORA00002222] MT6630 unified MAC RXM
  38. ** add mDNS filter for Android.
  39. **
  40. ** 08 13 2013 terry.wu
  41. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  42. ** 1. Assign TXD.PID by wlan index
  43. ** 2. Some bug fix
  44. **
  45. ** 08 05 2013 terry.wu
  46. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  47. ** 1. Add SW rate definition
  48. ** 2. Add HW default rate selection logic from FW
  49. **
  50. ** 07 28 2013 eddie.chen
  51. ** [BORA00002450] [WIFISYS][MT6630] New design for mt6630
  52. ** Save the compileflag and featureflag
  53. **
  54. ** 07 23 2013 wh.su
  55. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  56. ** Sync the latest jb2.mp 11w code as draft version
  57. ** Not the CM bit for avoid wapi 1x drop at re-key
  58. **
  59. ** 07 12 2013 terry.wu
  60. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  61. ** 1. Update VHT IE composing function
  62. ** 2. disable bow
  63. ** 3. Exchange bss/sta rec update sequence for temp solution
  64. **
  65. ** 07 05 2013 wh.su
  66. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  67. ** Fix to let the wpa-psk ok
  68. **
  69. ** 07 04 2013 wh.su
  70. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  71. ** Add the function to got the STA index via the wlan index
  72. ** report at Rx status
  73. **
  74. ** 07 03 2013 wh.su
  75. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  76. ** Refine some normal security code
  77. **
  78. ** 07 02 2013 wh.su
  79. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  80. ** Refine some secutity code
  81. **
  82. ** 06 26 2013 cm.chang
  83. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  84. ** For BSS_INFO alloc/free, Use fgIsInUse instead of fgIsNetActive
  85. **
  86. ** 03 20 2013 wh.su
  87. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  88. ** Add the security code for wlan table assign operation
  89. **
  90. ** 03 14 2013 wh.su
  91. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  92. ** .modify some code define and flow
  93. **
  94. ** 03 12 2013 wh.su
  95. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  96. ** .
  97. **
  98. ** 03 08 2013 wh.su
  99. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  100. ** Modify code for security design
  101. **
  102. ** 03 06 2013 wh.su
  103. ** [BORA00002446] [MT6630] [Wi-Fi] [Driver] Update the security function code
  104. ** submit some code related with security.
  105. **
  106. ** 02 27 2013 yuche.tsai
  107. ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
  108. ** Add new code, fix compile warning.
  109. **
  110. ** 02 06 2013 yuche.tsai
  111. ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
  112. ** Fix BSS index to BSS Info MACRO
  113. **
  114. ** 02 05 2013 yuche.tsai
  115. ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
  116. ** Code update for FW development.
  117. **
  118. ** 01 22 2013 cp.wu
  119. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  120. ** modification for ucBssIndex migration
  121. **
  122. ** 01 21 2013 cm.chang
  123. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  124. ** 1. Create rP2pDevInfo structure
  125. ** 2. Support 80/160 MHz channel bandwidth for channel privilege
  126. **
  127. ** 01 17 2013 cm.chang
  128. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  129. ** Use ucBssIndex to replace eNetworkTypeIndex
  130. **
  131. ** 12 27 2012 terry.wu
  132. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  133. ** Update MQM index mapping mechanism
  134. ** 1. TID to ACI
  135. ** 2. ACI to SW TxQ
  136. ** 3. ACI to network TC resource
  137. **
  138. ** 12 19 2012 terry.wu
  139. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  140. ** Add Tx desc composing function
  141. **
  142. ** 11 06 2012 eason.tsai
  143. ** [BORA00002255] [MT6630 Wi-Fi][Driver] develop
  144. ** .
  145. **
  146. ** 10 31 2012 cp.wu
  147. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  148. ** code sync..
  149. **
  150. ** 09 17 2012 cm.chang
  151. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  152. ** Duplicate source from MT6620 v2.3 driver branch
  153. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  154. **
  155. ** 08 24 2012 cp.wu
  156. ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
  157. ** .
  158. **
  159. ** 08 24 2012 cp.wu
  160. ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
  161. ** cfg80211 support merge back from ALPS.JB to DaVinci - MT6620 Driver v2.3 branch.
  162. **
  163. ** 07 24 2012 yuche.tsai
  164. ** NULL
  165. ** Bug fix for JB.
  166. *
  167. * 07 17 2012 yuche.tsai
  168. * NULL
  169. * Let netdev bring up.
  170. *
  171. * 07 17 2012 yuche.tsai
  172. * NULL
  173. * Compile no error before trial run.
  174. *
  175. * 06 13 2012 yuche.tsai
  176. * NULL
  177. * Update maintrunk driver.
  178. * Add support for driver compose assoc request frame.
  179. *
  180. * 03 02 2012 terry.wu
  181. * NULL
  182. * Snc CFG80211 modification for ICS migration from branch 2.2.
  183. *
  184. * 03 02 2012 terry.wu
  185. * NULL
  186. * Sync CFG80211 modification from branch 2,2.
  187. *
  188. * 01 16 2012 cp.wu
  189. * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration
  190. * with corresponding network configuration
  191. * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration
  192. * corresponding to network type.
  193. *
  194. * 12 13 2011 cm.chang
  195. * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer
  196. * Add wake lock if timer timeout value is smaller than 5 seconds
  197. *
  198. * 12 02 2011 yuche.tsai
  199. * NULL
  200. * Resolve inorder issue under AP mode.
  201. *
  202. * data frame may TX before assoc response frame.
  203. *
  204. * 11 19 2011 yuche.tsai
  205. * NULL
  206. * Update RSSI for P2P.
  207. *
  208. * 11 18 2011 yuche.tsai
  209. * NULL
  210. * CONFIG P2P support RSSI query, default turned off.
  211. *
  212. * 11 11 2011 yuche.tsai
  213. * NULL
  214. * Fix work thread cancel issue.
  215. *
  216. * 10 21 2011 eddie.chen
  217. * [WCXRP00001051] [MT6620 Wi-Fi][Driver/Fw] Adjust the STA aging timeout
  218. * Add switch to ignore the STA aging timeout.
  219. *
  220. * 10 12 2011 wh.su
  221. * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
  222. * adding the 802.11w related function and define .
  223. *
  224. * 09 20 2011 cm.chang
  225. * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time
  226. * Remove ERP member in adapter structure
  227. *
  228. * 09 14 2011 yuche.tsai
  229. * NULL
  230. * Add P2P IE in assoc response.
  231. *
  232. * 08 31 2011 cm.chang
  233. * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
  234. * .
  235. *
  236. * 07 18 2011 chinghwa.yu
  237. * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
  238. * Add CMD/Event for RDD and BWCS.
  239. *
  240. * 06 23 2011 cp.wu
  241. * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content
  242. * check with firmware for valid MAC address.
  243. *
  244. * 04 18 2011 terry.wu
  245. * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
  246. * Remove flag CFG_WIFI_DIRECT_MOVED.
  247. *
  248. * 04 12 2011 cm.chang
  249. * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
  250. * .
  251. *
  252. * 04 08 2011 yuche.tsai
  253. * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO.
  254. * Add device discoverability support.
  255. * Action frame callback for GO Device Discoverability Req.
  256. *
  257. * 04 08 2011 george.huang
  258. * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode
  259. * separate settings of P2P and AIS
  260. *
  261. * 04 08 2011 eddie.chen
  262. * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma
  263. * Fix for sigma
  264. *
  265. * 03 19 2011 yuche.tsai
  266. * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct.
  267. * Add beacon timeout support for WiFi Direct Network.
  268. *
  269. * 03 19 2011 yuche.tsai
  270. * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
  271. * Make assoc req to append P2P IE if wifi direct is enabled.
  272. *
  273. * 03 17 2011 cp.wu
  274. * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically
  275. * continuous memory shortage after system running for a long period
  276. * use pre-allocated buffer for storing enhanced interrupt response as well
  277. *
  278. * 03 15 2011 cp.wu
  279. * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce
  280. * physically continuous memory consumption
  281. * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK
  282. * 2. Use common coalescing buffer for both TX/RX directions
  283. *
  284. *
  285. * 03 10 2011 yuche.tsai
  286. * [WCXRP00000533] [Volunteer Patch][MT6620][Driver] Provide a P2P function API for Legacy WiFi to query AP mode.
  287. * Provide an API for Legacy WiFi to query the operation mode..
  288. *
  289. * 03 05 2011 wh.su
  290. * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
  291. * add the code to get the check rsponse and indicate to app.
  292. *
  293. * 03 02 2011 wh.su
  294. * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
  295. * Add code to send beacon and probe response WSC IE at Auto GO.
  296. *
  297. * 03 02 2011 cp.wu
  298. * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as
  299. * initial RSSI right after connection is built.
  300. * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid
  301. * using a uninitialized MAC-RX RCPI.
  302. *
  303. * 02 21 2011 terry.wu
  304. * [WCXRP00000476] [MT6620 Wi-Fi][Driver] Clean P2P scan list while removing P2P
  305. * Clean P2P scan list while removing P2P.
  306. *
  307. * 02 17 2011 eddie.chen
  308. * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel
  309. * 1) Chnange GetFrameAction decision when BSS is absent.
  310. * 2) Check channel and resource in processing ProbeRequest
  311. *
  312. * 02 16 2011 cm.chang
  313. * [WCXRP00000447] [MT6620 Wi-Fi][FW] Support new NVRAM update mechanism
  314. * .
  315. *
  316. * 02 10 2011 yuche.tsai
  317. * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode.
  318. * Add RX deauthentication & disassociation process under Hot-Spot mode.
  319. *
  320. * 02 09 2011 wh.su
  321. * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module
  322. * with structure miss-align pointer issue
  323. * always pre-allio WAPI related structure for align p2p module.
  324. *
  325. * 02 08 2011 yuche.tsai
  326. * [WCXRP00000419] [Volunteer Patch][MT6620/MT5931][Driver] Provide function of disconnect to
  327. * target station for AAA module.
  328. * Provide disconnect function for AAA module.
  329. *
  330. * 02 01 2011 cm.chang
  331. * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode
  332. * .
  333. *
  334. * 01 27 2011 tsaiyuan.hsu
  335. * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
  336. * add roaming fsm
  337. * 1. not support 11r, only use strength of signal to determine roaming.
  338. * 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
  339. * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
  340. * 4. assume that change of link quality in smooth way.
  341. *
  342. * 01 27 2011 george.huang
  343. * [WCXRP00000400] [MT6620 Wi-Fi] support CTIA power mode setting
  344. * Support CTIA power mode setting.
  345. *
  346. * 01 27 2011 george.huang
  347. * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability
  348. * Support current measure mode, assigned by registry (XP only).
  349. *
  350. * 01 24 2011 cp.wu
  351. * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
  352. * 1. add an extra counter for tracking pending forward frames.
  353. * 2. notify TX service thread as well when there is pending forward frame
  354. * 3. correct build errors leaded by introduction of Wi-Fi direct separation module
  355. *
  356. * 01 12 2011 cm.chang
  357. * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
  358. * User-defined bandwidth is for 2.4G and 5G individually
  359. *
  360. * 12 29 2010 eddie.chen
  361. * [WCXRP00000322] Add WMM IE in beacon,
  362. Add per station flow control when STA is in PS
  363. * Add WMM parameter for broadcast.
  364. *
  365. * 12 29 2010 eddie.chen
  366. * [WCXRP00000322] Add WMM IE in beacon,
  367. Add per station flow control when STA is in PS
  368. * Add CWMin CWMax for AP to generate IE.
  369. *
  370. * 12 29 2010 eddie.chen
  371. * [WCXRP00000322] Add WMM IE in beacon,
  372. Add per station flow control when STA is in PS
  373. * 1) PS flow control event
  374. *
  375. * 2) WMM IE in beacon, assoc resp, probe resp
  376. *
  377. * 12 28 2010 cp.wu
  378. * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release
  379. * report EEPROM used flag via NIC_CAPABILITY
  380. *
  381. * 12 28 2010 cp.wu
  382. * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release
  383. * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools
  384. *
  385. * 12 07 2010 cm.chang
  386. * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
  387. * 1. Country code is from NVRAM or supplicant
  388. * 2. Change band definition in CMD/EVENT.
  389. *
  390. * 11 01 2010 cp.wu
  391. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver]
  392. * Add implementation for querying current TX rate from firmware auto rate module
  393. * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead
  394. * 2) Remove CNM CH-RECOVER event handling
  395. * 3) cfg read/write API renamed with kal prefix for unified naming rules.
  396. *
  397. * 10 27 2010 george.huang
  398. * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB
  399. * Support registry option for disable beacon lost detection.
  400. *
  401. * 10 26 2010 cp.wu
  402. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW]
  403. * Support NIC capability query command
  404. * 1) update NVRAM content template to ver 1.02
  405. * 2) add compile option for querying NIC capability (default: off)
  406. * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
  407. * 4) correct auto-rate compiler error under linux (treat warning as error)
  408. * 5) simplify usage of NVRAM and REG_INFO_T
  409. * 6) add version checking between driver and firmware
  410. *
  411. * 10 08 2010 cp.wu
  412. * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test
  413. * adding fixed rate support for distance test. (from registry setting)
  414. *
  415. * 10 06 2010 cp.wu
  416. * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
  417. * code reorganization to improve isolation between GLUE and CORE layers.
  418. *
  419. * 10 05 2010 cp.wu
  420. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
  421. * 1) add NVRAM access API
  422. * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
  423. * 3) add OID implementation for NVRAM read/write service
  424. *
  425. * 09 27 2010 chinghwa.yu
  426. * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings
  427. * Update BCM/BoW design and settings.
  428. *
  429. * 09 24 2010 cp.wu
  430. * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature
  431. * Modify online scan as a run-time adjustable option (for Windows, in registry)
  432. *
  433. * 09 23 2010 cp.wu
  434. * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item
  435. * use firmware reported mac address right after wlanAdapterStart() as permanent address
  436. *
  437. * 09 08 2010 cp.wu
  438. * NULL
  439. * use static memory pool for storing IEs of scanning result.
  440. *
  441. * 09 07 2010 yuche.tsai
  442. * NULL
  443. * Add a common IE buffer in P2P INFO structure.
  444. *
  445. * 09 03 2010 kevin.huang
  446. * NULL
  447. * Refine #include sequence and solve recursive/nested #include issue
  448. *
  449. * 09 01 2010 cp.wu
  450. * NULL
  451. * restore configuration as before.
  452. *
  453. * 09 01 2010 wh.su
  454. * NULL
  455. * adding the wapi support for integration test.
  456. *
  457. * 08 31 2010 kevin.huang
  458. * NULL
  459. * Use LINK LIST operation to process SCAN result
  460. *
  461. * 08 29 2010 yuche.tsai
  462. * NULL
  463. * Finish SLT TX/RX & Rate Changing Support.
  464. *
  465. * 08 25 2010 george.huang
  466. * NULL
  467. * update OID/ registry control path for PM related settings
  468. *
  469. * 08 24 2010 cm.chang
  470. * NULL
  471. * Support RLM initail channel of Ad-hoc, P2P and BOW
  472. *
  473. * 08 23 2010 chinghwa.yu
  474. * NULL
  475. * Update for BOW.
  476. *
  477. * 08 20 2010 cm.chang
  478. * NULL
  479. * Migrate RLM code to host from FW
  480. *
  481. * 08 16 2010 yuche.tsai
  482. * NULL
  483. * Add an intend mode for BSS info.
  484. * It is used to let P2P BSS Info to know which OP Mode it is going to become.
  485. *
  486. * 08 04 2010 george.huang
  487. * NULL
  488. * handle change PS mode OID/ CMD
  489. *
  490. * 08 02 2010 cp.wu
  491. * NULL
  492. * comment out deprecated members in BSS_INFO, which are only used by firmware rather than driver.
  493. *
  494. * 07 29 2010 cp.wu
  495. * NULL
  496. * eliminate u4FreqInKHz usage, combined into rConnections.ucAdHoc*
  497. *
  498. * 07 28 2010 cp.wu
  499. * NULL
  500. * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo
  501. * 2) change nicMediaStateChange() API prototype
  502. *
  503. * 07 24 2010 wh.su
  504. *
  505. * .support the Wi-Fi RSN
  506. *
  507. * 07 21 2010 yuche.tsai
  508. *
  509. * Add for P2P Scan Result Parsing & Saving.
  510. *
  511. * 07 19 2010 wh.su
  512. *
  513. * update for security supporting.
  514. *
  515. * 07 19 2010 cm.chang
  516. *
  517. * Set RLM parameters and enable CNM channel manager
  518. *
  519. * 07 19 2010 yuche.tsai
  520. *
  521. * Remove BSS info which is redonedent in Wifi Var..
  522. *
  523. * 07 16 2010 yarco.yang
  524. *
  525. * 1. Support BSS Absence/Presence Event
  526. * 2. Support STA change PS mode Event
  527. * 3. Support BMC forwarding for AP mode.
  528. *
  529. * 07 14 2010 yarco.yang
  530. *
  531. * 1. Remove CFG_MQM_MIGRATION
  532. * 2. Add CMD_UPDATE_WMM_PARMS command
  533. *
  534. * 07 09 2010 george.huang
  535. *
  536. * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info
  537. *
  538. * 07 08 2010 cp.wu
  539. *
  540. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  541. *
  542. * 07 08 2010 cm.chang
  543. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  544. * Check draft RLM code for HT cap
  545. *
  546. * 06 29 2010 yarco.yang
  547. * [WPD00003837][MT6620]Data Path Refine
  548. * replace g_rQM with Adpater->rQM
  549. *
  550. * 06 28 2010 cm.chang
  551. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  552. * 1st draft code for RLM module
  553. *
  554. * 06 21 2010 wh.su
  555. * [WPD00003840][MT6620 5931] Security migration
  556. * remove duplicate variable for migration.
  557. *
  558. * 06 21 2010 wh.su
  559. * [WPD00003840][MT6620 5931] Security migration
  560. * modify some code for concurrent network.
  561. *
  562. * 06 21 2010 yuche.tsai
  563. * [WPD00003839][MT6620 5931][P2P] Feature migration
  564. * Add P2P FSM Info in adapter.
  565. *
  566. * 06 21 2010 yarco.yang
  567. * [WPD00003837][MT6620]Data Path Refine
  568. * Support CFG_MQM_MIGRATION flag
  569. *
  570. * 06 18 2010 cm.chang
  571. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  572. * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
  573. *
  574. * 06 18 2010 wh.su
  575. * [WPD00003840][MT6620 5931] Security migration
  576. * migration the security related function from firmware.
  577. *
  578. * 06 17 2010 yuche.tsai
  579. * [WPD00003839][MT6620 5931][P2P] Feature migration
  580. * Add P2P related field, additional include p2p_fsm.h if p2p is enabled.
  581. *
  582. * 06 15 2010 cp.wu
  583. * [WPD00003833][MT6620 and MT5931] Driver migration
  584. * add scan.c.
  585. *
  586. * 06 14 2010 cp.wu
  587. * [WPD00003833][MT6620 and MT5931] Driver migration
  588. * add management dispatching function table.
  589. *
  590. * 06 11 2010 cp.wu
  591. * [WPD00003833][MT6620 and MT5931] Driver migration
  592. * auth.c is migrated.
  593. *
  594. * 06 11 2010 cp.wu
  595. * [WPD00003833][MT6620 and MT5931] Driver migration
  596. * 1) migrate assoc.c.
  597. * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
  598. * 3) add configuration options for CNM_MEM and RSN modules
  599. * 4) add data path for management frames
  600. * 5) eliminate rPacketInfo of MSDU_INFO_T
  601. *
  602. * 06 10 2010 cp.wu
  603. * [WPD00003833][MT6620 and MT5931] Driver migration
  604. * add buildable & linkable ais_fsm.c
  605. *
  606. * related reference are still waiting to be resolved
  607. *
  608. * 06 09 2010 cp.wu
  609. * [WPD00003833][MT6620 and MT5931] Driver migration
  610. * add definitions for module migration.
  611. *
  612. * 06 08 2010 cp.wu
  613. * [WPD00003833][MT6620 and MT5931] Driver migration
  614. * cnm_timer has been migrated.
  615. *
  616. * 06 08 2010 cp.wu
  617. * [WPD00003833][MT6620 and MT5931] Driver migration
  618. * hem_mbox is migrated.
  619. *
  620. * 06 07 2010 cp.wu
  621. * [WPD00003833][MT6620 and MT5931] Driver migration
  622. * merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
  623. *
  624. * 06 06 2010 kevin.huang
  625. * [WPD00003832][MT6620 5931] Create driver base
  626. * [MT6620 5931] Create driver base
  627. *
  628. * 05 22 2010 cp.wu
  629. * [WPD00001943]Create WiFi test driver framework on WinXP
  630. * change OID behavior to meet WHQL requirement.
  631. *
  632. * 05 20 2010 cp.wu
  633. * [WPD00001943]Create WiFi test driver framework on WinXP
  634. * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS
  635. * 2) buffer statistics data for 2 seconds
  636. * 3) use default value for adhoc parameters instead of 0
  637. *
  638. * 05 19 2010 cp.wu
  639. * [WPD00001943]Create WiFi test driver framework on WinXP
  640. * 1) do not take timeout mechanism for power mode oids
  641. * 2) retrieve network type from connection status
  642. * 3) after disassciation, set radio state to off
  643. * 4) TCP option over IPv6 is supported
  644. *
  645. * 05 18 2010 cp.wu
  646. * [WPD00001943]Create WiFi test driver framework on WinXP
  647. * implement Wakeup-on-LAN except firmware integration part
  648. *
  649. * 04 27 2010 cp.wu
  650. * [WPD00001943]Create WiFi test driver framework on WinXP
  651. * reserve field of privacy filter and RTS threshold setting.
  652. *
  653. * 04 13 2010 cp.wu
  654. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  655. * add framework for BT-over-Wi-Fi support.
  656. * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
  657. * * * * * * 2) command sequence number is now increased atomically
  658. * * * * * * 3) private data could be hold and taken use for other purpose
  659. *
  660. * 04 07 2010 cp.wu
  661. * [WPD00001943]Create WiFi test driver framework on WinXP
  662. * rWlanInfo should be placed at adapter rather than glue due to most operations
  663. * * * are done in adapter layer.
  664. *
  665. * 04 06 2010 cp.wu
  666. * [WPD00001943]Create WiFi test driver framework on WinXP
  667. * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved
  668. *
  669. * 03 31 2010 wh.su
  670. * [WPD00003816][MT6620 Wi-Fi] Adding the security support
  671. * modify the wapi related code for new driver's design.
  672. *
  673. * 03 19 2010 cp.wu
  674. * [WPD00001943]Create WiFi test driver framework on WinXP
  675. * 1) add ACPI D0/D3 state switching support
  676. * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response
  677. *
  678. * 03 03 2010 cp.wu
  679. * [WPD00001943]Create WiFi test driver framework on WinXP
  680. * implement OID_802_3_MULTICAST_LIST oid handling
  681. *
  682. * 03 02 2010 cp.wu
  683. * [WPD00001943]Create WiFi test driver framework on WinXP
  684. * 1) the use of prPendingOid revised, all accessing are now protected by spin lock
  685. * * * 2) ensure wlanReleasePendingOid will clear all command queues
  686. *
  687. * 02 09 2010 cp.wu
  688. * [WPD00001943]Create WiFi test driver framework on WinXP
  689. * move ucCmdSeqNum as instance variable
  690. *
  691. * 01 27 2010 wh.su
  692. * [WPD00003816][MT6620 Wi-Fi] Adding the security support
  693. * .
  694. *
  695. * 01 27 2010 cp.wu
  696. * [WPD00001943]Create WiFi test driver framework on WinXP
  697. * 1. eliminate improper variable in rHifInfo
  698. * * * 2. block TX/ordinary OID when RF test mode is engaged
  699. * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode
  700. * * * 4. correct some HAL implementation
  701. *
  702. * 12 30 2009 cp.wu
  703. * [WPD00001943]Create WiFi test driver framework on WinXP
  704. * 1) According to CMD/EVENT documentation v0.8,
  705. * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used,
  706. * * * and result is retrieved by get ATInfo instead
  707. * * * 2) add 4 counter for recording aggregation statistics
  708. *
  709. * 12 28 2009 cp.wu
  710. * [WPD00001943]Create WiFi test driver framework on WinXP
  711. * eliminate redundant variables for connection_state
  712. ** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-12-16 18:02:03 GMT mtk02752
  713. ** add external reference to avoid compilation error
  714. ** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-12-10 16:40:26 GMT mtk02752
  715. ** eliminate unused member
  716. ** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-12-08 17:36:08 GMT mtk02752
  717. ** add RF test data members into P_ADAPTER_T
  718. ** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:45 GMT mtk01084
  719. ** update for new HW architecture design
  720. ** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-28 10:29:57 GMT mtk01461
  721. ** Add read WTSR for SDIO_STATUS_ENHANCE mode
  722. ** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-21 09:37:35 GMT mtk01461
  723. ** Add prPendingCmdInfoOfOID for temporarily saving the CMD_INFO_T before en-queue to rCmdQueue
  724. ** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-17 19:57:51 GMT mtk01461
  725. ** Add MGMT Buffer Info
  726. ** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:34:12 GMT mtk01461
  727. ** Add SW pre test CFG_HIF_LOOPBACK_PRETEST
  728. ** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 21:41:48 GMT mtk01461
  729. ** Add fgIsWmmAssoc flag for TC assignment
  730. ** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 18:32:51 GMT mtk01084
  731. ** update for basic power management functions
  732. ** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:51:52 GMT mtk01426
  733. ** Add #if CFG_SDIO_RX_ENHANCE related data structure
  734. ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:17 GMT mtk01426
  735. ** Init for develop
  736. **
  737. */
  738. #ifndef _ADAPTER_H
  739. #define _ADAPTER_H
  740. /*******************************************************************************
  741. * C O M P I L E R F L A G S
  742. ********************************************************************************
  743. */
  744. /*******************************************************************************
  745. * E X T E R N A L R E F E R E N C E S
  746. ********************************************************************************
  747. */
  748. #if CFG_SUPPORT_PASSPOINT
  749. #include "hs20.h"
  750. #endif /* CFG_SUPPORT_PASSPOINT */
  751. /*******************************************************************************
  752. * C O N S T A N T S
  753. ********************************************************************************
  754. */
  755. /*******************************************************************************
  756. * D A T A T Y P E S
  757. ********************************************************************************
  758. */
  759. typedef struct _ENHANCE_MODE_DATA_STRUCT_T SDIO_CTRL_T, *P_SDIO_CTRL_T;
  760. typedef struct _WLAN_INFO_T {
  761. PARAM_BSSID_EX_T rCurrBssId;
  762. /* Scan Result */
  763. PARAM_BSSID_EX_T arScanResult[CFG_MAX_NUM_BSS_LIST];
  764. PUINT_8 apucScanResultIEs[CFG_MAX_NUM_BSS_LIST];
  765. UINT_32 u4ScanResultNum;
  766. /* IE pool for Scanning Result */
  767. UINT_8 aucScanIEBuf[CFG_MAX_COMMON_IE_BUF_LEN];
  768. UINT_32 u4ScanIEBufferUsage;
  769. OS_SYSTIME u4SysTime;
  770. /* connection parameter (for Ad-Hoc) */
  771. UINT_16 u2BeaconPeriod;
  772. UINT_16 u2AtimWindow;
  773. PARAM_RATES eDesiredRates;
  774. CMD_LINK_ATTRIB eLinkAttr;
  775. /* CMD_PS_PROFILE_T ePowerSaveMode; */
  776. CMD_PS_PROFILE_T arPowerSaveMode[BSS_INFO_NUM];
  777. /* trigger parameter */
  778. ENUM_RSSI_TRIGGER_TYPE eRssiTriggerType;
  779. PARAM_RSSI rRssiTriggerValue;
  780. /* Privacy Filter */
  781. ENUM_PARAM_PRIVACY_FILTER_T ePrivacyFilter;
  782. /* RTS Threshold */
  783. PARAM_RTS_THRESHOLD eRtsThreshold;
  784. /* Network Type */
  785. UINT_8 ucNetworkType;
  786. /* Network Type In Use */
  787. UINT_8 ucNetworkTypeInUse;
  788. } WLAN_INFO_T, *P_WLAN_INFO_T;
  789. /* Session for CONNECTION SETTINGS */
  790. typedef struct _CONNECTION_SETTINGS_T {
  791. UINT_8 aucMacAddress[MAC_ADDR_LEN];
  792. UINT_8 ucDelayTimeOfDisconnectEvent;
  793. BOOLEAN fgIsConnByBssidIssued;
  794. UINT_8 aucBSSID[MAC_ADDR_LEN];
  795. BOOLEAN fgIsConnReqIssued;
  796. BOOLEAN fgIsDisconnectedByNonRequest;
  797. UINT_8 ucSSIDLen;
  798. UINT_8 aucSSID[ELEM_MAX_LEN_SSID];
  799. ENUM_PARAM_OP_MODE_T eOPMode;
  800. ENUM_PARAM_CONNECTION_POLICY_T eConnectionPolicy;
  801. ENUM_PARAM_AD_HOC_MODE_T eAdHocMode;
  802. ENUM_PARAM_AUTH_MODE_T eAuthMode;
  803. ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus;
  804. BOOLEAN fgIsScanReqIssued;
  805. /* MIB attributes */
  806. UINT_16 u2BeaconPeriod;
  807. UINT_16 u2RTSThreshold; /* User desired setting */
  808. UINT_16 u2DesiredNonHTRateSet; /* User desired setting */
  809. UINT_8 ucAdHocChannelNum; /* For AdHoc */
  810. ENUM_BAND_T eAdHocBand; /* For AdHoc */
  811. UINT_32 u4FreqInKHz; /* Center frequency */
  812. /* ATIM windows using for IBSS power saving function */
  813. UINT_16 u2AtimWindow;
  814. /* Features */
  815. BOOLEAN fgIsEnableRoaming;
  816. BOOLEAN fgIsAdHocQoSEnable;
  817. ENUM_PARAM_PHY_CONFIG_T eDesiredPhyConfig;
  818. /* Used for AP mode for desired channel and bandwidth */
  819. UINT_16 u2CountryCode;
  820. UINT_8 uc2G4BandwidthMode; /* 20/40M or 20M only *//* Not used */
  821. UINT_8 uc5GBandwidthMode; /* 20/40M or 20M only *//* Not used */
  822. #if CFG_SUPPORT_802_11D
  823. BOOLEAN fgMultiDomainCapabilityEnabled;
  824. #endif /* CFG_SUPPORT_802_11D */
  825. #if 1 /* CFG_SUPPORT_WAPI */
  826. BOOL fgWapiMode;
  827. UINT_32 u4WapiSelectedGroupCipher;
  828. UINT_32 u4WapiSelectedPairwiseCipher;
  829. UINT_32 u4WapiSelectedAKMSuite;
  830. #endif
  831. /* CR1486, CR1640 */
  832. /* for WPS, disable the privacy check for AP selection policy */
  833. BOOLEAN fgPrivacyCheckDisable;
  834. /* b0~3: trigger-en AC0~3. b4~7: delivery-en AC0~3 */
  835. UINT_8 bmfgApsdEnAc;
  836. /* for RSN info store, when upper layer set rsn info */
  837. RSN_INFO_T rRsnInfo;
  838. } CONNECTION_SETTINGS_T, *P_CONNECTION_SETTINGS_T;
  839. struct _BSS_INFO_T {
  840. ENUM_NETWORK_TYPE_T eNetworkType;
  841. UINT_32 u4PrivateData; /* Private data parameter for each NETWORK type usage. */
  842. /* P2P network type has 3 network interface to distinguish. */
  843. ENUM_PARAM_MEDIA_STATE_T eConnectionState; /* Connected Flag used in AIS_NORMAL_TR */
  844. ENUM_PARAM_MEDIA_STATE_T eConnectionStateIndicated; /* The Media State that report to HOST */
  845. ENUM_OP_MODE_T eCurrentOPMode; /* Current Operation Mode - Infra/IBSS */
  846. #if CFG_ENABLE_WIFI_DIRECT
  847. ENUM_OP_MODE_T eIntendOPMode;
  848. #endif
  849. BOOLEAN fgIsInUse; /* For CNM to assign BSS_INFO */
  850. BOOLEAN fgIsNetActive; /* TRUE if this network has been activated */
  851. UINT_8 ucBssIndex; /* BSS_INFO_T index */
  852. UINT_8 ucReasonOfDisconnect; /* Used by media state indication */
  853. UINT_8 ucSSIDLen; /* Length of SSID */
  854. #if CFG_ENABLE_WIFI_DIRECT
  855. ENUM_HIDDEN_SSID_TYPE_T eHiddenSsidType; /* For Hidden SSID usage. */
  856. #endif
  857. UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; /* SSID used in this BSS */
  858. UINT_8 aucBSSID[MAC_ADDR_LEN]; /* The BSSID of the associated BSS */
  859. UINT_8 aucOwnMacAddr[MAC_ADDR_LEN]; /* Owned MAC Address used in this BSS */
  860. UINT_8 ucOwnMacIndex; /* Owned MAC index used in this BSS */
  861. P_STA_RECORD_T prStaRecOfAP; /* For Infra Mode, and valid only if
  862. * eConnectionState == MEDIA_STATE_CONNECTED
  863. */
  864. LINK_T rStaRecOfClientList; /* For IBSS/AP Mode, all known STAs in current BSS */
  865. UINT_8 ucBMCWlanIndex; /* For IBSS/AP Mode, BC/MC Tx wlan index, For STA, BC/MC Rx wlan index */
  866. BOOLEAN fgTxBcKeyExist; /* Bc Transmit key exist or not */
  867. UINT_8 ucTxDefaultKeyID; /* Bc Transmit key ID */
  868. UINT_8 ucCurrentGtkId; /* The Current Group key ID */
  869. UINT_16 u2CapInfo; /* Change Detection */
  870. UINT_16 u2BeaconInterval; /* The Beacon Interval of this BSS */
  871. UINT_16 u2ATIMWindow; /* For IBSS Mode */
  872. UINT_16 u2AssocId; /* For Infra Mode, it is the Assoc ID assigned by AP.
  873. */
  874. UINT_8 ucDTIMPeriod; /* For Infra/AP Mode */
  875. UINT_8 ucDTIMCount; /* For AP Mode, it is the DTIM value we should carried in
  876. * the Beacon of next TBTT.
  877. */
  878. UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this peer
  879. * (This is deduced from received BSS_DESC_T)
  880. */
  881. UINT_8 ucNonHTBasicPhyType; /* The Basic PHY Type Index, used to setup Phy Capability */
  882. UINT_8 ucConfigAdHocAPMode; /* The configuration of AdHoc/AP Mode. e.g. 11g or 11b */
  883. UINT_8 ucBeaconTimeoutCount; /* For Infra/AP Mode, it is a threshold of Beacon Lost Count to
  884. confirm connection was lost */
  885. BOOLEAN fgHoldSameBssidForIBSS; /* For IBSS Mode, to keep use same BSSID to extend the life cycle of an IBSS */
  886. BOOLEAN fgIsBeaconActivated; /* For AP/IBSS Mode, it is used to indicate that Beacon is sending */
  887. P_MSDU_INFO_T prBeacon; /* For AP/IBSS Mode - Beacon Frame */
  888. BOOLEAN fgIsIBSSMaster; /* For IBSS Mode - To indicate that we can reply ProbeResp Frame.
  889. In current TBTT interval */
  890. BOOLEAN fgIsShortPreambleAllowed; /* From Capability Info. of AssocResp Frame
  891. AND of Beacon/ProbeResp Frame */
  892. BOOLEAN fgUseShortPreamble; /* Short Preamble is enabled in current BSS. */
  893. BOOLEAN fgUseShortSlotTime; /* Short Slot Time is enabled in current BSS. */
  894. UINT_16 u2OperationalRateSet; /* Operational Rate Set of current BSS */
  895. UINT_16 u2BSSBasicRateSet; /* Basic Rate Set of current BSS */
  896. UINT_8 ucAllSupportedRatesLen; /* Used for composing Beacon Frame in AdHoc or AP Mode */
  897. UINT_8 aucAllSupportedRates[RATE_NUM_SW];
  898. UINT_8 ucAssocClientCnt; /* TODO(Kevin): Number of associated clients */
  899. BOOLEAN fgIsProtection;
  900. BOOLEAN fgIsQBSS; /* fgIsWmmBSS; *//* For Infra/AP/IBSS Mode, it is used to indicate if we support WMM in
  901. * current BSS. */
  902. BOOLEAN fgIsNetAbsent; /* TRUE: BSS is absent, FALSE: BSS is present */
  903. UINT_32 u4RsnSelectedGroupCipher;
  904. UINT_32 u4RsnSelectedPairwiseCipher;
  905. UINT_32 u4RsnSelectedAKMSuite;
  906. UINT_16 u2RsnSelectedCapInfo;
  907. /*------------------------------------------------------------------------*/
  908. /* Power Management related information */
  909. /*------------------------------------------------------------------------*/
  910. PM_PROFILE_SETUP_INFO_T rPmProfSetupInfo;
  911. /*------------------------------------------------------------------------*/
  912. /* WMM/QoS related information */
  913. /*------------------------------------------------------------------------*/
  914. UINT_8 ucWmmParamSetCount; /* Used to detect the change of EDCA parameters. For AP mode,
  915. the value is used in WMM IE */
  916. AC_QUE_PARMS_T arACQueParms[WMM_AC_INDEX_NUM];
  917. UINT_8 aucCWminLog2ForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the CWminLog2 */
  918. UINT_8 aucCWmaxLog2ForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the CWmaxLog2 */
  919. AC_QUE_PARMS_T arACQueParmsForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the value */
  920. /*------------------------------------------------------------------------*/
  921. /* 802.11n HT operation IE when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_HT) */
  922. /* is true. They have the same definition with fields of */
  923. /* information element (CM) */
  924. /*------------------------------------------------------------------------*/
  925. ENUM_BAND_T eBand;
  926. UINT_8 ucPrimaryChannel;
  927. UINT_8 ucHtOpInfo1;
  928. UINT_16 u2HtOpInfo2;
  929. UINT_16 u2HtOpInfo3;
  930. /*------------------------------------------------------------------------*/
  931. /* 802.11ac VHT operation IE when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_VHT) */
  932. /* is true. They have the same definition with fields of */
  933. /* information element (EASON) */
  934. /*------------------------------------------------------------------------*/
  935. #if 1 /* CFG_SUPPORT_802_11AC */
  936. UINT_8 ucVhtChannelWidth;
  937. UINT_8 ucVhtChannelFrequencyS1;
  938. UINT_8 ucVhtChannelFrequencyS2;
  939. UINT_16 u2VhtBasicMcsSet;
  940. #endif
  941. /*------------------------------------------------------------------------*/
  942. /* Required protection modes (CM) */
  943. /*------------------------------------------------------------------------*/
  944. BOOLEAN fgErpProtectMode;
  945. ENUM_HT_PROTECT_MODE_T eHtProtectMode;
  946. ENUM_GF_MODE_T eGfOperationMode;
  947. ENUM_RIFS_MODE_T eRifsOperationMode;
  948. BOOLEAN fgObssErpProtectMode; /* GO only */
  949. ENUM_HT_PROTECT_MODE_T eObssHtProtectMode; /* GO only */
  950. ENUM_GF_MODE_T eObssGfOperationMode; /* GO only */
  951. BOOLEAN fgObssRifsOperationMode; /* GO only */
  952. /*------------------------------------------------------------------------*/
  953. /* OBSS to decide if 20/40M bandwidth is permitted. */
  954. /* The first member indicates the following channel list length. */
  955. /*------------------------------------------------------------------------*/
  956. BOOLEAN fgAssoc40mBwAllowed;
  957. BOOLEAN fg40mBwAllowed;
  958. ENUM_CHNL_EXT_T eBssSCO; /* Real setting for HW
  959. * 20/40M AP mode will always set 40M,
  960. * but its OP IE can be changed.
  961. */
  962. UINT_8 auc2G_20mReqChnlList[CHNL_LIST_SZ_2G + 1];
  963. UINT_8 auc2G_NonHtChnlList[CHNL_LIST_SZ_2G + 1];
  964. UINT_8 auc2G_PriChnlList[CHNL_LIST_SZ_2G + 1];
  965. UINT_8 auc2G_SecChnlList[CHNL_LIST_SZ_2G + 1];
  966. UINT_8 auc5G_20mReqChnlList[CHNL_LIST_SZ_5G + 1];
  967. UINT_8 auc5G_NonHtChnlList[CHNL_LIST_SZ_5G + 1];
  968. UINT_8 auc5G_PriChnlList[CHNL_LIST_SZ_5G + 1];
  969. UINT_8 auc5G_SecChnlList[CHNL_LIST_SZ_5G + 1];
  970. TIMER_T rObssScanTimer;
  971. UINT_16 u2ObssScanInterval; /* in unit of sec */
  972. BOOLEAN fgObssActionForcedTo20M; /* GO only */
  973. BOOLEAN fgObssBeaconForcedTo20M; /* GO only */
  974. /*------------------------------------------------------------------------*/
  975. /* HW Related Fields (Kevin) */
  976. /*------------------------------------------------------------------------*/
  977. UINT_16 u2HwDefaultFixedRateCode; /* The default rate code copied to MAC TX Desc */
  978. UINT_16 u2HwLPWakeupGuardTimeUsec;
  979. UINT_8 ucBssFreeQuota; /* The value is updated from FW */
  980. #if CFG_ENABLE_GTK_FRAME_FILTER
  981. P_IPV4_NETWORK_ADDRESS_LIST prIpV4NetAddrList;
  982. #endif
  983. UINT_16 u2DeauthReason;
  984. #if CFG_SUPPORT_TDLS
  985. BOOLEAN fgTdlsIsProhibited;
  986. BOOLEAN fgTdlsIsChSwProhibited;
  987. #endif
  988. #if CFG_SUPPORT_PNO
  989. BOOLEAN fgIsPNOEnable;
  990. BOOLEAN fgIsNetRequestInActive;
  991. #endif
  992. WIFI_WMM_AC_STAT_T arLinkStatistics[WMM_AC_INDEX_NUM]; /*link layer statistics */
  993. };
  994. struct _AIS_SPECIFIC_BSS_INFO_T {
  995. UINT_8 ucRoamingAuthTypes; /* This value indicate the roaming type used in AIS_JOIN */
  996. BOOLEAN fgIsIBSSActive;
  997. /*! \brief Global flag to let arbiter stay at standby and not connect to any network */
  998. BOOLEAN fgCounterMeasure;
  999. /* UINT_8 ucTxWlanIndex; *//* Legacy wep, adhoc wep wpa Transmit key wlan index */
  1000. /* BOOLEAN fgKeyMaterialExist[4]; */
  1001. /* UINT_8 aucKeyMaterial[32][4]; */
  1002. #if 0
  1003. BOOLEAN fgWepWapiBcKeyExist; /* WEP WAPI BC key exist flag */
  1004. UINT_8 ucWepWapiBcWlanIndex; /* WEP WAPI BC wlan index */
  1005. BOOLEAN fgRsnBcKeyExist[4]; /* RSN BC key exist flag, map to key id 0, 1, 2, 3 */
  1006. UINT_8 ucRsnBcWlanIndex[4]; /* RSN BC wlan index, map to key id 0, 1, 2, 3 */
  1007. #endif
  1008. /* While Do CounterMeasure procedure, check the EAPoL Error report have send out */
  1009. BOOLEAN fgCheckEAPoLTxDone;
  1010. UINT_32 u4RsnaLastMICFailTime;
  1011. /* Stored the current bss wpa rsn cap filed, used for roaming policy */
  1012. /* UINT_16 u2RsnCap; */
  1013. TIMER_T rPreauthenticationTimer;
  1014. /* By the flow chart of 802.11i,
  1015. wait 60 sec before associating to same AP
  1016. or roaming to a new AP
  1017. or sending data in IBSS,
  1018. keep a timer for handle the 60 sec counterMeasure */
  1019. TIMER_T rRsnaBlockTrafficTimer;
  1020. TIMER_T rRsnaEAPoLReportTimeoutTimer;
  1021. /* For Keep the Tx/Rx Mic key for TKIP SW Calculate Mic */
  1022. /* This is only one for AIS/AP */
  1023. UINT_8 aucTxMicKey[8];
  1024. UINT_8 aucRxMicKey[8];
  1025. /* Buffer for WPA2 PMKID */
  1026. /* The PMKID cache lifetime is expire by media_disconnect_indication */
  1027. UINT_32 u4PmkidCandicateCount;
  1028. PMKID_CANDICATE_T arPmkidCandicate[CFG_MAX_PMKID_CACHE];
  1029. UINT_32 u4PmkidCacheCount;
  1030. PMKID_ENTRY_T arPmkidCache[CFG_MAX_PMKID_CACHE];
  1031. BOOLEAN fgIndicatePMKID;
  1032. #if CFG_SUPPORT_802_11W
  1033. BOOLEAN fgMgmtProtection;
  1034. BOOLEAN fgAPApplyPmfReq;
  1035. UINT_32 u4SaQueryStart;
  1036. UINT_32 u4SaQueryCount;
  1037. UINT_8 ucSaQueryTimedOut;
  1038. PUINT_8 pucSaQueryTransId;
  1039. TIMER_T rSaQueryTimer;
  1040. BOOLEAN fgBipKeyInstalled;
  1041. #endif
  1042. };
  1043. struct _BOW_SPECIFIC_BSS_INFO_T {
  1044. UINT_16 u2Reserved; /* Reserved for Data Type Check */
  1045. };
  1046. #if CFG_SLT_SUPPORT
  1047. typedef struct _SLT_INFO_T {
  1048. P_BSS_DESC_T prPseudoBssDesc;
  1049. UINT_16 u2SiteID;
  1050. UINT_8 ucChannel2G4;
  1051. UINT_8 ucChannel5G;
  1052. BOOLEAN fgIsDUT;
  1053. UINT_32 u4BeaconReceiveCnt;
  1054. /* ///////Deprecated///////// */
  1055. P_STA_RECORD_T prPseudoStaRec;
  1056. } SLT_INFO_T, *P_SLT_INFO_T;
  1057. #endif
  1058. typedef struct _WLAN_TABLE_T {
  1059. UINT_8 ucUsed;
  1060. UINT_8 ucBssIndex;
  1061. UINT_8 ucKeyId;
  1062. UINT_8 ucPairwise;
  1063. UINT_8 aucMacAddr[MAC_ADDR_LEN];
  1064. UINT_8 ucStaIndex;
  1065. } WLAN_TABLE_T, *P_WLAN_TABLE_T;
  1066. #if 1 /* DBG */
  1067. typedef struct _HAL_WTBL_SEC_CONFIG_T {
  1068. BOOL fgRCA2;
  1069. BOOL fgRV;
  1070. BOOL fgIKV;
  1071. BOOL fgRKV;
  1072. BOOL fgRCID;
  1073. BOOL fgRCA1;
  1074. BOOL fgEvenPN;
  1075. UINT_8 ucKeyID;
  1076. UINT_8 ucMUARIdx;
  1077. UINT_8 ucCipherSuit;
  1078. } HAL_WTBL_SEC_CONFIG_T, *P_HAL_WTBL_SEC_CONFIG_T;
  1079. #endif
  1080. /* Major member variables for WiFi FW operation.
  1081. Variables within this region will be ready for access after WIFI function is enabled.
  1082. */
  1083. typedef struct _WIFI_VAR_T {
  1084. BOOLEAN fgIsRadioOff;
  1085. BOOLEAN fgIsEnterD3ReqIssued;
  1086. BOOLEAN fgDebugCmdResp;
  1087. CONNECTION_SETTINGS_T rConnSettings;
  1088. SCAN_INFO_T rScanInfo;
  1089. #if CFG_SUPPORT_ROAMING
  1090. ROAMING_INFO_T rRoamingInfo;
  1091. #endif /* CFG_SUPPORT_ROAMING */
  1092. AIS_FSM_INFO_T rAisFsmInfo;
  1093. ENUM_PWR_STATE_T aePwrState[BSS_INFO_NUM];
  1094. BSS_INFO_T arBssInfoPool[BSS_INFO_NUM];
  1095. P2P_DEV_INFO_T rP2pDevInfo;
  1096. AIS_SPECIFIC_BSS_INFO_T rAisSpecificBssInfo;
  1097. #if CFG_ENABLE_WIFI_DIRECT
  1098. P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings;
  1099. P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo;
  1100. /* P_P2P_FSM_INFO_T prP2pFsmInfo; */
  1101. P_P2P_DEV_FSM_INFO_T prP2pDevFsmInfo;
  1102. /* Currently we only support 2 p2p interface. */
  1103. P_P2P_ROLE_FSM_INFO_T aprP2pRoleFsmInfo[BSS_P2P_NUM];
  1104. #endif /* CFG_ENABLE_WIFI_DIRECT */
  1105. #if CFG_ENABLE_BT_OVER_WIFI
  1106. BOW_SPECIFIC_BSS_INFO_T rBowSpecificBssInfo;
  1107. BOW_FSM_INFO_T rBowFsmInfo;
  1108. #endif /* CFG_ENABLE_BT_OVER_WIFI */
  1109. WLAN_TABLE_T arWtbl[WTBL_SIZE];
  1110. #if DBG
  1111. HAL_WTBL_SEC_CONFIG_T arWtblCfg[WTBL_SIZE];
  1112. #endif
  1113. DEAUTH_INFO_T arDeauthInfo[MAX_DEAUTH_INFO_COUNT];
  1114. /* Current Wi-Fi Settings and Flags */
  1115. UINT_8 aucPermanentAddress[MAC_ADDR_LEN];
  1116. UINT_8 aucMacAddress[MAC_ADDR_LEN];
  1117. UINT_8 aucDeviceAddress[MAC_ADDR_LEN];
  1118. UINT_8 aucInterfaceAddress[MAC_ADDR_LEN];
  1119. UINT_8 ucAvailablePhyTypeSet;
  1120. ENUM_PHY_TYPE_INDEX_T eNonHTBasicPhyType2G4; /* Basic Phy Type used by SCN according
  1121. * to the set of Available PHY Types
  1122. */
  1123. ENUM_PARAM_PREAMBLE_TYPE_T ePreambleType;
  1124. ENUM_REGISTRY_FIXED_RATE_T eRateSetting;
  1125. BOOLEAN fgIsShortSlotTimeOptionEnable;
  1126. /* User desired setting, but will honor the capability of AP */
  1127. BOOLEAN fgEnableJoinToHiddenSSID;
  1128. BOOLEAN fgSupportWZCDisassociation;
  1129. #if CFG_SUPPORT_WFD
  1130. WFD_CFG_SETTINGS_T rWfdConfigureSettings;
  1131. #endif
  1132. #if CFG_SLT_SUPPORT
  1133. SLT_INFO_T rSltInfo;
  1134. #endif
  1135. #if CFG_SUPPORT_PASSPOINT
  1136. HS20_INFO_T rHS20Info;
  1137. #endif /* CFG_SUPPORT_PASSPOINT */
  1138. UINT_8 aucMediatekOuiIE[64];
  1139. UINT_16 u2MediatekOuiIELen;
  1140. /* Feature Options */
  1141. UINT_8 ucQoS;
  1142. UINT_8 ucStaHt;
  1143. UINT_8 ucStaVht;
  1144. UINT_8 ucApHt;
  1145. UINT_8 ucApVht;
  1146. UINT_8 ucP2pGoHt;
  1147. UINT_8 ucP2pGoVht;
  1148. UINT_8 ucP2pGcHt;
  1149. UINT_8 ucP2pGcVht;
  1150. UINT_8 ucAmpduTx;
  1151. UINT_8 ucAmpduRx;
  1152. UINT_8 ucTspec;
  1153. UINT_8 ucUapsd;
  1154. UINT_8 ucStaUapsd;
  1155. UINT_8 ucApUapsd;
  1156. UINT_8 ucP2pUapsd;
  1157. UINT_8 ucTxShortGI;
  1158. UINT_8 ucRxShortGI;
  1159. UINT_8 ucTxLdpc;
  1160. UINT_8 ucRxLdpc;
  1161. UINT_8 ucTxStbc;
  1162. UINT_8 ucRxStbc;
  1163. UINT_8 ucTxGf;
  1164. UINT_8 ucRxGf;
  1165. UINT_8 ucTxopPsTx;
  1166. UINT_8 ucSigTaRts;
  1167. UINT_8 ucDynBwRts;
  1168. UINT_8 ucStaHtBfee;
  1169. UINT_8 ucStaVhtBfee;
  1170. UINT_8 ucStaBfer;
  1171. UINT_8 ucApWpsMode;
  1172. UINT_8 ucApChannel;
  1173. UINT_8 ucApSco;
  1174. UINT_8 ucP2pGoSco;
  1175. UINT_8 ucStaBandwidth;
  1176. UINT_8 ucSta5gBandwidth;
  1177. UINT_8 ucSta2gBandwidth;
  1178. UINT_8 ucAp5gBandwidth;
  1179. UINT_8 ucAp2gBandwidth;
  1180. UINT_8 ucP2p5gBandwidth;
  1181. UINT_8 ucP2p2gBandwidth;
  1182. UINT_8 ucTxBaSize;
  1183. UINT_8 ucRxHtBaSize;
  1184. UINT_8 ucRxVhtBaSize;
  1185. UINT_8 ucStaDisconnectDetectTh;
  1186. UINT_8 ucApDisconnectDetectTh;
  1187. UINT_8 ucP2pDisconnectDetectTh;
  1188. UINT_8 ucThreadScheduling;
  1189. UINT_8 ucThreadPriority;
  1190. INT_8 cThreadNice;
  1191. UINT_8 ucTcRestrict;
  1192. UINT_32 u4MaxTxDeQLimit;
  1193. UINT_8 ucAlwaysResetUsedRes;
  1194. UINT_32 u4NetifStopTh;
  1195. UINT_32 u4NetifStartTh;
  1196. #if CFG_AUTO_CHANNEL_SEL_SUPPORT
  1197. PARAM_GET_CHN_LOAD rChnLoadInfo;
  1198. #endif
  1199. #if CFG_SUPPORT_MTK_SYNERGY
  1200. UINT_8 ucMtkOui;
  1201. UINT_32 u4MtkOuiCap;
  1202. UINT_8 aucMtkFeature[4];
  1203. #endif
  1204. UINT_32 u4HifIstLoopCount;
  1205. UINT_32 u4Rx2OsLoopCount;
  1206. UINT_32 u4HifTxloopCount;
  1207. UINT_32 u4TxRxLoopCount;
  1208. UINT_32 u4TxFromOsLoopCount;
  1209. UINT_32 au4TcPageCount[TC_NUM];
  1210. UINT_8 ucExtraTxDone;
  1211. UINT_8 ucTxDbg;
  1212. UINT_8 ucCmdRsvResource;
  1213. UINT_32 u4MgmtQueueDelayTimeout;
  1214. UINT_32 u4StatsLogTimeout;
  1215. UINT_32 u4StatsLogDuration;
  1216. UINT_8 ucDhcpTxDone;
  1217. UINT_8 ucArpTxDone;
  1218. } WIFI_VAR_T, *P_WIFI_VAR_T; /* end of _WIFI_VAR_T */
  1219. /* cnm_timer module */
  1220. typedef struct {
  1221. LINK_T rLinkHead;
  1222. OS_SYSTIME rNextExpiredSysTime;
  1223. KAL_WAKE_LOCK_T rWakeLock;
  1224. BOOLEAN fgWakeLocked;
  1225. } ROOT_TIMER, *P_ROOT_TIMER;
  1226. /* FW/DRV/NVRAM version information */
  1227. typedef struct {
  1228. /* NVRAM or Registry */
  1229. UINT_16 u2Part1CfgOwnVersion;
  1230. UINT_16 u2Part1CfgPeerVersion;
  1231. UINT_16 u2Part2CfgOwnVersion;
  1232. UINT_16 u2Part2CfgPeerVersion;
  1233. /* Firmware */
  1234. UINT_16 u2FwProductID;
  1235. UINT_16 u2FwOwnVersion;
  1236. UINT_16 u2FwPeerVersion;
  1237. UINT_32 u2FwOwnVersionExtend; /*support version extended*/
  1238. } WIFI_VER_INFO_T, *P_WIFI_VER_INFO_T;
  1239. #if CFG_ENABLE_WIFI_DIRECT
  1240. /*
  1241. * p2p function pointer structure
  1242. */
  1243. typedef struct _P2P_FUNCTION_LINKER {
  1244. P2P_REMOVE prP2pRemove;
  1245. /* NIC_P2P_MEDIA_STATE_CHANGE prNicP2pMediaStateChange; */
  1246. /* SCAN_UPDATE_P2P_DEVICE_DESC prScanUpdateP2pDeviceDesc; */
  1247. /* P2P_FSM_RUN_EVENT_RX_PROBE_RESPONSE_FRAME prP2pFsmRunEventRxProbeResponseFrame; */
  1248. P2P_GENERATE_P2P_IE prP2pGenerateWSC_IEForBeacon;
  1249. /* P2P_CALCULATE_WSC_IE_LEN_FOR_PROBE_RSP prP2pCalculateWSC_IELenForProbeRsp; */
  1250. /* P2P_GENERATE_WSC_IE_FOR_PROBE_RSP prP2pGenerateWSC_IEForProbeRsp; */
  1251. /* SCAN_REMOVE_P2P_BSS_DESC prScanRemoveP2pBssDesc; */
  1252. /* P2P_HANDLE_SEC_CHECK_RSP prP2pHandleSecCheckRsp; */
  1253. P2P_NET_REGISTER prP2pNetRegister;
  1254. P2P_NET_UNREGISTER prP2pNetUnregister;
  1255. P2P_CALCULATE_P2P_IE_LEN prP2pCalculateP2p_IELenForAssocReq; /* All IEs generated from supplicant. */
  1256. P2P_GENERATE_P2P_IE prP2pGenerateP2p_IEForAssocReq; /* All IEs generated from supplicant. */
  1257. } P2P_FUNCTION_LINKER, *P_P2P_FUNCTION_LINKER;
  1258. #endif
  1259. /*
  1260. * Major ADAPTER structure
  1261. * Major data structure for driver operation
  1262. */
  1263. struct _ADAPTER_T {
  1264. UINT_8 ucRevID;
  1265. BOOLEAN fgIsReadRevID;
  1266. UINT_16 u2NicOpChnlNum;
  1267. BOOLEAN fgIsEnableWMM;
  1268. BOOLEAN fgIsWmmAssoc; /* This flag is used to indicate that WMM is enable in current BSS */
  1269. UINT_32 u4OsPacketFilter; /* packet filter used by OS */
  1270. BOOLEAN fgAllMulicastFilter; /* mDNS filter used by OS */
  1271. P_BSS_INFO_T aprBssInfo[HW_BSSID_NUM + 1];
  1272. P_BSS_INFO_T prAisBssInfo;
  1273. #if CFG_TCP_IP_CHKSUM_OFFLOAD
  1274. UINT_32 u4CSUMFlags;
  1275. #endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
  1276. ENUM_BAND_T aePreferBand[BSS_INFO_NUM];
  1277. /* ADAPTER flags */
  1278. UINT_32 u4Flags;
  1279. UINT_32 u4HwFlags;
  1280. BOOLEAN fgIsRadioOff;
  1281. BOOLEAN fgIsEnterD3ReqIssued;
  1282. UINT_8 aucMacAddress[MAC_ADDR_LEN];
  1283. ENUM_PHY_TYPE_INDEX_T eCurrentPhyType; /* Current selection basing on the set of Available PHY Types */
  1284. #if CFG_COALESCING_BUFFER_SIZE || CFG_SDIO_RX_AGG
  1285. UINT_32 u4CoalescingBufCachedSize;
  1286. PUINT_8 pucCoalescingBufCached;
  1287. #endif /* CFG_COALESCING_BUFFER_SIZE */
  1288. /* Buffer for CMD_INFO_T, Mgt packet and mailbox message */
  1289. BUF_INFO_T rMgtBufInfo;
  1290. BUF_INFO_T rMsgBufInfo;
  1291. PUINT_8 pucMgtBufCached;
  1292. UINT_32 u4MgtBufCachedSize;
  1293. UINT_8 aucMsgBuf[MSG_BUFFER_SIZE];
  1294. #if CFG_DBG_MGT_BUF
  1295. UINT_32 u4MemAllocDynamicCount; /* Debug only */
  1296. UINT_32 u4MemFreeDynamicCount; /* Debug only */
  1297. #endif
  1298. STA_RECORD_T arStaRec[CFG_STA_REC_NUM];
  1299. /* Element for TX PATH */
  1300. TX_CTRL_T rTxCtrl;
  1301. QUE_T rFreeCmdList;
  1302. CMD_INFO_T arHifCmdDesc[CFG_TX_MAX_CMD_PKT_NUM];
  1303. /* Element for RX PATH */
  1304. RX_CTRL_T rRxCtrl;
  1305. /* Timer for restarting RFB setup procedure */
  1306. TIMER_T rPacketDelaySetupTimer;
  1307. P_SDIO_CTRL_T prSDIOCtrl;
  1308. /* Buffer for Authentication Event */
  1309. /* <Todo> Move to glue layer and refine the kal function */
  1310. /* Reference to rsnGeneratePmkidIndication function at rsn.c */
  1311. UINT_8 aucIndicationEventBuffer[(CFG_MAX_PMKID_CACHE * 20) + 8];
  1312. UINT_32 u4IntStatus;
  1313. ENUM_ACPI_STATE_T rAcpiState;
  1314. BOOLEAN fgIsIntEnable;
  1315. BOOLEAN fgIsIntEnableWithLPOwnSet;
  1316. BOOLEAN fgIsFwOwn;
  1317. BOOLEAN fgWiFiInSleepyState;
  1318. OS_SYSTIME rLastOwnFailedLogTime;
  1319. UINT_32 u4OwnFailedCount;
  1320. UINT_32 u4OwnFailedLogCount;
  1321. UINT_32 u4PwrCtrlBlockCnt;
  1322. QUE_T rPendingCmdQueue;
  1323. #if CFG_SUPPORT_MULTITHREAD
  1324. QUE_T rTxCmdQueue;
  1325. QUE_T rTxCmdDoneQueue;
  1326. QUE_T rTxP0Queue;
  1327. QUE_T rTxP1Queue;
  1328. QUE_T rRxQueue;
  1329. #endif
  1330. P_GLUE_INFO_T prGlueInfo;
  1331. UINT_8 ucCmdSeqNum;
  1332. UINT_8 ucTxSeqNum;
  1333. UINT_8 aucPidPool[WTBL_SIZE];
  1334. #if 1 /* CFG_SUPPORT_WAPI */
  1335. BOOLEAN fgUseWapi;
  1336. #endif
  1337. /* RF Test flags */
  1338. BOOLEAN fgTestMode;
  1339. BOOLEAN fgIcapMode;
  1340. /* WLAN Info for DRIVER_CORE OID query */
  1341. WLAN_INFO_T rWlanInfo;
  1342. #if CFG_ENABLE_WIFI_DIRECT
  1343. BOOLEAN fgIsP2PRegistered;
  1344. ENUM_NET_REG_STATE_T rP2PNetRegState;
  1345. /* BOOLEAN fgIsWlanLaunched; */
  1346. P_P2P_INFO_T prP2pInfo;
  1347. #if CFG_SUPPORT_P2P_RSSI_QUERY
  1348. OS_SYSTIME rP2pLinkQualityUpdateTime;
  1349. BOOLEAN fgIsP2pLinkQualityValid;
  1350. EVENT_LINK_QUALITY rP2pLinkQuality;
  1351. #endif
  1352. #endif
  1353. /* Online Scan Option */
  1354. BOOLEAN fgEnOnlineScan;
  1355. /* Online Scan Option */
  1356. BOOLEAN fgDisBcnLostDetection;
  1357. /* MAC address */
  1358. PARAM_MAC_ADDRESS rMyMacAddr;
  1359. /* Wake-up Event for WOL */
  1360. UINT_32 u4WakeupEventEnable;
  1361. /* Event Buffering */
  1362. EVENT_STATISTICS rStatStruct;
  1363. OS_SYSTIME rStatUpdateTime;
  1364. BOOLEAN fgIsStatValid;
  1365. EVENT_LINK_QUALITY rLinkQuality;
  1366. OS_SYSTIME rLinkQualityUpdateTime;
  1367. BOOLEAN fgIsLinkQualityValid;
  1368. OS_SYSTIME rLinkRateUpdateTime;
  1369. BOOLEAN fgIsLinkRateValid;
  1370. /* WIFI_VAR_T */
  1371. WIFI_VAR_T rWifiVar;
  1372. /* MTK WLAN NIC driver IEEE 802.11 MIB */
  1373. IEEE_802_11_MIB_T rMib;
  1374. /* Mailboxs for inter-module communication */
  1375. MBOX_T arMbox[MBOX_ID_TOTAL_NUM];
  1376. /* Timers for OID Pending Handling */
  1377. TIMER_T rOidTimeoutTimer;
  1378. UINT_8 ucOidTimeoutCount;
  1379. /* Root Timer for cnm_timer module */
  1380. ROOT_TIMER rRootTimer;
  1381. BOOLEAN fgIsChipNoAck;
  1382. /* RLM maintenance */
  1383. ENUM_CHNL_EXT_T eRfSco;
  1384. ENUM_SYS_PROTECT_MODE_T eSysProtectMode;
  1385. ENUM_GF_MODE_T eSysHtGfMode;
  1386. ENUM_RIFS_MODE_T eSysTxRifsMode;
  1387. ENUM_SYS_PCO_PHASE_T eSysPcoPhase;
  1388. P_DOMAIN_INFO_ENTRY prDomainInfo;
  1389. /* QM */
  1390. QUE_MGT_T rQM;
  1391. CNM_INFO_T rCnmInfo;
  1392. UINT_32 u4PowerMode;
  1393. UINT_32 u4CtiaPowerMode;
  1394. BOOLEAN fgEnCtiaPowerMode;
  1395. UINT_32 fgEnArpFilter;
  1396. UINT_32 u4UapsdAcBmp;
  1397. UINT_32 u4MaxSpLen;
  1398. UINT_32 u4PsCurrentMeasureEn;
  1399. /* Version Information */
  1400. WIFI_VER_INFO_T rVerInfo;
  1401. /* 5GHz support (from F/W) */
  1402. BOOLEAN fgIsHw5GBandDisabled;
  1403. BOOLEAN fgEnable5GBand;
  1404. BOOLEAN fgIsEepromUsed;
  1405. BOOLEAN fgIsEfuseValid;
  1406. BOOLEAN fgIsEmbbededMacAddrValid;
  1407. #if CFG_SUPPORT_PWR_LIMIT_COUNTRY
  1408. BOOLEAN fgIsPowerLimitTableValid;
  1409. #endif
  1410. /* Packet Forwarding Tracking */
  1411. INT_32 i4PendingFwdFrameCount;
  1412. #if CFG_SUPPORT_RDD_TEST_MODE
  1413. UINT_8 ucRddStatus;
  1414. #endif
  1415. BOOL fgDisStaAgingTimeoutDetection;
  1416. UINT_32 u4FwCompileFlag0;
  1417. UINT_32 u4FwCompileFlag1;
  1418. UINT_32 u4FwFeatureFlag0;
  1419. UINT_32 u4FwFeatureFlag1;
  1420. #if CFG_SUPPORT_CFG_FILE
  1421. P_WLAN_CFG_T prWlanCfg;
  1422. WLAN_CFG_T rWlanCfg;
  1423. #endif
  1424. #if CFG_M0VE_BA_TO_DRIVER
  1425. TIMER_T rMqmIdleRxBaDetectionTimer;
  1426. UINT_32 u4FlagBitmap;
  1427. #endif
  1428. }; /* end of _ADAPTER_T */
  1429. /*******************************************************************************
  1430. * P U B L I C D A T A
  1431. ********************************************************************************
  1432. */
  1433. /*******************************************************************************
  1434. * P R I V A T E D A T A
  1435. ********************************************************************************
  1436. */
  1437. /*******************************************************************************
  1438. * M A C R O S
  1439. ********************************************************************************
  1440. */
  1441. /* Macros for argument _BssIndex */
  1442. #define IS_NET_ACTIVE(_prAdapter, _BssIndex) \
  1443. ((_prAdapter)->aprBssInfo[(_BssIndex)]->fgIsNetActive)
  1444. /* Macros for argument _prBssInfo */
  1445. #define IS_BSS_ACTIVE(_prBssInfo) ((_prBssInfo)->fgIsNetActive)
  1446. #define IS_BSS_AIS(_prBssInfo) \
  1447. ((_prBssInfo)->eNetworkType == NETWORK_TYPE_AIS)
  1448. #define IS_BSS_P2P(_prBssInfo) \
  1449. ((_prBssInfo)->eNetworkType == NETWORK_TYPE_P2P)
  1450. #define IS_BSS_BOW(_prBssInfo) \
  1451. ((_prBssInfo)->eNetworkType == NETWORK_TYPE_BOW)
  1452. #define SET_NET_ACTIVE(_prAdapter, _BssIndex) \
  1453. {(_prAdapter)->aprBssInfo[(_BssIndex)]->fgIsNetActive = TRUE; }
  1454. #define UNSET_NET_ACTIVE(_prAdapter, _BssIndex) \
  1455. {(_prAdapter)->aprBssInfo[(_BssIndex)]->fgIsNetActive = FALSE; }
  1456. #define BSS_INFO_INIT(_prAdapter, _prBssInfo) \
  1457. { UINT_8 _aucZeroMacAddr[] = NULL_MAC_ADDR; \
  1458. \
  1459. (_prBssInfo)->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; \
  1460. (_prBssInfo)->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; \
  1461. (_prBssInfo)->eCurrentOPMode = OP_MODE_INFRASTRUCTURE; \
  1462. (_prBssInfo)->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; \
  1463. COPY_MAC_ADDR((_prBssInfo)->aucBSSID, _aucZeroMacAddr); \
  1464. LINK_INITIALIZE(&((_prBssInfo)->rStaRecOfClientList)); \
  1465. (_prBssInfo)->fgIsBeaconActivated = FALSE; \
  1466. (_prBssInfo)->u2HwDefaultFixedRateCode = RATE_CCK_1M_LONG; \
  1467. }
  1468. /*----------------------------------------------------------------------------*/
  1469. /* Macros for Power State */
  1470. /*----------------------------------------------------------------------------*/
  1471. #define SET_NET_PWR_STATE_IDLE(_prAdapter, _BssIndex) \
  1472. {_prAdapter->rWifiVar.aePwrState[(_BssIndex)] = PWR_STATE_IDLE; }
  1473. #define SET_NET_PWR_STATE_ACTIVE(_prAdapter, _BssIndex) \
  1474. {_prAdapter->rWifiVar.aePwrState[(_BssIndex)] = PWR_STATE_ACTIVE; }
  1475. #define SET_NET_PWR_STATE_PS(_prAdapter, _BssIndex) \
  1476. {_prAdapter->rWifiVar.aePwrState[(_BssIndex)] = PWR_STATE_PS; }
  1477. #define IS_NET_PWR_STATE_ACTIVE(_prAdapter, _BssIndex) \
  1478. (_prAdapter->rWifiVar.aePwrState[(_BssIndex)] == PWR_STATE_ACTIVE)
  1479. #define IS_NET_PWR_STATE_IDLE(_prAdapter, _BssIndex) \
  1480. (_prAdapter->rWifiVar.aePwrState[(_BssIndex)] == PWR_STATE_IDLE)
  1481. #define IS_SCN_PWR_STATE_ACTIVE(_prAdapter) \
  1482. (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_ACTIVE)
  1483. #define IS_SCN_PWR_STATE_IDLE(_prAdapter) \
  1484. (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_IDLE)
  1485. /*******************************************************************************
  1486. * F U N C T I O N D E C L A R A T I O N S
  1487. ********************************************************************************
  1488. */
  1489. /*******************************************************************************
  1490. * F U N C T I O N S
  1491. ********************************************************************************
  1492. */
  1493. #endif /* _ADAPTER_H */