2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/wlan_def.h#1 $
6 \brief This file includes the basic definition of WLAN
16 * [WCXRP00001131] [MT6620 Wi-Fi][Driver][AIS] Implement connect-by-BSSID path
17 * add CONNECT_BY_BSSID policy
20 * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
21 * adding the 802.11w related function and define .
24 * [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not align at byte
25 * Move the WAPI/RSN IE to mac.h and SW structure not align to byte,
26 * Notice needed update P2P.ko.
28 * 04 08 2011 eddie.chen
29 * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma
32 * 03 17 2011 yuche.tsai
34 * Resize the Secondary Device Type array when WiFi Direct is enabled.
36 * 01 25 2011 yuche.tsai
37 * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
38 * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role.
40 * 01 25 2011 yuche.tsai
41 * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
42 * Add new station type MACRO.
45 * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
46 * 1. Country code is from NVRAM or supplicant
47 * 2. Change band definition in CMD/EVENT.
49 * 10 11 2010 kevin.huang
50 * [WCXRP00000068] [MT6620 Wi-Fi][Driver][FW] Fix STA RECORD sync issue and remove unused code
51 * Update ENUM_STA_ROLE_INDEX_T by using a fixed base value
54 * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only
55 * remove ENUM_NETWORK_TYPE_T definitions
57 * 09 14 2010 chinghwa.yu
59 * Update OP_MODE_BOW and include bow_fsm.h.
61 * 09 03 2010 kevin.huang
63 * Refine #include sequence and solve recursive/nested #include issue
65 * 08 31 2010 kevin.huang
67 * Use LINK LIST operation to process SCAN result
69 * 08 29 2010 yuche.tsai
71 * Change P2P Descriptor List to a pointer and allocate it dynamically to avoid structure corrupt by BssDescriptor free.
73 * 08 16 2010 kevin.huang
75 * Refine AAA functions
77 * 08 12 2010 kevin.huang
79 * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse()
81 * 08 12 2010 yuche.tsai
83 * Add a pointer in BSS Descriptor for P2P Descriptor.
85 * 08 11 2010 yuche.tsai
87 * Add an Interface in BSS Descriptor.
89 * 08 05 2010 yuche.tsai
91 * Modify data structure for P2P Scan result.
93 * 07 26 2010 yuche.tsai
95 * Add an operation mode for P2P device.
99 * P2P/RSN/WAPI IEs need to be declared with compact structure.
101 * 07 21 2010 yuche.tsai
103 * Add for P2P Scan Result Parsing & Saving.
107 * adding the wapi code.
111 * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
112 * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
113 * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY
117 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
119 * 06 28 2010 cm.chang
120 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
121 * 1st draft code for RLM module
124 * [WPD00003833][MT6620 and MT5931] Driver migration
125 * modify Beacon/ProbeResp to complete parsing,
126 * because host software has looser memory usage restriction
128 * 06 21 2010 yuche.tsai
129 * [WPD00003839][MT6620 5931][P2P] Feature migration
130 * Add P2P present boolean flag in BSS & Pre-BSS descriptor.
133 * [WPD00003840][MT6620 5931] Security migration
134 * migration the security related function from firmware.
137 * [WPD00003833][MT6620 and MT5931] Driver migration
138 * auth.c is migrated.
141 * [WPD00003833][MT6620 and MT5931] Driver migration
142 * 1) migrate assoc.c.
143 * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
144 * 3) add configuration options for CNM_MEM and RSN modules
145 * 4) add data path for management frames
146 * 5) eliminate rPacketInfo of MSDU_INFO_T
149 * [WPD00003833][MT6620 and MT5931] Driver migration
150 * add buildable & linkable ais_fsm.c
152 * related reference are still waiting to be resolved
155 * [WPD00003833][MT6620 and MT5931] Driver migration
156 * add definitions for module migration.
159 * [WPD00003833][MT6620 and MT5931] Driver migration
160 * move bss related data types to wlan_def.h to avoid recursive dependency.
163 * [WPD00003833][MT6620 and MT5931] Driver migration
167 * [WPD00003833][MT6620 and MT5931] Driver migration
168 * merge cnm_scan.h and hem_mbox.h
171 * [WPD00003833][MT6620 and MT5931] Driver migration
172 * merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
174 * 06 06 2010 kevin.huang
175 * [WPD00003832][MT6620 5931] Create driver base
176 * [MT6620 5931] Create driver base
177 ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:40 GMT mtk01426
185 /*******************************************************************************
186 * C O M P I L E R F L A G S
187 ********************************************************************************
190 /*******************************************************************************
191 * E X T E R N A L R E F E R E N C E S
192 ********************************************************************************
195 /*******************************************************************************
197 ********************************************************************************
199 /* disconnect reason */
200 #define DISCONNECT_REASON_CODE_RESERVED 0
201 #define DISCONNECT_REASON_CODE_RADIO_LOST 1
202 #define DISCONNECT_REASON_CODE_DEAUTHENTICATED 2
203 #define DISCONNECT_REASON_CODE_DISASSOCIATED 3
204 #define DISCONNECT_REASON_CODE_NEW_CONNECTION 4
206 /* The rate definitions */
207 #define TX_MODE_CCK 0x00
208 #define TX_MODE_OFDM 0x40
209 #define TX_MODE_HT_MM 0x80
210 #define TX_MODE_HT_GF 0xC0
212 #define RATE_CCK_SHORT_PREAMBLE 0x10
213 #define RATE_OFDM 0x20
215 #define PHY_RATE_1M 0x0
216 #define PHY_RATE_2M 0x1
217 #define PHY_RATE_5_5M 0x2
218 #define PHY_RATE_11M 0x3
219 #define PHY_RATE_6M 0xB
220 #define PHY_RATE_9M 0xF
221 #define PHY_RATE_12M 0xA
222 #define PHY_RATE_18M 0xE
223 #define PHY_RATE_24M 0x9
224 #define PHY_RATE_36M 0xD
225 #define PHY_RATE_48M 0x8
226 #define PHY_RATE_54M 0xC
227 #define PHY_RATE_MCS0 0x0
228 #define PHY_RATE_MCS1 0x1
229 #define PHY_RATE_MCS2 0x2
230 #define PHY_RATE_MCS3 0x3
231 #define PHY_RATE_MCS4 0x4
232 #define PHY_RATE_MCS5 0x5
233 #define PHY_RATE_MCS6 0x6
234 #define PHY_RATE_MCS7 0x7
235 #define PHY_RATE_MCS32 0x20
237 #define RATE_CCK_1M_LONG (TX_MODE_CCK | PHY_RATE_1M)
238 #define RATE_CCK_2M_LONG (TX_MODE_CCK | PHY_RATE_2M)
239 #define RATE_CCK_5_5M_LONG (TX_MODE_CCK | PHY_RATE_5_5M)
240 #define RATE_CCK_11M_LONG (TX_MODE_CCK | PHY_RATE_11M)
241 #define RATE_CCK_2M_SHORT (TX_MODE_CCK | PHY_RATE_2M | RATE_CCK_SHORT_PREAMBLE)
242 #define RATE_CCK_5_5M_SHORT (TX_MODE_CCK | PHY_RATE_5_5M | RATE_CCK_SHORT_PREAMBLE)
243 #define RATE_CCK_11M_SHORT (TX_MODE_CCK | PHY_RATE_11M | RATE_CCK_SHORT_PREAMBLE)
244 #define RATE_OFDM_6M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_6M)
245 #define RATE_OFDM_9M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_9M)
246 #define RATE_OFDM_12M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_12M)
247 #define RATE_OFDM_18M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_18M)
248 #define RATE_OFDM_24M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_24M)
249 #define RATE_OFDM_36M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_36M)
250 #define RATE_OFDM_48M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_48M)
251 #define RATE_OFDM_54M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_54M)
253 #define RATE_MM_MCS_0 (TX_MODE_HT_MM | PHY_RATE_MCS0)
254 #define RATE_MM_MCS_1 (TX_MODE_HT_MM | PHY_RATE_MCS1)
255 #define RATE_MM_MCS_2 (TX_MODE_HT_MM | PHY_RATE_MCS2)
256 #define RATE_MM_MCS_3 (TX_MODE_HT_MM | PHY_RATE_MCS3)
257 #define RATE_MM_MCS_4 (TX_MODE_HT_MM | PHY_RATE_MCS4)
258 #define RATE_MM_MCS_5 (TX_MODE_HT_MM | PHY_RATE_MCS5)
259 #define RATE_MM_MCS_6 (TX_MODE_HT_MM | PHY_RATE_MCS6)
260 #define RATE_MM_MCS_7 (TX_MODE_HT_MM | PHY_RATE_MCS7)
261 #define RATE_MM_MCS_32 (TX_MODE_HT_MM | PHY_RATE_MCS32)
263 #define RATE_GF_MCS_0 (TX_MODE_HT_GF | PHY_RATE_MCS0)
264 #define RATE_GF_MCS_1 (TX_MODE_HT_GF | PHY_RATE_MCS1)
265 #define RATE_GF_MCS_2 (TX_MODE_HT_GF | PHY_RATE_MCS2)
266 #define RATE_GF_MCS_3 (TX_MODE_HT_GF | PHY_RATE_MCS3)
267 #define RATE_GF_MCS_4 (TX_MODE_HT_GF | PHY_RATE_MCS4)
268 #define RATE_GF_MCS_5 (TX_MODE_HT_GF | PHY_RATE_MCS5)
269 #define RATE_GF_MCS_6 (TX_MODE_HT_GF | PHY_RATE_MCS6)
270 #define RATE_GF_MCS_7 (TX_MODE_HT_GF | PHY_RATE_MCS7)
271 #define RATE_GF_MCS_32 (TX_MODE_HT_GF | PHY_RATE_MCS32)
273 #define RATE_TX_MODE_MASK BITS(6,7)
274 #define RATE_TX_MODE_OFFSET 6
275 #define RATE_CODE_GET_TX_MODE(_ucRateCode) ((_ucRateCode & RATE_TX_MODE_MASK) >> RATE_TX_MODE_OFFSET)
276 #define RATE_PHY_RATE_MASK BITS(0,5)
277 #define RATE_PHY_RATE_OFFSET 0
278 #define RATE_CODE_GET_PHY_RATE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_MASK) >> RATE_PHY_RATE_OFFSET)
279 #define RATE_PHY_RATE_SHORT_PREAMBLE BIT(4)
280 #define RATE_CODE_IS_SHORT_PREAMBLE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_SHORT_PREAMBLE)?TRUE:FALSE)
283 #define CHNL_LIST_SZ_2G 14
284 #define CHNL_LIST_SZ_5G 14
286 /*! CNM(STA_RECORD_T) related definition */
287 #define CFG_STA_REC_NUM 20
289 /* PHY TYPE bit definitions */
290 #define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX) /* HR/DSSS PHY (clause 18) */
291 #define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX) /* ERP PHY (clause 19) */
292 #define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX) /* OFDM 5 GHz PHY (clause 17) */
293 #define PHY_TYPE_BIT_HT BIT(PHY_TYPE_HT_INDEX) /* HT PHY (clause 20) */
296 /* PHY TYPE set definitions */
297 #define PHY_TYPE_SET_802_11ABGN (PHY_TYPE_BIT_OFDM | \
298 PHY_TYPE_BIT_HR_DSSS | \
302 #define PHY_TYPE_SET_802_11BGN (PHY_TYPE_BIT_HR_DSSS | \
306 #define PHY_TYPE_SET_802_11GN (PHY_TYPE_BIT_ERP | \
309 #define PHY_TYPE_SET_802_11AN (PHY_TYPE_BIT_OFDM | \
312 #define PHY_TYPE_SET_802_11ABG (PHY_TYPE_BIT_OFDM | \
313 PHY_TYPE_BIT_HR_DSSS | \
316 #define PHY_TYPE_SET_802_11BG (PHY_TYPE_BIT_HR_DSSS | \
319 #define PHY_TYPE_SET_802_11A (PHY_TYPE_BIT_OFDM)
321 #define PHY_TYPE_SET_802_11G (PHY_TYPE_BIT_ERP)
323 #define PHY_TYPE_SET_802_11B (PHY_TYPE_BIT_HR_DSSS)
325 #define PHY_TYPE_SET_802_11N (PHY_TYPE_BIT_HT)
328 /* Rate set bit definitions */
329 #define RATE_SET_BIT_1M BIT(RATE_1M_INDEX) /* Bit 0: 1M */
330 #define RATE_SET_BIT_2M BIT(RATE_2M_INDEX) /* Bit 1: 2M */
331 #define RATE_SET_BIT_5_5M BIT(RATE_5_5M_INDEX) /* Bit 2: 5.5M */
332 #define RATE_SET_BIT_11M BIT(RATE_11M_INDEX) /* Bit 3: 11M */
333 #define RATE_SET_BIT_22M BIT(RATE_22M_INDEX) /* Bit 4: 22M */
334 #define RATE_SET_BIT_33M BIT(RATE_33M_INDEX) /* Bit 5: 33M */
335 #define RATE_SET_BIT_6M BIT(RATE_6M_INDEX) /* Bit 6: 6M */
336 #define RATE_SET_BIT_9M BIT(RATE_9M_INDEX) /* Bit 7: 9M */
337 #define RATE_SET_BIT_12M BIT(RATE_12M_INDEX) /* Bit 8: 12M */
338 #define RATE_SET_BIT_18M BIT(RATE_18M_INDEX) /* Bit 9: 18M */
339 #define RATE_SET_BIT_24M BIT(RATE_24M_INDEX) /* Bit 10: 24M */
340 #define RATE_SET_BIT_36M BIT(RATE_36M_INDEX) /* Bit 11: 36M */
341 #define RATE_SET_BIT_48M BIT(RATE_48M_INDEX) /* Bit 12: 48M */
342 #define RATE_SET_BIT_54M BIT(RATE_54M_INDEX) /* Bit 13: 54M */
343 #define RATE_SET_BIT_HT_PHY BIT(RATE_HT_PHY_INDEX) /* Bit 14: BSS Selector */
346 /* Rate set definitions */
347 #define RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
349 RATE_SET_BIT_5_5M | \
352 #define RATE_SET_ERP (RATE_SET_BIT_1M | \
354 RATE_SET_BIT_5_5M | \
365 #define RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
374 #define RATE_SET_OFDM (RATE_SET_BIT_6M | \
383 #define RATE_SET_HT (RATE_SET_ERP)
384 //#define RATE_SET_HT (RATE_SET_ERP | RATE_SET_BIT_HT_PHY) /* NOTE(Kevin): TBD */
387 #define RATE_SET_ALL_ABG RATE_SET_ERP
389 #define BASIC_RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
392 #define BASIC_RATE_SET_HR_DSSS_ERP (RATE_SET_BIT_1M | \
394 RATE_SET_BIT_5_5M | \
397 #define BASIC_RATE_SET_ERP (RATE_SET_BIT_1M | \
399 RATE_SET_BIT_5_5M | \
405 #define BASIC_RATE_SET_OFDM (RATE_SET_BIT_6M | \
409 #define BASIC_RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
413 #define INITIAL_RATE_SET_RCPI_100 RATE_SET_ALL_ABG
415 #define INITIAL_RATE_SET_RCPI_80 (RATE_SET_BIT_1M | \
417 RATE_SET_BIT_5_5M | \
424 #define INITIAL_RATE_SET_RCPI_60 (RATE_SET_BIT_1M | \
426 RATE_SET_BIT_5_5M | \
430 #define INITIAL_RATE_SET(_rcpi) (INITIAL_RATE_SET_ ## _rcpi)
432 #define RCPI_100 100 /* -60 dBm */
433 #define RCPI_80 80 /* -70 dBm */
434 #define RCPI_60 60 /* -80 dBm */
437 /* The number of RCPI records used to calculate their average value */
438 #define MAX_NUM_RCPI_RECORDS 10
440 /* The number of RCPI records used to calculate their average value */
441 #define NO_RCPI_RECORDS -128
442 #define MAX_RCPI_DBM 0
443 #define MIN_RCPI_DBM -100
446 #define MAC_TX_RESERVED_FIELD 0 /* NOTE(Kevin): Should defined in tx.h */
448 #define MAX_ASSOC_ID (CFG_STA_REC_NUM) /* Available AID: 1 ~ 20(STA_REC_NUM) */
451 #define MAX_DEAUTH_INFO_COUNT 4 /* NOTE(Kevin): Used in auth.c */
452 #define MIN_DEAUTH_INTERVAL_MSEC 500 /* The minimum interval if continuously send Deauth Frame */
454 /* Authentication Type */
455 #define AUTH_TYPE_OPEN_SYSTEM BIT(AUTH_ALGORITHM_NUM_OPEN_SYSTEM)
456 #define AUTH_TYPE_SHARED_KEY BIT(AUTH_ALGORITHM_NUM_SHARED_KEY)
457 #define AUTH_TYPE_FAST_BSS_TRANSITION BIT(AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION)
459 /* Authentication Retry Limit */
460 #define TX_AUTH_ASSOCI_RETRY_LIMIT 2
461 #define TX_AUTH_ASSOCI_RETRY_LIMIT_FOR_ROAMING 1
463 /* WMM-2.2.1 WMM Information Element */
464 #define ELEM_MAX_LEN_WMM_INFO 7
466 /*******************************************************************************
468 ********************************************************************************
470 typedef UINT_16 PHY_TYPE, *P_PHY_TYPE;
471 typedef UINT_8 RCPI, *P_RCPI;
472 typedef UINT_8 ALC_VAL, *P_ALC_VAL;
474 typedef enum _ENUM_HW_BSSID_T {
480 typedef enum _ENUM_HW_MAC_ADDR_T {
484 } ENUM_HW_MAC_ADDR_T;
486 typedef enum _ENUM_HW_OP_MODE_T {
493 typedef enum _ENUM_TSF_T {
497 } ENUM_LOCAL_TSF_T, *P_ENUM_LOCAL_TSF_T;
499 typedef enum _HAL_TS_HW_UPDATE_MODE {
500 HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME,
501 HAL_TSF_HW_UPDATE_BY_TICK_ONLY,
502 HAL_TSF_HW_UPDATE_BY_RECEIVED_FRAME_ONLY,
503 HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME_AD_HOC
504 } HAL_TSF_HW_UPDATE_MODE;
507 typedef enum _ENUM_AC_T {
513 } ENUM_AC_T, *P_ENUM_AC_T;
516 /* The Type of Network been activated */
517 typedef enum _ENUM_NETWORK_TYPE_INDEX_T {
518 NETWORK_TYPE_AIS_INDEX = 0,
519 NETWORK_TYPE_P2P_INDEX,
520 NETWORK_TYPE_BOW_INDEX,
521 NETWORK_TYPE_INDEX_NUM
522 } ENUM_NETWORK_TYPE_INDEX_T;
525 /* The Type of STA Type. */
526 typedef enum _ENUM_STA_TYPE_INDEX_T {
527 STA_TYPE_LEGACY_INDEX = 0,
532 ENUM_STA_TYPE_INDEX_T;
534 #define STA_ROLE_BASE_INDEX 4
536 typedef enum _ENUM_STA_ROLE_INDEX_T {
537 STA_ROLE_ADHOC_INDEX = STA_ROLE_BASE_INDEX, //4
538 STA_ROLE_CLIENT_INDEX,
541 } ENUM_STA_ROLE_INDEX_T;
543 /* The Power State of a specific Network */
544 typedef enum _ENUM_PWR_STATE_T {
551 typedef enum _ENUM_PHY_TYPE_INDEX_T {
552 //PHY_TYPE_DSSS_INDEX, /* DSSS PHY (clause 15) -- Not used anymore */
553 PHY_TYPE_HR_DSSS_INDEX = 0, /* HR/DSSS PHY (clause 18) */
554 PHY_TYPE_ERP_INDEX, /* ERP PHY (clause 19) */
555 PHY_TYPE_ERP_P2P_INDEX, /* ERP PHY (clause 19) w/o HR/DSSS */
556 PHY_TYPE_OFDM_INDEX, /* OFDM 5 GHz PHY (clause 17) */
557 PHY_TYPE_HT_INDEX, /* HT PHY (clause 20) */
558 PHY_TYPE_INDEX_NUM // 5
559 } ENUM_PHY_TYPE_INDEX_T, *P_ENUM_PHY_TYPE_INDEX_T;
561 typedef enum _ENUM_ACPI_STATE_T {
568 /* The operation mode of a specific Network */
569 typedef enum _ENUM_OP_MODE_T {
570 OP_MODE_INFRASTRUCTURE = 0, /* Infrastructure/GC */
571 OP_MODE_IBSS, /* AdHoc */
572 OP_MODE_ACCESS_POINT, /* For GO */
573 OP_MODE_P2P_DEVICE, /* P2P Device */
576 } ENUM_OP_MODE_T, *P_ENUM_OP_MODE_T;
578 typedef enum _ENUM_CHNL_EXT_T {
583 } ENUM_CHNL_EXT_T, *P_ENUM_CHNL_EXT_T;
585 /* This starting freq of the band is unit of kHz */
586 typedef enum _ENUM_BAND_T {
591 } ENUM_BAND_T, *P_ENUM_BAND_T;
593 /* Provide supported channel list to other components in array format */
594 typedef struct _RF_CHANNEL_INFO_T {
597 } RF_CHANNEL_INFO_T, *P_RF_CHANNEL_INFO_T;
599 typedef enum _ENUM_RATE_INDEX_T {
600 RATE_1M_INDEX = 0, /* 1M */
601 RATE_2M_INDEX, /* 2M */
602 RATE_5_5M_INDEX, /* 5.5M */
603 RATE_11M_INDEX, /* 11M */
604 RATE_22M_INDEX, /* 22M */
605 RATE_33M_INDEX, /* 33M */
606 RATE_6M_INDEX, /* 6M */
607 RATE_9M_INDEX, /* 9M */
608 RATE_12M_INDEX, /* 12M */
609 RATE_18M_INDEX, /* 18M */
610 RATE_24M_INDEX, /* 24M */
611 RATE_36M_INDEX, /* 36M */
612 RATE_48M_INDEX, /* 48M */
613 RATE_54M_INDEX, /* 54M */
614 RATE_HT_PHY_INDEX, /* BSS Selector - HT PHY */
616 } ENUM_RATE_INDEX_T, *P_ENUM_RATE_INDEX_T;
618 typedef enum _ENUM_HT_RATE_INDEX_T {
619 HT_RATE_MCS0_INDEX = 0,
629 } ENUM_HT_RATE_INDEX_T, *P_ENUM_HT_RATE_INDEX_T;
631 typedef enum _ENUM_PREMABLE_OPTION_T {
632 PREAMBLE_DEFAULT_LONG_NONE = 0, /* LONG for PHY_TYPE_HR_DSSS, NONE for PHY_TYPE_OFDM */
633 PREAMBLE_OPTION_SHORT, /* SHORT mandatory for PHY_TYPE_ERP, SHORT option for PHY_TYPE_HR_DSSS */
634 PREAMBLE_HT_MIXED_MODE,
635 PREAMBLE_HT_GREEN_FIELD,
637 } ENUM_PREMABLE_OPTION_T, *P_ENUM_PREMABLE_OPTION_T;
639 typedef enum _ENUM_MODULATION_SYSTEM_T {
640 MODULATION_SYSTEM_CCK = 0,
641 MODULATION_SYSTEM_OFDM,
642 MODULATION_SYSTEM_HT20,
643 MODULATION_SYSTEM_HT40,
644 MODULATION_SYSTEM_NUM
645 } ENUM_MODULATION_SYSTEM_T, *P_ENUM_MODULATION_SYSTEM_T;
647 typedef enum _ENUM_MODULATION_TYPE_T {
648 MODULATION_TYPE_CCK_BPSK = 0,
649 MODULATION_TYPE_QPSK,
650 MODULATION_TYPE_16QAM,
651 MODULATION_TYPE_64QAM,
653 } ENUM_MODULATION_TYPE_T, *P_ENUM_MODULATION_TYPE_T;
655 typedef enum _ENUM_PS_FORWARDING_TYPE_T {
656 PS_FORWARDING_TYPE_NON_PS = 0,
657 PS_FORWARDING_TYPE_DELIVERY_ENABLED,
658 PS_FORWARDING_TYPE_NON_DELIVERY_ENABLED,
659 PS_FORWARDING_MORE_DATA_ENABLED,
660 PS_FORWARDING_TYPE_NUM
661 } ENUM_PS_FORWARDING_TYPE_T, *P_ENUM_PS_FORWARDING_TYPE_T;
663 typedef struct _DEAUTH_INFO_T {
664 UINT_8 aucRxAddr[MAC_ADDR_LEN];
665 OS_SYSTIME rLastSendTime;
666 } DEAUTH_INFO_T, *P_DEAUTH_INFO_T;
668 /*----------------------------------------------------------------------------*/
669 /* Information Element (IE) handlers */
670 /*----------------------------------------------------------------------------*/
671 typedef VOID (*PFN_APPEND_IE_FUNC)(P_ADAPTER_T, P_MSDU_INFO_T);
672 typedef VOID (*PFN_HANDLE_IE_FUNC)(P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T);
673 typedef VOID (*PFN_VERIFY_IE_FUNC)(P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T, PUINT_16);
674 typedef UINT_32 (*PFN_CALCULATE_VAR_IE_LEN_FUNC)(P_ADAPTER_T, ENUM_NETWORK_TYPE_INDEX_T, P_STA_RECORD_T);
676 typedef struct _APPEND_IE_ENTRY_T {
677 UINT_16 u2EstimatedIELen;
678 PFN_APPEND_IE_FUNC pfnAppendIE;
679 } APPEND_IE_ENTRY_T, *P_APPEND_IE_ENTRY_T;
681 typedef struct _APPEND_VAR_IE_ENTRY_T {
682 UINT_16 u2EstimatedFixedIELen; /* For Fixed Length */
683 PFN_CALCULATE_VAR_IE_LEN_FUNC pfnCalculateVariableIELen;
684 PFN_APPEND_IE_FUNC pfnAppendIE;
685 } APPEND_VAR_IE_ENTRY_T, *P_APPEND_VAR_IE_ENTRY_T;
687 typedef struct _HANDLE_IE_ENTRY_T {
689 PFN_HANDLE_IE_FUNC pfnHandleIE;
690 } HANDLE_IE_ENTRY_T, *P_HANDLE_IE_ENTRY_T;
692 typedef struct _VERIFY_IE_ENTRY_T {
694 PFN_VERIFY_IE_FUNC pfnVarifyIE;
695 } VERIFY_IE_ENTRY_T, *P_VERIFY_IE_ENTRY_T;
697 /*----------------------------------------------------------------------------*/
698 /* Parameters of User Configuration */
699 /*----------------------------------------------------------------------------*/
700 typedef enum _ENUM_PARAM_CONNECTION_POLICY_T {
701 CONNECT_BY_SSID_BEST_RSSI = 0,
702 CONNECT_BY_SSID_GOOD_RSSI_MIN_CH_LOAD,
703 CONNECT_BY_SSID_ANY, /* NOTE(Kevin): Needed by WHQL */
705 CONNECT_BY_CUSTOMIZED_RULE /* NOTE(Kevin): TBD */
706 } ENUM_PARAM_CONNECTION_POLICY_T, *P_ENUM_PARAM_CONNECTION_POLICY_T;
708 typedef enum _ENUM_PARAM_PREAMBLE_TYPE_T {
709 PREAMBLE_TYPE_LONG = 0,
711 PREAMBLE_TYPE_AUTO /*!< Try preamble short first, if fail tray preamble long. */
712 } ENUM_PARAM_PREAMBLE_TYPE_T, *P_ENUM_PARAM_PREAMBLE_TYPE_T;
714 /* This is enum defined for user to select a phy config listed in combo box */
715 typedef enum _ENUM_PARAM_PHY_CONFIG_T {
716 PHY_CONFIG_802_11ABG = 0, /*!< Can associated with 802.11abg AP but without n capability, Scan dual band. */
717 PHY_CONFIG_802_11BG, /*!< Can associated with 802_11bg AP, Scan single band and not report 5G BSSs. */
718 PHY_CONFIG_802_11G, /*!< Can associated with 802_11g only AP, Scan single band and not report 5G BSSs. */
719 PHY_CONFIG_802_11A, /*!< Can associated with 802_11a only AP, Scan single band and not report 2.4G BSSs. */
720 PHY_CONFIG_802_11B, /*!< Can associated with 802_11b only AP, Scan single band and not report 5G BSSs. */
721 PHY_CONFIG_802_11ABGN, /*!< Can associated with 802.11abgn AP, Scan dual band. */
722 PHY_CONFIG_802_11BGN, /*!< Can associated with 802_11bgn AP, Scan single band and not report 5G BSSs. */
723 PHY_CONFIG_802_11AN, /*!< Can associated with 802_11an AP, Scan single band and not report 2.4G BSSs. */
724 PHY_CONFIG_802_11GN, /*!< Can associated with 802_11gn AP, Scan single band and not report 5G BSSs. */
726 } ENUM_PARAM_PHY_CONFIG_T, *P_ENUM_PARAM_PHY_CONFIG_T;
728 /* This is enum defined for user to select an AP Mode */
729 typedef enum _ENUM_PARAM_AP_MODE_T {
730 AP_MODE_11B = 0, /*!< Create 11b BSS if we support 802.11abg/802.11bg. */
731 AP_MODE_MIXED_11BG, /*!< Create 11bg mixed BSS if we support 802.11abg/802.11bg/802.11g. */
732 AP_MODE_11G, /*!< Create 11g only BSS if we support 802.11abg/802.11bg/802.11g. */
733 AP_MODE_11G_P2P, /*!< Create 11g only BSS for P2P if we support 802.11abg/802.11bg/802.11g. */
734 AP_MODE_11A, /*!< Create 11a only BSS if we support 802.11abg. */
736 } ENUM_PARAM_AP_MODE_T, *P_ENUM_PARAM_AP_MODE_T;
739 /* Masks for determining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
740 #define NETWORK_TYPE_AIS_MASK BIT(NETWORK_TYPE_AIS_INDEX)
741 #define NETWORK_TYPE_P2P_MASK BIT(NETWORK_TYPE_P2P_INDEX)
742 #define NETWORK_TYPE_BOW_MASK BIT(NETWORK_TYPE_BOW_INDEX)
743 #define STA_TYPE_LEGACY_MASK BIT(STA_TYPE_LEGACY_INDEX)
744 #define STA_TYPE_P2P_MASK BIT(STA_TYPE_P2P_INDEX)
745 #define STA_TYPE_BOW_MASK BIT(STA_TYPE_BOW_INDEX)
746 #define STA_TYPE_ADHOC_MASK BIT(STA_ROLE_ADHOC_INDEX)
747 #define STA_TYPE_CLIENT_MASK BIT(STA_ROLE_CLIENT_INDEX)
748 #define STA_TYPE_AP_MASK BIT(STA_ROLE_AP_INDEX)
749 #define STA_TYPE_DLS_MASK BIT(STA_ROLE_DLS_INDEX)
751 /* Macros for obtaining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
752 #define IS_STA_IN_AIS(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX)
753 #define IS_STA_IN_P2P(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX)
754 #define IS_STA_IN_BOW(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX)
755 #define IS_STA_LEGACY_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_LEGACY_MASK)
756 #define IS_STA_P2P_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_P2P_MASK)
757 #define IS_STA_BOW_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_BOW_MASK)
758 #define IS_ADHOC_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_ADHOC_MASK)
759 #define IS_CLIENT_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_CLIENT_MASK)
760 #define IS_AP_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_AP_MASK)
761 #define IS_DLS_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_DLS_MASK)
763 /* The ENUM_STA_TYPE_T accounts for ENUM_NETWORK_TYPE_T and ENUM_STA_ROLE_INDEX_T.
764 * * It is a merged version of Network Type and STA Role.
766 typedef enum _ENUM_STA_TYPE_T {
767 STA_TYPE_LEGACY_AP = (STA_TYPE_LEGACY_MASK | STA_TYPE_AP_MASK),
768 STA_TYPE_LEGACY_CLIENT = (STA_TYPE_LEGACY_MASK | STA_TYPE_CLIENT_MASK),
769 STA_TYPE_ADHOC_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_ADHOC_MASK),
770 #if CFG_ENABLE_WIFI_DIRECT
771 STA_TYPE_P2P_GO = (STA_TYPE_P2P_MASK | STA_TYPE_AP_MASK),
772 STA_TYPE_P2P_GC = (STA_TYPE_P2P_MASK | STA_TYPE_CLIENT_MASK),
774 #if CFG_ENABLE_BT_OVER_WIFI
775 STA_TYPE_BOW_AP = (STA_TYPE_BOW_MASK | STA_TYPE_AP_MASK),
776 STA_TYPE_BOW_CLIENT = (STA_TYPE_BOW_MASK | STA_TYPE_CLIENT_MASK),
778 STA_TYPE_DLS_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_DLS_MASK)
779 } ENUM_STA_TYPE_T, *P_ENUM_STA_TYPE_T;
781 /* The type of BSS we discovered */
782 typedef enum _ENUM_BSS_TYPE_T {
783 BSS_TYPE_INFRASTRUCTURE = 1,
788 } ENUM_BSS_TYPE_T, *P_ENUM_BSS_TYPE_T;
790 /*----------------------------------------------------------------------------*/
792 /*----------------------------------------------------------------------------*/
793 //#if defined(WINDOWS_DDK) || defined(WINDOWS_CE)
797 #define MAX_NUM_SUPPORTED_CIPHER_SUITES 8 /* max number of supported cipher suites */
798 #if CFG_SUPPORT_802_11W
799 #define MAX_NUM_SUPPORTED_AKM_SUITES 8 /* max number of supported AKM suites */
801 #define MAX_NUM_SUPPORTED_AKM_SUITES 6 /* max number of supported AKM suites */
804 /* Structure of RSN Information */
805 typedef struct _RSN_INFO_T {
808 UINT_32 u4GroupKeyCipherSuite;
809 UINT_32 u4PairwiseKeyCipherSuiteCount;
810 UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_CIPHER_SUITES];
811 UINT_32 u4AuthKeyMgtSuiteCount;
812 UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_AKM_SUITES];
814 BOOLEAN fgRsnCapPresent;
815 } /*__KAL_ATTRIB_PACKED__*/ RSN_INFO_T, *P_RSN_INFO_T;
817 #define MAX_NUM_SUPPORTED_WAPI_AKM_SUITES 1 /* max number of supported AKM suites */
818 #define MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES 1 /* max number of supported cipher suites */
820 /* Structure of WAPI Information */
821 typedef struct _WAPI_INFO_T {
825 UINT_32 u4AuthKeyMgtSuiteCount;
826 UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_WAPI_AKM_SUITES];
827 UINT_32 u4PairwiseKeyCipherSuiteCount;
828 UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES];
829 UINT_32 u4GroupKeyCipherSuite;
832 UINT_8 aucBkid[1][16];
833 } /* __KAL_ATTRIB_PACKED__*/ WAPI_INFO_T, *P_WAPI_INFO_T;
835 //#if defined(WINDOWS_DDK) || defined(WINDOWS_CE)
840 #if CFG_ENABLE_WIFI_DIRECT
842 typedef struct _P2P_DEVICE_TYPE_T {
843 UINT_16 u2CategoryID;
844 UINT_16 u2SubCategoryID;
845 } P2P_DEVICE_TYPE_T, *P_P2P_DEVICE_TYPE_T;
847 typedef struct _P2P_DEVICE_DESC_T {
848 LINK_ENTRY_T rLinkEntry;
849 BOOLEAN fgDevInfoValid;
850 UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */
851 UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Interface Address. */
852 UINT_8 ucDeviceCapabilityBitmap;
853 UINT_8 ucGroupCapabilityBitmap;
854 UINT_16 u2ConfigMethod; /* Configure Method support. */
855 P2P_DEVICE_TYPE_T rPriDevType;
856 UINT_8 ucSecDevTypeNum;
857 P2P_DEVICE_TYPE_T arSecDevType[8]; // Reference to P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT
858 UINT_16 u2NameLength;
859 UINT_8 aucName[32]; // Reference to WPS_ATTRI_MAX_LEN_DEVICE_NAME
860 // TODO: Service Information or PasswordID valid?
861 } P2P_DEVICE_DESC_T, *P_P2P_DEVICE_DESC_T;
866 /*******************************************************************************
867 * P U B L I C D A T A
868 ********************************************************************************
871 /*******************************************************************************
872 * P R I V A T E D A T A
873 ********************************************************************************
875 static const UINT_8 aucRateIndex2RateCode[PREAMBLE_OPTION_NUM][RATE_NUM] = {
876 { /* Long Preamble */
877 RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */
878 RATE_CCK_2M_LONG, /* RATE_2M_INDEX */
879 RATE_CCK_5_5M_LONG, /* RATE_5_5M_INDEX */
880 RATE_CCK_11M_LONG, /* RATE_11M_INDEX */
881 RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */
882 RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */
883 RATE_OFDM_6M, /* RATE_6M_INDEX */
884 RATE_OFDM_9M, /* RATE_9M_INDEX */
885 RATE_OFDM_12M, /* RATE_12M_INDEX */
886 RATE_OFDM_18M, /* RATE_18M_INDEX */
887 RATE_OFDM_24M, /* RATE_24M_INDEX */
888 RATE_OFDM_36M, /* RATE_36M_INDEX */
889 RATE_OFDM_48M, /* RATE_48M_INDEX */
890 RATE_OFDM_54M, /* RATE_54M_INDEX */
892 { /* Short Preamble */
893 RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */
894 RATE_CCK_2M_SHORT, /* RATE_2M_INDEX */
895 RATE_CCK_5_5M_SHORT, /* RATE_5_5M_INDEX */
896 RATE_CCK_11M_SHORT, /* RATE_11M_INDEX */
897 RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */
898 RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */
899 RATE_OFDM_6M, /* RATE_6M_INDEX */
900 RATE_OFDM_9M, /* RATE_9M_INDEX */
901 RATE_OFDM_12M, /* RATE_12M_INDEX */
902 RATE_OFDM_18M, /* RATE_18M_INDEX */
903 RATE_OFDM_24M, /* RATE_24M_INDEX */
904 RATE_OFDM_36M, /* RATE_36M_INDEX */
905 RATE_OFDM_48M, /* RATE_48M_INDEX */
906 RATE_OFDM_54M, /* RATE_54M_INDEX */
908 { /* Mixed Mode(Option) */
909 RATE_MM_MCS_0, /* RATE_MCS0_INDEX, */
910 RATE_MM_MCS_1, /* RATE_MCS1_INDEX, */
911 RATE_MM_MCS_2, /* RATE_MCS2_INDEX, */
912 RATE_MM_MCS_3, /* RATE_MCS3_INDEX, */
913 RATE_MM_MCS_4, /* RATE_MCS4_INDEX, */
914 RATE_MM_MCS_5, /* RATE_MCS5_INDEX, */
915 RATE_MM_MCS_6, /* RATE_MCS6_INDEX, */
916 RATE_MM_MCS_7, /* RATE_MCS7_INDEX, */
917 RATE_MM_MCS_32 /* RATE_MCS32_INDEX, */
919 { /* Green Field(Option) */
920 RATE_GF_MCS_0, /* RATE_MCS0_INDEX, */
921 RATE_GF_MCS_1, /* RATE_MCS1_INDEX, */
922 RATE_GF_MCS_2, /* RATE_MCS2_INDEX, */
923 RATE_GF_MCS_3, /* RATE_MCS3_INDEX, */
924 RATE_GF_MCS_4, /* RATE_MCS4_INDEX, */
925 RATE_GF_MCS_5, /* RATE_MCS5_INDEX, */
926 RATE_GF_MCS_6, /* RATE_MCS6_INDEX, */
927 RATE_GF_MCS_7, /* RATE_MCS7_INDEX, */
928 RATE_GF_MCS_32 /* RATE_MCS32_INDEX, */
932 static const UINT_8 aucRateTableSize[PREAMBLE_OPTION_NUM] = {
940 /*******************************************************************************
942 ********************************************************************************
944 /* Macros to get and set the wireless LAN frame fields those are 16/32 bits in
946 #define WLAN_GET_FIELD_16(_memAddr_p, _value_p) \
948 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
949 *(PUINT_16)(_value_p) = ((UINT_16) __cp[0]) | ((UINT_16) __cp[1] << 8); \
952 #define WLAN_GET_FIELD_BE16(_memAddr_p, _value_p) \
954 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
955 *(PUINT_16)(_value_p) = ((UINT_16) __cp[0] << 8) | ((UINT_16) __cp[1]); \
958 #define WLAN_GET_FIELD_32(_memAddr_p, _value_p) \
960 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
961 *(PUINT_32)(_value_p) = ((UINT_32) __cp[0]) | ((UINT_32) __cp[1] << 8) | \
962 ((UINT_32) __cp[2] << 16) | ((UINT_32) __cp[3] << 24); \
965 #define WLAN_GET_FIELD_64(_memAddr_p, _value_p) \
967 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
968 *(PUINT_64)(_value_p) = \
969 ((UINT_64) __cp[0]) | ((UINT_64) __cp[1] << 8) | \
970 ((UINT_64) __cp[2] << 16) | ((UINT_64) __cp[3] << 24) | \
971 ((UINT_64) __cp[4] << 32) | ((UINT_64) __cp[5] << 40) | \
972 ((UINT_64) __cp[6] << 48) | ((UINT_64) __cp[7] << 56); \
975 #define WLAN_SET_FIELD_16(_memAddr_p, _value) \
977 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
978 __cp[0] = (UINT_8) (_value); \
979 __cp[1] = (UINT_8) ((_value) >> 8); \
982 #define WLAN_SET_FIELD_BE16(_memAddr_p, _value) \
984 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
985 __cp[0] = (UINT_8) ((_value) >> 8); \
986 __cp[1] = (UINT_8) (_value); \
989 #define WLAN_SET_FIELD_32(_memAddr_p, _value) \
991 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
992 __cp[0] = (UINT_8) (_value); \
993 __cp[1] = (UINT_8) ((_value) >> 8); \
994 __cp[2] = (UINT_8) ((_value) >> 16); \
995 __cp[3] = (UINT_8) ((_value) >> 24); \
1000 /*******************************************************************************
1001 * F U N C T I O N D E C L A R A T I O N S
1002 ********************************************************************************
1006 /*******************************************************************************
1008 ********************************************************************************
1011 #endif /* _WLAN_DEF_H */