wlan_def.h 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/wlan_def.h#1
  3. */
  4. /*! \file "wlan_def.h"
  5. * \brief This file includes the basic definition of WLAN
  6. *
  7. */
  8. /*
  9. ** Log: wlan_def.h
  10. **
  11. ** 07 25 2014 eason.tsai
  12. ** AOSP
  13. **
  14. ** 08 05 2013 terry.wu
  15. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  16. ** 1. Add SW rate definition
  17. ** 2. Add HW default rate selection logic from FW
  18. **
  19. ** 07 31 2013 terry.wu
  20. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  21. ** 1. Fix NetDev binding issue
  22. **
  23. ** 07 30 2013 yuche.tsai
  24. ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
  25. ** Driver update for Hot-Spot mode.
  26. **
  27. ** 07 12 2013 terry.wu
  28. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  29. ** 1. Add 11ac to AIS desired PHY config
  30. ** 2. Extend PHY type set to 11ac/11anac/11abgnac
  31. **
  32. ** 07 12 2013 terry.wu
  33. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  34. ** 1. Update VHT IE composing function
  35. ** 2. disable bow
  36. ** 3. Exchange bss/sta rec update sequence for temp solution
  37. **
  38. ** 06 26 2013 terry.wu
  39. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  40. ** Update VHT rate definition
  41. **
  42. ** 06 14 2013 eddie.chen
  43. ** [BORA00002450] [WIFISYS][MT6630] New design for mt6630
  44. ** Add full mcsset. Add more vht info in sta update
  45. **
  46. ** 02 27 2013 yuche.tsai
  47. ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
  48. ** Add new code, fix compile warning.
  49. **
  50. ** 02 25 2013 terry.wu
  51. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  52. ** <saved by Perforce>
  53. **
  54. ** 02 19 2013 cp.wu
  55. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  56. ** enable AIS related management modules building under Android/Linux
  57. **
  58. ** 02 18 2013 cm.chang
  59. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  60. ** New feature to remove all sta records by BssIndex
  61. **
  62. ** 02 06 2013 yuche.tsai
  63. ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
  64. ** MT6630 code update.
  65. **
  66. ** 01 22 2013 cp.wu
  67. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  68. ** modification for ucBssIndex migration
  69. **
  70. ** 01 21 2013 cm.chang
  71. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  72. ** 1. Create rP2pDevInfo structure
  73. ** 2. Support 80/160 MHz channel bandwidth for channel privilege
  74. **
  75. ** 01 17 2013 cm.chang
  76. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  77. ** Use ucBssIndex to replace eNetworkTypeIndex
  78. **
  79. ** 11 06 2012 eason.tsai
  80. ** [BORA00002255] [MT6630 Wi-Fi][Driver] develop
  81. ** .
  82. **
  83. ** 09 17 2012 cm.chang
  84. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  85. ** Duplicate source from MT6620 v2.3 driver branch
  86. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  87. *
  88. * 12 05 2011 cp.wu
  89. * [WCXRP00001131] [MT6620 Wi-Fi][Driver][AIS] Implement connect-by-BSSID path
  90. * add CONNECT_BY_BSSID policy
  91. *
  92. * 10 12 2011 wh.su
  93. * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
  94. * adding the 802.11w related function and define .
  95. *
  96. * 06 22 2011 wh.su
  97. * [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not
  98. *align at byte
  99. * Move the WAPI/RSN IE to mac.h and SW structure not align to byte,
  100. * Notice needed update P2P.ko.
  101. *
  102. * 04 08 2011 eddie.chen
  103. * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma
  104. * Fix for sigma
  105. *
  106. * 03 17 2011 yuche.tsai
  107. * NULL
  108. * Resize the Secondary Device Type array when WiFi Direct is enabled.
  109. *
  110. * 01 25 2011 yuche.tsai
  111. * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
  112. * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role.
  113. *
  114. * 01 25 2011 yuche.tsai
  115. * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
  116. * Add new station type MACRO.
  117. *
  118. * 12 07 2010 cm.chang
  119. * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
  120. * 1. Country code is from NVRAM or supplicant
  121. * 2. Change band definition in CMD/EVENT.
  122. *
  123. * 10 11 2010 kevin.huang
  124. * [WCXRP00000068] [MT6620 Wi-Fi][Driver][FW] Fix STA RECORD sync issue and remove unused code
  125. * Update ENUM_STA_ROLE_INDEX_T by using a fixed base value
  126. *
  127. * 10 04 2010 cp.wu
  128. * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by
  129. *ENUM_NETWORK_TYPE_INDEX_T only
  130. * remove ENUM_NETWORK_TYPE_T definitions
  131. *
  132. * 09 14 2010 chinghwa.yu
  133. * NULL
  134. * Update OP_MODE_BOW and include bow_fsm.h.
  135. *
  136. * 09 03 2010 kevin.huang
  137. * NULL
  138. * Refine #include sequence and solve recursive/nested #include issue
  139. *
  140. * 08 31 2010 kevin.huang
  141. * NULL
  142. * Use LINK LIST operation to process SCAN result
  143. *
  144. * 08 29 2010 yuche.tsai
  145. * NULL
  146. * Change P2P Descriptor List to a pointer and allocate it dynamically to avoid structure corrupt by BssDescriptor free.
  147. *
  148. * 08 16 2010 kevin.huang
  149. * NULL
  150. * Refine AAA functions
  151. *
  152. * 08 12 2010 kevin.huang
  153. * NULL
  154. * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse()
  155. *
  156. * 08 12 2010 yuche.tsai
  157. * NULL
  158. * Add a pointer in BSS Descriptor for P2P Descriptor.
  159. *
  160. * 08 11 2010 yuche.tsai
  161. * NULL
  162. * Add an Interface in BSS Descriptor.
  163. *
  164. * 08 05 2010 yuche.tsai
  165. * NULL
  166. * Modify data structure for P2P Scan result.
  167. *
  168. * 07 26 2010 yuche.tsai
  169. *
  170. * Add an operation mode for P2P device.
  171. *
  172. * 07 23 2010 cp.wu
  173. *
  174. * P2P/RSN/WAPI IEs need to be declared with compact structure.
  175. *
  176. * 07 21 2010 yuche.tsai
  177. *
  178. * Add for P2P Scan Result Parsing & Saving.
  179. *
  180. * 07 20 2010 wh.su
  181. *
  182. * adding the wapi code.
  183. *
  184. * 07 09 2010 cp.wu
  185. *
  186. * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
  187. * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
  188. * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by
  189. *returning BUSY
  190. *
  191. * 07 08 2010 cp.wu
  192. *
  193. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  194. *
  195. * 06 28 2010 cm.chang
  196. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  197. * 1st draft code for RLM module
  198. *
  199. * 06 25 2010 cp.wu
  200. * [WPD00003833][MT6620 and MT5931] Driver migration
  201. * modify Beacon/ProbeResp to complete parsing,
  202. * because host software has looser memory usage restriction
  203. *
  204. * 06 21 2010 yuche.tsai
  205. * [WPD00003839][MT6620 5931][P2P] Feature migration
  206. * Add P2P present boolean flag in BSS & Pre-BSS descriptor.
  207. *
  208. * 06 18 2010 wh.su
  209. * [WPD00003840][MT6620 5931] Security migration
  210. * migration the security related function from firmware.
  211. *
  212. * 06 11 2010 cp.wu
  213. * [WPD00003833][MT6620 and MT5931] Driver migration
  214. * auth.c is migrated.
  215. *
  216. * 06 11 2010 cp.wu
  217. * [WPD00003833][MT6620 and MT5931] Driver migration
  218. * 1) migrate assoc.c.
  219. * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
  220. * 3) add configuration options for CNM_MEM and RSN modules
  221. * 4) add data path for management frames
  222. * 5) eliminate rPacketInfo of MSDU_INFO_T
  223. *
  224. * 06 10 2010 cp.wu
  225. * [WPD00003833][MT6620 and MT5931] Driver migration
  226. * add buildable & linkable ais_fsm.c
  227. *
  228. * related reference are still waiting to be resolved
  229. *
  230. * 06 09 2010 cp.wu
  231. * [WPD00003833][MT6620 and MT5931] Driver migration
  232. * add definitions for module migration.
  233. *
  234. * 06 07 2010 cp.wu
  235. * [WPD00003833][MT6620 and MT5931] Driver migration
  236. * move bss related data types to wlan_def.h to avoid recursive dependency.
  237. *
  238. * 06 07 2010 cp.wu
  239. * [WPD00003833][MT6620 and MT5931] Driver migration
  240. * merge wlan_def.h.
  241. *
  242. * 06 07 2010 cp.wu
  243. * [WPD00003833][MT6620 and MT5931] Driver migration
  244. * merge cnm_scan.h and hem_mbox.h
  245. *
  246. * 06 07 2010 cp.wu
  247. * [WPD00003833][MT6620 and MT5931] Driver migration
  248. * merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
  249. *
  250. * 06 06 2010 kevin.huang
  251. * [WPD00003832][MT6620 5931] Create driver base
  252. * [MT6620 5931] Create driver base
  253. ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:40 GMT mtk01426
  254. ** Init for develop
  255. **
  256. */
  257. #ifndef _WLAN_DEF_H
  258. #define _WLAN_DEF_H
  259. /*******************************************************************************
  260. * C O M P I L E R F L A G S
  261. ********************************************************************************
  262. */
  263. /*******************************************************************************
  264. * E X T E R N A L R E F E R E N C E S
  265. ********************************************************************************
  266. */
  267. /*******************************************************************************
  268. * C O N S T A N T S
  269. ********************************************************************************
  270. */
  271. /* disconnect reason */
  272. #define DISCONNECT_REASON_CODE_RESERVED 0
  273. #define DISCONNECT_REASON_CODE_RADIO_LOST 1
  274. #define DISCONNECT_REASON_CODE_DEAUTHENTICATED 2
  275. #define DISCONNECT_REASON_CODE_DISASSOCIATED 3
  276. #define DISCONNECT_REASON_CODE_NEW_CONNECTION 4
  277. #define DISCONNECT_REASON_CODE_REASSOCIATION 5
  278. /* The rate definitions */
  279. #define TX_MODE_CCK 0x00
  280. #define TX_MODE_OFDM 0x40
  281. #define TX_MODE_HT_MM 0x80
  282. #define TX_MODE_HT_GF 0xC0
  283. #define TX_MODE_VHT 0x100
  284. #define RATE_CCK_SHORT_PREAMBLE 0x4
  285. #define PHY_RATE_1M 0x0
  286. #define PHY_RATE_2M 0x1
  287. #define PHY_RATE_5_5M 0x2
  288. #define PHY_RATE_11M 0x3
  289. #define PHY_RATE_6M 0xB
  290. #define PHY_RATE_9M 0xF
  291. #define PHY_RATE_12M 0xA
  292. #define PHY_RATE_18M 0xE
  293. #define PHY_RATE_24M 0x9
  294. #define PHY_RATE_36M 0xD
  295. #define PHY_RATE_48M 0x8
  296. #define PHY_RATE_54M 0xC
  297. #define PHY_RATE_MCS0 0x0
  298. #define PHY_RATE_MCS1 0x1
  299. #define PHY_RATE_MCS2 0x2
  300. #define PHY_RATE_MCS3 0x3
  301. #define PHY_RATE_MCS4 0x4
  302. #define PHY_RATE_MCS5 0x5
  303. #define PHY_RATE_MCS6 0x6
  304. #define PHY_RATE_MCS7 0x7
  305. #define PHY_RATE_MCS8 0x8
  306. #define PHY_RATE_MCS9 0x9
  307. #define PHY_RATE_MCS32 0x20
  308. #define RATE_CCK_1M_LONG (TX_MODE_CCK | PHY_RATE_1M)
  309. #define RATE_CCK_2M_LONG (TX_MODE_CCK | PHY_RATE_2M)
  310. #define RATE_CCK_5_5M_LONG (TX_MODE_CCK | PHY_RATE_5_5M)
  311. #define RATE_CCK_11M_LONG (TX_MODE_CCK | PHY_RATE_11M)
  312. #define RATE_CCK_2M_SHORT (TX_MODE_CCK | PHY_RATE_2M | RATE_CCK_SHORT_PREAMBLE)
  313. #define RATE_CCK_5_5M_SHORT (TX_MODE_CCK | PHY_RATE_5_5M | RATE_CCK_SHORT_PREAMBLE)
  314. #define RATE_CCK_11M_SHORT (TX_MODE_CCK | PHY_RATE_11M | RATE_CCK_SHORT_PREAMBLE)
  315. #define RATE_OFDM_6M (TX_MODE_OFDM | PHY_RATE_6M)
  316. #define RATE_OFDM_9M (TX_MODE_OFDM | PHY_RATE_9M)
  317. #define RATE_OFDM_12M (TX_MODE_OFDM | PHY_RATE_12M)
  318. #define RATE_OFDM_18M (TX_MODE_OFDM | PHY_RATE_18M)
  319. #define RATE_OFDM_24M (TX_MODE_OFDM | PHY_RATE_24M)
  320. #define RATE_OFDM_36M (TX_MODE_OFDM | PHY_RATE_36M)
  321. #define RATE_OFDM_48M (TX_MODE_OFDM | PHY_RATE_48M)
  322. #define RATE_OFDM_54M (TX_MODE_OFDM | PHY_RATE_54M)
  323. #define RATE_MM_MCS_0 (TX_MODE_HT_MM | PHY_RATE_MCS0)
  324. #define RATE_MM_MCS_1 (TX_MODE_HT_MM | PHY_RATE_MCS1)
  325. #define RATE_MM_MCS_2 (TX_MODE_HT_MM | PHY_RATE_MCS2)
  326. #define RATE_MM_MCS_3 (TX_MODE_HT_MM | PHY_RATE_MCS3)
  327. #define RATE_MM_MCS_4 (TX_MODE_HT_MM | PHY_RATE_MCS4)
  328. #define RATE_MM_MCS_5 (TX_MODE_HT_MM | PHY_RATE_MCS5)
  329. #define RATE_MM_MCS_6 (TX_MODE_HT_MM | PHY_RATE_MCS6)
  330. #define RATE_MM_MCS_7 (TX_MODE_HT_MM | PHY_RATE_MCS7)
  331. #define RATE_MM_MCS_32 (TX_MODE_HT_MM | PHY_RATE_MCS32)
  332. #define RATE_GF_MCS_0 (TX_MODE_HT_GF | PHY_RATE_MCS0)
  333. #define RATE_GF_MCS_1 (TX_MODE_HT_GF | PHY_RATE_MCS1)
  334. #define RATE_GF_MCS_2 (TX_MODE_HT_GF | PHY_RATE_MCS2)
  335. #define RATE_GF_MCS_3 (TX_MODE_HT_GF | PHY_RATE_MCS3)
  336. #define RATE_GF_MCS_4 (TX_MODE_HT_GF | PHY_RATE_MCS4)
  337. #define RATE_GF_MCS_5 (TX_MODE_HT_GF | PHY_RATE_MCS5)
  338. #define RATE_GF_MCS_6 (TX_MODE_HT_GF | PHY_RATE_MCS6)
  339. #define RATE_GF_MCS_7 (TX_MODE_HT_GF | PHY_RATE_MCS7)
  340. #define RATE_GF_MCS_32 (TX_MODE_HT_GF | PHY_RATE_MCS32)
  341. #define RATE_VHT_MCS_0 (TX_MODE_VHT | PHY_RATE_MCS0)
  342. #define RATE_VHT_MCS_1 (TX_MODE_VHT | PHY_RATE_MCS1)
  343. #define RATE_VHT_MCS_2 (TX_MODE_VHT | PHY_RATE_MCS2)
  344. #define RATE_VHT_MCS_3 (TX_MODE_VHT | PHY_RATE_MCS3)
  345. #define RATE_VHT_MCS_4 (TX_MODE_VHT | PHY_RATE_MCS4)
  346. #define RATE_VHT_MCS_5 (TX_MODE_VHT | PHY_RATE_MCS5)
  347. #define RATE_VHT_MCS_6 (TX_MODE_VHT | PHY_RATE_MCS6)
  348. #define RATE_VHT_MCS_7 (TX_MODE_VHT | PHY_RATE_MCS7)
  349. #define RATE_VHT_MCS_8 (TX_MODE_VHT | PHY_RATE_MCS8)
  350. #define RATE_VHT_MCS_9 (TX_MODE_VHT | PHY_RATE_MCS9)
  351. #define RATE_TX_MODE_MASK BITS(6, 8)
  352. #define RATE_TX_MODE_OFFSET 6
  353. #define RATE_CODE_GET_TX_MODE(_ucRateCode) ((_ucRateCode & RATE_TX_MODE_MASK) >> RATE_TX_MODE_OFFSET)
  354. #define RATE_PHY_RATE_MASK BITS(0, 5)
  355. #define RATE_PHY_RATE_OFFSET 0
  356. #define RATE_CODE_GET_PHY_RATE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_MASK) >> RATE_PHY_RATE_OFFSET)
  357. #define RATE_PHY_RATE_SHORT_PREAMBLE BIT(2)
  358. #define RATE_CODE_IS_SHORT_PREAMBLE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_SHORT_PREAMBLE) ? TRUE : FALSE)
  359. #define CHNL_LIST_SZ_2G 14
  360. #define CHNL_LIST_SZ_5G 14
  361. /*! CNM(STA_RECORD_T) related definition */
  362. #define CFG_STA_REC_NUM 27
  363. /* PHY TYPE bit definitions */
  364. #define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX) /* HR/DSSS PHY (clause 18) */
  365. #define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX) /* ERP PHY (clause 19) */
  366. #define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX) /* OFDM 5 GHz PHY (clause 17) */
  367. #define PHY_TYPE_BIT_HT BIT(PHY_TYPE_HT_INDEX) /* HT PHY (clause 20) */
  368. #define PHY_TYPE_BIT_VHT BIT(PHY_TYPE_VHT_INDEX) /* HT PHY (clause 22) */
  369. /* PHY TYPE set definitions */
  370. #define PHY_TYPE_SET_802_11ABGN (PHY_TYPE_BIT_OFDM | \
  371. PHY_TYPE_BIT_HR_DSSS | \
  372. PHY_TYPE_BIT_ERP | \
  373. PHY_TYPE_BIT_HT)
  374. #define PHY_TYPE_SET_802_11BGN (PHY_TYPE_BIT_HR_DSSS | \
  375. PHY_TYPE_BIT_ERP | \
  376. PHY_TYPE_BIT_HT)
  377. #define PHY_TYPE_SET_802_11GN (PHY_TYPE_BIT_ERP | \
  378. PHY_TYPE_BIT_HT)
  379. #define PHY_TYPE_SET_802_11AN (PHY_TYPE_BIT_OFDM | \
  380. PHY_TYPE_BIT_HT)
  381. #define PHY_TYPE_SET_802_11ABG (PHY_TYPE_BIT_OFDM | \
  382. PHY_TYPE_BIT_HR_DSSS | \
  383. PHY_TYPE_BIT_ERP)
  384. #define PHY_TYPE_SET_802_11BG (PHY_TYPE_BIT_HR_DSSS | \
  385. PHY_TYPE_BIT_ERP)
  386. #define PHY_TYPE_SET_802_11A (PHY_TYPE_BIT_OFDM)
  387. #define PHY_TYPE_SET_802_11G (PHY_TYPE_BIT_ERP)
  388. #define PHY_TYPE_SET_802_11B (PHY_TYPE_BIT_HR_DSSS)
  389. #define PHY_TYPE_SET_802_11N (PHY_TYPE_BIT_HT)
  390. #define PHY_TYPE_SET_802_11AC (PHY_TYPE_BIT_VHT)
  391. #define PHY_TYPE_SET_802_11ANAC (PHY_TYPE_BIT_OFDM | \
  392. PHY_TYPE_BIT_HT | \
  393. PHY_TYPE_BIT_VHT)
  394. #define PHY_TYPE_SET_802_11ABGNAC (PHY_TYPE_BIT_OFDM | \
  395. PHY_TYPE_BIT_HR_DSSS | \
  396. PHY_TYPE_BIT_ERP | \
  397. PHY_TYPE_BIT_HT | \
  398. PHY_TYPE_BIT_VHT)
  399. /* Rate set bit definitions */
  400. #define RATE_SET_BIT_1M BIT(RATE_1M_SW_INDEX) /* Bit 0: 1M */
  401. #define RATE_SET_BIT_2M BIT(RATE_2M_SW_INDEX) /* Bit 1: 2M */
  402. #define RATE_SET_BIT_5_5M BIT(RATE_5_5M_SW_INDEX) /* Bit 2: 5.5M */
  403. #define RATE_SET_BIT_11M BIT(RATE_11M_SW_INDEX) /* Bit 3: 11M */
  404. #define RATE_SET_BIT_22M BIT(RATE_22M_SW_INDEX) /* Bit 4: 22M */
  405. #define RATE_SET_BIT_33M BIT(RATE_33M_SW_INDEX) /* Bit 5: 33M */
  406. #define RATE_SET_BIT_6M BIT(RATE_6M_SW_INDEX) /* Bit 6: 6M */
  407. #define RATE_SET_BIT_9M BIT(RATE_9M_SW_INDEX) /* Bit 7: 9M */
  408. #define RATE_SET_BIT_12M BIT(RATE_12M_SW_INDEX) /* Bit 8: 12M */
  409. #define RATE_SET_BIT_18M BIT(RATE_18M_SW_INDEX) /* Bit 9: 18M */
  410. #define RATE_SET_BIT_24M BIT(RATE_24M_SW_INDEX) /* Bit 10: 24M */
  411. #define RATE_SET_BIT_36M BIT(RATE_36M_SW_INDEX) /* Bit 11: 36M */
  412. #define RATE_SET_BIT_48M BIT(RATE_48M_SW_INDEX) /* Bit 12: 48M */
  413. #define RATE_SET_BIT_54M BIT(RATE_54M_SW_INDEX) /* Bit 13: 54M */
  414. #define RATE_SET_BIT_HT_PHY BIT(RATE_HT_PHY_SW_INDEX) /* Bit 14: BSS Selector */
  415. /* Rate set definitions */
  416. #define RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
  417. RATE_SET_BIT_2M | \
  418. RATE_SET_BIT_5_5M | \
  419. RATE_SET_BIT_11M)
  420. #define RATE_SET_ERP (RATE_SET_BIT_1M | \
  421. RATE_SET_BIT_2M | \
  422. RATE_SET_BIT_5_5M | \
  423. RATE_SET_BIT_11M | \
  424. RATE_SET_BIT_6M | \
  425. RATE_SET_BIT_9M | \
  426. RATE_SET_BIT_12M | \
  427. RATE_SET_BIT_18M | \
  428. RATE_SET_BIT_24M | \
  429. RATE_SET_BIT_36M | \
  430. RATE_SET_BIT_48M | \
  431. RATE_SET_BIT_54M)
  432. #define RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
  433. RATE_SET_BIT_9M | \
  434. RATE_SET_BIT_12M | \
  435. RATE_SET_BIT_18M | \
  436. RATE_SET_BIT_24M | \
  437. RATE_SET_BIT_36M | \
  438. RATE_SET_BIT_48M | \
  439. RATE_SET_BIT_54M)
  440. #define RATE_SET_OFDM (RATE_SET_BIT_6M | \
  441. RATE_SET_BIT_9M | \
  442. RATE_SET_BIT_12M | \
  443. RATE_SET_BIT_18M | \
  444. RATE_SET_BIT_24M | \
  445. RATE_SET_BIT_36M | \
  446. RATE_SET_BIT_48M | \
  447. RATE_SET_BIT_54M)
  448. #define RATE_SET_HT (RATE_SET_ERP)
  449. /* #define RATE_SET_HT (RATE_SET_ERP | RATE_SET_BIT_HT_PHY) *//* NOTE(Kevin): TBD */
  450. #define RATE_SET_ALL_ABG RATE_SET_ERP
  451. #define BASIC_RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
  452. RATE_SET_BIT_2M)
  453. #define BASIC_RATE_SET_HR_DSSS_ERP (RATE_SET_BIT_1M | \
  454. RATE_SET_BIT_2M | \
  455. RATE_SET_BIT_5_5M | \
  456. RATE_SET_BIT_11M)
  457. #define BASIC_RATE_SET_ERP (RATE_SET_BIT_1M | \
  458. RATE_SET_BIT_2M | \
  459. RATE_SET_BIT_5_5M | \
  460. RATE_SET_BIT_11M | \
  461. RATE_SET_BIT_6M | \
  462. RATE_SET_BIT_12M | \
  463. RATE_SET_BIT_24M)
  464. #define BASIC_RATE_SET_OFDM (RATE_SET_BIT_6M | \
  465. RATE_SET_BIT_12M | \
  466. RATE_SET_BIT_24M)
  467. #define BASIC_RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
  468. RATE_SET_BIT_12M | \
  469. RATE_SET_BIT_24M)
  470. #define INITIAL_RATE_SET_RCPI_100 RATE_SET_ALL_ABG
  471. #define INITIAL_RATE_SET_RCPI_80 (RATE_SET_BIT_1M | \
  472. RATE_SET_BIT_2M | \
  473. RATE_SET_BIT_5_5M | \
  474. RATE_SET_BIT_11M | \
  475. RATE_SET_BIT_6M | \
  476. RATE_SET_BIT_9M | \
  477. RATE_SET_BIT_12M | \
  478. RATE_SET_BIT_24M)
  479. #define INITIAL_RATE_SET_RCPI_60 (RATE_SET_BIT_1M | \
  480. RATE_SET_BIT_2M | \
  481. RATE_SET_BIT_5_5M | \
  482. RATE_SET_BIT_11M | \
  483. RATE_SET_BIT_6M)
  484. #define INITIAL_RATE_SET(_rcpi) (INITIAL_RATE_SET_ ## _rcpi)
  485. #define RCPI_100 100 /* -60 dBm */
  486. #define RCPI_80 80 /* -70 dBm */
  487. #define RCPI_60 60 /* -80 dBm */
  488. /* The number of RCPI records used to calculate their average value */
  489. #define MAX_NUM_RCPI_RECORDS 10
  490. /* The number of RCPI records used to calculate their average value */
  491. #define NO_RCPI_RECORDS -128
  492. #define MAX_RCPI_DBM 0
  493. #define MIN_RCPI_DBM -100
  494. #define MAX_ASSOC_ID (CFG_STA_REC_NUM) /* Available AID: 1 ~ 20(STA_REC_NUM) */
  495. #define MAX_DEAUTH_INFO_COUNT 4 /* NOTE(Kevin): Used in auth.c */
  496. #define MIN_DEAUTH_INTERVAL_MSEC 500 /* The minimum interval if continuously send Deauth Frame */
  497. /* Authentication Type */
  498. #define AUTH_TYPE_OPEN_SYSTEM BIT(AUTH_ALGORITHM_NUM_OPEN_SYSTEM)
  499. #define AUTH_TYPE_SHARED_KEY BIT(AUTH_ALGORITHM_NUM_SHARED_KEY)
  500. #define AUTH_TYPE_FAST_BSS_TRANSITION BIT(AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION)
  501. /* Authentication Retry Limit */
  502. #define TX_AUTH_ASSOCI_RETRY_LIMIT 2
  503. #define TX_AUTH_ASSOCI_RETRY_LIMIT_FOR_ROAMING 1
  504. /* WMM-2.2.1 WMM Information Element */
  505. #define ELEM_MAX_LEN_WMM_INFO 7
  506. /*******************************************************************************
  507. * D A T A T Y P E S
  508. ********************************************************************************
  509. */
  510. typedef UINT_16 PHY_TYPE, *P_PHY_TYPE;
  511. typedef UINT_8 RCPI, *P_RCPI;
  512. typedef UINT_8 ALC_VAL, *P_ALC_VAL;
  513. typedef enum _ENUM_HW_BSSID_T {
  514. BSSID_0 = 0,
  515. BSSID_1,
  516. BSSID_2,
  517. BSSID_3,
  518. BSSID_NUM
  519. } ENUM_HW_BSSID_T;
  520. typedef enum _ENUM_HW_MAC_ADDR_T {
  521. MAC_ADDR_0 = 0,
  522. MAC_ADDR_1,
  523. MAC_ADDR_NUM
  524. } ENUM_HW_MAC_ADDR_T;
  525. typedef enum _ENUM_HW_OP_MODE_T {
  526. HW_OP_MODE_STA = 0,
  527. HW_OP_MODE_AP,
  528. HW_OP_MODE_ADHOC,
  529. HW_OP_MODE_NUM
  530. } ENUM_HW_OP_MODE_T;
  531. typedef enum _ENUM_TSF_T {
  532. ENUM_LOCAL_TSF_0,
  533. ENUM_LOCAL_TSF_1,
  534. ENUM_LOCAL_TSF_NUM
  535. } ENUM_LOCAL_TSF_T, *P_ENUM_LOCAL_TSF_T;
  536. typedef enum _HAL_TS_HW_UPDATE_MODE {
  537. HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME,
  538. HAL_TSF_HW_UPDATE_BY_TICK_ONLY,
  539. HAL_TSF_HW_UPDATE_BY_RECEIVED_FRAME_ONLY,
  540. HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME_AD_HOC
  541. } HAL_TSF_HW_UPDATE_MODE;
  542. typedef enum _ENUM_AC_T {
  543. AC0 = 0,
  544. AC1,
  545. AC2,
  546. AC3,
  547. AC_NUM
  548. } ENUM_AC_T, *P_ENUM_AC_T;
  549. typedef enum _ENUM_NETWORK_TYPE_T {
  550. NETWORK_TYPE_AIS,
  551. NETWORK_TYPE_P2P,
  552. NETWORK_TYPE_BOW,
  553. NETWORK_TYPE_MBSS,
  554. NETWORK_TYPE_NUM
  555. } ENUM_NETWORK_TYPE_T;
  556. /* The Type of STA Type. */
  557. typedef enum _ENUM_STA_TYPE_INDEX_T {
  558. STA_TYPE_LEGACY_INDEX = 0,
  559. STA_TYPE_P2P_INDEX,
  560. STA_TYPE_BOW_INDEX,
  561. STA_TYPE_INDEX_NUM
  562. } ENUM_STA_TYPE_INDEX_T;
  563. #define STA_ROLE_BASE_INDEX 4
  564. typedef enum _ENUM_STA_ROLE_INDEX_T {
  565. STA_ROLE_ADHOC_INDEX = STA_ROLE_BASE_INDEX, /* 4 */
  566. STA_ROLE_CLIENT_INDEX,
  567. STA_ROLE_AP_INDEX,
  568. STA_ROLE_DLS_INDEX,
  569. STA_ROLE_MAX_INDEX
  570. } ENUM_STA_ROLE_INDEX_T;
  571. #define STA_ROLE_INDEX_NUM (STA_ROLE_MAX_INDEX - STA_ROLE_BASE_INDEX)
  572. /* The Power State of a specific Network */
  573. typedef enum _ENUM_PWR_STATE_T {
  574. PWR_STATE_IDLE = 0,
  575. PWR_STATE_ACTIVE,
  576. PWR_STATE_PS,
  577. PWR_STATE_NUM
  578. } ENUM_PWR_STATE_T;
  579. typedef enum _ENUM_PHY_TYPE_INDEX_T {
  580. /* PHY_TYPE_DSSS_INDEX, *//* DSSS PHY (clause 15) -- Not used anymore */
  581. PHY_TYPE_HR_DSSS_INDEX = 0, /* HR/DSSS PHY (clause 18) */
  582. PHY_TYPE_ERP_INDEX, /* ERP PHY (clause 19) */
  583. PHY_TYPE_ERP_P2P_INDEX, /* ERP PHY (clause 19) w/o HR/DSSS */
  584. PHY_TYPE_OFDM_INDEX, /* OFDM 5 GHz PHY (clause 17) */
  585. PHY_TYPE_HT_INDEX, /* HT PHY (clause 20) */
  586. PHY_TYPE_VHT_INDEX, /* HT PHY (clause 22) */
  587. PHY_TYPE_INDEX_NUM /* 6 */
  588. } ENUM_PHY_TYPE_INDEX_T, *P_ENUM_PHY_TYPE_INDEX_T;
  589. typedef enum _ENUM_SW_RATE_INDEX_T {
  590. RATE_1M_SW_INDEX = 0, /* 1M */
  591. RATE_2M_SW_INDEX, /* 2M */
  592. RATE_5_5M_SW_INDEX, /* 5.5M */
  593. RATE_11M_SW_INDEX, /* 11M */
  594. RATE_22M_SW_INDEX, /* 22M */
  595. RATE_33M_SW_INDEX, /* 33M */
  596. RATE_6M_SW_INDEX, /* 6M */
  597. RATE_9M_SW_INDEX, /* 9M */
  598. RATE_12M_SW_INDEX, /* 12M */
  599. RATE_18M_SW_INDEX, /* 18M */
  600. RATE_24M_SW_INDEX, /* 24M */
  601. RATE_36M_SW_INDEX, /* 36M */
  602. RATE_48M_SW_INDEX, /* 48M */
  603. RATE_54M_SW_INDEX, /* 54M */
  604. RATE_HT_PHY_SW_INDEX, /* BSS Selector - HT PHY */
  605. RATE_NUM_SW /* 15 */
  606. } ENUM_SW_RATE_INDEX_T, *P_ENUM_SW_RATE_INDEX_T;
  607. typedef enum _ENUM_CCK_RATE_INDEX_T {
  608. RATE_1M_INDEX = 0, /* 1M */
  609. RATE_2M_INDEX, /* 2M */
  610. RATE_5_5M_INDEX, /* 5.5M */
  611. RATE_11M_INDEX, /* 11M */
  612. CCK_RATE_NUM /* 4 */
  613. } ENUM_CCK_RATE_INDEX_T, *P_ENUM_CCK_RATE_INDEX_T;
  614. typedef enum _ENUM_OFDM_RATE_INDEX_T {
  615. RATE_6M_INDEX = 0, /* 6M */
  616. RATE_9M_INDEX, /* 9M */
  617. RATE_12M_INDEX, /* 12M */
  618. RATE_18M_INDEX, /* 18M */
  619. RATE_24M_INDEX, /* 24M */
  620. RATE_36M_INDEX, /* 36M */
  621. RATE_48M_INDEX, /* 48M */
  622. RATE_54M_INDEX, /* 54M */
  623. OFDM_RATE_NUM /* 8 */
  624. } ENUM_OFDM_RATE_INDEX_T, *P_ENUM_OFDM_RATE_INDEX_T;
  625. typedef enum _ENUM_HT_RATE_INDEX_T {
  626. HT_RATE_MCS32_INDEX = 0,
  627. HT_RATE_MCS0_INDEX,
  628. HT_RATE_MCS1_INDEX,
  629. HT_RATE_MCS2_INDEX,
  630. HT_RATE_MCS3_INDEX,
  631. HT_RATE_MCS4_INDEX,
  632. HT_RATE_MCS5_INDEX,
  633. HT_RATE_MCS6_INDEX,
  634. HT_RATE_MCS7_INDEX,
  635. HT_RATE_NUM /* 9 */
  636. } ENUM_HT_RATE_INDEX_T, *P_ENUM_HT_RATE_INDEX_T;
  637. typedef enum _ENUM_VHT_RATE_INDEX_T {
  638. VHT_RATE_MCS0_INDEX = 0,
  639. VHT_RATE_MCS1_INDEX,
  640. VHT_RATE_MCS2_INDEX,
  641. VHT_RATE_MCS3_INDEX,
  642. VHT_RATE_MCS4_INDEX,
  643. VHT_RATE_MCS5_INDEX,
  644. VHT_RATE_MCS6_INDEX,
  645. VHT_RATE_MCS7_INDEX,
  646. VHT_RATE_MCS8_INDEX,
  647. VHT_RATE_MCS9_INDEX,
  648. VHT_RATE_NUM /* 10 */
  649. } ENUM_VHT_RATE_INDEX_T, *P_ENUM_VHT_RATE_INDEX_T;
  650. typedef enum _ENUM_PREMABLE_OPTION_T {
  651. PREAMBLE_DEFAULT_LONG_NONE = 0, /* LONG for PHY_TYPE_HR_DSSS, NONE for PHY_TYPE_OFDM */
  652. PREAMBLE_OPTION_SHORT, /* SHORT mandatory for PHY_TYPE_ERP, SHORT option for PHY_TYPE_HR_DSSS */
  653. PREAMBLE_OFDM_MODE,
  654. PREAMBLE_HT_MIXED_MODE,
  655. PREAMBLE_HT_GREEN_FIELD,
  656. PREAMBLE_VHT_FIELD,
  657. PREAMBLE_OPTION_NUM
  658. } ENUM_PREMABLE_OPTION_T, *P_ENUM_PREMABLE_OPTION_T;
  659. typedef enum _ENUM_MODULATION_SYSTEM_T {
  660. MODULATION_SYSTEM_CCK = 0,
  661. MODULATION_SYSTEM_OFDM,
  662. MODULATION_SYSTEM_HT20,
  663. MODULATION_SYSTEM_HT40,
  664. MODULATION_SYSTEM_NUM
  665. } ENUM_MODULATION_SYSTEM_T, *P_ENUM_MODULATION_SYSTEM_T;
  666. typedef enum _ENUM_MODULATION_TYPE_T {
  667. MODULATION_TYPE_CCK_BPSK = 0,
  668. MODULATION_TYPE_QPSK,
  669. MODULATION_TYPE_16QAM,
  670. MODULATION_TYPE_64QAM,
  671. MODULATION_TYPE_NUM
  672. } ENUM_MODULATION_TYPE_T, *P_ENUM_MODULATION_TYPE_T;
  673. typedef enum _ENUM_ACPI_STATE_T {
  674. ACPI_STATE_D0 = 0,
  675. ACPI_STATE_D1,
  676. ACPI_STATE_D2,
  677. ACPI_STATE_D3
  678. } ENUM_ACPI_STATE_T;
  679. /* The operation mode of a specific Network */
  680. typedef enum _ENUM_OP_MODE_T {
  681. OP_MODE_INFRASTRUCTURE = 0, /* Infrastructure/GC */
  682. OP_MODE_IBSS, /* AdHoc */
  683. OP_MODE_ACCESS_POINT, /* For GO */
  684. OP_MODE_P2P_DEVICE, /* P2P Device */
  685. OP_MODE_BOW,
  686. OP_MODE_NUM
  687. } ENUM_OP_MODE_T, *P_ENUM_OP_MODE_T;
  688. typedef enum _ENUM_CHNL_EXT_T {
  689. CHNL_EXT_SCN = 0,
  690. CHNL_EXT_SCA = 1,
  691. CHNL_EXT_RES = 2,
  692. CHNL_EXT_SCB = 3
  693. } ENUM_CHNL_EXT_T, *P_ENUM_CHNL_EXT_T;
  694. typedef enum _ENUM_CHANNEL_WIDTH_T {
  695. CW_20_40MHZ = 0,
  696. CW_80MHZ = 1,
  697. CW_160MHZ = 2,
  698. CW_80P80MHZ = 3
  699. } ENUM_CHANNEL_WIDTH_T, *P_ENUM_CHANNEL_WIDTH_P;
  700. /* This starting freq of the band is unit of kHz */
  701. typedef enum _ENUM_BAND_T {
  702. BAND_NULL,
  703. BAND_2G4,
  704. BAND_5G,
  705. BAND_NUM
  706. } ENUM_BAND_T, *P_ENUM_BAND_T;
  707. /* Provide supported channel list to other components in array format */
  708. typedef struct _RF_CHANNEL_INFO_T {
  709. ENUM_BAND_T eBand;
  710. UINT_8 ucChannelNum;
  711. } RF_CHANNEL_INFO_T, *P_RF_CHANNEL_INFO_T;
  712. typedef enum _ENUM_PS_FORWARDING_TYPE_T {
  713. PS_FORWARDING_TYPE_NON_PS = 0,
  714. PS_FORWARDING_TYPE_DELIVERY_ENABLED,
  715. PS_FORWARDING_TYPE_NON_DELIVERY_ENABLED,
  716. PS_FORWARDING_MORE_DATA_ENABLED,
  717. PS_FORWARDING_TYPE_NUM
  718. } ENUM_PS_FORWARDING_TYPE_T, *P_ENUM_PS_FORWARDING_TYPE_T;
  719. typedef struct _DEAUTH_INFO_T {
  720. UINT_8 aucRxAddr[MAC_ADDR_LEN];
  721. OS_SYSTIME rLastSendTime;
  722. } DEAUTH_INFO_T, *P_DEAUTH_INFO_T;
  723. /*----------------------------------------------------------------------------*/
  724. /* Information Element (IE) handlers */
  725. /*----------------------------------------------------------------------------*/
  726. typedef VOID(*PFN_APPEND_IE_FUNC) (P_ADAPTER_T, P_MSDU_INFO_T);
  727. typedef VOID(*PFN_HANDLE_IE_FUNC) (P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T);
  728. typedef VOID(*PFN_VERIFY_IE_FUNC) (P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T, PUINT_16);
  729. typedef UINT_32(*PFN_CALCULATE_VAR_IE_LEN_FUNC) (P_ADAPTER_T, UINT_8, P_STA_RECORD_T);
  730. typedef struct _APPEND_IE_ENTRY_T {
  731. UINT_16 u2EstimatedIELen;
  732. PFN_APPEND_IE_FUNC pfnAppendIE;
  733. } APPEND_IE_ENTRY_T, *P_APPEND_IE_ENTRY_T;
  734. typedef struct _APPEND_VAR_IE_ENTRY_T {
  735. UINT_16 u2EstimatedFixedIELen; /* For Fixed Length */
  736. PFN_CALCULATE_VAR_IE_LEN_FUNC pfnCalculateVariableIELen;
  737. PFN_APPEND_IE_FUNC pfnAppendIE;
  738. } APPEND_VAR_IE_ENTRY_T, *P_APPEND_VAR_IE_ENTRY_T;
  739. typedef struct _HANDLE_IE_ENTRY_T {
  740. UINT_8 ucElemID;
  741. PFN_HANDLE_IE_FUNC pfnHandleIE;
  742. } HANDLE_IE_ENTRY_T, *P_HANDLE_IE_ENTRY_T;
  743. typedef struct _VERIFY_IE_ENTRY_T {
  744. UINT_8 ucElemID;
  745. PFN_VERIFY_IE_FUNC pfnVarifyIE;
  746. } VERIFY_IE_ENTRY_T, *P_VERIFY_IE_ENTRY_T;
  747. /*----------------------------------------------------------------------------*/
  748. /* Parameters of User Configuration */
  749. /*----------------------------------------------------------------------------*/
  750. typedef enum _ENUM_PARAM_CONNECTION_POLICY_T {
  751. CONNECT_BY_SSID_BEST_RSSI = 0,
  752. CONNECT_BY_SSID_GOOD_RSSI_MIN_CH_LOAD,
  753. CONNECT_BY_SSID_ANY, /* NOTE(Kevin): Needed by WHQL */
  754. CONNECT_BY_BSSID,
  755. CONNECT_BY_CUSTOMIZED_RULE /* NOTE(Kevin): TBD */
  756. } ENUM_PARAM_CONNECTION_POLICY_T, *P_ENUM_PARAM_CONNECTION_POLICY_T;
  757. typedef enum _ENUM_PARAM_PREAMBLE_TYPE_T {
  758. PREAMBLE_TYPE_LONG = 0,
  759. PREAMBLE_TYPE_SHORT,
  760. PREAMBLE_TYPE_AUTO /*!< Try preamble short first, if fail tray preamble long. */
  761. } ENUM_PARAM_PREAMBLE_TYPE_T, *P_ENUM_PARAM_PREAMBLE_TYPE_T;
  762. /* This is enum defined for user to select a phy config listed in combo box */
  763. typedef enum _ENUM_PARAM_PHY_CONFIG_T {
  764. PHY_CONFIG_802_11ABG = 0, /*!< Can associated with 802.11abg AP but without n capability, Scan dual band.
  765. **/
  766. PHY_CONFIG_802_11BG, /*!< Can associated with 802_11bg AP, Scan single band and not report 5G BSSs.
  767. **/
  768. PHY_CONFIG_802_11G, /*!< Can associated with 802_11g only AP, Scan single band and not report 5G
  769. *BSSs. */
  770. PHY_CONFIG_802_11A, /*!< Can associated with 802_11a only AP, Scan single band and not report 2.4G
  771. *BSSs. */
  772. PHY_CONFIG_802_11B, /*!< Can associated with 802_11b only AP, Scan single band and not report 5G
  773. *BSSs. */
  774. PHY_CONFIG_802_11ABGN, /*!< Can associated with 802.11abgn AP, Scan dual band. */
  775. PHY_CONFIG_802_11BGN, /*!< Can associated with 802_11bgn AP, Scan single band and not report 5G BSSs.
  776. **/
  777. PHY_CONFIG_802_11AN, /*!< Can associated with 802_11an AP, Scan single band and not report 2.4G BSSs.
  778. **/
  779. PHY_CONFIG_802_11GN, /*!< Can associated with 802_11gn AP, Scan single band and not report 5G BSSs.
  780. **/
  781. PHY_CONFIG_802_11AC,
  782. PHY_CONFIG_802_11ANAC,
  783. PHY_CONFIG_802_11ABGNAC,
  784. PHY_CONFIG_NUM /* 12 */
  785. } ENUM_PARAM_PHY_CONFIG_T, *P_ENUM_PARAM_PHY_CONFIG_T;
  786. /* This is enum defined for user to select an AP Mode */
  787. typedef enum _ENUM_PARAM_AP_MODE_T {
  788. AP_MODE_11B = 0, /*!< Create 11b BSS if we support 802.11abg/802.11bg. */
  789. AP_MODE_MIXED_11BG, /*!< Create 11bg mixed BSS if we support 802.11abg/802.11bg/802.11g. */
  790. AP_MODE_11G, /*!< Create 11g only BSS if we support 802.11abg/802.11bg/802.11g. */
  791. AP_MODE_11G_P2P, /*!< Create 11g only BSS for P2P if we support 802.11abg/802.11bg/802.11g. */
  792. AP_MODE_11A, /*!< Create 11a only BSS if we support 802.11abg. */
  793. AP_MODE_NUM /* 4 */
  794. } ENUM_PARAM_AP_MODE_T, *P_ENUM_PARAM_AP_MODE_T;
  795. /* Masks for determining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
  796. #define STA_TYPE_LEGACY_MASK BIT(STA_TYPE_LEGACY_INDEX)
  797. #define STA_TYPE_P2P_MASK BIT(STA_TYPE_P2P_INDEX)
  798. #define STA_TYPE_BOW_MASK BIT(STA_TYPE_BOW_INDEX)
  799. #define STA_TYPE_ADHOC_MASK BIT(STA_ROLE_ADHOC_INDEX)
  800. #define STA_TYPE_CLIENT_MASK BIT(STA_ROLE_CLIENT_INDEX)
  801. #define STA_TYPE_AP_MASK BIT(STA_ROLE_AP_INDEX)
  802. #define STA_TYPE_DLS_MASK BIT(STA_ROLE_DLS_INDEX)
  803. /* Macros for obtaining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
  804. #define IS_STA_IN_AIS(_prStaRec) ((_prStaRec)->ucBssIndex == prAdapter->prAisBssInfo->ucBssIndex)
  805. #define IS_STA_IN_P2P(_prStaRec) (prAdapter->aprBssInfo[(_prStaRec)->ucBssIndex]->eNetworkType == \
  806. NETWORK_TYPE_P2P)
  807. #define IS_STA_LEGACY_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_LEGACY_MASK)
  808. #define IS_STA_P2P_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_P2P_MASK)
  809. #define IS_STA_BOW_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_BOW_MASK)
  810. #define IS_ADHOC_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_ADHOC_MASK)
  811. #define IS_CLIENT_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_CLIENT_MASK)
  812. #define IS_AP_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_AP_MASK)
  813. #define IS_DLS_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_DLS_MASK)
  814. /* The ENUM_STA_TYPE_T accounts for ENUM_NETWORK_TYPE_T and ENUM_STA_ROLE_INDEX_T.
  815. * * It is a merged version of Network Type and STA Role.
  816. * */
  817. typedef enum _ENUM_STA_TYPE_T {
  818. STA_TYPE_LEGACY_AP = (STA_TYPE_LEGACY_MASK | STA_TYPE_AP_MASK),
  819. STA_TYPE_LEGACY_CLIENT = (STA_TYPE_LEGACY_MASK | STA_TYPE_CLIENT_MASK),
  820. STA_TYPE_ADHOC_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_ADHOC_MASK),
  821. #if CFG_ENABLE_WIFI_DIRECT
  822. STA_TYPE_P2P_GO = (STA_TYPE_P2P_MASK | STA_TYPE_AP_MASK),
  823. STA_TYPE_P2P_GC = (STA_TYPE_P2P_MASK | STA_TYPE_CLIENT_MASK),
  824. #endif
  825. #if CFG_ENABLE_BT_OVER_WIFI
  826. STA_TYPE_BOW_AP = (STA_TYPE_BOW_MASK | STA_TYPE_AP_MASK),
  827. STA_TYPE_BOW_CLIENT = (STA_TYPE_BOW_MASK | STA_TYPE_CLIENT_MASK),
  828. #endif
  829. STA_TYPE_DLS_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_DLS_MASK),
  830. } ENUM_STA_TYPE_T, *P_ENUM_STA_TYPE_T;
  831. /* The type of BSS we discovered */
  832. typedef enum _ENUM_BSS_TYPE_T {
  833. BSS_TYPE_INFRASTRUCTURE = 1,
  834. BSS_TYPE_IBSS,
  835. BSS_TYPE_P2P_DEVICE,
  836. BSS_TYPE_BOW_DEVICE,
  837. BSS_TYPE_NUM
  838. } ENUM_BSS_TYPE_T, *P_ENUM_BSS_TYPE_T;
  839. /*----------------------------------------------------------------------------*/
  840. /* RSN structures */
  841. /*----------------------------------------------------------------------------*/
  842. /* #if defined(WINDOWS_DDK) || defined(WINDOWS_CE) */
  843. /* #pragma pack(1) */
  844. /* #endif */
  845. #define MAX_NUM_SUPPORTED_CIPHER_SUITES 8 /* max number of supported cipher suites */
  846. #if CFG_SUPPORT_802_11W
  847. #define MAX_NUM_SUPPORTED_AKM_SUITES 8 /* max number of supported AKM suites */
  848. #else
  849. #define MAX_NUM_SUPPORTED_AKM_SUITES 6 /* max number of supported AKM suites */
  850. #endif
  851. /* Structure of RSN Information */
  852. typedef struct _RSN_INFO_T {
  853. UINT_8 ucElemId;
  854. UINT_16 u2Version;
  855. UINT_32 u4GroupKeyCipherSuite;
  856. UINT_32 u4PairwiseKeyCipherSuiteCount;
  857. UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_CIPHER_SUITES];
  858. UINT_32 u4AuthKeyMgtSuiteCount;
  859. UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_AKM_SUITES];
  860. UINT_16 u2RsnCap;
  861. BOOLEAN fgRsnCapPresent;
  862. } /*__KAL_ATTRIB_PACKED__*/ RSN_INFO_T, *P_RSN_INFO_T;
  863. #define MAX_NUM_SUPPORTED_WAPI_AKM_SUITES 1 /* max number of supported AKM suites */
  864. #define MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES 1 /* max number of supported cipher suites */
  865. /* Structure of WAPI Information */
  866. typedef struct _WAPI_INFO_T {
  867. UINT_8 ucElemId;
  868. UCHAR ucLength;
  869. UINT_16 u2Version;
  870. UINT_32 u4AuthKeyMgtSuiteCount;
  871. UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_WAPI_AKM_SUITES];
  872. UINT_32 u4PairwiseKeyCipherSuiteCount;
  873. UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES];
  874. UINT_32 u4GroupKeyCipherSuite;
  875. UINT_16 u2WapiCap;
  876. UINT_16 u2Bkid;
  877. UINT_8 aucBkid[1][16];
  878. } /* __KAL_ATTRIB_PACKED__ */ WAPI_INFO_T, *P_WAPI_INFO_T;
  879. /* #if defined(WINDOWS_DDK) || defined(WINDOWS_CE) */
  880. /* #pragma pack() */
  881. /* #endif */
  882. #if CFG_ENABLE_WIFI_DIRECT
  883. typedef struct _P2P_DEVICE_TYPE_T {
  884. UINT_16 u2CategoryID;
  885. UINT_16 u2SubCategoryID;
  886. } P2P_DEVICE_TYPE_T, *P_P2P_DEVICE_TYPE_T;
  887. typedef struct _P2P_DEVICE_DESC_T {
  888. LINK_ENTRY_T rLinkEntry;
  889. BOOLEAN fgDevInfoValid;
  890. UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */
  891. UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Interface Address. */
  892. UINT_8 ucDeviceCapabilityBitmap;
  893. UINT_8 ucGroupCapabilityBitmap;
  894. UINT_16 u2ConfigMethod; /* Configure Method support. */
  895. P2P_DEVICE_TYPE_T rPriDevType;
  896. UINT_8 ucSecDevTypeNum;
  897. P2P_DEVICE_TYPE_T arSecDevType[8]; /* Reference to P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT */
  898. UINT_16 u2NameLength;
  899. UINT_8 aucName[32]; /* Reference to WPS_ATTRI_MAX_LEN_DEVICE_NAME */
  900. /* TODO: Service Information or PasswordID valid? */
  901. } P2P_DEVICE_DESC_T, *P_P2P_DEVICE_DESC_T;
  902. #endif
  903. /*******************************************************************************
  904. * P U B L I C D A T A
  905. ********************************************************************************
  906. */
  907. /*******************************************************************************
  908. * P R I V A T E D A T A
  909. ********************************************************************************
  910. */
  911. /*******************************************************************************
  912. * M A C R O S
  913. ********************************************************************************
  914. */
  915. /* Macros to get and set the wireless LAN frame fields those are 16/32 bits in
  916. * length. */
  917. #define WLAN_GET_FIELD_16(_memAddr_p, _value_p) \
  918. { \
  919. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  920. *(PUINT_16)(_value_p) = ((UINT_16)__cp[0]) | ((UINT_16)__cp[1] << 8); \
  921. }
  922. #define WLAN_GET_FIELD_BE16(_memAddr_p, _value_p) \
  923. { \
  924. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  925. *(PUINT_16)(_value_p) = ((UINT_16)__cp[0] << 8) | ((UINT_16)__cp[1]); \
  926. }
  927. #define WLAN_GET_FIELD_32(_memAddr_p, _value_p) \
  928. { \
  929. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  930. *(PUINT_32)(_value_p) = ((UINT_32)__cp[0]) | ((UINT_32)__cp[1] << 8) | \
  931. ((UINT_32)__cp[2] << 16) | ((UINT_32)__cp[3] << 24); \
  932. }
  933. #define WLAN_GET_FIELD_BE32(_memAddr_p, _value_p) \
  934. { \
  935. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  936. *(PUINT_32)(_value_p) = ((UINT_32)__cp[0] << 24) | \
  937. ((UINT_32)__cp[1] << 16) | ((UINT_32)__cp[2] << 8) | \
  938. ((UINT_32)__cp[3]); \
  939. }
  940. #define WLAN_GET_FIELD_64(_memAddr_p, _value_p) \
  941. { \
  942. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  943. *(PUINT_64)(_value_p) = \
  944. ((UINT_64)__cp[0]) | ((UINT_64)__cp[1] << 8) | \
  945. ((UINT_64)__cp[2] << 16) | ((UINT_64)__cp[3] << 24) | \
  946. ((UINT_64)__cp[4] << 32) | ((UINT_64)__cp[5] << 40) | \
  947. ((UINT_64)__cp[6] << 48) | ((UINT_64)__cp[7] << 56); \
  948. }
  949. #define WLAN_SET_FIELD_16(_memAddr_p, _value) \
  950. { \
  951. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  952. __cp[0] = (UINT_8)(_value); \
  953. __cp[1] = (UINT_8)((_value) >> 8); \
  954. }
  955. #define WLAN_SET_FIELD_BE16(_memAddr_p, _value) \
  956. { \
  957. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  958. __cp[0] = (UINT_8)((_value) >> 8); \
  959. __cp[1] = (UINT_8)(_value); \
  960. }
  961. #define WLAN_SET_FIELD_32(_memAddr_p, _value) \
  962. { \
  963. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  964. __cp[0] = (UINT_8)(_value); \
  965. __cp[1] = (UINT_8)((_value) >> 8); \
  966. __cp[2] = (UINT_8)((_value) >> 16); \
  967. __cp[3] = (UINT_8)((_value) >> 24); \
  968. }
  969. #define WLAN_SET_FIELD_BE24(_memAddr_p, _value) \
  970. { \
  971. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  972. __cp[0] = (UINT_8)((_value) >> 16); \
  973. __cp[1] = (UINT_8)((_value) >> 8); \
  974. __cp[2] = (UINT_8)(_value); \
  975. }
  976. #define WLAN_SET_FIELD_BE32(_memAddr_p, _value) \
  977. { \
  978. PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
  979. __cp[0] = (UINT_8)((_value) >> 24); \
  980. __cp[1] = (UINT_8)((_value) >> 16); \
  981. __cp[2] = (UINT_8)((_value) >> 8); \
  982. __cp[3] = (UINT_8)(_value); \
  983. }
  984. /*******************************************************************************
  985. * F U N C T I O N D E C L A R A T I O N S
  986. ********************************************************************************
  987. */
  988. /*******************************************************************************
  989. * F U N C T I O N S
  990. ********************************************************************************
  991. */
  992. #endif /* _WLAN_DEF_H */