adapter.h 48 KB

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