xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/mvl88w8977/mlan/esa/common/IEEE_types.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file IEEE_types.h
2  *
3  *  @brief This file contains definitions relating to messages specified in the
4  *    IEEE 802.11 spec.
5  *
6  * Copyright (C) 2014-2017, Marvell International Ltd.
7  *
8  * This software file (the "File") is distributed by Marvell International
9  * Ltd. under the terms of the GNU General Public License Version 2, June 1991
10  * (the "License").  You may use, redistribute and/or modify this File in
11  * accordance with the terms and conditions of the License, a copy of which
12  * is available by writing to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
14  * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
15  *
16  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
18  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
19  * this warranty disclaimer.
20  */
21 
22 /******************************************************
23 Change log:
24     03/07/2014: Initial version
25 ******************************************************/
26 #ifndef _IEEE_TYPES_H_
27 #define _IEEE_TYPES_H_
28 
29 /*==========================================================================*/
30 /*                               INCLUDE FILES                              */
31 /*==========================================================================*/
32 #include "wltypes.h"
33 
34 /*==========================================================================*/
35 /*                            PUBLIC DEFINITIONS                            */
36 /*==========================================================================*/
37 
38 #define IS_BROADCAST(macaddr) ((*(UINT16 *)macaddr == 0xffff) &&        \
39                                (*(UINT16 *)((UINT8 *)macaddr+2) == 0xffff) && \
40                                (*(UINT16 *)((UINT8 *)macaddr+4) == 0xffff))
41 
42 #define IS_MULTICAST(macaddr) ((*(UINT8*)macaddr & 0x01) == 0x01)
43 
44 #define IS_GROUP(macaddr)     ((*(UINT8*)macaddr & 0x01) == 0x01)
45 
46 #define ADDR_NOT_EQUAL(a, b)  (((a)[0] != (b)[0]) || ((a)[1] != (b)[1]) || \
47                                ((a)[2] != (b)[2]) || ((a)[3] != (b)[3]) || \
48                                ((a)[4] != (b)[4]) || ((a)[5] != (b)[5]))
49 
50 #define LLC_SNAP_SIZE         6
51 #define ETHERTYPE_LEN         2
52 
53 #define IEEE_MSG_TYPE(Hdr_p)    ((Hdr_p)->FrmCtl.Type)
54 #define IEEE_MSG_SUBTYPE(Hdr_p) ((Hdr_p)->FrmCtl.Subtype)
55 
56 /*--------------------------------------------------------------*/
57 /* Reason Codes - these codes are used in management message    */
58 /* frame bodies to indicate why an action is taking place (such */
59 /* as a disassociation or deauthentication).                    */
60 /*--------------------------------------------------------------*/
61 #define IEEEtypes_REASON_RSVD                      0
62 #define IEEEtypes_REASON_UNSPEC                    1
63 #define IEEEtypes_REASON_PRIOR_AUTH_INVALID        2
64 #define IEEEtypes_REASON_DEAUTH_LEAVING            3
65 #define IEEEtypes_REASON_DISASSOC_INACTIVE         4
66 #define IEEEtypes_REASON_DISASSOC_AP_BUSY          5
67 #define IEEEtypes_REASON_CLASS2_NONAUTH            6
68 #define IEEEtypes_REASON_CLASS3_NONASSOC           7
69 #define IEEEtypes_REASON_DISASSOC_STA_HASLEFT      8
70 #define IEEEtypes_REASON_CANT_ASSOC_NONAUTH        9
71 /***************802.11h Reasons***************/
72 #define IEEEtypes_REASON_DISASSOC_BAD_POWERCAP    10
73 #define IEEEtypes_REASON_DISASSOC_BAD_SUPPCHAN    11
74 /***************802.11v Reasons***************/
75 #define IEEEtypes_REASON_BSS_TRANSITION_MGMT      12
76 /***************WPA Reasons*******************/
77 #define IEEEtypes_REASON_INVALID_IE               13
78 #define IEEEtypes_REASON_MIC_FAILURE              14
79 #define IEEEtypes_REASON_4WAY_HANDSHK_TIMEOUT     15
80 #define IEEEtypes_REASON_GRP_KEY_UPD_TIMEOUT      16
81 #define IEEEtypes_REASON_IE_4WAY_DIFF             17
82 #define IEEEtypes_REASON_INVALID_MCAST_CIPHER     18
83 #define IEEEtypes_REASON_INVALID_UNICAST_CIPHER   19
84 #define IEEEtypes_REASON_INVALID_AKMP             20
85 #define IEEEtypes_REASON_UNSUPT_RSN_VER           21
86 #define IEEEtypes_REASON_INVALID_RSN_CAP          22
87 #define IEEEtypes_REASON_8021X_AUTH_FAIL          23
88 #define IEEEtypes_REASON_CIPHER_POLICY_REJECT     24
89 /*************** 802.11z(TDLS) Reasons*************/
90 #define IEEEtypes_REASON_TDLS_TEARDOWN_TDLSPEER_UNREACHABLE 25
91 #define IEEEtypes_REASON_TDLS_TEARDOWN_UNSPEC     26
92 /***************802.11e Reasons***************/
93 #define IEEEtypes_REASON_DISASSOC_UNSPEC_QOS      32
94 #define IEEEtypes_REASON_DISASSOC_QAP_NO_BNDWDTH  33
95 #define IEEEtypes_REASON_DISASSOC_FRM_LOSS_BAD_CH 34
96 #define IEEEtypes_REASON_DISASSOC_QSTA_VIOL_TXOP  35
97 #define IEEEtypes_REASON_REQ_PEER_LEAVE_QBSS      36
98 #define IEEEtypes_REASON_REQ_PEER_NO_THANKS       37
99 #define IEEEtypes_REASON_REQ_PEER_ACM_MISMATCH    38
100 #define IEEEtypes_REASON_REQ_PEER_TIMEOUT         39
101 #define IEEEtypes_REASON_PEER_QSTA_NO_SUPP_CIPHER 45
102 /*********************************************/
103 
104 /*------------------------------------------------------------*/
105 /* Status Codes - these codes are used in management message  */
106 /* frame bodies to indicate the results of an operation (such */
107 /* as association, reassociation, and authentication).        */
108 /*------------------------------------------------------------*/
109 #define IEEEtypes_STATUS_SUCCESS                           0
110 #define IEEEtypes_STATUS_UNSPEC_FAILURE                    1
111 
112 /****************BEGIN: 802.11z(TDLS) status codes********/
113 #define IEEEtypes_STATUS_TDLS_WAKEUPSCHEDULE_REJECTED_BUT_ALT_PROVIDED 2
114 #define IEEEtypes_STATUS_TDLS_WAKEUPSCHEDULE_REJECTED      3
115 #define IEEEtypes_STATUS_SECURITY_DISABLED                 5
116 #define IEEEtypes_STATUS_UNACCEPTABLE_LIFETIME             6
117 #define IEEEtypes_STATUS_NOT_IN_SAME_BSS                   7
118 /****************END:   802.11z(TDLS) status codes********/
119 #define IEEEtypes_STATUS_CAPS_UNSUPPORTED                 10
120 #define IEEEtypes_STATUS_REASSOC_NO_ASSOC                 11
121 #define IEEEtypes_STATUS_ASSOC_DENIED_UNSPEC              12
122 #define IEEEtypes_STATUS_UNSUPPORTED_AUTHALG              13
123 #define IEEEtypes_STATUS_RX_AUTH_NOSEQ                    14
124 #define IEEEtypes_STATUS_CHALLENGE_FAIL                   15
125 #define IEEEtypes_STATUS_AUTH_TIMEOUT                     16
126 #define IEEEtypes_STATUS_ASSOC_DENIED_BUSY                17
127 #define IEEEtypes_STATUS_ASSOC_DENIED_RATES               18
128 #define IEEEtypes_STATUS_ASSOC_DENIED_NOSHORT             19
129 #define IEEEtypes_STATUS_ASSOC_DENIED_NOPBCC              20
130 #define IEEEtypes_STATUS_ASSOC_DENIED_NOAGILITY           21
131 #define IEEEtypes_STATUS_ASSOC_DENIED_SPECMGMT_REQD       22
132 #define IEEEtypes_STATUS_ASSOC_DENIED_BAD_POWERCAP        23
133 #define IEEEtypes_STATUS_ASSOC_DENIED_BAD_SUPPCHAN        24
134 #define IEEEtypes_STATUS_ASSOC_DENIED_NOSHORTSLOTTIME     25
135 #define IEEEtypes_STATUS_ASSOC_DENIED_NODSSSOFDM          26
136 
137 #define IEEEtypes_STATUS_R0KH_UNAVAILABLE                 28
138 
139 #define IEEEtypes_STATUS_TEMP_REJECTION                   30
140 #define IEEEtypes_STATUS_ROBUST_MGMT_VIOLAION             31
141 #define IEEEtypes_STATUS_UNSPEC_QOS_FAILURE               32
142 #define IEEEtypes_STATUS_ASSOC_DENIED_QAP_INSUFF_BNDWDTH  33
143 #define IEEEtypes_STATUS_ASSOC_DENIED_EXC_FRM_LOSS_BAD_CH 34
144 #define IEEEtypes_STATUS_ASSOC_DENIED_STA_NO_QOS_SUPP     35
145 
146 #define IEEEtypes_STATUS_REQ_DECLINED                     37
147 #define IEEEtypes_STATUS_REQ_FAIL_INVALID_PARAMS          38
148 #define IEEEtypes_STATUS_FAIL_TS_AP_THINKS_ITS_SMART_THO  39
149 #define IEEEtypes_STATUS_INVALID_IE                       40
150 #define IEEEtypes_STATUS_INVALID_GROUP_CIPHER             41
151 #define IEEEtypes_STATUS_INVALID_PAIRWISE_CIPHER          42
152 #define IEEEtypes_STATUS_INVALID_AKMP                     43
153 #define IEEEtypes_STATUS_UNSUPPORTED_RSN_VER              44
154 #define IEEEtypes_STATUS_INVALID_RSN_CAPABILITIES         45
155 #define IEEEtypes_STATUS_CIPHER_POLICY_REJECT             46
156 #define IEEEtypes_STATUS_FAIL_TS_TRY_LATER_AFTER_TS_DELAY 47
157 #define IEEEtypes_STATUS_DIRECT_LINK_NOT_ALLOWED          48
158 #define IEEEtypes_STATUS_DEST_STA_NOT_IN_QBSS             49
159 #define IEEEtypes_STATUS_DEST_STA_NOT_A_QSTA              50
160 #define IEEEtypes_STATUS_LISTEN_INTERVAL_TOO_LARGE        51
161 #define IEEEtypes_STATUS_INVALID_FT_ACT_FRAME_COUNT       52
162 #define IEEEtypes_STATUS_INVALID_PMKID                    53
163 #define IEEEtypes_STATUS_INVALID_MDIE                     54
164 #define IEEEtypes_STATUS_INVALID_FTIE                     55
165 #define IEEEtypes_STATUS_REQ_TCLAS_NOT_SUPPORTED          56
166 #define IEEEtypes_STATUS_INSF_TCLAS_RSOURCES              57
167 #define IEEEtypes_STATUS_TS_FAIL_TRANS_SUGGESTED          58
168 #define IEEEtypes_STATUS_UAPSD_COEX_NOT_SUPPORTED         59
169 #define IEEEtypes_STATUS_REQ_UAPSD_COEX_MODE_NOT_SUP      60
170 #define IEEEtypes_STATUS_REQ_INVL_WITH_UAPSD_COEX_NOT_SUP 61
171 #define IEEEtypes_STATUS_INVALID_CONTENTS_OF_RSNIE        72
172 
173 /*--------------------------------------------*/
174 /* Various sizes used in IEEE 802.11 messages */
175 /*--------------------------------------------*/
176 #define IEEEtypes_ADDRESS_SIZE         6
177 #define IEEEtypes_BITMAP_SIZE          251
178 #define IEEEtypes_CHALLENGE_TEXT_SIZE  128
179 #define IEEEtypes_CHALLENGE_TEXT_LEN   128
180 #define IEEEtypes_MAX_DATA_RATES       8
181 #define IEEEtypes_MAX_DATA_BODY_LEN    2312
182 #define IEEEtypes_MAX_MGMT_BODY_LEN    2312
183 #define IEEEtypes_SSID_SIZE            32
184 #define IEEEtypes_TIME_STAMP_SIZE      8
185 #define IEEEtypes_MAX_CHANNELS         14
186 #define IEEEtypes_MAX_BSS_DESCRIPTS    16
187 #define IEEEtypes_MAX_DATA_RATES_G     14
188 #define IEEEtypes_COUNTRY_CODE_SIZE    3
189 #define IEEEtypes_COUNTRY_MAX_TRIPLETS 83
190 
191 /*---------------------------------------------------------------------*/
192 /* Define masks used to extract fields from the capability information */
193 /* structure in a beacon message.                                      */
194 /*---------------------------------------------------------------------*/
195 #define IEEEtypes_CAP_INFO_ESS              1
196 #define IEEEtypes_CAP_INFO_IBSS             2
197 #define IEEEtypes_CAP_INFO_CF_POLLABLE      4
198 #define IEEEtypes_CAP_INFO_CF_POLL_RQST     8
199 #define IEEEtypes_CAP_INFO_PRIVACY          16
200 #define IEEEtypes_CAP_INFO_SHORT_PREAMB     32
201 #define IEEEtypes_CAP_INFO_PBCC             64
202 #define IEEEtypes_CAP_INFO_CHANGE_AGILITY   128
203 #define IEEEtypes_CAP_INFO_SHORT_SLOT_TIME  0x0400
204 #define IEEEtypes_CAP_INFO_DSSS_OFDM        0x2000
205 
206 /*---------------------------*/
207 /* Miscellaneous definitions */
208 /*---------------------------*/
209 #define IEEEtypes_PROTOCOL_VERSION     0
210 
211 #define IEEEtypes_BASIC_RATE_FLAG      0x80
212 /* */
213 /* Used to determine which rates in a list are designated as basic rates */
214 /* */
215 
216 #define IEEEtypes_SUPP_RATE_MASK     0x7F
217 
218 #define IEEE_DATA_RATE_1Mbps    2
219 #define IEEE_DATA_RATE_2Mbps    4
220 #define IEEE_DATA_RATE_5_5Mbps  11
221 #define IEEE_DATA_RATE_11Mbps   22
222 
223 #define IEEE_DATA_RATE_6Mbps    12
224 #define IEEE_DATA_RATE_9Mbps    18
225 #define IEEE_DATA_RATE_12Mbps   24
226 #define IEEE_DATA_RATE_18Mbps   36
227 #define IEEE_DATA_RATE_24Mbps   48
228 #define IEEE_DATA_RATE_36Mbps   72
229 #define IEEE_DATA_RATE_48Mbps   96
230 #define IEEE_DATA_RATE_54Mbps   108
231 
232 /* */
233 /* Used to mask off the basic rate flag, if one exists, for given */
234 /* data rates */
235 /* */
236 
237 #define IEEEtypes_RATE_MIN 2
238 /* */
239 /* The minimum allowable data rate in units of kb/s */
240 /* */
241 
242 #define IEEEtypes_RATE_MAX 127
243 /* */
244 /* The maximum allowable data rate in units of kb/s */
245 /* */
246 
247 #define IEEEtypes_TIME_UNIT 1024
248 /* */
249 /* The number of microseconds in 1 time unit, as specified in the */
250 /* 802.11 spec */
251 /* */
252 #define CONVERT_TU_TO_MILLISECOND(x)    (x * 1024 / 1000)
253 #define CONVERT_TU_TO_MICROSECOND(x)    (x * 1024)
254 
255 /**
256  * 802.11 frame classes
257  */
258 #define IEEEtypes_CLASS1_FRAME 1
259 #define IEEEtypes_CLASS2_FRAME 2
260 #define IEEEtypes_CLASS3_FRAME 3
261 
262 /*
263  * Structure of an internet header, naked of options.
264  *
265  * ip_len and ip_off are sint16, rather than UINT16
266  * pragmatically since otherwise unsigned comparisons can result
267  * against negative integers quite easily, and fail in subtle ways.
268  */
269 typedef MLAN_PACK_START struct {
270 #if 1				//BYTE_ORDER == LITTLE_ENDIAN
271 	UINT8 ip_hl:4;		/* header length */
272 	UINT8 ip_v:4;		/* version */
273 #endif
274 	UINT8 ip_tos;		/* type of service */
275 	sint16 ip_len;		/* total length */
276 	UINT16 ip_id;		/* identification */
277 	sint16 ip_off;		/* fragment offset field */
278 	UINT8 ip_ttl;		/* time to live */
279 	UINT8 ip_p;		/* protocol */
280 	UINT16 ip_sum;		/* checksum */
281 	UINT32 ip_src;		// source ip addr
282 	UINT32 ip_dst;		// dest ip address
283 } MLAN_PACK_END ip_hdr_t;
284 #define    IP_DF 0x4000		/* dont fragment flag */
285 #define    IP_MF 0x2000		/* more fragments flag */
286 #define    IP_OFFMASK 0x1fff	/* mask for fragmenting bits */
287 
288 #define    IP_V4           4
289 #define    IP_V6           6
290 #define    IP_PROT_TCP     0x06
291 #define    IP_PROT_UDP     0x11
292 
293 typedef MLAN_PACK_START struct {
294 	UINT8 priority:4;
295 	UINT8 ip_v:4;
296 	UINT8 flow_lbl[3];
297 	UINT16 payload_len;
298 	UINT8 next_hdr;
299 	UINT8 hop_limit;
300 	UINT8 ip_src[16];	/* source ip addr */
301 	UINT8 ip_dst[16];	/* dest ip address */
302 } MLAN_PACK_END ipv6_hdr_t;
303 
304 #define ETHTYPE_ARP         0x0806
305 #define ETHTYPE_IP          0x0800
306 #define ARP_OP_REQ          1
307 #define ARP_OP_RESP         2
308 #define ETHTYPE_IPV6        0x86DD
309 #define ICMPV6_TYPE         0x3a
310 
311 /* See RFC 826 for ARP protocol description. */
312 typedef MLAN_PACK_START struct {
313 	UINT16 ar_hrd;		// hardware address space
314 	UINT16 ar_pro;		// prototcol address space
315 	UINT8 ar_hln;		// byte length of hardware addr
316 	UINT8 ar_pln;		// byte length of protocol addr
317 	UINT16 ar_op;		// ARP opcode
318 } MLAN_PACK_END arp_hdr_t;
319 
320 typedef MLAN_PACK_START struct {
321 	arp_hdr_t hdr;		// arp header
322 	UINT8 ar_sha[IEEEtypes_ADDRESS_SIZE];	// sender hardware addr
323 	UINT8 ar_spa[4];	// sender protocol addr
324 	UINT8 ar_tha[IEEEtypes_ADDRESS_SIZE];	// target hardware addr
325 	UINT8 ar_tpa[4];	// target protocol addr
326 } MLAN_PACK_END arp_t;
327 
328 /* icmp header struct of echo request and echo reply */
329 typedef MLAN_PACK_START struct {
330 	UINT8 type;
331 	UINT8 code;
332 	UINT16 sum;
333 	UINT16 id;
334 	UINT16 seq;
335 } MLAN_PACK_END icmp_hdr_t;
336 #define ICMP_ECHO_REQ       8
337 #define ICMP_ECHO_REPLY     0
338 
339 typedef MLAN_PACK_START struct {
340 	UINT8 type;
341 	UINT8 icode;
342 	UINT16 csum;
343 	UINT32 reserved;
344 	UINT8 target_addr[16];
345 } MLAN_PACK_END icmpv6_nsol_t;
346 #define ICMPV6_TYPE_NSOL 0x87
347 #define ICMPV6_TYPE_NADV 0x88
348 
349 #define ICMPV6_NADV_FLAG_RTR (1<<31)
350 #define ICMPV6_NADV_FLAG_SOL (1<<30)
351 #define ICMPV6_NADV_FLAG_OVR (1<<29)
352 
353 #define ICMPV6_OPT_TYPE_TLA  (0x2)
354 #define ICMPV6_OPT_TYPE_TLA_LEN (0x1)
355 
356 typedef MLAN_PACK_START struct {
357 	UINT8 type;
358 	UINT8 icode;
359 	UINT16 csum;
360 	UINT32 reserved;
361 	UINT8 target_addr[16];
362 	UINT8 icmp_option_type;
363 	UINT8 icmp_option_length;
364 	UINT8 macAddr[6];
365 } MLAN_PACK_END icmpv6_nadv_t;
366 
367 /*
368 *****************************************************************************
369 **
370 **
371 **                       802.1x Types
372 **
373 **
374 *****************************************************************************
375 */
376 typedef MLAN_PACK_START enum {
377 	IEEE_8021X_PACKET_TYPE_EAP_PACKET = 0,
378 	IEEE_8021X_PACKET_TYPE_EAPOL_START = 1,
379 	IEEE_8021X_PACKET_TYPE_EAPOL_LOGOFF = 2,
380 	IEEE_8021X_PACKET_TYPE_EAPOL_KEY = 3,
381 	IEEE_8021X_PACKET_TYPE_ASF_ALERT = 4,
382 
383 } MLAN_PACK_END IEEEtypes_8021x_PacketType_e;
384 
385 typedef MLAN_PACK_START enum {
386 	IEEE_8021X_CODE_TYPE_REQUEST = 1,
387 	IEEE_8021X_CODE_TYPE_RESPONSE = 2,
388 	IEEE_8021X_CODE_TYPE_SUCCESS = 3,
389 	IEEE_8021X_CODE_TYPE_FAILURE = 4,
390 
391 } MLAN_PACK_END IEEEtypes_8021x_CodeType_e;
392 
393 /*
394 *****************************************************************************
395 **
396 **
397 **                       802.11 PHY Types
398 **
399 **
400 *****************************************************************************
401 */
402 typedef MLAN_PACK_START enum {
403 	IEEE_PHY_TYPE_UNKNOWN = 0,
404 
405 	IEEE_PHY_TYPE_FHSS_2_4_GHz = 1,
406 	IEEE_PHY_TYPE_DSSS_2_4_GHz = 2,
407 	IEEE_PHY_TYPE_IR_BASEBAND = 3,
408 	IEEE_PHY_TYPE_OFDM_5GHz = 4,
409 	IEEE_PHY_TYPE_HRDSSS = 5,
410 	IEEE_PHY_TYPE_ERP = 6,
411 
412 } MLAN_PACK_END IEEEtypes_PhyType_e;
413 
414 /*
415 *****************************************************************************
416 **
417 **
418 **                         802.11 Message Types
419 **
420 **
421 *****************************************************************************
422 */
423 typedef enum {
424 	IEEE_TYPE_MANAGEMENT = 0,
425 	IEEE_TYPE_CONTROL,
426 	IEEE_TYPE_DATA
427 } IEEEtypes_MsgType_e;
428 
429 /*
430 *****************************************************************************
431 **
432 **
433 **                      802.11 Mangagement SubTypes
434 **
435 **
436 *****************************************************************************
437 */
438 typedef enum {
439 	IEEE_MSG_ASSOCIATE_RQST = 0,
440 	IEEE_MSG_ASSOCIATE_RSP,
441 	IEEE_MSG_REASSOCIATE_RQST,
442 	IEEE_MSG_REASSOCIATE_RSP,
443 	IEEE_MSG_PROBE_RQST,
444 	IEEE_MSG_PROBE_RSP,
445 	IEEE_MSG_BEACON = 8,
446 	IEEE_MSG_ATIM,
447 	IEEE_MSG_DISASSOCIATE,
448 	IEEE_MSG_AUTHENTICATE,
449 	IEEE_MSG_DEAUTHENTICATE,
450 	IEEE_MSG_ACTION
451 } IEEEtypes_MgmtSubType_e;
452 
453 /*
454 *****************************************************************************
455 **
456 **
457 **                    802.11 Control Frame SubTypes
458 **
459 **
460 *****************************************************************************
461 */
462 typedef enum {
463 	BF_RPRT_POLL = 4,
464 	NDPA = 5,
465 	BAR = 8,
466 	BA = 9,
467 	PS_POLL = 10,
468 	RTS = 11,
469 	CTS = 12,
470 	ACK = 13,
471 	CF_END = 14,
472 	CF_END_CF_ACK = 15,
473 } IEEEtypes_CtlSubType_e;
474 
475 /*
476 *****************************************************************************
477 **
478 **
479 **                    802.11 Data Frame SubTypes
480 **
481 **
482 *****************************************************************************
483 */
484 typedef enum {
485 	DATA = 0,
486 	DATA_CF_ACK = 1,
487 	DATA_CF_POLL = 2,
488 	DATA_CF_ACK_CF_POLL = 3,
489 	NULL_DATA = 4,
490 	CF_ACK = 5,
491 	CF_POLL = 6,
492 	CF_ACK_CF_POLL = 7,
493 	QOS_DATA = 8,
494 	QOS_DATA_CF_ACK = 9,
495 	QOS_DATA_CF_POLL = 10,
496 	QOS_DATA_CF_ACK_CF_POLL = 11,
497 	QOS_NULL = 12,
498 	RESERVED_13 = 13,
499 	QOS_CF_POLL_NO_DATA = 14,
500 	QOS_CF_ACK_CF_POLL_NO_DATA = 15
501 } IEEEtypes_DataSubType_e;
502 
503 /*
504 *****************************************************************************
505 **
506 **
507 **                    802.11 Action Frame Categories
508 **
509 **
510 *****************************************************************************
511 */
512 typedef MLAN_PACK_START enum {
513 	IEEE_MGMT_ACTION_CATEGORY_SPECTRUM_MGMT = 0,
514 	IEEE_MGMT_ACTION_CATEGORY_QOS = 1,
515 	IEEE_MGMT_ACTION_CATEGORY_DLS = 2,
516 	IEEE_MGMT_ACTION_CATEGORY_BLOCK_ACK = 3,
517 	IEEE_MGMT_ACTION_CATEGORY_UNPROTECT_PUBLIC = 4,
518 	IEEE_MGMT_ACTION_CATEGORY_RADIO_RSRC = 5,
519 	IEEE_MGMT_ACTION_CATEGORY_FAST_BSS_TRANS = 6,
520 	IEEE_MGMT_ACTION_CATEGORY_HT = 7,
521 	IEEE_MGMT_ACTION_CATEGORY_SA_QUERY = 8,
522 	IEEE_MGMT_ACTION_CATEGORY_PROTECT_PUBLIC = 9,
523 	IEEE_MGMT_ACTION_CATEGORY_PROTECT_WNM = 10,
524 	IEEE_MGMT_ACTION_CATEGORY_UNPROTECT_WNM = 11,
525 	IEEE_MGMT_ACTION_CATEGORY_TDLS = 12,
526 
527 	IEEE_MGMT_ACTION_CATEGORY_WMM_TSPEC = 17,
528 	IEEE_MGMT_ACTION_CATEGORY_VHT = 21,
529 	IEEE_MGMT_ACTION_CATEGORY_PROTECT_VENDOR_SPECIFIC = 126,
530 	IEEE_MGMT_ACTION_CATEGORY_VENDOR_SPECIFIC = 127
531 } MLAN_PACK_END IEEEtypes_ActionCategory_e;
532 
533 /*
534 ** The possible types of commands sent from the SME
535 */
536 typedef enum {
537 	SME_CMD_NONE,
538 
539 	SME_CMD_AUTHENTICATE,
540 	SME_CMD_ASSOCIATE,
541 	SME_CMD_REASSOCIATE,
542 
543 	SME_CMD_DEAUTHENTICATE,
544 	SME_CMD_DISASSOCIATE,
545 
546 	SME_CMD_START,
547 	SME_CMD_JOIN,
548 
549 	SME_CMD_RESET,
550 	SME_CMD_SCAN,
551 
552 } IEEEtypes_SmeCmd_e;
553 
554 /*
555 ** The possible types of Basic Service Sets
556 */
557 typedef enum {
558 	BSS_INFRASTRUCTURE = 1,
559 	BSS_INDEPENDENT,
560 	BSS_ANY,
561 	BSS_TDLS,
562 	// Firmware internal BSS types only
563 	BSS_BT_AMP = 0xF0,
564 	BSS_LAST = 0xFF
565 } IEEEtypes_Bss_e;
566 
567 /*
568 **  802.11 Element and Subelement IDs
569 */
570 typedef MLAN_PACK_START enum {
571 	ELEM_ID_SSID = 0,
572 	ELEM_ID_SUPPORTED_RATES = 1,
573 	ELEM_ID_FH_PARAM_SET = 2,
574 	ELEM_ID_DS_PARAM_SET = 3,
575 	ELEM_ID_CF_PARAM_SET = 4,
576 	ELEM_ID_TIM = 5,
577 	ELEM_ID_IBSS_PARAM_SET = 6,
578 	ELEM_ID_COUNTRY = 7,
579 	ELEM_ID_HOP_PARAM = 8,
580 	ELEM_ID_HOP_TABLE = 9,
581 	ELEM_ID_REQUEST = 10,
582 	ELEM_ID_BSS_LOAD = 11,
583 	ELEM_ID_EDCA_PARAM_SET = 12,
584 	ELEM_ID_TSPEC = 13,
585 	ELEM_ID_TCLAS = 14,
586 	ELEM_ID_SCHEDULE = 15,
587 	ELEM_ID_CHALLENGE_TEXT = 16,
588 
589 	ELEM_ID_POWER_CONSTRAINT = 32,
590 	ELEM_ID_POWER_CAPABILITY = 33,
591 	ELEM_ID_TPC_REQUEST = 34,
592 	ELEM_ID_TPC_REPORT = 35,
593 	ELEM_ID_SUPPORTED_CHANNELS = 36,
594 	ELEM_ID_CHANNEL_SWITCH_ANN = 37,
595 	ELEM_ID_MEASUREMENT_REQ = 38,
596 	ELEM_ID_MEASUREMENT_RPT = 39,
597 	ELEM_ID_QUIET = 40,
598 	ELEM_ID_IBSS_DFS = 41,
599 	ELEM_ID_ERP_INFO = 42,
600 	ELEM_ID_TS_DELAY = 43,
601 	ELEM_ID_TCLAS_PROCESS = 44,
602 	ELEM_ID_HT_CAPABILITY = 45,
603 	ELEM_ID_QOS_CAPABILITY = 46,
604 
605 	ELEM_ID_RSN = 48,
606 
607 	ELEM_ID_EXT_SUPPORTED_RATES = 50,
608 	ELEM_ID_AP_CHANNEL_REPORT = 51,
609 	ELEM_ID_NEIGHBOR_REPORT = 52,
610 	ELEM_ID_RCPI = 53,
611 	ELEM_ID_MOBILITY_DOMAIN = 54,
612 	ELEM_ID_FAST_BSS_TRANS = 55,
613 	ELEM_ID_TIMEOUT_INTERVAL = 56,
614 	ELEM_ID_RIC_DATA = 57,
615 	ELEM_ID_DSE_REGISTERED_LOC = 58,
616 	ELEM_ID_SUPPORTED_REGCLASS = 59,
617 	ELEM_ID_EXT_CHAN_SWITCH_ANN = 60,
618 	ELEM_ID_HT_INFORMATION = 61,
619 	ELEM_ID_SECONDARY_CHAN_OFFSET = 62,
620 	ELEM_ID_BSS_ACCESS_DELAY = 63,
621 	ELEM_ID_ANTENNA_INFO = 64,
622 	ELEM_ID_RSNI = 65,
623 	ELEM_ID_MEAS_PILOT_TX_INFO = 66,
624 	ELEM_ID_BSS_AVAIL_ADM_CAP = 67,
625 	ELEM_ID_BSS_AC_ACCESS_DELAY = 68,
626 
627 	ELEM_ID_RRM_ENABLED_CAP = 70,
628 	ELEM_ID_MULTI_BSSID = 71,
629 	ELEM_ID_2040_BSS_COEXISTENCE = 72,
630 	ELEM_ID_2040_BSS_INTOL_CHRPT = 73,
631 	ELEM_ID_OBSS_SCAN_PARAM = 74,
632 	ELEM_ID_RIC_DESCRIPTOR = 75,
633 	ELEM_ID_MANAGEMENT_MIC = 76,
634 
635 	ELEM_ID_EVENT_REQUEST = 78,
636 	ELEM_ID_EVENT_REPORT = 79,
637 	ELEM_ID_DIAG_REQUEST = 80,
638 	ELEM_ID_DIAG_REPORT = 81,
639 	ELEM_ID_LOCATION_PARAM = 82,
640 	ELEM_ID_NONTRANS_BSSID_CAP = 83,
641 	ELEM_ID_SSID_LIST = 84,
642 	ELEM_ID_MBSSID_INDEX = 85,
643 	ELEM_ID_FMS_DESCRIPTOR = 86,
644 	ELEM_ID_FMS_REQUEST = 87,
645 	ELEM_ID_FMS_RESPONSE = 88,
646 	ELEM_ID_QOS_TRAFFIC_CAP = 89,
647 	ELEM_ID_BSS_MAX_IDLE_PERIOD = 90,
648 	ELEM_ID_TFS_REQUEST = 91,
649 	ELEM_ID_TFS_RESPONSE = 92,
650 	ELEM_ID_WNM_SLEEP_MODE = 93,
651 	ELEM_ID_TIM_BCAST_REQUEST = 94,
652 	ELEM_ID_TIM_BCAST_RESPONSE = 95,
653 	ELEM_ID_COLLOC_INTF_REPORT = 96,
654 	ELEM_ID_CHANNEL_USAGE = 97,
655 	ELEM_ID_TIME_ZONE = 98,
656 	ELEM_ID_DMS_REQUEST = 99,
657 	ELEM_ID_DMS_RESPONSE = 100,
658 	ELEM_ID_LINK_ID = 101,
659 	ELEM_ID_WAKEUP_SCHEDULE = 102,
660 	ELEM_ID_TDLS_CS_TIMING = 104,
661 	ELEM_ID_PTI_CONTROL = 105,
662 	ELEM_ID_PU_BUFFER_STATUS = 106,
663 
664 	ELEM_ID_EXT_CAPABILITIES = 127,
665 	ELEM_ID_VHT_CAPABILITIES = 191,
666 	ELEM_ID_VHT_OPERATION = 192,
667 	ELEM_ID_WIDE_BAND_CHAN_SW = 193,
668 	ELEM_ID_AID = 197,
669 	ELEM_ID_VHT_OP_MODE_NOTIFICATION = 199,
670 
671 	ELEM_ID_VENDOR_SPECIFIC = 221,
672 
673 	/* Subelement IDs */
674 	SUBELEM_ID_REPORTED_FRAME_BODY = 1,
675 	SUBELEM_ID_REPORTING_DETAIL = 2,
676 
677 	SUBELEM_ID_PMK_R1_KEY_HOLDER_ID = 1,
678 	SUBELEM_ID_GTK = 2,
679 	SUBELEM_ID_PMK_R0_KEY_HOLDER_ID = 3,
680 	SUBELEM_ID_IGTK = 4,
681 
682 	/* Non-IEEE IDs */
683 	ELEM_ID_WAPI = 68,
684 
685 } MLAN_PACK_END IEEEtypes_ElementId_e;
686 
687 /* The KDE data types */
688 typedef enum {
689 	KDE_DATA_TYPE_RESERVED,
690 	KDE_DATA_TYPE_GTK = 1,
691 	KDE_DATA_TYPE_RESERVED2,
692 	KDE_DATA_TYPE_MACADDR = 3,
693 	KDE_DATA_TYPE_PMKID = 4,
694 	KDE_DATA_TYPE_SMK = 5,
695 	KDE_DATA_TYPE_NONCE = 6,
696 	KDE_DATA_TYPE_LIFETIME = 7,
697 	KDE_DATA_TYPE_ERROR = 8,
698 	KDE_DATA_TYPE_IGTK = 9
699 } IEEEtypes_KDEDataType_e;
700 
701 /* The possible power management modes */
702 typedef enum {
703 	PWR_MODE_ACTIVE,
704 	PWR_MODE_PWR_SAVE
705 } IEEEtypes_PwrMgmtMode_e;
706 
707 /* The possible types of authentication */
708 typedef enum {
709 	AUTH_OPEN_SYSTEM = 0,
710 	AUTH_SHARED_KEY = 1,
711 	AUTH_FAST_BSS_TRANSITION = 2,
712 
713 	AUTH_NETWORK_EAP = 0x80,
714 
715 	AUTH_NOT_SUPPORTED,
716 
717 	AUTH_AUTO_OPEN_OR_SHARED = 0xFF
718 } IEEEtypes_AuthType_e;
719 
720 /* The possible responses to a request to scan */
721 typedef enum {
722 	SCAN_RESULT_SUCCESS,
723 	SCAN_RESULT_INVALID_PARAMETERS,
724 	SCAN_RESULT_INTERNAL_ERROR,
725 	SCAN_RESULT_PARTIAL_RESULTS,
726 
727 } IEEEtypes_ScanResult_e;
728 
729 /* The possible responses to a request to join a BSS */
730 typedef enum {
731 	JOIN_RESULT_SUCCESS,
732 	JOIN_RESULT_INTERNAL_ERROR,
733 	JOIN_RESULT_TIMEOUT
734 } IEEEtypes_JoinResult_e;
735 
736 /* The possible results to a request to authenticate */
737 typedef enum {
738 	AUTH_RESULT_SUCCESS,
739 	AUTH_RESULT_INTERNAL_ERROR,
740 	AUTH_RESULT_TIMEOUT,
741 	AUTH_RESULT_UNUSED,	/* Do not reuse, maps to refused assoc result */
742 	AUTH_RESULT_UNHANDLED_MSG,
743 	AUTH_RESULT_REFUSED,
744 	AUTH_RESULT_INVALID_PARAMETER
745 } IEEEtypes_AuthResult_e;
746 
747 /* The possible results to a request to deauthenticate */
748 typedef enum {
749 	DEAUTH_RESULT_SUCCESS,
750 	DEAUTH_RESULT_INVALID_PARAMETERS,
751 	DEAUTH_RESULT_TOO_MANY_SIMULTANEOUS_RQSTS,
752 	DEAUTH_RESULT_TIMEOUT
753 } IEEEtypes_DeauthResult_e;
754 
755 /* The possible results to a request to associate */
756 typedef enum {
757 	ASSOC_RESULT_SUCCESS,
758 	ASSOC_RESULT_INTERNAL_ERROR,
759 	ASSOC_RESULT_TIMEOUT,
760 	ASSOC_RESULT_REFUSED,
761 	ASSOC_RESULT_AUTH_UNHANDLED_MSG,
762 	ASSOC_RESULT_AUTH_REFUSED,
763 	ASSOC_RESULT_INVALID_PARAMETER,
764 
765 } IEEEtypes_AssocResult_e;
766 
767 typedef enum {
768 	/* Failure enumerations must be non-zero since they map to the
769 	 **  IEEE status field in the assoc response.  The SUCCESS code is left
770 	 **  in here as a place holder but is never used.  The remaining enums
771 	 **  cannot be assigned a value of 0.
772 	 */
773 	ASSOC_CMD_SUCCESS = 0,
774 
775 	ASSOC_CMD_FAILURE_ASSOC,
776 	ASSOC_CMD_FAILURE_AUTH,
777 	ASSOC_CMD_FAILURE_JOIN
778 } IEEEtypes_AssocCmdFailurePoint_e;
779 
780 typedef enum {
781 	DISASSOC_RESULT_SUCCESS,
782 	DISASSOC_RESULT_INVALID_PARAMETERS,
783 	DISASSOC_RESULT_TIMEOUT,
784 	DISASSOC_RESULT_REFUSED
785 } IEEEtypes_DisassocResult_e;
786 /* */
787 /* The possible results to a request to disassociate */
788 /* */
789 
790 typedef enum {
791 	PWR_MGMT_RESULT_SUCCESS,
792 	PWR_MGMT_RESULT_INVALID_PARAMETERS,
793 	PWR_MGMT_RESULT_NOT_SUPPORTED
794 } IEEEtypes_PwrMgmtResult_e;
795 /* */
796 /* The possible results to a request to change the power management mode */
797 /* */
798 
799 typedef enum {
800 	RESET_RESULT_SUCCESS
801 } IEEEtypes_ResetResult_e;
802 /* */
803 /* The possible results to a request to reset */
804 /* */
805 
806 typedef enum {
807 	START_RESULT_SUCCESS,
808 	START_RESULT_INVALID_PARAMETERS,
809 	START_RESULT_BSS_ALREADY_STARTED_OR_JOINED,
810 	START_RESULT_RESET_REQUIRED_BEFORE_START,
811 	START_RESULT_NOT_SUPPORTED,
812 	START_RESULT_ACS_ENABLED
813 } IEEEtypes_StartResult_e;
814 /* */
815 /* The possible results to a request to start */
816 /* */
817 
818 typedef enum {
819 	TPCADAPT_RESULT_SUCCESS,
820 	TPCADAPT_RESULT_INVALID_PARAMETERS,
821 	TPCADAPT_RESULT_UNSPECIFIED_FAILURE
822 } IEEEtypes_TPCAdaptResult_e;
823 
824 typedef enum {
825 	STATE_IDLE,
826 	STATE_SCANNING,
827 	STATE_JOINING,
828 
829 	STATE_ASSOCIATING,
830 	STATE_ASSOCIATED,
831 	STATE_ROAMING,
832 
833 	STATE_IBSS_ACTIVE,
834 	STATE_BSS_ACTIVE,
835 	STATE_TDLS_SETUP_REQ_RCVD,
836 	STATE_TDLS_SETUP_REQ_SENT,
837 	STATE_TDLS_SETUP_RSP_SENT,
838 	STATE_TDLS_ACTIVE,
839 } IEEEtypes_MacMgmtStates_e;
840 
841 /* */
842 /* The possible states the MAC Management Service Task can be in */
843 /* */
844 
845 /*---------------------------------------------------------------------------*/
846 /*           Types Used In IEEE 802.11 MAC Message Data Structures           */
847 /*---------------------------------------------------------------------------*/
848 typedef UINT8 IEEEtypes_Len_t;
849 /* */
850 /* Length type */
851 /* */
852 
853 typedef UINT8 IEEEtypes_Addr_t;
854 /* */
855 /* Address type */
856 /* */
857 
858 typedef IEEEtypes_Addr_t IEEEtypes_MacAddr_t[IEEEtypes_ADDRESS_SIZE];
859 /* */
860 /* MAC address type */
861 /* */
862 
863 typedef UINT8 IEEEtypes_DataRate_t;
864 /* */
865 /* Type used to specify the supported data rates */
866 /* */
867 
868 typedef UINT8 IEEEtypes_SsId_t[IEEEtypes_SSID_SIZE];
869 /* */
870 /* SS ID type */
871 /* */
872 
873 /*---------------------------------------------------------------------------*/
874 /*                 IEEE 802.11 MAC Message Data Structures                   */
875 /*                                                                           */
876 /* Each IEEE 802.11 MAC message includes a MAC header, a frame body (which   */
877 /* can be empty), and a frame check sequence field. This section gives the   */
878 /* structures that used for the MAC message headers and frame bodies that    */
879 /* can exist in the three types of MAC messages - 1) Control messages,       */
880 /* 2) Data messages, and 3) Management messages.                             */
881 /*---------------------------------------------------------------------------*/
882 typedef MLAN_PACK_START struct {
883 	UINT16 ProtocolVersion:2;
884 	UINT16 Type:2;
885 	UINT16 Subtype:4;
886 	UINT16 ToDs:1;
887 	UINT16 FromDs:1;
888 	UINT16 MoreFrag:1;
889 	UINT16 Retry:1;
890 	UINT16 PwrMgmt:1;
891 	UINT16 MoreData:1;
892 	UINT16 Protected:1;
893 	UINT16 Order:1;
894 
895 } MLAN_PACK_END IEEEtypes_FrameCtl_t;
896 
897 typedef MLAN_PACK_START struct {
898 	UINT16 FragNum:4;
899 	UINT16 SeqNum:12;
900 
901 } MLAN_PACK_END IEEEtypes_SeqCtl_t;
902 
903 typedef struct {
904 	UINT16 FrmBodyLen;
905 	IEEEtypes_FrameCtl_t FrmCtl;
906 	UINT16 DurationId;
907 	IEEEtypes_MacAddr_t Addr1;
908 	IEEEtypes_MacAddr_t Addr2;
909 	IEEEtypes_MacAddr_t Addr3;
910 	IEEEtypes_SeqCtl_t SeqCtl;
911 	IEEEtypes_MacAddr_t Addr4;
912 
913 } IEEEtypes_GenHdr_t;
914 
915 typedef MLAN_PACK_START struct {
916 	UINT16 FrmBodyLen;
917 	IEEEtypes_FrameCtl_t FrmCtl;
918 	UINT16 Duration;
919 	IEEEtypes_MacAddr_t DestAddr;
920 	IEEEtypes_MacAddr_t SrcAddr;
921 	IEEEtypes_MacAddr_t BssId;
922 	IEEEtypes_SeqCtl_t SeqCtl;
923 	IEEEtypes_MacAddr_t Rsrvd;
924 
925 } MLAN_PACK_END IEEEtypes_MgmtHdr_t;
926 
927 typedef struct {
928 	IEEEtypes_GenHdr_t Hdr;
929 	UINT8 FrmBody[IEEEtypes_MAX_DATA_BODY_LEN];
930 	UINT32 FCS;
931 
932 } IEEEtypes_DataFrame_t;
933 
934 typedef struct {
935 	UINT8 UserPriority:4;
936 	UINT8 Management:1;
937 	UINT8 Reserved:3;
938 
939 } IEEEtypes_NonceFlags_t;
940 
941 typedef MLAN_PACK_START struct {
942 	UINT8 PN0;
943 	UINT8 PN1;
944 	UINT8 Reserved1;
945 	UINT8 Reserved2:5;
946 	UINT8 ExtIV:1;
947 	UINT8 KeyId:2;
948 	UINT8 PN2;
949 	UINT8 PN3;
950 	UINT8 PN4;
951 	UINT8 PN5;
952 
953 } MLAN_PACK_END IEEEtypes_CcmpHeader_t;
954 
955 typedef MLAN_PACK_START struct {
956 	UINT8 TSC1;
957 	UINT8 WepSeed;
958 	UINT8 TSC0;
959 	UINT8 Reserved:5;
960 	UINT8 ExtIV:1;
961 	UINT8 KeyId:2;
962 	UINT8 TSC2;
963 	UINT8 TSC3;
964 	UINT8 TSC4;
965 	UINT8 TSC5;
966 
967 } MLAN_PACK_END IEEEtypes_TkipHeader_t;
968 
969 typedef MLAN_PACK_START struct {
970 	IEEEtypes_FrameCtl_t frameCtl;
971 	IEEEtypes_MacAddr_t addr1;
972 	IEEEtypes_MacAddr_t addr2;
973 	IEEEtypes_MacAddr_t addr3;
974 
975 } MLAN_PACK_END IEEEtypes_BIP_AAD_t;
976 
977 /************************************************************************/
978 /*                      Control Frame Types                             */
979 /************************************************************************/
980 typedef MLAN_PACK_START struct {
981 	UINT16 FrmBodyLen;
982 	IEEEtypes_FrameCtl_t FrmCtl;
983 	UINT16 DurationId;
984 	IEEEtypes_MacAddr_t DestAddr;
985 	IEEEtypes_MacAddr_t SrcAddr;
986 	UINT8 Reserved[14];	/* Header MAC HW is 32 bytes */
987 
988 } MLAN_PACK_END IEEEtypes_CtlHdr_t;
989 
990 typedef MLAN_PACK_START struct {
991 	IEEEtypes_CtlHdr_t Hdr;
992 	UINT32 FCS;
993 
994 } MLAN_PACK_END IEEEtypes_PsPoll_t;
995 
996 typedef MLAN_PACK_START struct {
997 	UINT16 BARAckPolicy:1;
998 	UINT16 Multi_TID:1;
999 	UINT16 CompressedBitmap:1;
1000 	UINT16 Reserved:9;
1001 	UINT16 TID:4;
1002 
1003 } MLAN_PACK_END IEEEtypes_BARCtl_t;
1004 
1005 typedef MLAN_PACK_START struct {
1006 	IEEEtypes_CtlHdr_t Hdr;
1007 
1008 	IEEEtypes_BARCtl_t BARCtl;
1009 	IEEEtypes_SeqCtl_t SeqCtl;
1010 	UINT32 FCS;
1011 
1012 } MLAN_PACK_END IEEEtypes_BlockAckReq_t;
1013 
1014 //NDPA frame components
1015 typedef MLAN_PACK_START struct {
1016 	UINT16 AID:12;
1017 	UINT16 FbType:1;
1018 	UINT16 NcIndex:3;
1019 
1020 } MLAN_PACK_END IEEEtypes_StaInfo_t;
1021 
1022 typedef MLAN_PACK_START struct {
1023 	UINT8 Rsvd:2;		//[0:1] Reserved
1024 	UINT8 SoundingSeq:6;	//[2:7]Seq no.
1025 	IEEEtypes_StaInfo_t StaInfo;	//Currently only 1 sta_info support
1026 
1027 } MLAN_PACK_END IEEEtypes_NDPAFrameBody_t;
1028 
1029 typedef MLAN_PACK_START struct {
1030 	IEEEtypes_CtlHdr_t Hdr;
1031 	IEEEtypes_NDPAFrameBody_t FrameBody;
1032 	UINT32 FCS;
1033 
1034 } MLAN_PACK_END IEEEtypes_NDPAFrame_t;
1035 /*-------------------------------------------------*/
1036 /* Management Frame Body Components - Fixed Fields */
1037 /*-------------------------------------------------*/
1038 typedef UINT16 IEEEtypes_AId_t;
1039 /* */
1040 /* Association ID assigned by an AP during the association process */
1041 /* */
1042 
1043 typedef UINT16 IEEEtypes_AuthAlg_t;
1044 /* */
1045 /* Number indicating the authentication algorithm used (it can take */
1046 /* on the values given by IEEEtypes_AuthType_e): */
1047 /*    0 = Open system */
1048 /*    1 = Shared key */
1049 /*    All other values reserved */
1050 /* */
1051 
1052 typedef UINT16 IEEEtypes_AuthTransSeq_t;
1053 /* */
1054 /* Authentication transaction sequence number that indicates the current */
1055 /* state of progress through a multistep transaction */
1056 /* */
1057 
1058 typedef UINT16 IEEEtypes_BcnInterval_t;
1059 /* */
1060 /* Beacon interval that represents the number of time units between */
1061 /* target beacon transmission times */
1062 /* */
1063 
1064 typedef UINT8 IEEEtypes_DtimPeriod_t;
1065 /*
1066  * Interval that represents the number of time units between DTIMs.
1067  */
1068 
1069 typedef MLAN_PACK_START struct {
1070 	UINT16 Ess:1;
1071 	UINT16 Ibss:1;
1072 	UINT16 CfPollable:1;
1073 	UINT16 CfPollRqst:1;
1074 	UINT16 Privacy:1;
1075 	UINT16 ShortPreamble:1;
1076 	UINT16 Pbcc:1;
1077 	UINT16 ChanAgility:1;
1078 	UINT16 SpectrumMgmt:1;
1079 	UINT16 Qos:1;
1080 	UINT16 ShortSlotTime:1;
1081 	UINT16 APSD:1;
1082 	UINT16 RadioMeasurement:1;
1083 	UINT16 DsssOfdm:1;
1084 	UINT16 DelayedBlockAck:1;
1085 	UINT16 ImmediateBlockAck:1;
1086 } MLAN_PACK_END IEEEtypes_CapInfo_t;
1087 
1088 typedef UINT16 IEEEtypes_ListenInterval_t;
1089 /* */
1090 /* Listen interval to indicate to an AP how often a STA wakes to listen */
1091 /* to beacon management frames */
1092 /* */
1093 
1094 typedef UINT16 IEEEtypes_ReasonCode_t;
1095 /* */
1096 /* Reason code to indicate the reason that an unsolicited notification */
1097 /* management frame of type Disassociation or Deauthentication was */
1098 /* generated */
1099 /* */
1100 
1101 typedef UINT16 IEEEtypes_StatusCode_t;
1102 /* */
1103 /* Status code used in a response management frame to indicate the */
1104 /* success or failure of a requested operation */
1105 /* */
1106 
1107 typedef UINT8 IEEEtypes_TimeStamp_t[IEEEtypes_TIME_STAMP_SIZE];
1108 
1109 /*-------------------------------------------------------*/
1110 /* Management Frame Body Components - Information Fields */
1111 /*-------------------------------------------------------*/
1112 
1113 typedef MLAN_PACK_START struct {
1114 	IEEEtypes_ElementId_e ElementId;
1115 	IEEEtypes_Len_t Len;
1116 } MLAN_PACK_END IEEEtypes_InfoElementHdr_t;
1117 
1118 typedef MLAN_PACK_START struct {
1119 	IEEEtypes_ElementId_e ElementId;
1120 	IEEEtypes_Len_t Len;
1121 
1122 	UINT8 Data[255];
1123 } MLAN_PACK_END IEEEtypes_IE_Param_t;
1124 
1125 /*
1126 ** SSID element that idicates the identity of an ESS or IBSS
1127 */
1128 typedef MLAN_PACK_START struct {
1129 	IEEEtypes_ElementId_e ElementId;
1130 	IEEEtypes_Len_t Len;
1131 	IEEEtypes_SsId_t SsId;
1132 } MLAN_PACK_END IEEEtypes_SsIdElement_t;
1133 
1134 /*
1135 ** Supported rates element that specifies the rates in the operational
1136 ** rate set in the MLME join request and the MLME start request
1137 */
1138 typedef MLAN_PACK_START struct {
1139 	IEEEtypes_ElementId_e ElementId;
1140 	IEEEtypes_Len_t Len;
1141 	IEEEtypes_DataRate_t Rates[IEEEtypes_MAX_DATA_RATES];
1142 } MLAN_PACK_END IEEEtypes_SuppRatesElement_t;
1143 
1144 /*
1145 ** FH parameter set that conatins the set of parameters necessary to
1146 ** allow sychronization for stations using a frequency hopping PHY
1147 */
1148 typedef MLAN_PACK_START struct {
1149 	IEEEtypes_ElementId_e ElementId;
1150 	IEEEtypes_Len_t Len;
1151 	UINT16 DwellTime;
1152 	UINT8 HopSet;
1153 	UINT8 HopPattern;
1154 	UINT8 HopIndex;
1155 } MLAN_PACK_END IEEEtypes_FhParamElement_t;
1156 
1157 /*
1158 ** DS parameter set that contains information to allow channel number
1159 ** identification for stations using a direct sequence spread spectrum PHY
1160 */
1161 typedef MLAN_PACK_START struct {
1162 	IEEEtypes_ElementId_e ElementId;
1163 	IEEEtypes_Len_t Len;
1164 	UINT8 CurrentChan;
1165 } MLAN_PACK_END IEEEtypes_DsParamElement_t;
1166 
1167 /*
1168 ** CF parameter set that contains the set of parameters necessary to
1169 ** support the PCF
1170 */
1171 typedef MLAN_PACK_START struct {
1172 	IEEEtypes_ElementId_e ElementId;
1173 	IEEEtypes_Len_t Len;
1174 	UINT8 CfpCnt;
1175 	UINT8 CfpPeriod;
1176 	UINT16 CfpMaxDuration;
1177 	UINT16 CfpDurationRemaining;
1178 } MLAN_PACK_END IEEEtypes_CfParamElement_t;
1179 
1180 /* Since uAP is the only one that holds the TIM statically, we'll
1181 ** define a max size for the PVB that accomodates a max AID of 32
1182 ** used by the uAP.  Size is 5 to account for broadcast.
1183 */
1184 #define MAX_TIM_ELEMENT_PVB_LENGTH 5
1185 /*
1186 ** TIM, which contains:
1187 ** 1) DTIM count - how many beacons (including the current beacon
1188 **    frame) appear before the next DTIM; a count of 0 indicates the
1189 **    current TIM is the DTIM
1190 **
1191 ** 2) DTIM period - indicates the number of beacon intervals between
1192 **    successive DTIMs
1193 **
1194 ** 3) Bitmap control - contains the traffic indicator bit associated
1195 **    with association ID 0 - this is set to 1 for TIM elements with a
1196 **    a value of 0 in the DTIM count field when one or more broadcast
1197 **    or multicast frames are buffered at the AP. The remaining bits
1198 **    of the field form the bitmap offset
1199 **
1200 ** 4) Partial virtual bitmap - indicates which stations have messages
1201 **    buffered at the AP, for which the AP is prepared to deliver at
1202 *    the time the beacon frame is transmitted
1203 */
1204 typedef MLAN_PACK_START struct {
1205 	IEEEtypes_ElementId_e ElementId;
1206 	IEEEtypes_Len_t Len;
1207 	UINT8 DtimCnt;
1208 	UINT8 DtimPeriod;
1209 	UINT8 BitmapCtl;
1210 	UINT8 PartialVirtualBitmap[MAX_TIM_ELEMENT_PVB_LENGTH];
1211 } MLAN_PACK_END IEEEtypes_TimElement_t;
1212 
1213 /*
1214 ** IBSS parameters necessary to support an IBSS
1215 */
1216 typedef MLAN_PACK_START struct {
1217 	IEEEtypes_ElementId_e ElementId;
1218 	IEEEtypes_Len_t Len;
1219 	UINT16 AtimWindow;
1220 } MLAN_PACK_END IEEEtypes_IbssParamElement_t;
1221 
1222 /*
1223 ** The challenge text used in authentication exchanges
1224 */
1225 typedef MLAN_PACK_START struct {
1226 	IEEEtypes_ElementId_e ElementId;
1227 	IEEEtypes_Len_t Len;
1228 	UINT8 Text[IEEEtypes_CHALLENGE_TEXT_SIZE];
1229 } MLAN_PACK_END IEEEtypes_ChallengeText_t;
1230 
1231 typedef MLAN_PACK_START struct {
1232 	UINT8 ExtCapability;
1233 	UINT32 Capability;
1234 
1235 	UINT8 SsIdLength;
1236 	IEEEtypes_SsId_t SsId;
1237 
1238 } MLAN_PACK_END IEEEtypes_SsIdL_HidSsId_t;
1239 
1240 typedef MLAN_PACK_START struct {
1241 	IEEEtypes_ElementId_e ElementId;
1242 	IEEEtypes_Len_t Len;
1243 
1244 	UINT8 OuiType[4];	/* 00:50:f2:05 */
1245 
1246 	UINT8 PrimarySsIdExtCapability;
1247 
1248 	/* Start optional fields */
1249 
1250 	UINT8 SsIdCount;
1251 
1252 	/* SsIdCount # of hidden SSIDs, not a fixed size substructure */
1253 	IEEEtypes_SsIdL_HidSsId_t hidSsid[1];
1254 
1255 } MLAN_PACK_END IEEEtypes_SsIdLElement_t;
1256 
1257 typedef MLAN_PACK_START struct {
1258 	IEEEtypes_ElementId_e ElementId;
1259 	IEEEtypes_Len_t Len;
1260 	UINT8 OuiType[4];
1261 	UINT8 Data[1];
1262 
1263 } MLAN_PACK_END IEEEtypes_WPS_DataElement_t;
1264 
1265 /* This structure is a member of BssConfig_t which is referenced by ROMed code.
1266 ** Any increase in the size of this structure will cause the subsequent elements
1267 ** of BssConfig_t to move forward, in turn affecting the ROM code. Therefore,
1268 ** any changes to this structure should be done taking into account its effect
1269 ** on BssConfig_t and ROM code.
1270 */
1271 typedef MLAN_PACK_START struct {
1272 	IEEEtypes_ElementId_e ElementId;
1273 	IEEEtypes_Len_t Len;
1274 
1275 	UINT8 BSS_CoexistSupport:1;	/* bit 0 */
1276 	UINT8 Reserved1:1;	/* bit 1 */
1277 	UINT8 ExtChanSwitching:1;	/* bit 2 */
1278 	UINT8 RejectUnadmFrame:1;	/* bit 3 */
1279 	UINT8 PSMP_Capable:1;	/* bit 4 */
1280 	UINT8 Reserved5:1;	/* bit 5 */
1281 	UINT8 SPSMP_Support:1;	/* bit 6 */
1282 	UINT8 Event:1;		/* bit 7  */
1283 	UINT8 Diagnostics:1;	/* bit 8  */
1284 	UINT8 MulticastDiagnostics:1;	/* bit 9  */
1285 	UINT8 LocationTracking:1;	/* bit 10 */
1286 	UINT8 FMS:1;		/* bit 11 */
1287 	UINT8 ProxyARPService:1;	/* bit 12 */
1288 	UINT8 CollocatedIntf:1;	/* bit 13 */
1289 	UINT8 CivicLocation:1;	/* bit 14 */
1290 	UINT8 GeospatialLocation:1;	/* bit 15 */
1291 	UINT8 TFS:1;		/* bit 16 */
1292 	UINT8 WNM_Sleep:1;	/* bit 17 */
1293 	UINT8 TIM_Broadcast:1;	/* bit 18 */
1294 	UINT8 BSS_Transition:1;	/* bit 19 */
1295 	UINT8 QoSTrafficCap:1;	/* bit 20 */
1296 	UINT8 AC_StationCount:1;	/* bit 21 */
1297 	UINT8 MultipleBSSID:1;	/* bit 22 */
1298 	UINT8 TimingMeasurement:1;	/* bit 23 */
1299 	UINT8 ChannelUsage:1;	/* bit 24 */
1300 	UINT8 SSID_List:1;	/* bit 25 */
1301 	UINT8 DMS:1;		/* bit 26 */
1302 	UINT8 UTC:1;		/* bit 27 */
1303 	UINT8 TDLSPeerUAPSDSupport:1;	/* bit 28 */
1304 	UINT8 TDLSPeerPSMSupport:1;	/* bit 29 */
1305 	UINT8 TDLSChannelSwitching:1;	/* bit 30 */
1306 	UINT8 Reserved31:1;
1307 	UINT8 Reserved32_36:5;
1308 	UINT8 TDLSSupport:1;	/* bit 37 */
1309 	UINT8 TDLSProhibited:1;	/* bit 38 */
1310 	UINT8 TDLSChlSwitchProhib:1;	/* bit 39 */
1311 	UINT8 Reserved40_47:8;
1312 	UINT8 Reserved48_55:8;
1313 	UINT8 Reserved56_60:5;
1314 	UINT8 TDLSWiderBandSupport:1;
1315 	UINT8 OpModeNotification:1;	/* bit 62 */
1316 	UINT8 Reserved63:1;	/* bit 63 */
1317 /* This structure is a member of BssConfig_t which is referenced by ROMed code.
1318 ** Any increase in the size of this structure will cause the subsequent elements
1319 ** of BssConfig_t to move forward, in turn affecting the ROM code. Therefore,
1320 ** any changes to this structure should be done taking into account its effect
1321 ** on BssConfig_t and ROM code.
1322 */
1323 } MLAN_PACK_END IEEEtypes_ExtCapability_t;
1324 
1325 /*
1326 ** The HT Capability Element
1327 */
1328 
1329 typedef enum {
1330 	STATIC_SM_PS,
1331 	DYNAMIC_SM_PS,
1332 	RESERVED_SM_PS,
1333 	DISABLE_SM_PS
1334 } IEEEtypes_HtCap_SMPS_e;
1335 
1336 typedef MLAN_PACK_START struct {
1337 	UINT16 LdpcCoding:1;
1338 	UINT16 SuppChanWidth:1;
1339 	UINT16 MIMOPowerSave:2;
1340 	UINT16 GFPreamble:1;
1341 	UINT16 ShortGI20MHZ:1;
1342 	UINT16 ShortGI40MHZ:1;
1343 	UINT16 TxSTBC:1;
1344 	UINT16 RxSTBC:2;
1345 	UINT16 DelayedBA:1;
1346 	UINT16 MaximalAMSDUSize:1;
1347 	UINT16 DsssCck40MHzMode:1;
1348 	UINT16 Psmp:1;
1349 	UINT16 FortyMHzIntolerant:1;
1350 	UINT16 L_SIG_TXOP_Protection:1;
1351 } MLAN_PACK_END IEEEtypes_HT_Cap_Info_t;
1352 
1353 typedef MLAN_PACK_START struct {
1354 	UINT8 MaxRxAMpduFactor:2;
1355 	UINT8 MpduDensity:3;
1356 	UINT8 Reserved_5_7:3;
1357 } MLAN_PACK_END IEEEtypes_HT_Mac_Params_t;
1358 
1359 typedef MLAN_PACK_START struct {
1360 	UINT16 Pco:1;
1361 	UINT16 TransitionTime:2;
1362 	UINT16 Reserved:5;
1363 
1364 	UINT16 McsFeedback:2;
1365 	UINT16 HtcSupport:1;
1366 	UINT16 RdResponder:1;
1367 	UINT16 Reserved2:4;
1368 } MLAN_PACK_END IEEEtypes_HT_Ext_Cap_t;
1369 
1370 typedef MLAN_PACK_START struct {
1371 	UINT32 TxBFCapable:1;	/* B0 */
1372 	UINT32 RxStaggeredSounding:1;
1373 	UINT32 TxStaggeredSounding:1;
1374 	UINT32 RxNDPCap:1;
1375 	UINT32 TxNDPCap:1;
1376 	UINT32 ImplicitTxBF:1;
1377 	UINT32 Calibration:2;
1378 	UINT32 ExplCSITxBF:1;	/* B8 */
1379 
1380 	UINT32 ExplUcompSteerMatrix:1;
1381 	UINT32 ExplCompSteerMatrix:1;
1382 	UINT32 ExplBFCSIFeedback:2;
1383 	UINT32 ExplUcompSteerFeedback:2;
1384 	UINT32 ExplCompSteerMatrixFeedback:2;
1385 	UINT32 MinimalGrouping:2;
1386 	UINT32 CSINumMFAntennae:2;	/* B20 */
1387 
1388 	UINT32 UcompSteerMatrixBFAntennae:2;
1389 	UINT32 CompSteerMatrixBFAntennae:2;
1390 	UINT32 CSIMaxMaxBeamSupported:2;
1391 	UINT32 ChanEstCapability:2;
1392 	UINT32 Reserved:3;	/* B31 */
1393 
1394 } MLAN_PACK_END IEEEtypes_HT_TXBF_Cap_t;
1395 
1396 typedef MLAN_PACK_START struct {
1397 	UINT8 ASCapable:1;
1398 	UINT8 ExplCSITxASCapable:1;
1399 	UINT8 IndicesFeedbackTxAS:1;
1400 	UINT8 ExplicitCSIFeedback:1;
1401 	UINT8 AntIndicesFeedback:1;
1402 	UINT8 RxASCapable:1;
1403 	UINT8 TxSoundingPPDUs:1;
1404 	UINT8 Reserved:1;
1405 
1406 } MLAN_PACK_END IEEEtypes_HT_AS_Cap_t;
1407 
1408 typedef enum {
1409 	HTC_NO_FEEDBACK = 0,
1410 	HTC_CSI,
1411 	HTC_UCOMP_BF,
1412 	HTC_COMP_BF
1413 } IEEEtypes_HTC_CSI_Types_e;
1414 
1415 typedef MLAN_PACK_START struct {
1416 	UINT16 Nc:2;
1417 	UINT16 Nr:2;
1418 	UINT16 ChanW:1;
1419 	UINT16 Ng:2;
1420 	UINT16 Coeff_size:2;
1421 	UINT16 Codebook_info:2;
1422 	UINT16 Re_segments:2;
1423 	UINT16 Reserved:2;
1424 
1425 	UINT32 SndTimestamp;
1426 
1427 } MLAN_PACK_END IEEEtypes_MIMOCtrl_t;
1428 
1429 typedef MLAN_PACK_START struct {
1430 	UINT16 Reserved:1;
1431 	UINT16 TRQ:1;
1432 	UINT16 MAI:4;
1433 	UINT16 MFSI:3;
1434 	UINT16 MFB_ASELC:7;
1435 
1436 } MLAN_PACK_END IEEEtypes_LinkAdaptCtrl_t;
1437 
1438 typedef MLAN_PACK_START struct {
1439 	IEEEtypes_LinkAdaptCtrl_t LA_Ctrl;
1440 	UINT16 CalibPos:2;
1441 	UINT16 CalibSeq:2;
1442 	UINT16 Reserved:2;
1443 	UINT16 CSI:2;
1444 	UINT16 NDPAnnounce:1;
1445 	UINT16 Reserved2:5;
1446 	UINT16 ACConst:1;
1447 	UINT16 RDG_MorePPDU:1;
1448 
1449 } MLAN_PACK_END IEEEtypes_HTCtrl_t;
1450 
1451 #define HTC_NDP_ANNOUNCE    BIT24
1452 
1453 #define IEEEtypes_MCS_BITMAP_SIZE       16
1454 typedef UINT8 IEEEtypes_Supported_MCS_Bitmap_t[IEEEtypes_MCS_BITMAP_SIZE];
1455 
1456 typedef MLAN_PACK_START struct {
1457 	IEEEtypes_ElementId_e ElementId;
1458 	IEEEtypes_Len_t Len;
1459 
1460 	IEEEtypes_HT_Cap_Info_t HtCapInfo;
1461 	IEEEtypes_HT_Mac_Params_t HtMacParams;
1462 	IEEEtypes_Supported_MCS_Bitmap_t SupportedMcsBitmap;
1463 	IEEEtypes_HT_Ext_Cap_t ExtHTCaps;
1464 	IEEEtypes_HT_TXBF_Cap_t TxBFCaps;
1465 	IEEEtypes_HT_AS_Cap_t ASCaps;
1466 
1467 } MLAN_PACK_END IEEEtypes_HT_Capability_t;
1468 
1469 /*
1470 ** The HT Information Element
1471 */
1472 typedef MLAN_PACK_START struct {
1473 	IEEEtypes_ElementId_e ElementId;
1474 	IEEEtypes_Len_t Len;
1475 
1476 	UINT8 PrimaryChan;
1477     /*-----------------------------------------------*/
1478 	UINT8 SecChanOffset:2;
1479 	UINT8 ChanWidth:1;
1480 	UINT8 RifsMode:1;
1481 	UINT8 CtrlLedAccessOnly:1;
1482 	UINT8 SrvIntrvlGran:3;
1483     /*-----------------------------------------------*/
1484 	UINT16 HtProtection:2;
1485 	UINT16 NonGfHtStaPresent:1;
1486 	UINT16 Reserved1:1;
1487 	UINT16 ObssNonHtStaPresent:1;
1488 	UINT16 Reserved2:11;
1489     /*-----------------------------------------------*/
1490 	UINT16 Reserved3:6;
1491 	UINT16 DualBeacon:1;
1492 	UINT16 DualCtsProtection:1;
1493 	UINT16 StbcBeacon:1;
1494 	UINT16 L_SIGTxopProtectionAllowed:1;
1495 	UINT16 PcoActive:1;
1496 	UINT16 PcoPhase:1;
1497 	UINT16 Reserved4:4;
1498     /*-----------------------------------------------*/
1499 	IEEEtypes_Supported_MCS_Bitmap_t BasicMcsSetBitmap;
1500 
1501 } MLAN_PACK_END IEEEtypes_HT_Information_t;
1502 
1503 /* secondary channel offset        */
1504 /* 20/40 BSS Coexistence           */
1505 typedef MLAN_PACK_START struct {
1506 	IEEEtypes_ElementId_e ElementId;
1507 	IEEEtypes_Len_t Len;
1508 
1509 	UINT8 InfoResuest:1;
1510 	UINT8 FortyMHzIntolerant:1;
1511 	UINT8 Width20MHzRequest:1;
1512 	UINT8 Reserved:5;
1513 
1514 } MLAN_PACK_END IEEEtypes_20N40_BSS_Coexist_t;
1515 
1516 /* overlapping BSS Scan Parameters */
1517 typedef MLAN_PACK_START struct {
1518 	IEEEtypes_ElementId_e ElementId;
1519 	IEEEtypes_Len_t Len;
1520 
1521 	UINT16 OBSSScanPassiveDwell;
1522 	UINT16 OBSSScanActiveDwel;
1523 	UINT16 BSSChanWidthTriggerScanInt;
1524 	UINT16 OBSSScanPassiveTotal;
1525 	UINT16 OBSSScanActiveTotal;
1526 	UINT16 BSSWidthChanTransDelay;
1527 	UINT16 OBSSScanActiveThreshold;
1528 
1529 } MLAN_PACK_END IEEEtypes_OBSS_ScanParam_t;
1530 
1531 typedef MLAN_PACK_START struct {
1532 	UINT8 htSupported;
1533 	IEEEtypes_HT_Capability_t htCap;
1534 	IEEEtypes_HT_Information_t htInfo;
1535 	UINT8 secChanOffset;
1536 	IEEEtypes_20N40_BSS_Coexist_t coexist;
1537 	IEEEtypes_OBSS_ScanParam_t scanParam;
1538 
1539 } MLAN_PACK_END HtEntry_t;
1540 
1541 #define DOT11AC_VHTCAP_MAX_MPDU_LEN_0     3895
1542 #define DOT11AC_VHTCAP_MAX_MPDU_LEN_1     7991
1543 #define DOT11AC_VHTCAP_MAX_MPDU_LEN_2     11454
1544 #define DOT11AC_VHTCAP_MAX_MPDU_LEN_3     3895	//reserved value
1545 
1546     /* IE definitions based on draft 1.4.
1547      */
1548 typedef MLAN_PACK_START struct {
1549 	UINT32 MaxMpduLen:2;
1550 	UINT32 SuppChanWidthSet:2;
1551 	UINT32 RxLDPC:1;
1552 	UINT32 ShortGI_80:1;
1553 	UINT32 ShortGI_160:1;
1554 	UINT32 TxSTBC:1;
1555     /*------------------------*/
1556 	UINT32 RxSTBC:3;
1557 	UINT32 SUBFerCap:1;
1558 	UINT32 SUBFeeCap:1;
1559 	UINT32 NumBFerAnt:3;
1560     /*------------------------*/
1561 	UINT32 NumSoundingDim:3;
1562 	UINT32 MUBFerCap:1;
1563 	UINT32 MUBFeeCap:1;
1564 	UINT32 VHTTxOPPs:1;
1565 	UINT32 HTC_VHT_Cap:1;
1566 	UINT32 MaxAMPDULenExp:3;
1567 	UINT32 VHTLinkAdaptCap:2;
1568 	UINT32 Reserved:4;
1569 
1570 } MLAN_PACK_END IEEEtypes_VHT_Cap_Info_t;
1571 
1572 typedef MLAN_PACK_START struct {
1573 	UINT16 RxMCSMap;
1574 	UINT16 RxHighestDataRate:13;
1575 	UINT16 Reserved1:3;
1576 
1577 	UINT16 TxMCSMap;
1578 	UINT16 TxHighestDataRate:13;
1579 	UINT16 Reserved2:3;
1580 
1581 } MLAN_PACK_END IEEEtypes_VHT_Supp_MCS_Set_t;
1582 
1583 typedef MLAN_PACK_START struct {
1584 	IEEEtypes_ElementId_e ElementId;
1585 	IEEEtypes_Len_t Len;
1586 
1587 	IEEEtypes_VHT_Cap_Info_t VhtCap;
1588 	IEEEtypes_VHT_Supp_MCS_Set_t VhtSuppMcsSet;
1589 
1590 } MLAN_PACK_END IEEEtypes_VHT_Capability_t;
1591 
1592 typedef MLAN_PACK_START struct {
1593 	UINT8 ChanWidth;
1594 	UINT8 ChanCenterFreq1;
1595 	UINT8 ChanCenterFreq2;
1596 
1597 } MLAN_PACK_END IEEEtypes_VHT_Op_Info_t;
1598 
1599 /*
1600 ** The VHT Operation Element
1601 */
1602 typedef MLAN_PACK_START struct {
1603 	IEEEtypes_ElementId_e ElementId;
1604 	IEEEtypes_Len_t Len;
1605 
1606 	IEEEtypes_VHT_Op_Info_t VhtOpInfo;
1607 	UINT16 VhtBasicMcsSet;
1608 
1609 } MLAN_PACK_END IEEEtypes_VHT_Operation_t;
1610 
1611 typedef MLAN_PACK_START struct {
1612 	UINT8 chanWidth:2;
1613 	UINT8 reserved:2;
1614 	UINT8 rxNss:3;
1615 	UINT8 rxNssType:1;
1616 
1617 } MLAN_PACK_END IEEEtypes_VHT_OpMode_t;
1618 
1619 typedef MLAN_PACK_START struct {
1620 	IEEEtypes_ElementId_e ElementId;
1621 	IEEEtypes_Len_t Len;
1622 
1623 	IEEEtypes_VHT_OpMode_t VhtOpMode;
1624 } MLAN_PACK_END IEEEtypes_VHT_OpModeNotification_t;
1625 
1626 typedef MLAN_PACK_START struct {
1627 	IEEEtypes_ElementId_e ElementId;
1628 	IEEEtypes_Len_t Len;
1629     /** WideBW has same structure as VHT_OP_INFO*/
1630 	IEEEtypes_VHT_Op_Info_t wideBwCs;
1631 } MLAN_PACK_END IEEEtypes_WIde_BW_CS_t;
1632 
1633 typedef MLAN_PACK_START struct {
1634 	IEEEtypes_ElementId_e ElementId;
1635 	IEEEtypes_Len_t Len;
1636 	IEEEtypes_AId_t Aid;
1637 } MLAN_PACK_END IEEEtypes_AIDElement_t;
1638 
1639 /*
1640 *****************************************************************************
1641 **
1642 **
1643 **                     802.11k RRM definitions
1644 **
1645 **
1646 *****************************************************************************
1647 */
1648 typedef MLAN_PACK_START struct {
1649 	IEEEtypes_ElementId_e ElementId;
1650 	IEEEtypes_Len_t Len;
1651 
1652 	/* First byte */
1653 	UINT8 LinkMeas:1;
1654 	UINT8 NborRpt:1;
1655 	UINT8 ParallelMeas:1;
1656 	UINT8 RepeatMeas:1;
1657 	UINT8 BcnPassiveMeas:1;
1658 	UINT8 BcnActiveMeas:1;
1659 	UINT8 BcnTableMeas:1;
1660 	UINT8 BcnMeasRptCond:1;
1661 
1662 	/* Second byte */
1663 	UINT8 FrameMeas:1;
1664 	UINT8 ChanLoadMeas:1;
1665 	UINT8 NoiseHistMeas:1;
1666 	UINT8 StatsMeas:1;
1667 	UINT8 LciMeas:1;
1668 	UINT8 LciAzimuth:1;
1669 	UINT8 TxStreamMeas:1;
1670 	UINT8 TrigTxStreamMeas:1;
1671 
1672 	/* Third byte */
1673 	UINT8 ApChanRpt:1;
1674 	UINT8 RrmMib:1;
1675 	UINT8 OpChanMaxMeas:3;
1676 	UINT8 NonOpChanMaxMeas:3;
1677 
1678 	/* Fourth byte */
1679 	UINT8 MeasPilot:3;
1680 	UINT8 MeasPilotTxInfo:1;
1681 	UINT8 NborRptTsfOffset:1;
1682 	UINT8 RcpiMeas:1;
1683 	UINT8 RsniMeas:1;
1684 	UINT8 BssAvgAccessDelay:1;
1685 
1686 	/* Fifth byte */
1687 	UINT8 BssAvailAdmCap:1;
1688 	UINT8 AntennaInfo:1;
1689 	UINT8 Reserved:6;
1690 
1691 } MLAN_PACK_END IEEEtypes_RrmEnabledCapabilities_t;
1692 
1693 typedef MLAN_PACK_START struct {
1694 	IEEEtypes_ElementId_e ElementId;
1695 	IEEEtypes_Len_t Len;
1696 
1697 	UINT8 RegulatoryClass;
1698 
1699 	UINT8 ChannelList[1];
1700 
1701 } MLAN_PACK_END IEEEtypes_ApChanRptElement_t;
1702 
1703 typedef enum {
1704 	RPT_DTL_NO_FIX_OR_IE = 0,
1705 	RPT_DTL_ALL_FIX_AND_REQ_IES = 1,
1706 	RPT_DTL_ALL_FIX_AND_ALL_IES = 2,
1707 
1708 } IEEEtypes_ReportDetailLevel_e;
1709 
1710 typedef MLAN_PACK_START struct {
1711 	IEEEtypes_ElementId_e ElementId;
1712 	IEEEtypes_Len_t Len;
1713 
1714 	MLAN_PACK_START IEEEtypes_ReportDetailLevel_e MLAN_PACK_END
1715 		RptDetailLevel;
1716 
1717 } MLAN_PACK_END IEEEtypes_ReportingDetailElement_t;
1718 
1719 typedef MLAN_PACK_START struct {
1720 	IEEEtypes_ElementId_e ElementId;
1721 	IEEEtypes_Len_t Len;
1722 
1723 	IEEEtypes_ElementId_e IeList[1];
1724 
1725 } MLAN_PACK_END IEEEtypes_RequestElement_t;
1726 
1727 /*
1728 *****************************************************************************
1729 **
1730 **
1731 **               802.11d and 802.11j Country IE definitions
1732 **
1733 **
1734 *****************************************************************************
1735 */
1736 
1737 /** Regulatory Triplet component in the country IE */
1738 typedef MLAN_PACK_START struct {
1739 	UINT8 RegulatoryExtensionId;
1740 	UINT8 RegulatoryClass;
1741 	UINT8 CoverageClass;
1742 
1743 } MLAN_PACK_END IEEEtypes_RegulatoryTriplet_t;
1744 
1745 /** Subband Triplet component in the country IE */
1746 typedef MLAN_PACK_START struct {
1747 	UINT8 FirstChan;
1748 	UINT8 NumChans;
1749 	UINT8 MaxTxPower;
1750 
1751 } MLAN_PACK_END IEEEtypes_SubbandTriplet_t;
1752 
1753 /* Country Info Triplet union comprised of subband and potentially regulatory
1754  *   triplets
1755  */
1756 typedef MLAN_PACK_START union {
1757 	UINT8 TripletIdentifier;
1758 	IEEEtypes_SubbandTriplet_t Subband;
1759 	IEEEtypes_RegulatoryTriplet_t Regulatory;
1760 
1761 } MLAN_PACK_END IEEEtypes_CountryInfoTriplet_t;
1762 
1763 typedef MLAN_PACK_START struct {
1764 	IEEEtypes_ElementId_e ElementId;
1765 	IEEEtypes_Len_t Len;
1766 	UINT8 CountryCode[IEEEtypes_COUNTRY_CODE_SIZE];
1767 	IEEEtypes_CountryInfoTriplet_t Triplets[IEEEtypes_COUNTRY_MAX_TRIPLETS];
1768 
1769 } MLAN_PACK_END IEEEtypes_CountryInfoElement_t;
1770 
1771 /*
1772 *****************************************************************************
1773 **
1774 **
1775 **                      802.11h TPC definitions
1776 **
1777 **
1778 *****************************************************************************
1779 */
1780 
1781 /*
1782 ** Power Constraint IE - for 802.11h TPC. Specifies a Local
1783 **  Power Constraint in a channel.
1784 */
1785 typedef MLAN_PACK_START struct {
1786 	IEEEtypes_ElementId_e ElementId;
1787 	IEEEtypes_Len_t Len;
1788 	UINT8 localConstraint;
1789 } MLAN_PACK_END IEEEtypes_PowerConstraintElement_t;
1790 
1791 /*
1792 ** Power Capability IE - for 802.11h TPC. Specifies the
1793 **   min and max power the station is capable of transmitting with.
1794 */
1795 typedef MLAN_PACK_START struct {
1796 	IEEEtypes_ElementId_e ElementId;
1797 	IEEEtypes_Len_t Len;
1798 	UINT8 minTxPwr;
1799 	UINT8 maxTxPwr;
1800 } MLAN_PACK_END IEEEtypes_PowerCapabilityElement_t;
1801 
1802 /*
1803 ** 802.11h TPC Request IE - used for requesting a peer station
1804 **   to send Tx power and Link Margin.
1805 */
1806 typedef MLAN_PACK_START struct {
1807 	IEEEtypes_ElementId_e ElementId;
1808 	IEEEtypes_Len_t Len;
1809 } MLAN_PACK_END IEEEtypes_TPCRequestElement_t;
1810 
1811 typedef MLAN_PACK_START struct {
1812 	IEEEtypes_ElementId_e ElementId;
1813 	IEEEtypes_Len_t Len;
1814 	UINT8 TxPwr;
1815 	UINT8 LinkMargin;
1816 } MLAN_PACK_END IEEEtypes_TPCReportElement_t;
1817 
1818 #define WIFI_TPCRPT_OUI_SUBTYPE  0x08
1819 
1820 typedef MLAN_PACK_START struct {
1821 	IEEEtypes_ElementId_e ElementId;
1822 	IEEEtypes_Len_t Len;
1823 
1824 	UINT8 OuiType[4];	/* 00:50:f2:08 */
1825 	UINT8 OuiSubType;
1826 
1827 	UINT8 TxPwr;
1828 	UINT8 LinkMargin;
1829 
1830 } MLAN_PACK_END IEEEtypes_WiFi_TPCReportElement_t;
1831 
1832 /*
1833 *****************************************************************************
1834 **
1835 **
1836 **                     802.11h DFS definitions
1837 **
1838 **
1839 *****************************************************************************
1840 */
1841 typedef MLAN_PACK_START struct {
1842 	IEEEtypes_ElementId_e ElementId;
1843 	IEEEtypes_Len_t Len;
1844 
1845 	UINT8 ChannelSwitchMode;
1846 	UINT8 ChannelNumber;
1847 	UINT8 ChannelSwitchCount;
1848 } MLAN_PACK_END IEEEtypes_ChannelSwitchElement_t;
1849 
1850 typedef MLAN_PACK_START struct {
1851 	UINT8 BSS:1;
1852 	UINT8 OFDM_Preamble:1;
1853 	UINT8 Unidentified:1;
1854 	UINT8 Radar:1;
1855 	UINT8 Unmeasured:1;
1856 	UINT8 Reserved:3;
1857 } MLAN_PACK_END IEEEtypes_DFS_Map_t;
1858 
1859 typedef MLAN_PACK_START struct {
1860 	UINT8 ChannelNumber;
1861 	IEEEtypes_DFS_Map_t DFS_Map;
1862 } MLAN_PACK_END IEEEtypes_ChannelMap_t;
1863 
1864 #define MAX_NUMBER_OF_DFS_CHANNELS 25
1865 typedef MLAN_PACK_START struct {
1866 	IEEEtypes_ElementId_e ElementId;
1867 	IEEEtypes_Len_t Len;
1868 
1869 	IEEEtypes_MacAddr_t DFS_Owner;
1870 	UINT8 DFS_Recovery_Interval;
1871 
1872 	/* For the channels in .11a */
1873 	IEEEtypes_ChannelMap_t Channel_Map[MAX_NUMBER_OF_DFS_CHANNELS];
1874 } MLAN_PACK_END IEEEtypes_IbssDfsElement_t;
1875 
1876 typedef MLAN_PACK_START struct {
1877 	IEEEtypes_ElementId_e ElementId;
1878 	IEEEtypes_Len_t Len;
1879 
1880 	UINT8 QuietCount;
1881 	UINT8 QuietPeriod;
1882 	UINT16 QuietDuration;
1883 	UINT16 QuietOffset;
1884 } MLAN_PACK_END IEEEtypes_QuietElement_t;
1885 
1886 typedef MLAN_PACK_START struct {
1887 	UINT8 FirstChannelNumber;
1888 	UINT8 NumberOfChannels;
1889 } MLAN_PACK_END ChannelsTuple_t;
1890 
1891 #define MAX_CHANNEL_TUPLES 20
1892 typedef MLAN_PACK_START struct {
1893 	IEEEtypes_ElementId_e ElementId;
1894 	IEEEtypes_Len_t Len;
1895 
1896 	ChannelsTuple_t ChannelTuple[MAX_CHANNEL_TUPLES];
1897 } MLAN_PACK_END IEEEtypes_SupportedChannelsElement_t;
1898 
1899 typedef MLAN_PACK_START struct {
1900 	IEEEtypes_ElementId_e ElementId;
1901 	IEEEtypes_Len_t Len;
1902 
1903 	UINT8 currRegClass;
1904 	UINT8 suppRegClass;
1905 } MLAN_PACK_END IEEEtypes_SupportedRegClasses_t;
1906 
1907 /*
1908 *****************************************************************************
1909 **
1910 **
1911 **                        802.11y definitions
1912 **
1913 **
1914 *****************************************************************************
1915 */
1916 typedef MLAN_PACK_START struct {
1917 	IEEEtypes_ElementId_e ElementId;
1918 	IEEEtypes_Len_t Len;
1919 
1920 	UINT8 ChannelSwitchMode;
1921 	UINT8 RegClass;
1922 	UINT8 ChannelNumber;
1923 	UINT8 ChannelSwitchCount;
1924 } MLAN_PACK_END IEEEtypes_ExtChannelSwitchElement_t;
1925 
1926 /*
1927 *****************************************************************************
1928 **
1929 **
1930 **                        802.11e definitions
1931 **
1932 **
1933 *****************************************************************************
1934 */
1935 typedef MLAN_PACK_START struct {
1936 	IEEEtypes_ElementId_e ElementId;
1937 	IEEEtypes_Len_t Len;
1938 
1939 	UINT16 StaCount;
1940 	UINT8 ChnlUtil;
1941 	UINT16 AdmCap;
1942 } MLAN_PACK_END IEEEtypes_BSSLoadElement_t;
1943 
1944 /*
1945 *****************************************************************************
1946 **
1947 **
1948 **                     802.11i and WPA definitions
1949 **
1950 **
1951 *****************************************************************************
1952 */
1953 typedef enum {
1954 	IEEEtypes_RSN_AUTH_KEY_SUITE_RSVD = 0,
1955 	IEEEtypes_RSN_AUTH_KEY_SUITE_8021X = 1,
1956 	IEEEtypes_RSN_AUTH_KEY_SUITE_PSK = 2,
1957 	IEEEtypes_AKM_SUITE_FT_1X = 3,
1958 	IEEEtypes_AKM_SUITE_FT_PSK = 4,
1959 	IEEEtypes_AKM_SUITE_1X_SHA256 = 5,
1960 	IEEEtypes_AKM_SUITE_PSK_SHA256 = 6
1961 } IEEEtypes_RSN_Auth_Key_Suite;
1962 
1963 /* Cipher Suite Selector */
1964 typedef enum {
1965 	IEEEtypes_RSN_CIPHER_SUITE_NONE = 0,
1966 	IEEEtypes_RSN_CIPHER_SUITE_WEP40,
1967 	IEEEtypes_RSN_CIPHER_SUITE_TKIP,
1968 	IEEEtypes_RSN_CIPHER_SUITE_WRAP,
1969 	IEEEtypes_RSN_CIPHER_SUITE_CCMP,
1970 	IEEEtypes_RSN_CIPHER_SUITE_WEP104
1971 } IEEEtypes_RSN_Cipher_Suite;
1972 
1973 typedef MLAN_PACK_START struct {
1974 	IEEEtypes_ElementId_e ElementId;
1975 	IEEEtypes_Len_t Len;
1976 
1977 	UINT8 OuiType[4];	/* 00:50:f2:01 */
1978 	UINT16 Ver;
1979 	UINT8 GrpKeyCipher[4];
1980 	UINT16 PwsKeyCnt;
1981 	UINT8 PwsKeyCipherList[4];
1982 	UINT16 AuthKeyCnt;
1983 	UINT8 AuthKeyList[4];
1984 } MLAN_PACK_END IEEEtypes_WPAElement_t;
1985 
1986 typedef MLAN_PACK_START struct {
1987 	UINT8 PreAuth:1;	/* B0 */
1988 	UINT8 NoPairwise:1;
1989 	UINT8 PtksaReplayCtr:2;
1990 	UINT8 GtksaReplayCtr:2;
1991 	UINT8 MFPR:1;
1992 	UINT8 MFPC:1;
1993 
1994 	UINT8 Reserved_8:1;	/* B8 */
1995 	UINT8 PeerkeyEnabled:1;
1996 	UINT8 SppAmsduCap:1;
1997 	UINT8 SppAmsduReq:1;
1998 	UINT8 PBAC:1;
1999 	UINT8 Reserved_13_15:3;
2000 } MLAN_PACK_END IEEEtypes_RSNCapability_t;
2001 
2002 typedef MLAN_PACK_START struct {
2003 	IEEEtypes_ElementId_e ElementId;
2004 	IEEEtypes_Len_t Len;
2005 
2006 	/* All elements after Ver field are optional per the spec.
2007 	 **
2008 	 ** - AuthKeyList and PwsKeyCipherList can have multiple elements so
2009 	 **   static parsing of this structure is not possible.
2010 	 **
2011 	 ** - RsnCap, PMKIDCnt/List, and GrpMgmtCipher are often not included
2012 	 **
2013 	 ** - If any optional element is included, all preceding elements must
2014 	 **   also be included.  Once an optional element is not inserted, the
2015 	 **   IE construction ends. (i.e. RsnCap must be included if PMKIDCnt/List
2016 	 **   is needed).
2017 	 */
2018 
2019 	UINT16 Ver;
2020 	UINT8 GrpKeyCipher[4];
2021 	UINT16 PwsKeyCnt;
2022 	UINT8 PwsKeyCipherList[4];
2023 	UINT16 AuthKeyCnt;
2024 	UINT8 AuthKeyList[4];
2025 
2026 	IEEEtypes_RSNCapability_t RsnCap;
2027 
2028 	UINT16 PMKIDCnt;
2029 	UINT8 PMKIDList[16];
2030 
2031 	UINT8 GrpMgmtCipher[4];
2032 } MLAN_PACK_END IEEEtypes_RSNElement_t;
2033 
2034 /*
2035 *****************************************************************************
2036 **
2037 **
2038 **                        802.11r definitions
2039 **
2040 **
2041 *****************************************************************************
2042 */
2043 
2044 typedef MLAN_PACK_START struct {
2045 	UINT8 FtOverBss:1;
2046 	UINT8 FtOverAir:1;
2047 
2048 	UINT8 Reserved:6;
2049 
2050 } MLAN_PACK_END IEEEtypes_FT_CapabilityPolicy_t;
2051 
2052 typedef MLAN_PACK_START struct {
2053 	IEEEtypes_ElementId_e ElementId;
2054 	IEEEtypes_Len_t Len;
2055 
2056 	UINT16 MobilityDomainId;
2057 
2058 	IEEEtypes_FT_CapabilityPolicy_t FtCapPol;
2059 
2060 } MLAN_PACK_END IEEEtypes_MobilityDomainElement_t;
2061 
2062 typedef MLAN_PACK_START struct {
2063 	UINT8 KeyId:2;
2064 
2065 	UINT8 Reserved1:6;
2066 	UINT8 Reserved2:8;
2067 
2068 } MLAN_PACK_END IEEEtypes_GtkKeyInfo_t;
2069 
2070 typedef MLAN_PACK_START struct {
2071 	IEEEtypes_ElementId_e ElementId;
2072 	IEEEtypes_Len_t Len;
2073 
2074 	IEEEtypes_GtkKeyInfo_t KeyInfo;
2075 	UINT8 KeyLen;
2076 	UINT8 RSC[8];
2077 
2078 	UINT8 Key[32];		/* Variable length from 5 to 32 */
2079 
2080 } IEEEtypes_GtkElement_t;
2081 
2082 typedef MLAN_PACK_START struct {
2083 	UINT8 Reserved;
2084 	UINT8 InfoElementCount;
2085 
2086 } MLAN_PACK_END IEEEtypes_FT_MICControl_t;
2087 
2088 #define FTIE_MIC_LEN  16
2089 typedef MLAN_PACK_START struct {
2090 	IEEEtypes_ElementId_e ElementId;
2091 	IEEEtypes_Len_t Len;
2092 
2093 	IEEEtypes_FT_MICControl_t MicControl;
2094 
2095 	UINT8 MIC[FTIE_MIC_LEN];
2096 	UINT8 ANonce[32];
2097 	UINT8 SNonce[32];
2098 
2099 	UINT8 SubElem[1];
2100 
2101 } MLAN_PACK_END IEEEtypes_FastBssTransElement_t;
2102 
2103 typedef MLAN_PACK_START enum {
2104 	TI_TYPE_RESERVED = 0,
2105 	TI_TYPE_REASSOC_DEADLINE_TUS = 1,
2106 	TI_TYPE_KEY_LIFETIME_SECS = 2,
2107 	TI_TYPE_ASSOCIATION_COMEBACK_TIME = 3,
2108 
2109 } IEEEtypes_TimeoutInterval_e;
2110 
2111 typedef MLAN_PACK_START struct {
2112 	IEEEtypes_ElementId_e ElementId;
2113 	IEEEtypes_Len_t Len;
2114 
2115 	IEEEtypes_TimeoutInterval_e TimeoutIntervalType;
2116 	UINT32 TimeoutInterval;
2117 
2118 } MLAN_PACK_END IEEEtypes_TimeoutIntervalElement_t;
2119 
2120 typedef MLAN_PACK_START struct {
2121 	IEEEtypes_ElementId_e ElementId;
2122 	IEEEtypes_Len_t Len;
2123 
2124 	UINT8 Identifier;
2125 	UINT8 DescCount;
2126 
2127 	IEEEtypes_StatusCode_t StatusCode;
2128 
2129 } MLAN_PACK_END IEEEtypes_RICDataElement_t;
2130 
2131 typedef MLAN_PACK_START enum {
2132 	RIC_RESOURCE_BLOCK_ACK = 1,
2133 
2134 } MLAN_PACK_END IEEEtypes_RICResource_e;
2135 
2136 typedef MLAN_PACK_START struct {
2137 	IEEEtypes_ElementId_e ElementId;
2138 	IEEEtypes_Len_t Len;
2139 
2140 	IEEEtypes_RICResource_e ResourceType;
2141 
2142 	UINT8 Data[1];
2143 
2144 } MLAN_PACK_END IEEEtypes_RICDescElement_t;
2145 
2146 /*
2147 *****************************************************************************
2148 **
2149 **
2150 **                        802.11w definitions
2151 **
2152 **
2153 *****************************************************************************
2154 */
2155 #define MMIE_MIC_LEN  8
2156 typedef MLAN_PACK_START struct {
2157 	IEEEtypes_ElementId_e ElementId;
2158 	IEEEtypes_Len_t Len;
2159 
2160 	UINT8 KeyId[2];
2161 	UINT8 IPN[6];
2162 
2163 	UINT8 MIC[MMIE_MIC_LEN];
2164 
2165 } MLAN_PACK_END IEEEtypes_ManagementMICElement_t;
2166 
2167 /*
2168 *****************************************************************************
2169 **
2170 **
2171 **                        Management Frame Bodies
2172 **
2173 **
2174 *****************************************************************************
2175 */
2176 
2177 /*
2178 ** The parameter set relevant to the PHY
2179 */
2180 typedef MLAN_PACK_START union {
2181 	IEEEtypes_FhParamElement_t FhParamSet;
2182 	IEEEtypes_DsParamElement_t DsParamSet;
2183 
2184 } MLAN_PACK_END IEEEtypes_PhyParamElement_t;
2185 
2186 /*
2187 ** Service set parameters - for a BSS supporting, PCF, the
2188 ** CF parameter set is used; for an independent BSS, the IBSS
2189 ** parameter set is used.
2190 */
2191 typedef MLAN_PACK_START union {
2192 	IEEEtypes_CfParamElement_t CfParamSet;
2193 	IEEEtypes_IbssParamElement_t IbssParamSet;
2194 } MLAN_PACK_END IEEEtypes_SsParamElement_t;
2195 
2196 typedef MLAN_PACK_START struct {
2197 	IEEEtypes_ElementId_e ElementId;
2198 	IEEEtypes_Len_t Len;
2199 	IEEEtypes_DataRate_t Rates[IEEEtypes_MAX_DATA_RATES];
2200 } MLAN_PACK_END IEEEtypes_ExtSuppRatesElement_t;
2201 
2202 typedef MLAN_PACK_START struct {
2203 	IEEEtypes_ElementId_e ElementId;
2204 	IEEEtypes_Len_t Len;
2205 
2206 	MLAN_PACK_START union {
2207 		MLAN_PACK_START struct {
2208 			UINT8 NonERPPresent:1;
2209 			UINT8 UseProtection:1;
2210 			UINT8 BarkerPreamble:1;
2211 			UINT8 Reserved:5;
2212 		} bf;
2213 		UINT8 erpInfo;
2214 	} u;
2215 } MLAN_PACK_END IEEEtypes_ERPInfoElement_t;
2216 
2217 #define IEEEtypes_BCN_FIXED_FIELD_SZ (sizeof(IEEEtypes_TimeStamp_t)     \
2218                                       + sizeof(IEEEtypes_BcnInterval_t) \
2219                                       + sizeof(IEEEtypes_CapInfo_t))
2220 
2221 typedef MLAN_PACK_START struct {
2222 	IEEEtypes_TimeStamp_t TimeStamp;
2223 	IEEEtypes_BcnInterval_t BcnInterval;
2224 	IEEEtypes_CapInfo_t CapInfo;
2225 	IEEEtypes_SsIdElement_t SsId;
2226 	IEEEtypes_SuppRatesElement_t SuppRates;
2227 	IEEEtypes_PhyParamElement_t PhyParamSet;
2228 	IEEEtypes_SsParamElement_t SsParamSet;
2229 	IEEEtypes_TimElement_t Tim;
2230 	IEEEtypes_ERPInfoElement_t ERPInfo;
2231 	IEEEtypes_ExtSuppRatesElement_t ExtSuppRates;
2232 } MLAN_PACK_END IEEEtypes_Bcn_t;
2233 
2234 typedef MLAN_PACK_START struct {
2235 	IEEEtypes_ReasonCode_t ReasonCode;
2236 } MLAN_PACK_END IEEEtypes_DisAssoc_t;
2237 
2238 typedef MLAN_PACK_START struct {
2239 	IEEEtypes_CapInfo_t CapInfo;
2240 	IEEEtypes_ListenInterval_t ListenInterval;
2241 	UINT8 IEBuffer[1];
2242 } MLAN_PACK_END IEEEtypes_AssocRqst_t;
2243 
2244 typedef MLAN_PACK_START struct {
2245 	IEEEtypes_CapInfo_t CapInfo;
2246 	IEEEtypes_StatusCode_t StatusCode;
2247 	IEEEtypes_AId_t AId;
2248 } MLAN_PACK_END IEEEtypes_AssocRsp_t;
2249 
2250 typedef MLAN_PACK_START struct {
2251 	IEEEtypes_CapInfo_t CapInfo;
2252 	IEEEtypes_ListenInterval_t ListenInterval;
2253 	IEEEtypes_MacAddr_t CurrentApAddr;
2254 	UINT8 IEBuffer[1];
2255 } MLAN_PACK_END IEEEtypes_ReAssocRqst_t;
2256 
2257 typedef MLAN_PACK_START struct {
2258 	IEEEtypes_CapInfo_t CapInfo;
2259 	IEEEtypes_StatusCode_t StatusCode;
2260 	IEEEtypes_AId_t AId;
2261 } MLAN_PACK_END IEEEtypes_ReAssocRsp_t;
2262 
2263 typedef MLAN_PACK_START struct {
2264 	IEEEtypes_SsIdElement_t SsId;
2265 	IEEEtypes_SuppRatesElement_t SuppRates;
2266 	IEEEtypes_ExtSuppRatesElement_t ExtSuppRates;
2267 } MLAN_PACK_END IEEEtypes_ProbeRqst_t;
2268 
2269 typedef MLAN_PACK_START struct {
2270 	IEEEtypes_TimeStamp_t TimeStamp;
2271 	IEEEtypes_BcnInterval_t BcnInterval;
2272 	IEEEtypes_CapInfo_t CapInfo;
2273 	IEEEtypes_SsIdElement_t SsId;
2274 	IEEEtypes_SuppRatesElement_t SuppRates;
2275 	IEEEtypes_PhyParamElement_t PhyParamSet;
2276 	IEEEtypes_SsParamElement_t SsParamSet;
2277 	IEEEtypes_TimElement_t Tim;
2278 	IEEEtypes_ERPInfoElement_t ERPInfo;
2279 	IEEEtypes_ExtSuppRatesElement_t ExtSuppRates;
2280 } MLAN_PACK_END IEEEtypes_ProbeRsp_t;
2281 
2282 typedef MLAN_PACK_START struct {
2283 	IEEEtypes_AuthAlg_t AuthAlg;
2284 	IEEEtypes_AuthTransSeq_t AuthTransSeq;
2285 	IEEEtypes_StatusCode_t StatusCode;
2286 	IEEEtypes_ChallengeText_t ChallengeText;
2287 } MLAN_PACK_END IEEEtypes_Auth_t;
2288 
2289 typedef MLAN_PACK_START struct {
2290 	IEEEtypes_ReasonCode_t ReasonCode;
2291 } MLAN_PACK_END IEEEtypes_Deauth_t;
2292 
2293 /*---------------------------------------------------------------------------*/
2294 /*              IEEE 802.11 MLME SAP Interface Data Structures               */
2295 /*                                                                           */
2296 /* According to IEEE 802.11, services are provided by the MLME to the SME.   */
2297 /* In the current architecture, the services are provided to the SME by the  */
2298 /* MAC Management Service Task. This section describes data structures       */
2299 /* needed for these services.                                                */
2300 /*---------------------------------------------------------------------------*/
2301 
2302 /*
2303 ** BSS Description Set
2304 **
2305 **  A description of a BSS, providing the following:
2306 **  BssId:        The ID of the BSS
2307 **  SsId:         The SSID of the BSS
2308 **  BssType:      The type of the BSS (INFRASTRUCTURE or INDEPENDENT)
2309 **  BcnPeriod:    The beacon period (in time units)
2310 **  DtimPeriod:   The DTIM period (in beacon periods)
2311 **  Tstamp:       Timestamp of a received frame from the BSS; this is an 8
2312 **                   byte string from a probe response or beacon
2313 **  StartTs:      The value of a station's timing synchronization function
2314 **                   at the start of reception of the first octet of the
2315 **                   timestamp field of a received frame (probe response or
2316 **                   beacon) from a BSS; this is an 8 byte string
2317 **  PhyParamSet:  The parameter set relevant to the PHY (empty if not
2318 **                   needed by the PHY)
2319 **  SsParamSet:   The service set parameters. These can consist of either
2320 **                   the parameter set for CF periods or for an IBSS.
2321 **  Cap:          The advertised capabilities of the BSS
2322 **  DataRates:    The set of data rates that must be supported by all
2323 **                   stations (the BSS basic rate set)
2324 */
2325 typedef MLAN_PACK_START struct {
2326 	IEEEtypes_MacAddr_t BssId;
2327 	IEEEtypes_SsId_t SsId;
2328 	IEEEtypes_Bss_e BssType;
2329 	IEEEtypes_BcnInterval_t BcnPeriod;
2330 	IEEEtypes_DtimPeriod_t DtimPeriod;
2331 	IEEEtypes_TimeStamp_t Tstamp;
2332 	IEEEtypes_TimeStamp_t StartTs;
2333 	IEEEtypes_PhyParamElement_t PhyParamSet;
2334 	IEEEtypes_SsParamElement_t SsParamSet;
2335 	IEEEtypes_CapInfo_t Cap;
2336 	IEEEtypes_DataRate_t DataRates[IEEEtypes_MAX_DATA_RATES_G];
2337 	/*
2338 	 ** DO NOT ADD ANY FIELDS TO THIS STRUCTURE.  It is used in the middle of
2339 	 **   the adhoc join command.  Any changes will shift the binary layout
2340 	 **   of the following fields in the command from the driver
2341 	 */
2342 } MLAN_PACK_END IEEEtypes_BssDesc_t;
2343 
2344 typedef enum {
2345 	Band_2_4_GHz = 0,
2346 	Band_5_GHz = 1,
2347 	Band_4_GHz = 2,
2348 
2349 } ChanBand_e;
2350 
2351 #define NUM_CHAN_BAND_ENUMS  3
2352 
2353 typedef enum {
2354 	ChanWidth_20_MHz = 0,
2355 	ChanWidth_10_MHz = 1,
2356 	ChanWidth_40_MHz = 2,
2357 	ChanWidth_80_MHz = 3,
2358 
2359 } ChanWidth_e;
2360 
2361 typedef enum {
2362 	SECONDARY_CHAN_NONE = 0,
2363 	SECONDARY_CHAN_ABOVE = 1,
2364 	SECONDARY_CHAN_BELOW = 3,
2365 	//reserved 2, 4~255
2366 } Chan2Offset_e;
2367 
2368 typedef enum {
2369 	MANUAL_MODE = 0,
2370 	ACS_MODE = 1,
2371 } ScanMode_e;
2372 
2373 typedef MLAN_PACK_START struct {
2374 	IEEEtypes_ElementId_e ElementId;
2375 	IEEEtypes_Len_t Len;
2376 	UINT8 chan2Offset;
2377 } MLAN_PACK_END IEEEtypes_SecondaryChannelOffset_t;
2378 
2379 /* This struct is used in ROM and existing fields should not be changed. */
2380 typedef MLAN_PACK_START struct {
2381 	ChanBand_e chanBand:2;
2382 	ChanWidth_e chanWidth:2;
2383 	Chan2Offset_e chan2Offset:2;
2384 	ScanMode_e scanMode:2;
2385 } MLAN_PACK_END BandConfig_t;
2386 
2387 #define MASK_SCAN_MODE(pBandConfig) (*(UINT8*)(pBandConfig) &= 0x3f)
2388 
2389 #define BC_2_4_GHZ  {Band_2_4_GHz, ChanWidth_20_MHz, SECONDARY_CHAN_NONE, MANUAL_MODE}
2390 #define BC_5_GHZ    {Band_5_GHz,   ChanWidth_20_MHz, SECONDARY_CHAN_NONE, MANUAL_MODE}
2391 
2392 typedef MLAN_PACK_START struct {
2393 	BandConfig_t bandConfig;
2394 	UINT8 chanNum;
2395 
2396 } MLAN_PACK_END ChanBandInfo_t;
2397 
2398 typedef MLAN_PACK_START struct {
2399 	UINT8 passiveScan:1;
2400 	UINT8 disableChanFilt:1;
2401 	UINT8 multiDomainScan:1;
2402 	UINT8 rspTimeoutEn:1;
2403 	UINT8 hiddenSsidReport:1;
2404 	UINT8 firstScanCmd:1;
2405 	UINT8 reserved_6_7:2;
2406 
2407 } MLAN_PACK_END ChanScanMode_t;
2408 
2409 typedef MLAN_PACK_START struct {
2410 	BandConfig_t bandConfig;
2411 	UINT8 chanNum;
2412 	ChanScanMode_t scanMode;
2413 	UINT16 minScanTime;	// unused - not removed since shared with
2414 	// host
2415 	UINT16 maxScanTime;
2416 
2417 } MLAN_PACK_END channelInfo_t;
2418 
2419 /*
2420 ** Join request message from the SME to establish synchronization with
2421 ** a BSS
2422 */
2423 typedef MLAN_PACK_START struct {
2424 	IEEEtypes_BssDesc_t BssDesc;
2425 #ifdef OLD_DFS
2426 	IEEEtypes_QuietElement_t Quiet_Element;
2427 	IEEEtypes_IbssDfsElement_t IBSS_DFS_Element;
2428 #endif
2429 	channelInfo_t JoinChannel;
2430 
2431 	UINT8 *pIeBuf;
2432 	UINT16 ieBufLen;
2433 } MLAN_PACK_END IEEEtypes_JoinCmd_t;
2434 
2435 /*
2436 ** Join confirm message sent from the MLME as a result of a join request;
2437 ** it reports the result of the join
2438 */
2439 typedef MLAN_PACK_START struct {
2440 	IEEEtypes_JoinResult_e Result;
2441 } MLAN_PACK_END IEEEtypes_JoinCfrm_t;
2442 
2443 /*
2444 ** Authenticate request message sent from the SME to establish
2445 ** authentication with a specified peer MAC entity
2446 */
2447 typedef MLAN_PACK_START struct {
2448 	IEEEtypes_MacAddr_t PeerStaAddr;
2449 	IEEEtypes_AuthType_e AuthType;
2450 	IEEEtypes_AuthTransSeq_t AuthTransSeq;
2451 } MLAN_PACK_END IEEEtypes_AuthCmd_t;
2452 
2453 /*
2454 ** Authenticate confirm message sent from the MLME as a result of an
2455 ** authenticate request; it reports the result of the authentication
2456 */
2457 typedef MLAN_PACK_START struct {
2458 	IEEEtypes_MacAddr_t PeerStaAddr;
2459 	IEEEtypes_AuthType_e AuthType;
2460 	IEEEtypes_AuthResult_e Result;
2461 } MLAN_PACK_END IEEEtypes_AuthCfrm_t;
2462 
2463 /*
2464 ** Authenticate indication message sent from the MLME to report
2465 ** authentication with a peer MAC entity that resulted from an
2466 ** authentication procedure that was initiated by that MAC entity
2467 */
2468 typedef MLAN_PACK_START struct {
2469 	IEEEtypes_MacAddr_t PeerStaAddr;
2470 	IEEEtypes_AuthType_e AuthType;
2471 } MLAN_PACK_END IEEEtypes_AuthInd_t;
2472 
2473 /*
2474 ** Deauthenticate request message sent from the SME to invalidate
2475 ** authentication with a specified peer MAC entity
2476 */
2477 typedef MLAN_PACK_START struct {
2478 	IEEEtypes_MacAddr_t PeerStaAddr;
2479 	channelInfo_t DeauthChanInfo;
2480 	IEEEtypes_ReasonCode_t Reason;
2481 } MLAN_PACK_END IEEEtypes_DeauthCmd_t;
2482 
2483 /*
2484 ** Deauthenticate confirm message sent from the MLME as a result of a
2485 ** deauthenticate request message; it reports the result of the
2486 ** deauthentication
2487 */
2488 typedef MLAN_PACK_START struct {
2489 	IEEEtypes_MacAddr_t PeerStaAddr;
2490 	IEEEtypes_DeauthResult_e Result;
2491 } MLAN_PACK_END IEEEtypes_DeauthCfrm_t;
2492 
2493 /*
2494 ** Deauthentication indication message sent from the MLME to report
2495 ** invalidation of an authentication with a peer MAC entity; the message
2496 ** is generated as a result of an invalidation of the authentication
2497 */
2498 typedef MLAN_PACK_START struct {
2499 	IEEEtypes_MacAddr_t PeerStaAddr;
2500 	IEEEtypes_ReasonCode_t Reason;
2501 } MLAN_PACK_END IEEEtypes_DeauthInd_t;
2502 
2503 /*
2504 ** Internal Association command constructed from the TLV based host
2505 **   command struct
2506 */
2507 typedef struct {
2508 	IEEEtypes_MacAddr_t PeerStaAddr;
2509 	IEEEtypes_CapInfo_t CapInfo;
2510 	IEEEtypes_ListenInterval_t ListenInterval;
2511 	IEEEtypes_SsId_t SsId;
2512 	IEEEtypes_DataRate_t RateSet[IEEEtypes_MAX_DATA_RATES_G];
2513 
2514 	UINT8 *pIeBuf;
2515 	UINT16 ieBufLen;
2516 
2517 } IEEEtypes_AssocCmd_t;
2518 
2519 /*
2520 ** Association confirm message sent from the MLME as a result of an
2521 **   association request message; it reports the result of the assoication
2522 */
2523 typedef MLAN_PACK_START struct {
2524 	IEEEtypes_AssocResult_e Result;
2525 	IEEEtypes_AssocCmdFailurePoint_e FailurePoint;
2526 } MLAN_PACK_END IEEEtypes_AssocCfrm_t;
2527 
2528 /*
2529 ** Disassociate request message sent from the SME to establish
2530 ** disassociation with an AP
2531 */
2532 typedef MLAN_PACK_START struct {
2533 	IEEEtypes_MacAddr_t PeerStaAddr;
2534 	IEEEtypes_ReasonCode_t Reason;
2535 } MLAN_PACK_END IEEEtypes_DisassocCmd_t;
2536 
2537 /*
2538 ** Disassociate confirm message sent from the MLME as a result of a
2539 ** disassociate request message; it reports the result of the
2540 ** disassociation
2541 */
2542 typedef MLAN_PACK_START struct {
2543 	IEEEtypes_DisassocResult_e Result;
2544 } MLAN_PACK_END IEEEtypes_DisassocCfrm_t;
2545 
2546 /*
2547 ** Disassociate indication message sent from the MLME to report the
2548 ** invalidation of an association relationship with a peer MAC entity;
2549 ** the message is generated as a result of an invalidation of an
2550 ** association relationship
2551 */
2552 typedef MLAN_PACK_START struct {
2553 	IEEEtypes_MacAddr_t PeerStaAddr;
2554 	IEEEtypes_ReasonCode_t Reason;
2555 } MLAN_PACK_END IEEEtypes_DisassocInd_t;
2556 
2557 typedef MLAN_PACK_START struct {
2558 	IEEEtypes_ElementId_e ElementId;
2559 	IEEEtypes_Len_t Len;
2560 	IEEEtypes_MacAddr_t MacAddr;
2561 } MLAN_PACK_END IEEEtypes_BssId_t;
2562 
2563 /*
2564 ** Start request message sent from the SME to start a new BSS; the BSS
2565 **   may be either an infrastructure BSS (with the MAC entity acting as the
2566 **   AP) or an independent BSS (with the MAC entity acting as the first
2567 **   station in the IBSS)
2568 */
2569 typedef MLAN_PACK_START struct {
2570 	IEEEtypes_SsId_t SsId;
2571 	IEEEtypes_Bss_e BssType;
2572 	IEEEtypes_BcnInterval_t BcnPeriod;
2573 	IEEEtypes_DtimPeriod_t DtimPeriod;
2574 	IEEEtypes_SsParamElement_t SsParamSet;
2575 	IEEEtypes_PhyParamElement_t PhyParamSet;
2576 	UINT16 Reserved;
2577 	IEEEtypes_CapInfo_t CapInfo;
2578 	IEEEtypes_DataRate_t OpRateSet[IEEEtypes_MAX_DATA_RATES_G];
2579 #ifdef OLD_DFS
2580 	IEEEtypes_QuietElement_t Quiet_Element;
2581 	IEEEtypes_IbssDfsElement_t IBSS_DFS_Element;
2582 #endif
2583 	channelInfo_t JoinChannel;
2584 	UINT8 *pIeBuf;
2585 	UINT16 ieBufLen;
2586 	IEEEtypes_BssId_t BssId;
2587 } MLAN_PACK_END IEEEtypes_StartCmd_t;
2588 
2589 /*
2590 ** Start confirm message sent from the MLME as a result of a start request
2591 **   message; it reports the results of the BSS creation procedure
2592 */
2593 typedef MLAN_PACK_START struct {
2594 	IEEEtypes_StartResult_e Result;
2595 } MLAN_PACK_END IEEEtypes_StartCfrm_t;
2596 
2597 typedef MLAN_PACK_START struct {
2598 	IEEEtypes_MacAddr_t PeerStaAddr;
2599 } MLAN_PACK_END IEEEtypes_TPCAdaptCmd_t;
2600 
2601 typedef MLAN_PACK_START struct {
2602 	IEEEtypes_TPCAdaptResult_e Result;
2603 } MLAN_PACK_END IEEEtypes_TPCAdaptCfrm_t;
2604 
2605 typedef struct {
2606 	IEEEtypes_GenHdr_t Hdr;
2607 	UINT8 Body[8];
2608 } IEEEtypes_Frame_t;
2609 
2610 typedef MLAN_PACK_START struct {
2611 	IEEEtypes_MacAddr_t da;
2612 	IEEEtypes_MacAddr_t sa;
2613 	UINT16 type;
2614 } MLAN_PACK_END ether_hdr_t;
2615 
2616 typedef MLAN_PACK_START struct {
2617 	ether_hdr_t Hdr;
2618 	UINT8 Body[1600 - 14];
2619 } MLAN_PACK_END IEEEtypes_8023_Frame_t;
2620 
2621 typedef MLAN_PACK_START struct {
2622 	IEEEtypes_ElementId_e ElemId;
2623 	IEEEtypes_Len_t Len;
2624 	UINT8 Oui[4];
2625 	UINT8 Data[1];
2626 } MLAN_PACK_END IEEEtypes_WPSElement_t;
2627 
2628 /*---------------------------------*/
2629 /* IEEE 802.11 Management Messages */
2630 /*---------------------------------*/
2631 
2632 #define WMM_STATS_PKTS_HIST_BINS 7
2633 
2634 typedef MLAN_PACK_START enum {
2635 	AckPolicy_ImmediateAck = 0,
2636 	AckPolicy_NoAck = 1,
2637 	AckPolicy_ExplicitAck = 2,
2638 	AckPolicy_BlockAck = 3,
2639 
2640 } MLAN_PACK_END IEEEtypes_AckPolicy_e;
2641 
2642 typedef MLAN_PACK_START struct {
2643 	UINT16 userPriority:3;
2644 	UINT16 reserved1:1;
2645 	UINT16 eosp:1;
2646 	IEEEtypes_AckPolicy_e ackPolicy:2;
2647 	UINT16 amsdu:1;
2648 	UINT16 reserved2:8;
2649 
2650 } MLAN_PACK_END IEEEtypes_QosCtl_t;
2651 
2652 typedef MLAN_PACK_START struct {
2653 	UINT8 Version;
2654 	UINT8 SourceIpAddr[4];
2655 	UINT8 DestIpAddr[4];
2656 	UINT8 SourcePort[2];
2657 	UINT8 DestPort[2];
2658 	UINT8 DSCP;
2659 	UINT8 Protocol;
2660 	UINT8 Reserved;
2661 
2662 } MLAN_PACK_END IEEEtypes_TCLAS_IPv4_t;
2663 
2664 typedef MLAN_PACK_START struct {
2665 	IEEEtypes_ElementId_e ElementId;
2666 	IEEEtypes_Len_t Len;
2667 
2668 	UINT8 UserPriority;
2669 
2670 	UINT8 ClassifierType;
2671 	UINT8 ClassifierMask;
2672 
2673 	MLAN_PACK_START union {
2674 		IEEEtypes_TCLAS_IPv4_t ipv4;
2675 
2676 	} MLAN_PACK_END classifier;
2677 
2678 } MLAN_PACK_END IEEEtypes_TCLAS_t;
2679 
2680 typedef enum {
2681 	AC_BE = 0x0,
2682 	AC_BK,
2683 	AC_VI,
2684 	AC_VO,
2685 
2686 	AC_MAX_TYPES
2687 } IEEEtypes_WMM_AC_e;
2688 
2689 #define WMM_MAX_TIDS              8
2690 #define WMM_MAX_RX_PN_SUPPORTED   4
2691 
2692 typedef MLAN_PACK_START struct {
2693 	UINT8 Aifsn:4;
2694 	UINT8 Acm:1;
2695 	UINT8 Aci:2;
2696 	UINT8 Rsvd1:1;
2697 
2698 } MLAN_PACK_END IEEEtypes_WMM_AC_ACI_AIFSN_t;
2699 
2700 typedef MLAN_PACK_START struct {
2701 	UINT8 EcwMin:4;
2702 	UINT8 EcwMax:4;
2703 
2704 } MLAN_PACK_END IEEEtypes_ECW_Min_Max_t;
2705 
2706 typedef MLAN_PACK_START struct {
2707 	IEEEtypes_WMM_AC_ACI_AIFSN_t AciAifsn;
2708 	IEEEtypes_ECW_Min_Max_t EcwMinMax;
2709 	UINT16 TxopLimit;
2710 
2711 } MLAN_PACK_END IEEEtypes_WMM_AC_Parameters_t;
2712 
2713 typedef MLAN_PACK_START struct {
2714 	UINT8 ParamSetCount:4;
2715 	UINT8 Reserved1:3;
2716 	UINT8 QosInfoUAPSD:1;
2717 
2718 } MLAN_PACK_END IEEEtypes_QAP_QOS_Info_t;
2719 
2720 typedef MLAN_PACK_START struct {
2721 	UINT8 AC_VO:1;
2722 	UINT8 AC_VI:1;
2723 	UINT8 AC_BK:1;
2724 	UINT8 AC_BE:1;
2725 	UINT8 QAck:1;
2726 	UINT8 MaxSP:2;
2727 	UINT8 MoreDataAck:1;
2728 
2729 } MLAN_PACK_END IEEEtypes_QSTA_QOS_Info_t;
2730 
2731 typedef MLAN_PACK_START union {
2732 	IEEEtypes_QAP_QOS_Info_t QAp;
2733 	IEEEtypes_QSTA_QOS_Info_t QSta;
2734 
2735 } MLAN_PACK_END IEEEtypes_QOS_Info_t;
2736 
2737 //added for TDLS
2738 typedef MLAN_PACK_START struct {
2739 	IEEEtypes_ElementId_e ElementId;
2740 	IEEEtypes_Len_t Len;
2741 	IEEEtypes_QOS_Info_t QosInfo;
2742 } MLAN_PACK_END IEEEtypes_QOS_Capability_t;
2743 
2744 typedef MLAN_PACK_START struct {
2745 	IEEEtypes_ElementId_e ElementId;
2746 	IEEEtypes_Len_t Len;
2747 	UINT8 OuiType[4];	/* 00:50:f2:02 */
2748 	UINT8 OuiSubType;	/* 01 */
2749 	UINT8 Version;
2750 
2751 	IEEEtypes_QOS_Info_t QosInfo;
2752 	UINT8 Reserved1;
2753 	IEEEtypes_WMM_AC_Parameters_t AcParams[AC_MAX_TYPES];
2754 
2755 } MLAN_PACK_END IEEEtypes_WMM_ParamElement_t;
2756 
2757 typedef MLAN_PACK_START struct {
2758 	IEEEtypes_ElementId_e ElementId;
2759 	IEEEtypes_Len_t Len;
2760 	UINT8 OuiType[4];	/* 00:50:f2:02 */
2761 	UINT8 OuiSubType;	/* 00 */
2762 	UINT8 Version;
2763 
2764 	IEEEtypes_QOS_Info_t QosInfo;
2765 
2766 } MLAN_PACK_END IEEEtypes_WMM_InfoElement_t;
2767 
2768 typedef MLAN_PACK_START enum {
2769 	TSPEC_DIR_UPLINK = 0,
2770 	TSPEC_DIR_DOWNLINK = 1,
2771 	/* 2 is a reserved value */
2772 	TSPEC_DIR_BIDIRECT = 3,
2773 
2774 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_Direction_e;
2775 
2776 typedef MLAN_PACK_START enum {
2777 	TSPEC_PSB_LEGACY = 0,
2778 	TSPEC_PSB_TRIG = 1,
2779 
2780 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_PSB_e;
2781 
2782 typedef MLAN_PACK_START enum {
2783 	/* 0 is reserved */
2784 	TSPEC_ACCESS_EDCA = 1,
2785 	TSPEC_ACCESS_HCCA = 2,
2786 	TSPEC_ACCESS_HEMM = 3,
2787 
2788 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_AccessPolicy_e;
2789 
2790 typedef MLAN_PACK_START enum {
2791 	TSPEC_ACKPOLICY_NORMAL = 0,
2792 	TSPEC_ACKPOLICY_NOACK = 1,
2793 	/* 2 is reserved */
2794 	TSPEC_ACKPOLICY_BLOCKACK = 3,
2795 
2796 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e;
2797 
2798 typedef MLAN_PACK_START enum {
2799 	TSPEC_TRAFFIC_APERIODIC = 0,
2800 	TSPEC_TRAFFIC_PERIODIC = 1,
2801 
2802 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e;
2803 
2804 typedef MLAN_PACK_START struct {
2805 	IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType:1;
2806 	UINT8 TID:4;		//! Unique identifier
2807 	IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction:2;
2808 	UINT8 acp_1:1;
2809 
2810 	UINT8 acp_2:1;
2811 	UINT8 Aggregation:1;
2812 	IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PSB:1;	//! Legacy/Trigg
2813 	UINT8 UserPriority:3;	//! 802.1d User Priority
2814 	IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy:2;
2815 
2816 	UINT8 tsinfo_0:8;
2817 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t;
2818 
2819 typedef MLAN_PACK_START struct {
2820 	UINT16 Size:15;		//! Nominal size in octets
2821 	UINT16 Fixed:1;		//! 1: Fixed size given in Size, 0: Var, size is nominal
2822 
2823 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t;
2824 
2825 typedef MLAN_PACK_START struct {
2826 	UINT16 Fractional:13;	//! Fractional portion
2827 	UINT16 Whole:3;		//! Whole portion
2828 
2829 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA;
2830 
2831 typedef MLAN_PACK_START struct {
2832 	IEEEtypes_WMM_TSPEC_TS_Info_t TSInfo;
2833 	IEEEtypes_WMM_TSPEC_NomMSDUSize_t NomMSDUSize;
2834 	UINT16 MaximumMSDUSize;
2835 	UINT32 MinServiceInterval;
2836 	UINT32 MaxServiceInterval;
2837 	UINT32 InactivityInterval;
2838 	UINT32 SuspensionInterval;
2839 	UINT32 ServiceStartTime;
2840 	UINT32 MinimumDataRate;
2841 	UINT32 MeanDataRate;
2842 	UINT32 PeakDataRate;
2843 	UINT32 MaxBurstSize;
2844 	UINT32 DelayBound;
2845 	UINT32 MinPHYRate;
2846 	IEEEtypes_WMM_TSPEC_SBWA SurplusBWAllowance;
2847 	UINT16 MediumTime;
2848 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_Body_t;
2849 
2850 typedef MLAN_PACK_START struct {
2851 	UINT8 ElementId;
2852 	UINT8 Len;
2853 	UINT8 OuiType[4];	/* 00:50:f2:02 */
2854 	UINT8 OuiSubType;	/* 01 */
2855 	UINT8 Version;
2856 
2857 	IEEEtypes_WMM_TSPEC_Body_t TspecBody;
2858 
2859 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_t;
2860 
2861 typedef MLAN_PACK_START enum {
2862 	TSPEC_ACTION_CODE_ADDTS_REQ = 0,
2863 	TSPEC_ACTION_CODE_ADDTS_RSP = 1,
2864 	TSPEC_ACTION_CODE_DELTS = 2,
2865 
2866 } MLAN_PACK_END IEEEtypes_WMM_Tspec_Action_e;
2867 
2868 typedef MLAN_PACK_START struct {
2869 	IEEEtypes_ActionCategory_e category;
2870 	IEEEtypes_WMM_Tspec_Action_e action;
2871 	UINT8 dialogToken;
2872 
2873 } MLAN_PACK_END IEEEtypes_WMM_Tspec_Action_Base_Tspec_t;
2874 
2875 /* Allocate enough space for a V4 TCLASS + a small CCX or VendSpec IE */
2876 #define WMM_TSPEC_EXTRA_IE_BUF_MAX  (sizeof(IEEEtypes_TCLAS_t) + 6)
2877 
2878 typedef MLAN_PACK_START struct {
2879 	IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
2880 	UINT8 statusCode;
2881 	IEEEtypes_WMM_TSPEC_t tspecIE;
2882 
2883 	/* Place holder for additional elements after the TSPEC */
2884 	UINT8 subElem[WMM_TSPEC_EXTRA_IE_BUF_MAX];
2885 
2886 } MLAN_PACK_END IEEEtypes_Action_WMM_AddTsReq_t;
2887 
2888 typedef MLAN_PACK_START struct {
2889 	IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
2890 	UINT8 statusCode;
2891 	IEEEtypes_WMM_TSPEC_t tspecIE;
2892 
2893 	/* Place holder for additional elements after the TSPEC */
2894 	UINT8 subElem[256];
2895 
2896 } MLAN_PACK_END IEEEtypes_Action_WMM_AddTsRsp_t;
2897 
2898 typedef MLAN_PACK_START struct {
2899 	IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
2900 	UINT8 reasonCode;
2901 	IEEEtypes_WMM_TSPEC_t tspecIE;
2902 
2903 } MLAN_PACK_END IEEEtypes_Action_WMM_DelTs_t;
2904 
2905 typedef MLAN_PACK_START union {
2906 	IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
2907 
2908 	IEEEtypes_Action_WMM_AddTsReq_t addTsReq;
2909 	IEEEtypes_Action_WMM_AddTsRsp_t addTsRsp;
2910 	IEEEtypes_Action_WMM_DelTs_t delTs;
2911 
2912 } MLAN_PACK_END IEEEtypes_Action_WMMAC_t;
2913 
2914 typedef MLAN_PACK_START struct {
2915 	IEEEtypes_MgmtHdr_t Hdr;
2916 	MLAN_PACK_START union {
2917 		IEEEtypes_Bcn_t Bcn;
2918 		IEEEtypes_DisAssoc_t DisAssoc;
2919 		IEEEtypes_AssocRqst_t AssocRqst;
2920 		IEEEtypes_AssocRsp_t AssocRsp;
2921 		IEEEtypes_ReAssocRqst_t ReAssocRqst;
2922 		IEEEtypes_ReAssocRsp_t ReAssocRsp;
2923 		IEEEtypes_ProbeRqst_t ProbeRqst;
2924 		IEEEtypes_ProbeRsp_t ProbeRsp;
2925 		IEEEtypes_Auth_t Auth;
2926 		IEEEtypes_Deauth_t Deauth;
2927 		UINT8 BodyStart;
2928 	} MLAN_PACK_END Body;
2929 
2930 	UINT32 FCS;
2931 } MLAN_PACK_END dot11MgtFrame_t;
2932 
2933 #define FCS_SIZE                    (4)
2934 
2935 #define IV_SIZE                     (4)
2936 #define EIV_SIZE                    (4)
2937 #define MIC_SIZE                    (8)
2938 #define MIC_KEY_SIZE                (8)
2939 #define ICV_SIZE                    (4)
2940 #define EXT_IV                      (0x20)
2941 
2942 #define IEEE80211_HEADER_SIZE       (24)
2943 #define QOS_CTRL_SIZE               (2)
2944 #define IEEE80211_QOSHEADER_SIZE    (IEEE80211_HEADER_SIZE+QOS_CTRL_SIZE)
2945 
2946 #define MACHDR_n_FCS_SIZE       (IEEE80211_HEADER_SIZE+FCS_SIZE)
2947 #define QOS_MACHDR_n_FCS_SIZE   (IEEE80211_QOSHEADER_SIZE+FCS_SIZE)
2948 
2949 #define WEPOVERHEAD             (IV_SIZE+ICV_SIZE)
2950 
2951 #define IEEE80211_SIFS_11b      (10)	/* us */
2952 #define IEEE80211_SIFS_11g      (IEEE80211_SIFS_11b)	/* us */
2953 #define IEEE80211_SIFS_11a      (16)	/* us */
2954 
2955 #define IEEE80211b_SHORT_PREAM  (96)	/* us */
2956 #define IEEE80211b_LONG_PREAM   (192)	/* us */
2957 
2958 #define SIGNAL_EXTENSION        (6)	/* us */
2959 
2960 #define TPREAMBLE               (16)	/* us */
2961 #define TSIGNAL                 (4)	/* us */
2962 #define IEEE80211g_PREAM        (TPREAMBLE+TSIGNAL)	/* us */
2963 #define IEEE80211a_PREAM        (IEEE80211g_PREAM )	/* us */
2964 #define IEEE80211n_PREAM        (40)	/* us */
2965 #define IEEE80211ac_PREAM       (40)    /* us */	//TBD
2966 
2967 #define TSYM                    (4)	/* us */
2968 
2969 #define IEEE80211_BSS_CLOCK_PPM (100)	// ppm
2970 
2971 enum {
2972 	OTHER = 0x00,
2973 	FCC = 0x10,
2974 	IC = 0x20,
2975 	ETSI = 0x30,
2976 	SPAIN = 0x31,
2977 	FRANCE = 0x32,
2978 	JAPAN = 0x40,
2979 	JAPAN1 = 0x41,
2980 	CHINA = 0x50
2981 };
2982 
2983 typedef enum {
2984 	RegDomain_Null = 0x00,
2985 
2986 	RegDomain_FCC = 0x01,
2987 	RegDomain_ETSI = 0x02,
2988 	RegDomain_MIC = 0x03,
2989 
2990 	RegDomain_Other = 0xFF,
2991 
2992 } RegDomain_e;
2993 
2994 #define IEEE_PHY_RATE_CODE_1Mbps    (10)	// it's the same as IEEE_PHY_RATE_CODE_12Mbps
2995 #define IEEE_PHY_RATE_CODE_2Mbps    (20)
2996 #define IEEE_PHY_RATE_CODE_5_5Mbps  (55)
2997 #define IEEE_PHY_RATE_CODE_11Mbps   (110)
2998 #define IEEE_PHY_RATE_CODE_22Mbps   (220)
2999 #define IEEE_PHY_RATE_CODE_6Mbps    (0x0B)
3000 #define IEEE_PHY_RATE_CODE_9Mbps    (0x0F)
3001 #define IEEE_PHY_RATE_CODE_12Mbps   (0x0A)	// it's the same as IEEE_PHY_RATE_CODE_1Mbps
3002 #define IEEE_PHY_RATE_CODE_18Mbps   (0x0E)
3003 #define IEEE_PHY_RATE_CODE_24Mbps   (0x09)
3004 #define IEEE_PHY_RATE_CODE_36Mbps   (0x0D)
3005 #define IEEE_PHY_RATE_CODE_48Mbps   (0x08)
3006 #define IEEE_PHY_RATE_CODE_54Mbps   (0x0C)
3007 #define IEEE_PHY_RATE_CODE_72Mbps   (0x07)
3008 
3009 #define IEEE_PHY_RATE_CODE_1Mbps    (10)	// it's the same as IEEE_PHY_RATE_CODE_12Mbps
3010 #define IEEE_PHY_RATE_CODE_2Mbps    (20)
3011 #define IEEE_PHY_RATE_CODE_5_5Mbps  (55)
3012 #define IEEE_PHY_RATE_CODE_11Mbps   (110)
3013 #define IEEE_PHY_RATE_CODE_22Mbps   (220)
3014 
3015 #define IEEE_PHY_RATE_CODE_6Mbps    (0x0B)
3016 #define IEEE_PHY_RATE_CODE_9Mbps    (0x0F)
3017 #define IEEE_PHY_RATE_CODE_12Mbps   (0x0A)	// it's the same as IEEE_PHY_RATE_CODE_1Mbps
3018 #define IEEE_PHY_RATE_CODE_18Mbps   (0x0E)
3019 #define IEEE_PHY_RATE_CODE_24Mbps   (0x09)
3020 #define IEEE_PHY_RATE_CODE_36Mbps   (0x0D)
3021 #define IEEE_PHY_RATE_CODE_48Mbps   (0x08)
3022 #define IEEE_PHY_RATE_CODE_54Mbps   (0x0C)
3023 #define IEEE_PHY_RATE_CODE_72Mbps   (0x07)
3024 
3025 #define IEEE_PHY_RATE_CODE_MCS0     (0x00)
3026 #define IEEE_PHY_RATE_CODE_MCS1     (0x01)
3027 #define IEEE_PHY_RATE_CODE_MCS2     (0x02)
3028 #define IEEE_PHY_RATE_CODE_MCS3     (0x03)
3029 #define IEEE_PHY_RATE_CODE_MCS4     (0x04)
3030 #define IEEE_PHY_RATE_CODE_MCS5     (0x05)
3031 #define IEEE_PHY_RATE_CODE_MCS6     (0x06)
3032 #define IEEE_PHY_RATE_CODE_MCS7     (0x07)
3033 
3034 #define IEEE_PHY_RATE_CODE_MCS8     (0x08)
3035 #define IEEE_PHY_RATE_CODE_MCS9     (0x09)
3036 #define IEEE_PHY_RATE_CODE_MCS10    (0x0A)
3037 #define IEEE_PHY_RATE_CODE_MCS11    (0x0B)
3038 #define IEEE_PHY_RATE_CODE_MCS12    (0x0C)
3039 #define IEEE_PHY_RATE_CODE_MCS13    (0x0D)
3040 #define IEEE_PHY_RATE_CODE_MCS14    (0x0E)
3041 #define IEEE_PHY_RATE_CODE_MCS15    (0x0F)
3042 
3043 #define IEEE_PHY_RATE_CODE_MCS32    (0x20)
3044 
3045 typedef enum {
3046 	MOD_CLASS_INFRA = 1,
3047 	MOD_CLASS_FHSS = 2,
3048 	MOD_CLASS_HR_DSSS = 3,
3049 	MOD_CLASS_ERP_PBCC = 4,
3050 	MOD_CLASS_DSSS_OFDM = 5,
3051 	MOD_CLASS_ERP_OFDM = 6,
3052 	MOD_CLASS_OFDM = 7,
3053 	MOD_CLASS_HT = 8,
3054 	MOD_CLASS_VHT = 9,
3055 } MOD_CLASS_e;
3056 
3057 typedef enum {
3058 	DSSS_1Mbps = 0 + (MOD_CLASS_HR_DSSS << 8),
3059 	DSSS_2Mbps,
3060 	DSSS_5d5Mbps,
3061 	DSSS_11Mbps,
3062 } HR_DSSS_e;
3063 
3064 typedef enum {
3065 	OFDM_6Mbps = 0 + (MOD_CLASS_OFDM << 8),
3066 	OFDM_9Mbps,
3067 	OFDM_12Mbps,
3068 	OFDM_18Mbps,
3069 	OFDM_24Mbps,
3070 	OFDM_36Mbps,
3071 	OFDM_48Mbps,
3072 	OFDM_54Mbps,
3073 } OFDM_e;
3074 
3075 typedef enum {
3076 	// 1x1 EM
3077 	MCS_0 = 0 + (MOD_CLASS_HT << 8),
3078 	MCS_1,
3079 	MCS_2,
3080 	MCS_3,
3081 	MCS_4,
3082 	MCS_5,
3083 	MCS_6,
3084 	MCS_7,
3085 
3086 	// 2x2 EM
3087 	MCS_8,
3088 	MCS_9,
3089 	MCS_10,
3090 	MCS_11,
3091 	MCS_12,
3092 	MCS_13,
3093 	MCS_14,
3094 	MCS_15,
3095 
3096 	// 3x3 EM
3097 	MCS_16,
3098 	MCS_17,
3099 	MCS_18,
3100 	MCS_19,
3101 	MCS_20,
3102 	MCS_21,
3103 	MCS_22,
3104 	MCS_23,
3105 
3106 	// 4x4 EM
3107 	MCS_24,
3108 	MCS_25,
3109 	MCS_26,
3110 	MCS_27,
3111 	MCS_28,
3112 	MCS_29,
3113 	MCS_30,
3114 	MCS_31,
3115 
3116 	// 1x1 EM 40MHz only
3117 	MCS_32,
3118 
3119 	// 2x2 UEM
3120 	MCS_33,
3121 	MCS_34,
3122 	MCS_35,
3123 	MCS_36,
3124 	MCS_37,
3125 	MCS_38,
3126 
3127 	// 3x3 UEM
3128 	MCS_39,
3129 	MCS_40,
3130 	MCS_41,
3131 	MCS_42,
3132 	MCS_43,
3133 	MCS_44,
3134 	MCS_45,
3135 	MCS_46,
3136 	MCS_47,
3137 	MCS_48,
3138 	MCS_49,
3139 	MCS_50,
3140 	MCS_51,
3141 	MCS_52,
3142 
3143 	// 4x4 UEM
3144 	MCS_53,
3145 	MCS_54,
3146 	MCS_55,
3147 	MCS_56,
3148 	MCS_57,
3149 	MCS_58,
3150 	MCS_59,
3151 	MCS_60,
3152 	MCS_61,
3153 	MCS_62,
3154 	MCS_63,
3155 	MCS_64,
3156 	MCS_65,
3157 	MCS_66,
3158 	MCS_67,
3159 	MCS_68,
3160 	MCS_69,
3161 	MCS_70,
3162 	MCS_71,
3163 	MCS_72,
3164 	MCS_73,
3165 	MCS_74,
3166 	MCS_75,
3167 	MCS_76,
3168 
3169 } MCS_e;
3170 
3171 typedef union {
3172 	UINT16 u16;
3173 	HR_DSSS_e dsss;
3174 	OFDM_e ofdm;
3175 	MCS_e mcs;
3176 } RATE_CODE_u;
3177 
3178 #define RATECODE_to_RATEID(x)     (x & 0xff)
3179 
3180 #define IEEEtypes_STATUS_INVALID_INFO_ELEMENT    40
3181 #define IEEEtypes_STATUS_INVALID_AKMP            43
3182 #define IEEEtypes_STATUS_CIPHER_POLICY_REJECT    46
3183 #define IEEEtypes_STATUS_INVALID_MCAST_CIPHER    47
3184 #define IEEEtypes_STATUS_INVALID_UCAST_CIPHER    48
3185 #define IEEEtypes_STATUS_UNSUPPORT_WAPI_VERSION  49
3186 #define IEEEtypes_STATUS_INVALID_WAPI_CAPS       50
3187 
3188 typedef MLAN_PACK_START struct {
3189 	IEEEtypes_ElementId_e ElementId;
3190 	IEEEtypes_Len_t Len;
3191 	UINT8 Data[1];
3192 } MLAN_PACK_END IEEEtypes_WAPIElement_t;
3193 
3194 #endif /* _IEEE_TYPES_H_ */
3195