wlan_lib.h 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/wlan_lib.h#3
  3. */
  4. /*! \file "wlan_lib.h"
  5. \brief The declaration of the functions of the wlanAdpater objects
  6. Detail description.
  7. */
  8. /*
  9. ** Log: wlan_lib.h
  10. **
  11. ** 01 15 2014 eason.tsai
  12. ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
  13. ** Merging
  14. **
  15. ** //ALPS_SW/DEV/ALPS.JB2.MT6630.DEV/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...
  16. **
  17. ** to //ALPS_SW/TRUNK/KK/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...
  18. **
  19. ** 12 27 2013 eason.tsai
  20. ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
  21. ** update code for ICAP & nvram
  22. **
  23. ** 08 09 2013 cp.wu
  24. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  25. ** 1. integrate scheduled scan functionality
  26. ** 2. condition compilation for linux-3.4 & linux-3.8 compatibility
  27. ** 3. correct CMD queue access to reduce lock scope
  28. **
  29. ** 08 09 2013 terry.wu
  30. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  31. ** 1. Add new input parameter, Tx done status, for wlanReleaseCommand()
  32. **
  33. ** 08 05 2013 cp.wu
  34. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  35. ** for windows build success
  36. **
  37. ** 07 31 2013 terry.wu
  38. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  39. ** 1. Fix NetDev binding issue
  40. **
  41. ** 07 30 2013 yuche.tsai
  42. ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
  43. ** Temp fix Hot-spot data path issue.
  44. **
  45. ** 07 26 2013 terry.wu
  46. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  47. ** 1. Reduce extra Tx frame header parsing
  48. ** 2. Add TX port control
  49. ** 3. Add net interface to BSS binding
  50. **
  51. ** 06 19 2013 cp.wu
  52. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  53. ** update MAC address handling logic
  54. **
  55. ** 02 06 2013 cp.wu
  56. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  57. ** add reset option for firmware download configuration
  58. **
  59. ** 02 01 2013 cp.wu
  60. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  61. ** 1. eliminate MT5931/MT6620/MT6628 logic
  62. ** 2. add firmware download control sequence
  63. **
  64. ** 01 21 2013 terry.wu
  65. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  66. ** Update TX path based on new ucBssIndex modifications.
  67. **
  68. ** 01 17 2013 cm.chang
  69. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  70. ** Use ucBssIndex to replace eNetworkTypeIndex
  71. **
  72. ** 01 15 2013 terry.wu
  73. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  74. ** Update Tx done resource release mechanism.
  75. **
  76. ** 09 17 2012 cm.chang
  77. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  78. ** Duplicate source from MT6620 v2.3 driver branch
  79. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  80. **
  81. ** 09 04 2012 cp.wu
  82. ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
  83. ** sync for NVRAM warning scan result generation for CFG80211.
  84. **
  85. ** 08 24 2012 cp.wu
  86. ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
  87. ** .
  88. **
  89. ** 08 24 2012 cp.wu
  90. ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
  91. ** cfg80211 support merge back from ALPS.JB to DaVinci - MT6620 Driver v2.3 branch.
  92. *
  93. * 06 08 2012 eason.tsai
  94. * NULL
  95. * Nvram context covert from 6620 to 6628 for old 6620 meta tool
  96. *
  97. * 01 16 2012 cp.wu
  98. * [MT6620 Wi-Fi][Driver] API and behavior modification for
  99. * preferred band configuration with corresponding network configuration
  100. * add wlanSetPreferBandByNetwork() for glue layer to invoke for
  101. * setting preferred band configuration corresponding to network type.
  102. *
  103. * 01 05 2012 wh.su
  104. * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function
  105. * Adding the related ioctl / wlan oid function to set the Tx power cfg.
  106. *
  107. * 10 03 2011 cp.wu
  108. * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality
  109. * eliminate win32 native data types.
  110. *
  111. * 10 03 2011 cp.wu
  112. * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality
  113. * add firmware download path in divided scatters.
  114. *
  115. * 10 03 2011 cp.wu
  116. * [MT6628 Driver][Firmware Download] Add multi section independent download functionality
  117. * add firmware downloading aggregated path.
  118. *
  119. * 09 20 2011 tsaiyuan.hsu
  120. * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver
  121. * change window registry of driver for roaming.
  122. *
  123. * 09 08 2011 cm.chang
  124. * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
  125. * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM
  126. *
  127. * 08 31 2011 cm.chang
  128. * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
  129. * .
  130. *
  131. * 08 25 2011 chinghwa.yu
  132. * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
  133. * Add DFS switch.
  134. *
  135. * 08 24 2011 chinghwa.yu
  136. * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
  137. * Update RDD test mode cases.
  138. *
  139. * 08 15 2011 cp.wu
  140. * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC
  141. * support to load different firmware image for E3/E4/E5 and E6 ASIC on win32 platforms.
  142. *
  143. * 08 02 2011 yuche.tsai
  144. * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client,
  145. * TX deauth to a disconnecting device issue.
  146. * Fix GO send deauth frame issue.
  147. *
  148. * 07 22 2011 jeffrey.chang
  149. * [WCXRP00000864] [MT5931] Add command to adjust OSC stable time
  150. * modify driver to set OSC stable time after f/w download
  151. *
  152. * 07 18 2011 chinghwa.yu
  153. * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
  154. * Add CMD/Event for RDD and BWCS.
  155. *
  156. * 05 27 2011 cp.wu
  157. * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM
  158. * invoke CMD_ID_SET_EDGE_TXPWR_LIMIT when there is valid data exist in NVRAM content.
  159. *
  160. * 05 11 2011 cp.wu
  161. * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power
  162. * ACPI APIs migrate to wlan_lib.c for glue layer to invoke.
  163. *
  164. * 04 18 2011 cp.wu
  165. * [WCXRP00000636] [WHQL][MT5931 Driver] 2c_PMHibernate (hang on 2h)
  166. * 1) add API for glue layer to query ACPI state
  167. * 2) Windows glue should not access to hardware after switched into D3 state
  168. *
  169. * 03 10 2011 cp.wu
  170. * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3
  171. * deprecate configuration used by MT6620 E2
  172. *
  173. * 01 27 2011 tsaiyuan.hsu
  174. * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
  175. * add roaming fsm
  176. * 1. not support 11r, only use strength of signal to determine roaming.
  177. * 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
  178. * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
  179. * 4. assume that change of link quality in smooth way.
  180. *
  181. * 01 27 2011 george.huang
  182. * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability
  183. * Support current measure mode, assigned by registry (XP only).
  184. *
  185. * 01 24 2011 cp.wu
  186. * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
  187. * 1. add an extra counter for tracking pending forward frames.
  188. * 2. notify TX service thread as well when there is pending forward frame
  189. * 3. correct build errors leaded by introduction of Wi-Fi direct separation module
  190. *
  191. * 01 10 2011 cp.wu
  192. * [WCXRP00000351] [MT6620 Wi-Fi][Driver] remove from scanning result
  193. * in OID handling layer when the corresponding BSS is disconnected due to beacon timeout
  194. * remove from scanning result when the BSS is disconnected due to beacon timeout.
  195. *
  196. * 10 27 2010 george.huang
  197. * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to
  198. * disable Beacon Timeout function for SQA test by using E1 EVB
  199. * Support registry option for disable beacon lost detection.
  200. *
  201. * 10 26 2010 cp.wu
  202. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
  203. * [WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command
  204. * 1) update NVRAM content template to ver 1.02
  205. * 2) add compile option for querying NIC capability (default: off)
  206. * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
  207. * 4) correct auto-rate compiler error under linux (treat warning as error)
  208. * 5) simplify usage of NVRAM and REG_INFO_T
  209. * 6) add version checking between driver and firmware
  210. *
  211. * 10 26 2010 eddie.chen
  212. * [WCXRP00000134] [MT6620 Wi-Fi][Driver] Add a registry to enable auto rate for SQA test by using E1 EVB
  213. * Add auto rate parameter in registry.
  214. *
  215. * 10 18 2010 cp.wu
  216. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
  217. * [WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android
  218. * complete implementation of Android NVRAM access
  219. *
  220. * 10 08 2010 cp.wu
  221. * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test
  222. * adding fixed rate support for distance test. (from registry setting)
  223. *
  224. * 10 06 2010 cp.wu
  225. * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
  226. * divide a single function into 2 part to surpress a weird compiler warning from gcc-4.4.0
  227. *
  228. * 10 06 2010 cp.wu
  229. * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
  230. * code reorganization to improve isolation between GLUE and CORE layers.
  231. *
  232. * 10 05 2010 cp.wu
  233. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
  234. * load manufacture data when CFG_SUPPORT_NVRAM is set to 1
  235. *
  236. * 09 24 2010 cp.wu
  237. * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature
  238. * Modify online scan as a run-time adjustable option (for Windows, in registry)
  239. *
  240. * 09 23 2010 cp.wu
  241. * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item
  242. * use firmware reported mac address right after wlanAdapterStart() as permanent address
  243. *
  244. * 09 23 2010 cp.wu
  245. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
  246. * add skeleton for NVRAM integration
  247. *
  248. * 08 26 2010 yuche.tsai
  249. * NULL
  250. * Add AT GO test configure mode under WinXP.
  251. * Please enable 1. CFG_ENABLE_WIFI_DIRECT, 2. CFG_TEST_WIFI_DIRECT_GO, 3. CFG_SUPPORT_AAA
  252. *
  253. * 08 25 2010 george.huang
  254. * NULL
  255. * .
  256. *
  257. * 07 21 2010 cp.wu
  258. *
  259. * 1) change BG_SCAN to ONLINE_SCAN for consistent term
  260. * 2) only clear scanning result when scan is permitted to do
  261. *
  262. * 07 13 2010 cp.wu
  263. *
  264. * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets
  265. * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending
  266. * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid
  267. * descriptor underflow under concurrent network operation
  268. *
  269. * 07 08 2010 cp.wu
  270. *
  271. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  272. *
  273. * 06 24 2010 cp.wu
  274. * [WPD00003833][MT6620 and MT5931] Driver migration
  275. * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path.
  276. *
  277. * 06 21 2010 cp.wu
  278. * [WPD00003833][MT6620 and MT5931] Driver migration
  279. * change MAC address updating logic.
  280. *
  281. * 06 21 2010 cp.wu
  282. * [WPD00003833][MT6620 and MT5931] Driver migration
  283. * simplify timer usage.
  284. *
  285. * 06 11 2010 cp.wu
  286. * [WPD00003833][MT6620 and MT5931] Driver migration
  287. * 1) migrate assoc.c.
  288. * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
  289. * 3) add configuration options for CNM_MEM and RSN modules
  290. * 4) add data path for management frames
  291. * 5) eliminate rPacketInfo of MSDU_INFO_T
  292. *
  293. * 06 08 2010 cp.wu
  294. * [WPD00003833][MT6620 and MT5931] Driver migration
  295. * cnm_timer has been migrated.
  296. *
  297. * 06 06 2010 kevin.huang
  298. * [WPD00003832][MT6620 5931] Create driver base
  299. * [MT6620 5931] Create driver base
  300. *
  301. * 05 20 2010 cp.wu
  302. * [WPD00001943]Create WiFi test driver framework on WinXP
  303. * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS
  304. * 2) buffer statistics data for 2 seconds
  305. * 3) use default value for adhoc parameters instead of 0
  306. *
  307. * 05 12 2010 cp.wu
  308. * [WPD00001943]Create WiFi test driver framework on WinXP
  309. * add extra 64 adjustable parameters for CoEX scenario.
  310. *
  311. * 04 06 2010 cp.wu
  312. * [WPD00001943]Create WiFi test driver framework on WinXP
  313. * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved
  314. *
  315. * 04 06 2010 cp.wu
  316. * [WPD00001943]Create WiFi test driver framework on WinXP
  317. * 1) for some OID, never do timeout expiration
  318. * * 2) add 2 kal API for later integration
  319. *
  320. * 04 01 2010 cp.wu
  321. * [WPD00001943]Create WiFi test driver framework on WinXP
  322. * change to use WIFI_TCM_ALWAYS_ON as firmware image
  323. *
  324. * 03 31 2010 wh.su
  325. * [WPD00003816][MT6620 Wi-Fi] Adding the security support
  326. * modify the wapi related code for new driver's design.
  327. *
  328. * 03 22 2010 cp.wu
  329. * [WPD00001943]Create WiFi test driver framework on WinXP
  330. * always send CMD_NIC_POWER_CTRL packet when nic is being halted
  331. *
  332. * 03 12 2010 cp.wu
  333. * [WPD00001943]Create WiFi test driver framework on WinXP
  334. * add two option for ACK and ENCRYPTION for firmware download
  335. *
  336. * 02 24 2010 cp.wu
  337. * [WPD00001943]Create WiFi test driver framework on WinXP
  338. * separate wlanProcesQueuePacket() into 2 APIs upon request
  339. *
  340. * 02 23 2010 cp.wu
  341. * [WPD00001943]Create WiFi test driver framework on WinXP
  342. * add new API: wlanProcessQueuedPackets()
  343. *
  344. * 02 11 2010 cp.wu
  345. * [WPD00001943]Create WiFi test driver framework on WinXP
  346. * 1. add logic for firmware download
  347. * * * 2. firmware image filename and start/load address are now retrieved from registry
  348. *
  349. * 02 10 2010 cp.wu
  350. * [WPD00001943]Create WiFi test driver framework on WinXP
  351. * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c]
  352. * * * * 2) firmware image length is now retrieved via NdisFileOpen
  353. * * * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore
  354. * * * * 4) nicRxWaitResponse() revised
  355. * * * * 5) another set of TQ counter default value is added for fw-download state
  356. * * * * 6) Wi-Fi load address is now retrieved from registry too
  357. *
  358. * 02 08 2010 cp.wu
  359. * [WPD00001943]Create WiFi test driver framework on WinXP
  360. * prepare for implementing fw download logic
  361. *
  362. * 01 27 2010 cp.wu
  363. * [WPD00001943]Create WiFi test driver framework on WinXP
  364. * 1. eliminate improper variable in rHifInfo
  365. * * * * * * * 2. block TX/ordinary OID when RF test mode is engaged
  366. * * * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode
  367. * * * * * * * 4. correct some HAL implementation
  368. ** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-12-10 16:39:55 GMT mtk02752
  369. ** eliminate unused API
  370. ** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:58:41 GMT mtk01084
  371. ** update for new macro define
  372. ** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-19 10:43:06 GMT mtk01461
  373. ** Add wlanReleasePendingOid()
  374. ** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-13 16:38:44 GMT mtk01084
  375. ** add WIFI start function
  376. ** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-08 16:51:14 GMT mtk01084
  377. ** Update for the image download part
  378. ** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:57:38 GMT mtk01461
  379. ** Add wlanSendLeftClusteredFrames() for SDIO_TX_ENHANCE
  380. ** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:31:02 GMT mtk01461
  381. ** Add declaration of FW Image download reference code
  382. ** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:31 GMT mtk01461
  383. ** Update TX PATH API
  384. ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:12:04 GMT mtk01426
  385. ** Init for develop
  386. **
  387. */
  388. #ifndef _WLAN_LIB_H
  389. #define _WLAN_LIB_H
  390. /*******************************************************************************
  391. * C O M P I L E R F L A G S
  392. ********************************************************************************
  393. */
  394. /*******************************************************************************
  395. * E X T E R N A L R E F E R E N C E S
  396. ********************************************************************************
  397. */
  398. #include "CFG_Wifi_File.h"
  399. #include "rlm_domain.h"
  400. /*******************************************************************************
  401. * C O N S T A N T S
  402. ********************************************************************************
  403. */
  404. #define MAX_NUM_GROUP_ADDR 32 /* max number of group addresses */
  405. #define TX_CS_TCP_UDP_GEN BIT(1)
  406. #define TX_CS_IP_GEN BIT(0)
  407. #define CSUM_OFFLOAD_EN_TX_TCP BIT(0)
  408. #define CSUM_OFFLOAD_EN_TX_UDP BIT(1)
  409. #define CSUM_OFFLOAD_EN_TX_IP BIT(2)
  410. #define CSUM_OFFLOAD_EN_RX_TCP BIT(3)
  411. #define CSUM_OFFLOAD_EN_RX_UDP BIT(4)
  412. #define CSUM_OFFLOAD_EN_RX_IPv4 BIT(5)
  413. #define CSUM_OFFLOAD_EN_RX_IPv6 BIT(6)
  414. #define CSUM_OFFLOAD_EN_TX_MASK BITS(0, 2)
  415. #define CSUM_OFFLOAD_EN_ALL BITS(0, 6)
  416. /* TCP, UDP, IP Checksum */
  417. #define RX_CS_TYPE_UDP BIT(7)
  418. #define RX_CS_TYPE_TCP BIT(6)
  419. #define RX_CS_TYPE_IPv6 BIT(5)
  420. #define RX_CS_TYPE_IPv4 BIT(4)
  421. #define RX_CS_STATUS_UDP BIT(3)
  422. #define RX_CS_STATUS_TCP BIT(2)
  423. #define RX_CS_STATUS_IP BIT(0)
  424. #define CSUM_NOT_SUPPORTED 0x0
  425. #define TXPWR_USE_PDSLOPE 0
  426. /* NVRAM error code definitions */
  427. #define NVRAM_ERROR_VERSION_MISMATCH BIT(1)
  428. #define NVRAM_ERROR_INVALID_TXPWR BIT(2)
  429. #define NVRAM_ERROR_INVALID_DPD BIT(3)
  430. #define NVRAM_ERROR_INVALID_MAC_ADDR BIT(4)
  431. #if CFG_SUPPORT_PWR_LIMIT_COUNTRY
  432. #define NVRAM_POWER_LIMIT_TABLE_INVALID BIT(5)
  433. #endif
  434. #define NUM_TC_RESOURCE_TO_STATISTICS 4
  435. #define WLAN_CFG_ARGV_MAX 8
  436. #define WLAN_CFG_ENTRY_NUM_MAX 128
  437. #define WLAN_CFG_KEY_LEN_MAX 32 /* include \x00 EOL */
  438. #define WLAN_CFG_VALUE_LEN_MAX 32 /* include \x00 EOL */
  439. #define WLAN_CFG_FLAG_SKIP_CB BIT(0)
  440. #define WLAN_CFG_FILE_BUF_SIZE 2048
  441. #define WLAN_CFG_SET_CHIP_LEN_MAX 10
  442. #define WLAN_CFG_SET_DEBUG_LEVEL_LEN_MAX 10
  443. #define WLAN_CFG_SET_SW_CTRL_LEN_MAX 10
  444. #define WLAN_OID_TIMEOUT_THRESHOLD 2000 /* OID timeout (in ms) */
  445. #define WLAN_OID_TIMEOUT_THRESHOLD_IN_RESETTING 300 /* OID timeout during chip-resetting (in ms) */
  446. #define WLAN_OID_NO_ACK_THRESHOLD 3
  447. #define WLAN_TX_THREAD_TASK_PRIORITY 0 /* If not setting the priority, 0 is the default */
  448. #define WLAN_TX_THREAD_TASK_NICE (-10) /* If not setting the nice, -10 is the default */
  449. #define WLAN_TX_STATS_LOG_TIMEOUT 30000
  450. #define WLAN_TX_STATS_LOG_DURATION 1500
  451. /*******************************************************************************
  452. * D A T A T Y P E S
  453. ********************************************************************************
  454. */
  455. typedef WLAN_STATUS(*PFN_OID_HANDLER_FUNC) (IN P_ADAPTER_T prAdapter,
  456. IN PVOID pvBuf, IN UINT_32 u4BufLen, OUT PUINT_32 pu4OutInfoLen);
  457. typedef enum _ENUM_CSUM_TYPE_T {
  458. CSUM_TYPE_IPV4,
  459. CSUM_TYPE_IPV6,
  460. CSUM_TYPE_TCP,
  461. CSUM_TYPE_UDP,
  462. CSUM_TYPE_NUM
  463. } ENUM_CSUM_TYPE_T, *P_ENUM_CSUM_TYPE_T;
  464. typedef enum _ENUM_CSUM_RESULT_T {
  465. CSUM_RES_NONE,
  466. CSUM_RES_SUCCESS,
  467. CSUM_RES_FAILED,
  468. CSUM_RES_NUM
  469. } ENUM_CSUM_RESULT_T, *P_ENUM_CSUM_RESULT_T;
  470. typedef enum _ENUM_PHY_MODE_T {
  471. ENUM_PHY_2G4_CCK,
  472. ENUM_PHY_2G4_OFDM_BPSK,
  473. ENUM_PHY_2G4_OFDM_QPSK,
  474. ENUM_PHY_2G4_OFDM_16QAM,
  475. ENUM_PHY_2G4_OFDM_48M,
  476. ENUM_PHY_2G4_OFDM_54M,
  477. ENUM_PHY_2G4_HT20_BPSK,
  478. ENUM_PHY_2G4_HT20_QPSK,
  479. ENUM_PHY_2G4_HT20_16QAM,
  480. ENUM_PHY_2G4_HT20_MCS5,
  481. ENUM_PHY_2G4_HT20_MCS6,
  482. ENUM_PHY_2G4_HT20_MCS7,
  483. ENUM_PHY_2G4_HT40_BPSK,
  484. ENUM_PHY_2G4_HT40_QPSK,
  485. ENUM_PHY_2G4_HT40_16QAM,
  486. ENUM_PHY_2G4_HT40_MCS5,
  487. ENUM_PHY_2G4_HT40_MCS6,
  488. ENUM_PHY_2G4_HT40_MCS7,
  489. ENUM_PHY_5G_OFDM_BPSK,
  490. ENUM_PHY_5G_OFDM_QPSK,
  491. ENUM_PHY_5G_OFDM_16QAM,
  492. ENUM_PHY_5G_OFDM_48M,
  493. ENUM_PHY_5G_OFDM_54M,
  494. ENUM_PHY_5G_HT20_BPSK,
  495. ENUM_PHY_5G_HT20_QPSK,
  496. ENUM_PHY_5G_HT20_16QAM,
  497. ENUM_PHY_5G_HT20_MCS5,
  498. ENUM_PHY_5G_HT20_MCS6,
  499. ENUM_PHY_5G_HT20_MCS7,
  500. ENUM_PHY_5G_HT40_BPSK,
  501. ENUM_PHY_5G_HT40_QPSK,
  502. ENUM_PHY_5G_HT40_16QAM,
  503. ENUM_PHY_5G_HT40_MCS5,
  504. ENUM_PHY_5G_HT40_MCS6,
  505. ENUM_PHY_5G_HT40_MCS7,
  506. ENUM_PHY_MODE_NUM
  507. } ENUM_PHY_MODE_T, *P_ENUM_PHY_MODE_T;
  508. typedef enum _ENUM_POWER_SAVE_POLL_MODE_T {
  509. ENUM_POWER_SAVE_POLL_DISABLE,
  510. ENUM_POWER_SAVE_POLL_LEGACY_NULL,
  511. ENUM_POWER_SAVE_POLL_QOS_NULL,
  512. ENUM_POWER_SAVE_POLL_NUM
  513. } ENUM_POWER_SAVE_POLL_MODE_T, *P_ENUM_POWER_SAVE_POLL_MODE_T;
  514. typedef enum _ENUM_AC_TYPE_T {
  515. ENUM_AC_TYPE_AC0,
  516. ENUM_AC_TYPE_AC1,
  517. ENUM_AC_TYPE_AC2,
  518. ENUM_AC_TYPE_AC3,
  519. ENUM_AC_TYPE_AC4,
  520. ENUM_AC_TYPE_AC5,
  521. ENUM_AC_TYPE_AC6,
  522. ENUM_AC_TYPE_BMC,
  523. ENUM_AC_TYPE_NUM
  524. } ENUM_AC_TYPE_T, *P_ENUM_AC_TYPE_T;
  525. typedef enum _ENUM_ADV_AC_TYPE_T {
  526. ENUM_ADV_AC_TYPE_RX_NSW,
  527. ENUM_ADV_AC_TYPE_RX_PTA,
  528. ENUM_ADV_AC_TYPE_RX_SP,
  529. ENUM_ADV_AC_TYPE_TX_PTA,
  530. ENUM_ADV_AC_TYPE_TX_RSP,
  531. ENUM_ADV_AC_TYPE_NUM
  532. } ENUM_ADV_AC_TYPE_T, *P_ENUM_ADV_AC_TYPE_T;
  533. typedef enum _ENUM_REG_CH_MAP_T {
  534. REG_CH_MAP_COUNTRY_CODE,
  535. REG_CH_MAP_TBL_IDX,
  536. REG_CH_MAP_CUSTOMIZED,
  537. REG_CH_MAP_NUM
  538. } ENUM_REG_CH_MAP_T, *P_ENUM_REG_CH_MAP_T;
  539. typedef enum _ENUM_FEATURE_OPTION_T {
  540. FEATURE_DISABLED,
  541. FEATURE_ENABLED,
  542. FEATURE_FORCE_ENABLED
  543. } ENUM_FEATURE_OPTION_T, *P_ENUM_FEATURE_OPTION_T;
  544. /* This enum is for later added feature options which use command reserved field as option switch */
  545. typedef enum _ENUM_FEATURE_OPTION_IN_CMD_T {
  546. FEATURE_OPT_CMD_AUTO,
  547. FEATURE_OPT_CMD_DISABLED,
  548. FEATURE_OPT_CMD_ENABLED,
  549. FEATURE_OPT_CMD_FORCE_ENABLED
  550. } ENUM_FEATURE_OPTION_IN_CMD_T, *P_ENUM_FEATURE_OPTION_IN_CMD_T;
  551. #define DEBUG_MSG_SIZE_MAX 1200
  552. enum {
  553. DEBUG_MSG_ID_UNKNOWN = 0x00,
  554. DEBUG_MSG_ID_PRINT = 0x01,
  555. DEBUG_MSG_ID_FWLOG = 0x02,
  556. DEBUG_MSG_ID_END
  557. };
  558. enum {
  559. DEBUG_MSG_TYPE_UNKNOWN = 0x00,
  560. DEBUG_MSG_TYPE_MEM8 = 0x01,
  561. DEBUG_MSG_TYPE_MEM32 = 0x02,
  562. DEBUG_MSG_TYPE_ASCII = 0x03,
  563. DEBUG_MSG_TYPE_BINARY = 0x04,
  564. DEBUG_MSG_TYPE_END
  565. };
  566. #define CHIP_CONFIG_RESP_SIZE 320
  567. enum {
  568. CHIP_CONFIG_TYPE_WO_RESPONSE = 0x00,
  569. CHIP_CONFIG_TYPE_MEM8 = 0x01,
  570. CHIP_CONFIG_TYPE_MEM32 = 0x02,
  571. CHIP_CONFIG_TYPE_ASCII = 0x03,
  572. CHIP_CONFIG_TYPE_BINARY = 0x04,
  573. CHIP_CONFIG_TYPE_DRV_PASSTHROUGH = 0x05,
  574. CHIP_CONFIG_TYPE_END
  575. };
  576. typedef struct _SET_TXPWR_CTRL_T {
  577. INT_8 c2GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0 */
  578. INT_8 c2GHotspotPwrOffset;
  579. INT_8 c2GP2pPwrOffset;
  580. INT_8 c2GBowPwrOffset;
  581. INT_8 c5GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0 */
  582. INT_8 c5GHotspotPwrOffset;
  583. INT_8 c5GP2pPwrOffset;
  584. INT_8 c5GBowPwrOffset;
  585. UINT_8 ucConcurrencePolicy; /* TX power policy when concurrence
  586. in the same channel
  587. 0: Highest power has priority
  588. 1: Lowest power has priority */
  589. INT_8 acReserved1[3]; /* Must be zero */
  590. /* Power limit by channel for all data rates */
  591. INT_8 acTxPwrLimit2G[14]; /* Channel 1~14, Unit: 0.5dBm */
  592. INT_8 acTxPwrLimit5G[4]; /* UNII 1~4 */
  593. INT_8 acReserved2[2]; /* Must be zero */
  594. } SET_TXPWR_CTRL_T, *P_SET_TXPWR_CTRL_T;
  595. typedef enum _ENUM_NVRAM_MTK_FEATURE_T {
  596. MTK_FEATURE_2G_256QAM_DISABLED = 0,
  597. MTK_FEATURE_NUM
  598. } ENUM_NVRAM_MTK_FEATURES_T, *P_ENUM_NVRAM_MTK_FEATURES_T;
  599. /* For storing driver initialization value from glue layer */
  600. typedef struct _REG_INFO_T {
  601. UINT_32 u4SdBlockSize; /* SDIO block size */
  602. UINT_32 u4SdBusWidth; /* SDIO bus width. 1 or 4 */
  603. UINT_32 u4SdClockRate; /* SDIO clock rate. (in unit of HZ) */
  604. UINT_32 u4StartAddress; /* Starting address of Wi-Fi Firmware */
  605. UINT_32 u4LoadAddress; /* Load address of Wi-Fi Firmware */
  606. UINT_16 aucFwImgFilename[65]; /* Firmware filename */
  607. UINT_16 aucFwImgFilenameE6[65]; /* Firmware filename for E6 */
  608. UINT_32 u4StartFreq; /* Start Frequency for Ad-Hoc network : in unit of KHz */
  609. UINT_32 u4AdhocMode; /* Default mode for Ad-Hoc network : ENUM_PARAM_AD_HOC_MODE_T */
  610. UINT_32 u4RddStartFreq;
  611. UINT_32 u4RddStopFreq;
  612. UINT_32 u4RddTestMode;
  613. UINT_32 u4RddShutFreq;
  614. UINT_32 u4RddDfs;
  615. INT_32 i4HighRssiThreshold;
  616. INT_32 i4MediumRssiThreshold;
  617. INT_32 i4LowRssiThreshold;
  618. INT_32 au4TxPriorityTag[ENUM_AC_TYPE_NUM];
  619. INT_32 au4RxPriorityTag[ENUM_AC_TYPE_NUM];
  620. INT_32 au4AdvPriorityTag[ENUM_ADV_AC_TYPE_NUM];
  621. UINT_32 u4FastPSPoll;
  622. UINT_32 u4PTA; /* 0: disable, 1: enable */
  623. UINT_32 u4TXLimit; /* 0: disable, 1: enable */
  624. UINT_32 u4SilenceWindow; /* range: 100 - 625, unit: us */
  625. UINT_32 u4TXLimitThreshold; /* range: 250 - 1250, unit: us */
  626. UINT_32 u4PowerMode;
  627. UINT_32 fgEnArpFilter;
  628. UINT_32 u4PsCurrentMeasureEn;
  629. UINT_32 u4UapsdAcBmp;
  630. UINT_32 u4MaxSpLen;
  631. UINT_32 fgDisOnlineScan; /* 0: enable online scan, non-zero: disable online scan */
  632. UINT_32 fgDisBcnLostDetection; /* 0: enable online scan, non-zero: disable online scan */
  633. UINT_32 u4FixedRate; /* 0: automatic, non-zero: fixed rate */
  634. UINT_32 u4ArSysParam0;
  635. UINT_32 u4ArSysParam1;
  636. UINT_32 u4ArSysParam2;
  637. UINT_32 u4ArSysParam3;
  638. UINT_32 fgDisRoaming; /* 0:enable roaming 1:disable */
  639. /* NVRAM - MP Data -START- */
  640. #if 1
  641. UINT_16 u2Part1OwnVersion;
  642. UINT_16 u2Part1PeerVersion;
  643. #endif
  644. UINT_8 aucMacAddr[6];
  645. UINT_16 au2CountryCode[4]; /* Country code (in ISO 3166-1 expression, ex: "US", "TW") */
  646. TX_PWR_PARAM_T rTxPwr;
  647. UINT_8 aucEFUSE[144];
  648. UINT_8 ucTxPwrValid;
  649. UINT_8 ucSupport5GBand;
  650. UINT_8 fg2G4BandEdgePwrUsed;
  651. INT_8 cBandEdgeMaxPwrCCK;
  652. INT_8 cBandEdgeMaxPwrOFDM20;
  653. INT_8 cBandEdgeMaxPwrOFDM40;
  654. ENUM_REG_CH_MAP_T eRegChannelListMap;
  655. UINT_8 ucRegChannelListIndex;
  656. DOMAIN_INFO_ENTRY rDomainInfo;
  657. RSSI_PATH_COMPASATION_T rRssiPathCompasation;
  658. UINT_8 ucRssiPathCompasationUsed;
  659. /* NVRAM - MP Data -END- */
  660. /* NVRAM - Functional Data -START- */
  661. UINT_8 uc2G4BwFixed20M;
  662. UINT_8 uc5GBwFixed20M;
  663. UINT_8 ucEnable5GBand;
  664. UINT_8 ucGpsDesense;
  665. UINT_8 ucRxDiversity;
  666. /* NVRAM - Functional Data -END- */
  667. P_NEW_EFUSE_MAPPING2NVRAM_T prOldEfuseMapping;
  668. UINT_8 aucNvram[512];
  669. P_WIFI_CFG_PARAM_STRUCT prNvramSettings;
  670. } REG_INFO_T, *P_REG_INFO_T;
  671. /* for divided firmware loading */
  672. typedef struct _FWDL_SECTION_INFO_T {
  673. UINT_32 u4Offset;
  674. UINT_32 u4Reserved;
  675. UINT_32 u4Length;
  676. UINT_32 u4DestAddr;
  677. } FWDL_SECTION_INFO_T, *P_FWDL_SECTION_INFO_T;
  678. typedef struct _FIRMWARE_DIVIDED_DOWNLOAD_T {
  679. UINT_32 u4Signature;
  680. UINT_32 u4CRC; /* CRC calculated without first 8 bytes included */
  681. UINT_32 u4NumOfEntries;
  682. UINT_32 u4Reserved;
  683. FWDL_SECTION_INFO_T arSection[];
  684. } FIRMWARE_DIVIDED_DOWNLOAD_T, *P_FIRMWARE_DIVIDED_DOWNLOAD_T;
  685. typedef struct _PARAM_MCR_RW_STRUCT_T {
  686. UINT_32 u4McrOffset;
  687. UINT_32 u4McrData;
  688. } PARAM_MCR_RW_STRUCT_T, *P_PARAM_MCR_RW_STRUCT_T;
  689. /* per access category statistics */
  690. typedef struct _WIFI_WMM_AC_STAT_T {
  691. UINT_32 u4TxMsdu;
  692. UINT_32 u4RxMsdu;
  693. UINT_32 u4TxDropMsdu;
  694. UINT_32 u4TxFailMsdu;
  695. UINT_32 u4TxRetryMsdu;
  696. } WIFI_WMM_AC_STAT_T, *P_WIFI_WMM_AC_STAT_T;
  697. typedef struct _PARAM_GET_STA_STATISTICS {
  698. /* Per-STA statistic */
  699. UINT_8 aucMacAddr[MAC_ADDR_LEN];
  700. UINT_32 u4Flag;
  701. UINT_8 ucReadClear;
  702. UINT_8 ucLlsReadClear;
  703. /* From driver */
  704. UINT_32 u4TxTotalCount;
  705. UINT_32 u4TxExceedThresholdCount;
  706. UINT_32 u4TxMaxTime;
  707. UINT_32 u4TxAverageProcessTime;
  708. UINT_32 u4RxTotalCount;
  709. UINT_32 au4TcResourceEmptyCount[NUM_TC_RESOURCE_TO_STATISTICS];
  710. UINT_32 au4TcQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
  711. /* From FW */
  712. UINT_8 ucPer; /* base: 128 */
  713. UINT_8 ucRcpi;
  714. UINT_32 u4PhyMode;
  715. UINT_16 u2LinkSpeed; /* unit is 0.5 Mbits */
  716. UINT_32 u4TxFailCount;
  717. UINT_32 u4TxLifeTimeoutCount;
  718. UINT_32 u4TxAverageAirTime;
  719. UINT_32 u4TransmitCount; /* Transmit in the air (wtbl) */
  720. UINT_32 u4TransmitFailCount; /* Transmit without ack/ba in the air (wtbl) */
  721. WIFI_WMM_AC_STAT_T arLinkStatistics[AC_NUM]; /*link layer statistics */
  722. /* Global queue management statistic */
  723. UINT_32 au4TcAverageQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
  724. UINT_32 au4TcCurrentQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
  725. /* Reserved fields */
  726. UINT_8 au4Reserved[32];
  727. } PARAM_GET_STA_STA_STATISTICS, *P_PARAM_GET_STA_STATISTICS;
  728. typedef struct _PARAM_GET_BSS_STATISTICS {
  729. /* Per-STA statistic */
  730. UINT_8 aucMacAddr[MAC_ADDR_LEN];
  731. UINT_32 u4Flag;
  732. UINT_8 ucReadClear;
  733. UINT_8 ucLlsReadClear;
  734. UINT_8 ucBssIndex;
  735. /* From driver */
  736. UINT_32 u4TxTotalCount;
  737. UINT_32 u4TxExceedThresholdCount;
  738. UINT_32 u4TxMaxTime;
  739. UINT_32 u4TxAverageProcessTime;
  740. UINT_32 u4RxTotalCount;
  741. UINT_32 au4TcResourceEmptyCount[NUM_TC_RESOURCE_TO_STATISTICS];
  742. UINT_32 au4TcQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
  743. /* From FW */
  744. UINT_8 ucPer; /* base: 128 */
  745. UINT_8 ucRcpi;
  746. UINT_32 u4PhyMode;
  747. UINT_16 u2LinkSpeed; /* unit is 0.5 Mbits */
  748. UINT_32 u4TxFailCount;
  749. UINT_32 u4TxLifeTimeoutCount;
  750. UINT_32 u4TxAverageAirTime;
  751. UINT_32 u4TransmitCount; /* Transmit in the air (wtbl) */
  752. UINT_32 u4TransmitFailCount; /* Transmit without ack/ba in the air (wtbl) */
  753. WIFI_WMM_AC_STAT_T arLinkStatistics[AC_NUM]; /*link layer statistics */
  754. /* Global queue management statistic */
  755. UINT_32 au4TcAverageQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
  756. UINT_32 au4TcCurrentQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
  757. /* Reserved fields */
  758. UINT_8 au4Reserved[32]; /* insufficient for LLS?? */
  759. } PARAM_GET_BSS_STATISTICS, *P_PARAM_GET_BSS_STATISTICS;
  760. typedef struct _NET_INTERFACE_INFO_T {
  761. UINT_8 ucBssIndex;
  762. PVOID pvNetInterface;
  763. } NET_INTERFACE_INFO_T, *P_NET_INTERFACE_INFO_T;
  764. #if 0
  765. typedef struct _SEC_FRAME_INFO_T {
  766. BOOLEAN fgIsProtected;
  767. #if CFG_SUPPORT_MULTITHREAD
  768. /* Compose TxDesc in tx_thread and place here */
  769. UINT_8 ucTxDescBuffer[DWORD_TO_BYTE(7)];
  770. #endif
  771. } SEC_FRAME_INFO_T, *P_SEC_FRAME_INFO_T;
  772. #endif
  773. typedef enum _ENUM_TX_RESULT_CODE_T {
  774. TX_RESULT_SUCCESS = 0,
  775. TX_RESULT_LIFE_TIMEOUT,
  776. TX_RESULT_RTS_ERROR,
  777. TX_RESULT_MPDU_ERROR,
  778. TX_RESULT_AGING_TIMEOUT,
  779. TX_RESULT_FLUSHED,
  780. TX_RESULT_BIP_ERROR,
  781. TX_RESULT_UNSPECIFIED_ERROR,
  782. TX_RESULT_DROPPED_IN_DRIVER = 32,
  783. TX_RESULT_DROPPED_IN_FW,
  784. TX_RESULT_QUEUE_CLEARANCE,
  785. TX_RESULT_NUM
  786. } ENUM_TX_RESULT_CODE_T, *P_ENUM_TX_RESULT_CODE_T;
  787. struct _WLAN_CFG_ENTRY_T {
  788. UINT_8 aucKey[WLAN_CFG_KEY_LEN_MAX];
  789. UINT_8 aucValue[WLAN_CFG_VALUE_LEN_MAX];
  790. WLAN_CFG_SET_CB pfSetCb;
  791. PVOID pPrivate;
  792. UINT_32 u4Flags;
  793. };
  794. struct _WLAN_CFG_T {
  795. UINT_32 u4WlanCfgEntryNumMax;
  796. UINT_32 u4WlanCfgKeyLenMax;
  797. UINT_32 u4WlanCfgValueLenMax;
  798. WLAN_CFG_ENTRY_T arWlanCfgBuf[WLAN_CFG_ENTRY_NUM_MAX];
  799. };
  800. typedef enum _ENUM_MAX_BANDWIDTH_SETTING_T {
  801. MAX_BW_20MHZ = 0,
  802. MAX_BW_40MHZ,
  803. MAX_BW_80MHZ,
  804. MAX_BW_160MHZ,
  805. MAX_BW_80_80_MHZ
  806. } ENUM_MAX_BANDWIDTH_SETTING, *P_ENUM_MAX_BANDWIDTH_SETTING_T;
  807. #if CFG_AUTO_CHANNEL_SEL_SUPPORT
  808. typedef struct _LTE_SAFE_CH_INFO_T {
  809. UINT_32 u4SafeChannelBitmask[4];
  810. } LTE_SAFE_CH_INFO_T, *P_CMD_LTE_SAFE_CH_INFO_T;
  811. /* Record Each CH Load */
  812. typedef struct _PARAM_CHN_LOAD_INFO {
  813. /* Per-CHN Load */
  814. UINT_32 u4Flag;
  815. UINT_8 ucChannel;
  816. UINT_16 u2ChannelLoad;
  817. UINT_8 au4Reserved0[1];
  818. UINT_16 u2APNum;
  819. UINT_16 u2APNumTmpCountingBuf;
  820. /* Reserved fields */
  821. UINT_8 au4Reserved1[8];
  822. } PARAM_CHN_LOAD_INFO, *P_PARAM_CHN_LOAD_INFO;
  823. typedef struct _PARAM_GET_CHN_LOAD {
  824. LTE_SAFE_CH_INFO_T rLteSafeChnList;
  825. PARAM_CHN_LOAD_INFO rEachChnLoad[MAX_AUTO_CHAL_NUM];
  826. BOOLEAN fgDataReadyBit;
  827. UINT_8 au4Reserved[3];
  828. } PARAM_GET_CHN_LOAD, *P_PARAM_GET_CHN_LOAD;
  829. typedef struct _PARAM_PREFER_CHN_INFO {
  830. UINT_8 ucChannel;
  831. UINT_16 u2APNum;
  832. UINT_8 au4Reserved[1];
  833. } PARAM_PREFER_CHN_INFO, *P_PARAM_PREFER_CHN_INFO;
  834. typedef struct _PARAM_GET_LTE_MODE {
  835. /* Event Body */
  836. UINT_8 ucVersion;
  837. UINT_8 aucReserved0[3];
  838. UINT_32 u4Flags; /* Bit0: valid */
  839. LTE_SAFE_CH_INFO_T LTE_MODE;
  840. UINT_8 aucReserved1[4];
  841. UINT_8 aucReserved2[4];
  842. } PARAM_GET_LTE_MODE, *P_PARAM_GET_LTE_MODE;
  843. #endif
  844. typedef struct _TX_PACKET_INFO {
  845. UINT_8 ucPriorityParam;
  846. UINT_32 u4PacketLen;
  847. UINT_8 aucEthDestAddr[MAC_ADDR_LEN];
  848. UINT_16 u2Flag;
  849. #if 0
  850. BOOLEAN fgIs1X;
  851. BOOLEAN fgIsPAL;
  852. BOOLEAN fgIs802_3;
  853. BOOLEAN fgIsVlanExists;
  854. BOOLEAN fgIsDhcp;
  855. BOOLEAN fgIsArp;
  856. #endif
  857. } TX_PACKET_INFO, *P_TX_PACKET_INFO;
  858. typedef enum _ENUM_TX_PROFILING_TAG_T {
  859. TX_PROF_TAG_OS_TO_DRV = 0,
  860. TX_PROF_TAG_DRV_ENQUE,
  861. TX_PROF_TAG_DRV_DEQUE,
  862. TX_PROF_TAG_DRV_TX_DONE,
  863. TX_PROF_TAG_MAC_TX_DONE
  864. } ENUM_TX_PROFILING_TAG_T, *P_ENUM_TX_PROFILING_TAG_T;
  865. /*******************************************************************************
  866. * P U B L I C D A T A
  867. ********************************************************************************
  868. */
  869. /*******************************************************************************
  870. * P R I V A T E D A T A
  871. ********************************************************************************
  872. */
  873. /*******************************************************************************
  874. * M A C R O S
  875. ********************************************************************************
  876. */
  877. #define BUILD_SIGN(ch0, ch1, ch2, ch3) \
  878. ((UINT_32)(UINT_8)(ch0) | ((UINT_32)(UINT_8)(ch1) << 8) | \
  879. ((UINT_32)(UINT_8)(ch2) << 16) | ((UINT_32)(UINT_8)(ch3) << 24))
  880. #define MTK_WIFI_SIGNATURE BUILD_SIGN('M', 'T', 'K', 'W')
  881. #define IS_FEATURE_ENABLED(_ucFeature) \
  882. (((_ucFeature) == FEATURE_ENABLED) || ((_ucFeature) == FEATURE_FORCE_ENABLED))
  883. #define IS_FEATURE_FORCE_ENABLED(_ucFeature) ((_ucFeature) == FEATURE_FORCE_ENABLED)
  884. #define IS_FEATURE_DISABLED(_ucFeature) ((_ucFeature) == FEATURE_DISABLED)
  885. /* This macro is for later added feature options which use command reserved field as option switch */
  886. /* 0: AUTO
  887. * 1: Disabled
  888. * 2: Enabled
  889. * 3: Force disabled
  890. */
  891. #define FEATURE_OPT_IN_COMMAND(_ucFeature) ((_ucFeature) + 1)
  892. /*******************************************************************************
  893. * F U N C T I O N D E C L A R A T I O N S
  894. ********************************************************************************
  895. */
  896. P_ADAPTER_T wlanAdapterCreate(IN P_GLUE_INFO_T prGlueInfo);
  897. VOID wlanAdapterDestroy(IN P_ADAPTER_T prAdapter);
  898. VOID wlanCardEjected(IN P_ADAPTER_T prAdapter);
  899. VOID wlanIST(IN P_ADAPTER_T prAdapter);
  900. BOOL wlanISR(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgGlobalIntrCtrl);
  901. WLAN_STATUS wlanProcessCommandQueue(IN P_ADAPTER_T prAdapter, IN P_QUE_T prCmdQue);
  902. WLAN_STATUS wlanSendCommand(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
  903. #if CFG_SUPPORT_MULTITHREAD
  904. WLAN_STATUS wlanSendCommandMthread(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
  905. WLAN_STATUS wlanTxCmdMthread(IN P_ADAPTER_T prAdapter);
  906. WLAN_STATUS wlanTxCmdDoneMthread(IN P_ADAPTER_T prAdapter);
  907. VOID wlanClearTxCommandQueue(IN P_ADAPTER_T prAdapter);
  908. VOID wlanClearTxCommandDoneQueue(IN P_ADAPTER_T prAdapter);
  909. VOID wlanClearDataQueue(IN P_ADAPTER_T prAdapter);
  910. VOID wlanClearRxToOsQueue(IN P_ADAPTER_T prAdapter);
  911. #endif
  912. VOID wlanReleaseCommand(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
  913. VOID wlanReleasePendingOid(IN P_ADAPTER_T prAdapter, IN ULONG ulParamPtr);
  914. VOID wlanReleasePendingCMDbyBssIdx(IN P_ADAPTER_T prAdapter, IN UINT_8 ucBssIndex);
  915. VOID wlanReturnPacketDelaySetupTimeout(IN P_ADAPTER_T prAdapter, IN ULONG ulParamPtr);
  916. VOID wlanReturnPacket(IN P_ADAPTER_T prAdapter, IN PVOID pvPacket);
  917. WLAN_STATUS
  918. wlanQueryInformation(IN P_ADAPTER_T prAdapter,
  919. IN PFN_OID_HANDLER_FUNC pfOidQryHandler,
  920. IN PVOID pvInfoBuf, IN UINT_32 u4InfoBufLen, OUT PUINT_32 pu4QryInfoLen);
  921. WLAN_STATUS
  922. wlanSetInformation(IN P_ADAPTER_T prAdapter,
  923. IN PFN_OID_HANDLER_FUNC pfOidSetHandler,
  924. IN PVOID pvInfoBuf, IN UINT_32 u4InfoBufLen, OUT PUINT_32 pu4SetInfoLen);
  925. WLAN_STATUS
  926. wlanAdapterStart(IN P_ADAPTER_T prAdapter,
  927. IN P_REG_INFO_T prRegInfo, IN PVOID pvFwImageMapFile, IN UINT_32 u4FwImageFileLength);
  928. WLAN_STATUS wlanAdapterStop(IN P_ADAPTER_T prAdapter);
  929. #if CFG_SUPPORT_WAPI
  930. BOOLEAN wlanQueryWapiMode(IN P_ADAPTER_T prAdapter);
  931. #endif
  932. VOID wlanReturnRxPacket(IN PVOID pvAdapter, IN PVOID pvPacket);
  933. VOID wlanRxSetBroadcast(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgEnableBroadcast);
  934. BOOLEAN wlanIsHandlerNeedHwAccess(IN PFN_OID_HANDLER_FUNC pfnOidHandler, IN BOOLEAN fgSetInfo);
  935. VOID wlanSetPromiscuousMode(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgEnablePromiscuousMode);
  936. #if CFG_ENABLE_FW_DOWNLOAD
  937. WLAN_STATUS
  938. wlanImageSectionConfig(IN P_ADAPTER_T prAdapter, IN UINT_32 u4DestAddr, IN UINT_32 u4ImgSecSize, IN BOOLEAN fgReset);
  939. WLAN_STATUS wlanImageSectionDownload(IN P_ADAPTER_T prAdapter, IN UINT_32 u4ImgSecSize, IN PUINT_8 pucImgSecBuf);
  940. VOID
  941. wlanFwDvdDwnloadHandler(IN P_ADAPTER_T prAdapter,
  942. IN P_FIRMWARE_DIVIDED_DOWNLOAD_T prFwHead, IN PVOID pvFwImageMapFile,
  943. OUT WLAN_STATUS *u4Status);
  944. VOID
  945. wlanFwDwnloadHandler(IN P_ADAPTER_T prAdapter,
  946. IN UINT_32 u4FwImgLength, IN PVOID pvFwImageMapFile, OUT WLAN_STATUS *u4Status);
  947. #if !CFG_ENABLE_FW_DOWNLOAD_ACK
  948. WLAN_STATUS wlanImageQueryStatus(IN P_ADAPTER_T prAdapter);
  949. #else
  950. WLAN_STATUS wlanImageSectionDownloadStatus(IN P_ADAPTER_T prAdapter, IN UINT_8 ucCmdSeqNum);
  951. #endif
  952. WLAN_STATUS wlanConfigWifiFunc(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgEnable, IN UINT_32 u4StartAddress);
  953. UINT_32 wlanCRC32(PUINT_8 buf, UINT_32 len);
  954. #endif
  955. WLAN_STATUS wlanSendNicPowerCtrlCmd(IN P_ADAPTER_T prAdapter, IN UINT_8 ucPowerMode);
  956. BOOLEAN wlanIsHandlerAllowedInRFTest(IN PFN_OID_HANDLER_FUNC pfnOidHandler, IN BOOLEAN fgSetInfo);
  957. WLAN_STATUS wlanProcessQueuedSwRfb(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfbListHead);
  958. WLAN_STATUS wlanProcessQueuedMsduInfo(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
  959. BOOLEAN wlanoidTimeoutCheck(IN P_ADAPTER_T prAdapter, IN PFN_OID_HANDLER_FUNC pfnOidHandler);
  960. VOID wlanoidClearTimeoutCheck(IN P_ADAPTER_T prAdapter);
  961. WLAN_STATUS wlanUpdateNetworkAddress(IN P_ADAPTER_T prAdapter);
  962. WLAN_STATUS wlanUpdateBasicConfig(IN P_ADAPTER_T prAdapter);
  963. BOOLEAN wlanQueryTestMode(IN P_ADAPTER_T prAdapter);
  964. BOOLEAN wlanProcessTxFrame(IN P_ADAPTER_T prAdapter, IN P_NATIVE_PACKET prPacket);
  965. /* Security Frame Handling */
  966. BOOLEAN wlanProcessSecurityFrame(IN P_ADAPTER_T prAdapter, IN P_NATIVE_PACKET prPacket);
  967. VOID wlanSecurityFrameTxDone(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
  968. VOID wlanSecurityFrameTxTimeout(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
  969. /*----------------------------------------------------------------------------*/
  970. /* OID/IOCTL Handling */
  971. /*----------------------------------------------------------------------------*/
  972. VOID wlanClearScanningResult(IN P_ADAPTER_T prAdapter);
  973. VOID wlanClearBssInScanningResult(IN P_ADAPTER_T prAdapter, IN PUINT_8 arBSSID);
  974. #if CFG_TEST_WIFI_DIRECT_GO
  975. VOID wlanEnableP2pFunction(IN P_ADAPTER_T prAdapter);
  976. VOID wlanEnableATGO(IN P_ADAPTER_T prAdapter);
  977. #endif
  978. /*----------------------------------------------------------------------------*/
  979. /* NIC Capability Retrieve by Polling */
  980. /*----------------------------------------------------------------------------*/
  981. WLAN_STATUS wlanQueryNicCapability(IN P_ADAPTER_T prAdapter);
  982. /*----------------------------------------------------------------------------*/
  983. /* PD MCR Retrieve by Polling */
  984. /*----------------------------------------------------------------------------*/
  985. WLAN_STATUS wlanQueryPdMcr(IN P_ADAPTER_T prAdapter, IN P_PARAM_MCR_RW_STRUCT_T prMcrRdInfo);
  986. /*----------------------------------------------------------------------------*/
  987. /* Loading Manufacture Data */
  988. /*----------------------------------------------------------------------------*/
  989. WLAN_STATUS wlanLoadManufactureData(IN P_ADAPTER_T prAdapter, IN P_REG_INFO_T prRegInfo);
  990. /*----------------------------------------------------------------------------*/
  991. /* Media Stream Mode */
  992. /*----------------------------------------------------------------------------*/
  993. BOOLEAN wlanResetMediaStreamMode(IN P_ADAPTER_T prAdapter);
  994. /*----------------------------------------------------------------------------*/
  995. /* Timer Timeout Check (for Glue Layer) */
  996. /*----------------------------------------------------------------------------*/
  997. WLAN_STATUS wlanTimerTimeoutCheck(IN P_ADAPTER_T prAdapter);
  998. /*----------------------------------------------------------------------------*/
  999. /* Mailbox Message Check (for Glue Layer) */
  1000. /*----------------------------------------------------------------------------*/
  1001. WLAN_STATUS wlanProcessMboxMessage(IN P_ADAPTER_T prAdapter);
  1002. /*----------------------------------------------------------------------------*/
  1003. /* TX Pending Packets Handling (for Glue Layer) */
  1004. /*----------------------------------------------------------------------------*/
  1005. WLAN_STATUS wlanEnqueueTxPacket(IN P_ADAPTER_T prAdapter, IN P_NATIVE_PACKET prNativePacket);
  1006. WLAN_STATUS wlanFlushTxPendingPackets(IN P_ADAPTER_T prAdapter);
  1007. WLAN_STATUS wlanTxPendingPackets(IN P_ADAPTER_T prAdapter, IN OUT PBOOLEAN pfgHwAccess);
  1008. /*----------------------------------------------------------------------------*/
  1009. /* Low Power Acquire/Release (for Glue Layer) */
  1010. /*----------------------------------------------------------------------------*/
  1011. WLAN_STATUS wlanAcquirePowerControl(IN P_ADAPTER_T prAdapter);
  1012. WLAN_STATUS wlanReleasePowerControl(IN P_ADAPTER_T prAdapter);
  1013. /*----------------------------------------------------------------------------*/
  1014. /* Pending Packets Number Reporting (for Glue Layer) */
  1015. /*----------------------------------------------------------------------------*/
  1016. UINT_32 wlanGetTxPendingFrameCount(IN P_ADAPTER_T prAdapter);
  1017. /*----------------------------------------------------------------------------*/
  1018. /* ACPI state inquiry (for Glue Layer) */
  1019. /*----------------------------------------------------------------------------*/
  1020. ENUM_ACPI_STATE_T wlanGetAcpiState(IN P_ADAPTER_T prAdapter);
  1021. VOID wlanSetAcpiState(IN P_ADAPTER_T prAdapter, IN ENUM_ACPI_STATE_T ePowerState);
  1022. VOID wlanDefTxPowerCfg(IN P_ADAPTER_T prAdapter);
  1023. /*----------------------------------------------------------------------------*/
  1024. /* get ECO version from Revision ID register (for Win32) */
  1025. /*----------------------------------------------------------------------------*/
  1026. UINT_8 wlanGetEcoVersion(IN P_ADAPTER_T prAdapter);
  1027. /*----------------------------------------------------------------------------*/
  1028. /* set preferred band configuration corresponding to network type */
  1029. /*----------------------------------------------------------------------------*/
  1030. VOID wlanSetPreferBandByNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_BAND_T eBand, IN UINT_8 ucBssIndex);
  1031. /*----------------------------------------------------------------------------*/
  1032. /* get currently operating channel information */
  1033. /*----------------------------------------------------------------------------*/
  1034. UINT_8 wlanGetChannelNumberByNetwork(IN P_ADAPTER_T prAdapter, IN UINT_8 ucBssIndex);
  1035. /*----------------------------------------------------------------------------*/
  1036. /* check for system configuration to generate message on scan list */
  1037. /*----------------------------------------------------------------------------*/
  1038. WLAN_STATUS wlanCheckSystemConfiguration(IN P_ADAPTER_T prAdapter);
  1039. /*----------------------------------------------------------------------------*/
  1040. /* query bss statistics information from driver and firmware */
  1041. /*----------------------------------------------------------------------------*/
  1042. WLAN_STATUS
  1043. wlanoidQueryBssStatistics(IN P_ADAPTER_T prAdapter,
  1044. IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
  1045. /*----------------------------------------------------------------------------*/
  1046. /* dump per-BSS statistics */
  1047. /*----------------------------------------------------------------------------*/
  1048. VOID wlanDumpBssStatistics(IN P_ADAPTER_T prAdapter, UINT_8 ucBssIndex);
  1049. /*----------------------------------------------------------------------------*/
  1050. /* query sta statistics information from driver and firmware */
  1051. /*----------------------------------------------------------------------------*/
  1052. WLAN_STATUS
  1053. wlanoidQueryStaStatistics(IN P_ADAPTER_T prAdapter,
  1054. IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
  1055. /*----------------------------------------------------------------------------*/
  1056. /* query NIC resource information from chip and reset Tx resource for normal operation */
  1057. /*----------------------------------------------------------------------------*/
  1058. VOID wlanQueryNicResourceInformation(IN P_ADAPTER_T prAdapter);
  1059. /*----------------------------------------------------------------------------*/
  1060. /* GET/SET BSS index mapping for network interfaces */
  1061. /*----------------------------------------------------------------------------*/
  1062. VOID wlanBindNetInterface(IN P_GLUE_INFO_T prGlueInfo, IN UINT_8 ucNetInterfaceIndex, IN PVOID pvNetInterface);
  1063. VOID wlanBindBssIdxToNetInterface(IN P_GLUE_INFO_T prGlueInfo, IN UINT_8 ucBssIndex, IN PVOID pvNetInterface);
  1064. UINT_8 wlanGetBssIdxByNetInterface(IN P_GLUE_INFO_T prGlueInfo, IN PVOID pvNetInterface);
  1065. PVOID wlanGetNetInterfaceByBssIdx(IN P_GLUE_INFO_T prGlueInfo, IN UINT_8 ucBssIndex);
  1066. /* for windows as windows glue cannot see through P_ADAPTER_T */
  1067. UINT_8 wlanGetAisBssIndex(IN P_ADAPTER_T prAdapter);
  1068. VOID wlanInitFeatureOption(IN P_ADAPTER_T prAdapter);
  1069. VOID wlanCfgSetSwCtrl(IN P_ADAPTER_T prAdapter);
  1070. VOID wlanCfgSetChip(IN P_ADAPTER_T prAdapter);
  1071. VOID wlanCfgSetDebugLevel(IN P_ADAPTER_T prAdapter);
  1072. VOID wlanCfgSetCountryCode(IN P_ADAPTER_T prAdapter);
  1073. P_WLAN_CFG_ENTRY_T wlanCfgGetEntry(IN P_ADAPTER_T prAdapter, const PCHAR pucKey);
  1074. WLAN_STATUS
  1075. wlanCfgGet(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, PCHAR pucValue, PCHAR pucValueDef, UINT_32 u4Flags);
  1076. UINT_32 wlanCfgGetUint32(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, UINT_32 u4ValueDef);
  1077. INT_32 wlanCfgGetInt32(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, INT_32 i4ValueDef);
  1078. WLAN_STATUS wlanCfgSetUint32(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, UINT_32 u4Value);
  1079. WLAN_STATUS wlanCfgSet(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, PCHAR pucValue, UINT_32 u4Flags);
  1080. WLAN_STATUS
  1081. wlanCfgSetCb(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, WLAN_CFG_SET_CB pfSetCb, void *pPrivate, UINT_32 u4Flags);
  1082. WLAN_STATUS wlanCfgInit(IN P_ADAPTER_T prAdapter, PUINT_8 pucConfigBuf, UINT_32 u4ConfigBufLen, UINT_32 u4Flags);
  1083. WLAN_STATUS wlanCfgParseArgument(CHAR *cmdLine, INT_32 *argc, CHAR *argv[]);
  1084. INT_32 wlanHexToNum(CHAR c);
  1085. INT_32 wlanHexToByte(PCHAR hex);
  1086. INT_32 wlanHwAddrToBin(PCHAR txt, UINT_8 *addr);
  1087. BOOLEAN wlanIsChipNoAck(IN P_ADAPTER_T prAdapter);
  1088. VOID wlanTxProfilingTagPacket(IN P_ADAPTER_T prAdapter, IN P_NATIVE_PACKET prPacket, IN ENUM_TX_PROFILING_TAG_T eTag);
  1089. VOID wlanTxProfilingTagMsdu(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_PROFILING_TAG_T eTag);
  1090. #endif /* _WLAN_LIB_H */
  1091. /*----------------------------------------------------------------------------*/
  1092. /* update per-AC statistics for LLS */
  1093. /*----------------------------------------------------------------------------*/
  1094. VOID wlanUpdateTxStatistics(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, BOOLEAN fgTxDrop);
  1095. VOID wlanUpdateRxStatistics(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
  1096. WLAN_STATUS wlanTriggerStatsLog(IN P_ADAPTER_T prAdapter, IN UINT_32 u4DurationInMs);
  1097. WLAN_STATUS wlanDhcpTxDone(IN P_ADAPTER_T prAdapter,
  1098. IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
  1099. WLAN_STATUS wlanArpTxDone(IN P_ADAPTER_T prAdapter,
  1100. IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);