1 /** @file mlan_ieee.h
2  *
3  *  @brief This file contains IEEE information element related
4  *  definitions used in MLAN and MOAL module.
5  *
6  *  Copyright 2008-2024 NXP
7  *
8  *  SPDX-License-Identifier: BSD-3-Clause
9  *
10  */
11 
12 /******************************************************
13 Change log:
14     11/03/2008: initial version
15 ******************************************************/
16 
17 #ifndef _MLAN_IEEE_H_
18 #define _MLAN_IEEE_H_
19 
20 /** FIX IES size in beacon buffer */
21 #define WLAN_802_11_FIXED_IE_SIZE 12
22 /** WLAN supported rates */
23 #define WLAN_SUPPORTED_RATES 14U
24 
25 /** WLAN supported rates extension*/
26 #define WLAN_SUPPORTED_RATES_EXT 60U
27 
28 enum wifi_nxp_wpa_versions
29 {
30     WIFI_NXP_WPA_VERSION_1 = 1 << 0,
31     WIFI_NXP_WPA_VERSION_2 = 1 << 1,
32 };
33 
34 /** Enumeration definition*/
35 /** WLAN_802_11_NETWORK_TYPE */
36 typedef enum _WLAN_802_11_NETWORK_TYPE
37 {
38     Wlan802_11FH,
39     Wlan802_11DS,
40     /* Defined as upper bound */
41     Wlan802_11NetworkTypeMax
42 } WLAN_802_11_NETWORK_TYPE;
43 
44 /** Maximum size of IEEE Information Elements */
45 #define IEEE_MAX_IE_SIZE 500
46 
47 #ifdef BIG_ENDIAN_SUPPORT
48 /** Frame control: Type Mgmt frame */
49 #define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x3000
50 /** Frame control: SubType Mgmt frame */
51 #define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0xF000U) >> 12)
52 #else
53 /** Frame control: Type Mgmt frame */
54 #define IEEE80211_FC_MGMT_FRAME_TYPE_MASK       0x000C
55 /** Frame control: SubType Mgmt frame */
56 #define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0x00F0U) >> 4)
57 #endif
58 
59 #ifdef PRAGMA_PACK
60 #pragma pack(push, 1)
61 #endif
62 
63 /*
64 *****************************************************************************
65 **
66 **
67 **                         802.11 Message Types
68 **
69 **
70 *****************************************************************************
71 */
72 typedef enum
73 {
74     IEEE_TYPE_MANAGEMENT = 0,
75     IEEE_TYPE_CONTROL,
76     IEEE_TYPE_DATA
77 } IEEEtypes_MsgType_e;
78 
79 #if CONFIG_11AX
80 typedef enum _IEEEtypes_Ext_ElementId_e
81 {
82     HE_CAPABILITY = 35,
83     HE_OPERATION  = 36
84 } IEEEtypes_Ext_ElementId_e;
85 #endif
86 
87 /** IEEE Type definitions  */
88 typedef MLAN_PACK_START enum _IEEEtypes_ElementId_e {
89     SSID            = 0,
90     SUPPORTED_RATES = 1,
91 
92     FH_PARAM_SET   = 2,
93     DS_PARAM_SET   = 3,
94     CF_PARAM_SET   = 4,
95     DTIM_PARAM_SET = 5,
96     IBSS_PARAM_SET = 6,
97 
98 #ifdef STA_SUPPORT
99     COUNTRY_INFO = 7,
100 #endif /* STA_SUPPORT */
101 
102     POWER_CONSTRAINT   = 32,
103     POWER_CAPABILITY   = 33,
104     TPC_REQUEST        = 34,
105     TPC_REPORT         = 35,
106     SUPPORTED_CHANNELS = 36,
107     CHANNEL_SWITCH_ANN = 37,
108 #if CONFIG_11K
109     MEASURE_REQUEST = 38,
110     MEASURE_REPORT  = 39,
111 #endif
112     QUIET         = 40,
113     IBSS_DFS      = 41,
114     HT_CAPABILITY = 45,
115     QOS_INFO      = 46,
116 
117 #if (CONFIG_11K) || (CONFIG_11V)
118     NEIGHBOR_REPORT = 52,
119 #endif
120 #if (CONFIG_11R) || (CONFIG_11K)
121     /*IEEE802.11r*/
122     MOBILITY_DOMAIN     = 54,
123     FAST_BSS_TRANSITION = 55,
124     TIMEOUT_INTERVAL    = 56,
125     RIC                 = 57,
126 #endif
127 
128     REGULATORY_CLASS = 59,
129 #if CONFIG_ECSA
130     EXTEND_CHANNEL_SWITCH_ANN = 60,
131 #endif
132     HT_OPERATION = 61,
133 #if CONFIG_11K
134     RRM_ENABLED_CAP = 70,
135 #endif
136 #if CONFIG_MULTI_BSSID_SUPPORT
137     MULTI_BSSID = 71,
138 #endif
139     BSSCO_2040          = 72,
140     OVERLAPBSSSCANPARAM = 74,
141 #if CONFIG_MULTI_BSSID_SUPPORT
142     NONTX_BSSID_CAP = 83,
143 #endif
144 
145 #if CONFIG_MULTI_BSSID_SUPPORT
146     MBSSID_INDEX = 85,
147 #endif
148     EXT_CAPABILITY = 127,
149 
150     /* ERP_INFO = 42, */
151 
152     EXTENDED_SUPPORTED_RATES = 50,
153 
154     VHT_CAPABILITY = 191,
155     VHT_OPERATION  = 192,
156 /*EXT_BSS_LOAD        = 193,*/
157 #if CONFIG_ECSA
158     BW_CHANNEL_SWITCH = 194,
159 #endif
160     VHT_TX_POWER_ENV = 195,
161 #if CONFIG_ECSA
162     EXT_POWER_CONSTR = 196,
163 #endif
164     /*AID_INFO            = 197,
165     QUIET_CHAN          = 198,*/
166     OPER_MODE_NTF = 199,
167 
168     VENDOR_SPECIFIC_221 = 221,
169     WMM_IE              = VENDOR_SPECIFIC_221,
170 
171     WPS_IE = VENDOR_SPECIFIC_221,
172 
173     WPA_IE    = VENDOR_SPECIFIC_221,
174     RSN_IE    = 48,
175     VS_IE     = VENDOR_SPECIFIC_221,
176     WAPI_IE   = 68,
177     FRAGMENT  = 242,
178     RSNX_IE   = 244,
179     EXTENSION = 255,
180 
181 } MLAN_PACK_END IEEEtypes_ElementId_e;
182 
183 /** IEEE IE header */
184 typedef MLAN_PACK_START struct _IEEEtypes_Header_t
185 {
186     /** Element ID */
187     IEEEtypes_ElementId_e element_id;
188     /** Length */
189     t_u8 len;
190 } MLAN_PACK_END IEEEtypes_Header_t, *pIEEEtypes_Header_t;
191 
192 /** Vendor specific IE header */
193 typedef MLAN_PACK_START struct _IEEEtypes_VendorHeader_t
194 {
195     /** Element ID */
196     IEEEtypes_ElementId_e element_id;
197     /** Length */
198     t_u8 len;
199     /** OUI */
200     t_u8 oui[3];
201     /** OUI type */
202     t_u8 oui_type;
203     /** OUI subtype */
204     t_u8 oui_subtype;
205     /** Version */
206     t_u8 version;
207 } MLAN_PACK_END IEEEtypes_VendorHeader_t, *pIEEEtypes_VendorHeader_t;
208 
209 /** Vendor specific IE */
210 typedef MLAN_PACK_START struct _IEEEtypes_VendorSpecific_t
211 {
212     /** Vendor specific IE header */
213     IEEEtypes_VendorHeader_t vend_hdr;
214     /** IE Max - size of previous fields */
215     t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_VendorHeader_t)];
216 } MLAN_PACK_END IEEEtypes_VendorSpecific_t, *pIEEEtypes_VendorSpecific_t;
217 
218 /** IEEE IE */
219 typedef MLAN_PACK_START struct _IEEEtypes_Generic_t
220 {
221     /** Generic IE header */
222     IEEEtypes_Header_t ieee_hdr;
223     /** IE Max - size of previous fields */
224     t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_Header_t)];
225 } MLAN_PACK_END IEEEtypes_Generic_t, *pIEEEtypes_Generic_t;
226 
227 #ifdef ENABLE_802_11R
228 /**ft capability policy*/
229 typedef MLAN_PACK_START struct _IEEEtypes_FtCapPolicy_t
230 {
231 #ifdef BIG_ENDIAN_SUPPORT
232     /** Reserved */
233     t_u8 reserved : 6;
234     /** RIC support */
235     t_u8 ric : 1;
236     /** FT over the DS capable */
237     t_u8 ft_over_ds : 1;
238 #else
239     /** FT over the DS capable */
240     t_u8 ft_over_ds : 1;
241     /** RIC support */
242     t_u8 ric : 1;
243     /** Reserved */
244     t_u8 reserved : 6;
245 #endif
246 } MLAN_PACK_END IEEEtypes_FtCapPolicy_t;
247 
248 /** Mobility domain IE */
249 typedef MLAN_PACK_START struct _IEEEtypes_MobilityDomain_t
250 {
251     /** Generic IE header */
252     IEEEtypes_Header_t ieee_hdr;
253     /** Mobility Domain ID */
254     t_u16 mdid;
255     /** FT Capability policy */
256     t_u8 ft_cap;
257 } MLAN_PACK_END IEEEtypes_MobilityDomain_t;
258 
259 /**FT MIC Control*/
260 typedef MLAN_PACK_START struct _IEEEtypes_FT_MICControl_t
261 {
262     /** reserved */
263     t_u8 reserved;
264     /** element count */
265     t_u8 element_count;
266 } MLAN_PACK_END IEEEtypes_FT_MICControl_t;
267 
268 /** FTIE MIC LEN */
269 #define FTIE_MIC_LEN 16
270 
271 /**FT IE*/
272 typedef MLAN_PACK_START struct _IEEEtypes_FastBssTransElement_t
273 {
274     /** Generic IE header */
275     IEEEtypes_Header_t ieee_hdr;
276     /** mic control */
277     IEEEtypes_FT_MICControl_t mic_control;
278     /** mic */
279     t_u8 mic[FTIE_MIC_LEN];
280     /** ANonce */
281     t_u8 a_nonce[32];
282     /** SNonce */
283     t_u8 s_nonce[32];
284     /** sub element */
285     t_u8 sub_element[1];
286 } MLAN_PACK_END IEEEtypes_FastBssTransElement_t;
287 
288 /*Category for FT*/
289 #define FT_CATEGORY 6
290 /** FT ACTION request */
291 #define FT_ACTION_REQUEST 1
292 /** FT ACTION response */
293 #define FT_ACTION_RESPONSE 2
294 
295 /*FT response and FT ack*/
296 typedef MLAN_PACK_START struct
297 {
298     /** category */
299     t_u8 category;
300     /** action */
301     t_u8 action;
302     /** sta address */
303     t_u8 sta_addr[MLAN_MAC_ADDR_LENGTH];
304     /** target ap address */
305     t_u8 target_ap_addr[MLAN_MAC_ADDR_LENGTH];
306     /** status code */
307     t_u16 status_code;
308     /** varible */
309     t_u8 variable[];
310 } MLAN_PACK_END IEEEtypes_Ft_action_response;
311 
312 /**FT request */
313 typedef MLAN_PACK_START struct
314 {
315     /** category */
316     t_u8 category;
317     /** action */
318     t_u8 action;
319     /** sta address */
320     t_u8 sta_addr[MLAN_MAC_ADDR_LENGTH];
321     /** target ap address */
322     t_u8 target_ap_addr[MLAN_MAC_ADDR_LENGTH];
323     /** varible */
324     t_u8 variable[];
325 } MLAN_PACK_END IEEEtypes_Ft_action_request;
326 #endif
327 
328 /** auth frame body*/
329 typedef MLAN_PACK_START struct
330 {
331     /** auth alg */
332     t_u16 auth_alg;
333     /** auth transaction */
334     t_u16 auth_transaction;
335     /** status code */
336     t_u16 status_code;
337     /** variable */
338     t_u8 variable[];
339 } MLAN_PACK_END IEEEtypes_Auth_framebody;
340 
341 /** associate request frame */
342 typedef MLAN_PACK_START struct
343 {
344     t_u16 capab_info;
345     t_u16 listen_interval;
346     /** followed by SSID and Supported rates */
347     t_u8 variablep[];
348 } MLAN_PACK_END IEEEtypes_assoc_req;
349 
350 /** deauth request frame */
351 typedef MLAN_PACK_START struct
352 {
353     t_u16 reason_code;
354     t_u8 variablep[];
355 } MLAN_PACK_END IEEEtypes_deauth_req;
356 
357 /*Mgmt frame*/
358 typedef MLAN_PACK_START struct
359 {
360     /** frame control */
361     t_u16 frame_control;
362     /** duration */
363     t_u16 duration;
364     /** dest address */
365     t_u8 da[MLAN_MAC_ADDR_LENGTH];
366     /** source address */
367     t_u8 sa[MLAN_MAC_ADDR_LENGTH];
368     /** bssid */
369     t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
370     /** seq control */
371     t_u16 seq_ctrl;
372     union
373     {
374         IEEEtypes_Auth_framebody auth;
375         IEEEtypes_assoc_req assoc_req;
376         IEEEtypes_deauth_req deauth_req;
377 #ifdef ENABLE_802_11R
378         IEEEtypes_Ft_action_response ft_resp;
379         IEEEtypes_Ft_action_request ft_req;
380 #endif
381     } u;
382 } MLAN_PACK_END IEEE80211_MGMT;
383 
384 /** Capability information mask */
385 #define CAPINFO_MASK (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9)))
386 
387 /** Capability Bit Map*/
388 #ifdef BIG_ENDIAN_SUPPORT
389 typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t
390 {
391     t_u8 immediate_block_ack : 1;
392     t_u8 delayed_block_ack : 1;
393     t_u8 dsss_ofdm : 1;
394     t_u8 radio_measurement : 1;
395     t_u8 Apsd : 1;
396     t_u8 short_slot_time : 1;
397     t_u8 qos : 1;
398     t_u8 spectrum_mgmt : 1;
399     t_u8 chan_agility : 1;
400     t_u8 pbcc : 1;
401     t_u8 short_preamble : 1;
402     t_u8 privacy : 1;
403     t_u8 cf_poll_rqst : 1;
404     t_u8 cf_pollable : 1;
405     t_u8 ibss : 1;
406     t_u8 ess : 1;
407 } MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
408 #else
409 typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t
410 {
411     /** Capability Bit Map : ESS */
412     t_u8 ess : 1;
413     /** Capability Bit Map : IBSS */
414     t_u8 ibss : 1;
415     /** Capability Bit Map : CF pollable */
416     t_u8 cf_pollable : 1;
417     /** Capability Bit Map : CF poll request */
418     t_u8 cf_poll_rqst : 1;
419     /** Capability Bit Map : privacy */
420     t_u8 privacy : 1;
421     /** Capability Bit Map : Short preamble */
422     t_u8 short_preamble : 1;
423     /** Capability Bit Map : PBCC */
424     t_u8 pbcc : 1;
425     /** Capability Bit Map : Channel agility */
426     t_u8 chan_agility : 1;
427     /** Capability Bit Map : Spectrum management */
428     t_u8 spectrum_mgmt : 1;
429     /** Capability Bit Map : Qos */
430     t_u8 qos : 1;
431     /** Capability Bit Map : Short slot time */
432     t_u8 short_slot_time : 1;
433     /** Capability Bit Map : APSD */
434     t_u8 Apsd : 1;
435     /** Capability Bit Map : Radio Rsrc Measurement */
436     t_u8 radio_measurement : 1;
437     /** Capability Bit Map : DSS OFDM */
438     t_u8 dsss_ofdm : 1;
439     /** Capability Bit Map : Delayed Block Ack */
440     t_u8 delayed_block_ack : 1;
441     /** Capability Bit Map : Immediate Block Ack */
442     t_u8 immediate_block_ack : 1;
443 } MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
444 #endif /* BIG_ENDIAN_SUPPORT */
445 
446 #if CONFIG_MULTI_BSSID_SUPPORT
447 /** IEEEtypes_Ssid_t */
448 typedef MLAN_PACK_START struct _IEEEtypes_Ssid_t
449 {
450     /** SSID: Element ID */
451     t_u8 element_id;
452     /** SSID : Length */
453     t_u8 len;
454     /** ssid */
455     t_u8 ssid[MLAN_MAX_SSID_LENGTH];
456 } MLAN_PACK_END IEEEtypes_Ssid_t, *pIEEEtypes_Ssid_t;
457 #endif
458 
459 /** IEEEtypes_CfParamSet_t */
460 typedef MLAN_PACK_START struct _IEEEtypes_CfParamSet_t
461 {
462     /** CF peremeter : Element ID */
463     IEEEtypes_ElementId_e element_id;
464     /** CF peremeter : Length */
465     t_u8 len;
466     /** CF peremeter : Count */
467     t_u8 cfp_cnt;
468     /** CF peremeter : Period */
469     t_u8 cfp_period;
470     /** CF peremeter : Maximum duration */
471     t_u16 cfp_max_duration;
472     /** CF peremeter : Remaining duration */
473     t_u16 cfp_duration_remaining;
474 } MLAN_PACK_END IEEEtypes_CfParamSet_t, *pIEEEtypes_CfParamSet_t;
475 
476 /** IEEEtypes_IbssParamSet_t */
477 typedef MLAN_PACK_START struct _IEEEtypes_IbssParamSet_t
478 {
479     /** Element ID */
480     IEEEtypes_ElementId_e element_id;
481     /** Length */
482     t_u8 len;
483     /** ATIM window value in milliseconds */
484     t_u16 atim_window;
485 } MLAN_PACK_END IEEEtypes_IbssParamSet_t, *pIEEEtypes_IbssParamSet_t;
486 
487 /** IEEEtypes_SsParamSet_t */
488 typedef MLAN_PACK_START union _IEEEtypes_SsParamSet_t
489 {
490     /** SS parameter : CF parameter set */
491     IEEEtypes_CfParamSet_t cf_param_set;
492     /** SS parameter : IBSS parameter set */
493     IEEEtypes_IbssParamSet_t ibss_param_set;
494 } MLAN_PACK_END IEEEtypes_SsParamSet_t, *pIEEEtypes_SsParamSet_t;
495 
496 /** IEEEtypes_FhParamSet_t */
497 typedef MLAN_PACK_START struct _IEEEtypes_FhParamSet_t
498 {
499     /** FH parameter : Element ID */
500     IEEEtypes_ElementId_e element_id;
501     /** FH parameter : Length */
502     t_u8 len;
503     /** FH parameter : Dwell time in milliseconds */
504     t_u16 dwell_time;
505     /** FH parameter : Hop set */
506     t_u8 hop_set;
507     /** FH parameter : Hop pattern */
508     t_u8 hop_pattern;
509     /** FH parameter : Hop index */
510     t_u8 hop_index;
511 } MLAN_PACK_END IEEEtypes_FhParamSet_t, *pIEEEtypes_FhParamSet_t;
512 
513 /** IEEEtypes_DsParamSet_t */
514 typedef MLAN_PACK_START struct _IEEEtypes_DsParamSet_t
515 {
516     /** DS parameter : Element ID */
517     IEEEtypes_ElementId_e element_id;
518     /** DS parameter : Length */
519     t_u8 len;
520     /** DS parameter : Current channel */
521     t_u8 current_chan;
522 } MLAN_PACK_END IEEEtypes_DsParamSet_t, *pIEEEtypes_DsParamSet_t;
523 
524 /** IEEEtypes_DTIMParamSet_t */
525 typedef MLAN_PACK_START struct _IEEEtypes_DtimParamSet_t
526 {
527     /** Element ID */
528     IEEEtypes_ElementId_e element_id;
529     /** Length */
530     t_u8 len;
531     /** DTIM Count */
532     t_u8 dtim_count;
533     /** DTIM Period */
534     t_u8 dtim_period;
535     /** Bitmap Control */
536     t_u8 bitmap_control;
537     /** Partial Virtual Bitmap */
538     t_u8 partial_virtual_bitmap;
539 } MLAN_PACK_END IEEEtypes_DtimParamSet_t, *pIEEEtypes_DtimParamSet_t;
540 
541 /** IEEEtypes_PhyParamSet_t */
542 typedef MLAN_PACK_START union _IEEEtypes_PhyParamSet_t
543 {
544     /** FH parameter set */
545     IEEEtypes_FhParamSet_t fh_param_set;
546     /** DS parameter set */
547     IEEEtypes_DsParamSet_t ds_param_set;
548 } MLAN_PACK_END IEEEtypes_PhyParamSet_t, *pIEEEtypes_PhyParamSet_t;
549 
550 /** IEEEtypes_ERPInfo_t */
551 typedef MLAN_PACK_START struct _IEEEtypes_ERPInfo_t
552 {
553     /** Element ID */
554     IEEEtypes_ElementId_e element_id;
555     /** Length */
556     t_u8 len;
557     /** ERP flags */
558     t_u8 erp_flags;
559 } MLAN_PACK_END IEEEtypes_ERPInfo_t, *pIEEEtypes_ERPInfo_t;
560 
561 /** IEEEtypes_AId_t */
562 typedef t_u16 IEEEtypes_AId_t;
563 
564 /** IEEEtypes_StatusCode_t */
565 typedef t_u16 IEEEtypes_StatusCode_t;
566 
567 #if CONFIG_HOST_MLME
568 /** IEEEtypes_SeqCtl_t */
569 typedef MLAN_PACK_START struct _IEEEtypes_SeqCtl_t
570 {
571     /** Fragment Number */
572     t_u16 FragNum : 4;
573     /** Sequence Number */
574     t_u16 SeqNum : 12;
575 } MLAN_PACK_END IEEEtypes_SeqCtl_t;
576 
577 /** IEEEtypes_MgmtHdr_t */
578 typedef MLAN_PACK_START struct _IEEEtypes_MgmtHdr_t
579 {
580     /** FrmCtl*/
581     t_u16 FrmCtl;
582     /** Duration*/
583     t_u16 Duration;
584     /** Destination Addr*/
585     t_u8 DestAddr[6];
586     /** Source Addr*/
587     t_u8 SrcAddr[6];
588     /** BSSID */
589     t_u8 BssId[6];
590     /** IEEEtypes_SeqCtl_t */
591     IEEEtypes_SeqCtl_t SeqCtl;
592 } MLAN_PACK_END IEEEtypes_MgmtHdr_t;
593 #endif
594 
595 /** IEEEtypes_AssocRsp_t */
596 typedef MLAN_PACK_START struct _IEEEtypes_AssocRsp_t
597 {
598     /** Capability information */
599     IEEEtypes_CapInfo_t capability;
600     /** Association response status code */
601     IEEEtypes_StatusCode_t status_code;
602     /** Association ID */
603     IEEEtypes_AId_t a_id;
604     /** IE data buffer */
605     t_u8 ie_buffer[1];
606 } MLAN_PACK_END IEEEtypes_AssocRsp_t, *pIEEEtypes_AssocRsp_t;
607 
608 /** 802.11 supported rates */
609 typedef t_u8 WLAN_802_11_RATES[WLAN_SUPPORTED_RATES];
610 
611 /** cipher TKIP */
612 #define WPA_CIPHER_TKIP2 2
613 /** cipher AES CCMP 128 */
614 #define WPA_CIPHER_AES_CCM 4
615 /** cipher AES GCMP 128 */
616 #define WPA_CIPHER_AES_GCM 8
617 /** cipher AES CCMP 256 */
618 #define WPA_CIPHER_AES_CCM_256 10
619 /** cipher AES GCMP 256 */
620 #define WPA_CIPHER_AES_GCM_256 9
621 
622 /** AKM: 8021x */
623 #define RSN_AKM_8021X 1
624 /** AKM: FT 8021x */
625 #define RSN_AKM_FT_8021X 3
626 /** AKM: 8021x SUITE B*/
627 #define RSN_AKM_8021X_SUITEB 0xb
628 /** AKM: 8021x SUITE B 192*/
629 #define RSN_AKM_8021X_SUITEB_192 0xc
630 /** AKM: FT 8021x SHA384 */
631 #define RSN_AKM_FT_8021X_SHA384 0xd
632 /** AKM: PSK */
633 #define RSN_AKM_PSK 2
634 /** AKM: FT PSK */
635 #define RSN_AKM_FT_PSK 4
636 /** AKM: 8021x_SHA256 */
637 #define RSN_AKM_8021X_SHA256 5
638 /** AKM: PSK SHA256 */
639 #define RSN_AKM_PSK_SHA256 6
640 
641 #ifdef UAP_HOST_MLME
642 /** AKM: SAE SHA256 */
643 #define RSN_AKM_SAE 8
644 /** AKM: FT SAE SHA256 */
645 #define RSN_AKM_FT_SAE 9
646 /** AKM: OWE SHA256 */
647 #define RSN_AKM_OWE 18
648 #endif
649 
650 #if defined(STA_SUPPORT) && defined(ENABLE_802_11W) && defined(EMBEDDED_SUPPLICANT)
651 /** Pairwise Cipher Suite length */
652 #define PAIRWISE_CIPHER_SUITE_LEN 4
653 /** AKM Suite length */
654 #define AKM_SUITE_LEN 4
655 /** MFPC bit in RSN capability */
656 #define MFPC_BIT 7
657 /** MFPR bit in RSN capability */
658 #define MFPR_BIT 6
659 /** PMF ORing mask */
660 #define PMF_MASK 0x00c0
661 #endif
662 
663 /** wpa_suite_t */
664 typedef MLAN_PACK_START struct _wpa_suite_t
665 {
666     /** OUI */
667     t_u8 oui[3];
668     /** tyep */
669     t_u8 type;
670 } MLAN_PACK_END wpa_suite, wpa_suite_mcast_t;
671 
672 /** wpa_suite_ucast_t */
673 typedef MLAN_PACK_START struct
674 {
675     /* count */
676     t_u16 count;
677     /** wpa_suite list */
678     wpa_suite list[1];
679 } MLAN_PACK_END wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t;
680 
681 /** IEEEtypes_Rsn_t */
682 typedef MLAN_PACK_START struct _IEEEtypes_Rsn_t
683 {
684     /** Rsn : Element ID */
685     IEEEtypes_ElementId_e element_id;
686     /** Rsn : Length */
687     t_u8 len;
688     /** Rsn : version */
689     t_u16 version;
690     /** Rsn : group cipher */
691     wpa_suite_mcast_t group_cipher;
692     /** Rsn : pairwise cipher */
693     wpa_suite_ucast_t pairwise_cipher;
694     /** Rsn : AuthKey Mgmt */
695     // wpa_suite_auth_key_mgmt_t auth_key_mgmt;
696 } MLAN_PACK_END IEEEtypes_Rsn_t, *pIEEEtypes_Rsn_t;
697 
698 /** IEEEtypes_Rsnx_t */
699 typedef MLAN_PACK_START struct _IEEEtypes_Rsnx_t
700 {
701     /** Generic IE header */
702     IEEEtypes_Header_t ieee_hdr;
703     /** Rsnx : data */
704     t_u8 data[1];
705 } MLAN_PACK_END IEEEtypes_Rsnx_t, *pIEEEtypes_Rsnx_t;
706 
707 /** IEEEtypes_Wpa_t */
708 typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t
709 {
710     /** Wpa : Element ID */
711     IEEEtypes_ElementId_e element_id;
712     /** Wpa : Length */
713     t_u8 len;
714     /** Wpa : oui */
715     t_u8 oui[4];
716     /** version */
717     t_u16 version;
718     /** Wpa : group cipher */
719     wpa_suite_mcast_t group_cipher;
720     /** Wpa : pairwise cipher */
721     wpa_suite_ucast_t pairwise_cipher;
722     /** Wpa : AuthKey Mgmt */
723     // wpa_suite_auth_key_mgmt_t auth_key_mgmt;
724 } MLAN_PACK_END IEEEtypes_Wpa_t, *pIEEEtypes_Wpa_t;
725 
726 /** Maximum number of AC QOS queues available in the driver/firmware */
727 #define MAX_AC_QUEUES 4
728 
729 /** Data structure of WMM QoS information */
730 typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t
731 {
732 #ifdef BIG_ENDIAN_SUPPORT
733     /** QoS UAPSD */
734     t_u8 qos_uapsd : 1;
735     /** Reserved */
736     t_u8 reserved : 3;
737     /** Parameter set count */
738     t_u8 para_set_count : 4;
739 #else
740     /** Parameter set count */
741     t_u8 para_set_count : 4;
742     /** Reserved */
743     t_u8 reserved : 3;
744     /** QoS UAPSD */
745     t_u8 qos_uapsd : 1;
746 #endif /* BIG_ENDIAN_SUPPORT */
747 } MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t;
748 
749 /** Data structure of WMM Aci/Aifsn */
750 typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t
751 {
752 #ifdef BIG_ENDIAN_SUPPORT
753     /** Reserved */
754     t_u8 reserved : 1;
755     /** Aci */
756     t_u8 aci : 2;
757     /** Acm */
758     t_u8 acm : 1;
759     /** Aifsn */
760     t_u8 aifsn : 4;
761 #else
762     /** Aifsn */
763     t_u8 aifsn : 4;
764     /** Acm */
765     t_u8 acm : 1;
766     /** Aci */
767     t_u8 aci : 2;
768     /** Reserved */
769     t_u8 reserved : 1;
770 #endif /* BIG_ENDIAN_SUPPORT */
771 } MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t;
772 
773 /** Data structure of WMM ECW */
774 typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t
775 {
776 #ifdef BIG_ENDIAN_SUPPORT
777     /** Maximum Ecw */
778     t_u8 ecw_max : 4;
779     /** Minimum Ecw */
780     t_u8 ecw_min : 4;
781 #else
782     /** Minimum Ecw */
783     t_u8 ecw_min : 4;
784     /** Maximum Ecw */
785     t_u8 ecw_max : 4;
786 #endif /* BIG_ENDIAN_SUPPORT */
787 } MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t;
788 
789 /** Data structure of WMM AC parameters  */
790 typedef MLAN_PACK_START struct _IEEEtypes_WmmAcParameters_t
791 {
792     IEEEtypes_WmmAciAifsn_t aci_aifsn; /**< AciAifSn */
793     IEEEtypes_WmmEcw_t ecw;            /**< Ecw */
794     t_u16 tx_op_limit;                 /**< Tx op limit */
795 } MLAN_PACK_END IEEEtypes_WmmAcParameters_t, *pIEEEtypes_WmmAcParameters_t;
796 
797 /** Data structure of WMM Info IE  */
798 typedef MLAN_PACK_START struct _IEEEtypes_WmmInfo_t
799 {
800     /**
801      * WMM Info IE - Vendor Specific Header:
802      *   element_id  [221/0xdd]
803      *   Len         [7]
804      *   Oui         [00:50:f2]
805      *   OuiType     [2]
806      *   OuiSubType  [0]
807      *   Version     [1]
808      */
809     IEEEtypes_VendorHeader_t vend_hdr;
810 
811     /** QoS information */
812     IEEEtypes_WmmQosInfo_t qos_info;
813 
814 } MLAN_PACK_END IEEEtypes_WmmInfo_t, *pIEEEtypes_WmmInfo_t;
815 
816 /** Data structure of WMM parameter IE  */
817 typedef MLAN_PACK_START struct _IEEEtypes_WmmParameter_t
818 {
819     /**
820      * WMM Parameter IE - Vendor Specific Header:
821      *   element_id  [221/0xdd]
822      *   Len         [24]
823      *   Oui         [00:50:f2]
824      *   OuiType     [2]
825      *   OuiSubType  [1]
826      *   Version     [1]
827      */
828     IEEEtypes_VendorHeader_t vend_hdr;
829 
830     /** QoS information */
831     IEEEtypes_WmmQosInfo_t qos_info;
832     /** Reserved */
833     t_u8 reserved;
834 
835     /** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI, WMM_AC_VO */
836     IEEEtypes_WmmAcParameters_t ac_params[MAX_AC_QUEUES];
837 } MLAN_PACK_END IEEEtypes_WmmParameter_t, *pIEEEtypes_WmmParameter_t;
838 
839 /** Enumerator for TSPEC direction */
840 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_Info_Direction_e {
841 
842     TSPEC_DIR_UPLINK   = 0,
843     TSPEC_DIR_DOWNLINK = 1,
844     /* 2 is a reserved value */
845     TSPEC_DIR_BIDIRECT = 3,
846 
847 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_Direction_e;
848 
849 /** Enumerator for TSPEC PSB */
850 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_Info_PSB_e {
851 
852     TSPEC_PSB_LEGACY = 0,
853     TSPEC_PSB_TRIG   = 1,
854 
855 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_PSB_e;
856 
857 /** Enumerator for TSPEC Ack Policy */
858 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e {
859 
860     TSPEC_ACKPOLICY_NORMAL = 0,
861     TSPEC_ACKPOLICY_NOACK  = 1,
862     /* 2 is reserved */
863     TSPEC_ACKPOLICY_BLOCKACK = 3,
864 
865 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e;
866 
867 /** Enumerator for TSPEC Trafffice type */
868 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e {
869 
870     TSPEC_TRAFFIC_APERIODIC = 0,
871     TSPEC_TRAFFIC_PERIODIC  = 1,
872 
873 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e;
874 
875 /** Data structure of WMM TSPEC information */
876 typedef MLAN_PACK_START struct
877 {
878 #ifdef BIG_ENDIAN_SUPPORT
879     t_u8 Reserved17_23 : 7; // ! Reserved
880     t_u8 Schedule : 1;
881     IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
882     t_u8 UserPri : 3;                                        // ! 802.1d User Priority
883     IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; // !
884                                                              // Legacy/Trigg
885     t_u8 Aggregation : 1;                                    // ! Reserved
886     t_u8 AccessPolicy2 : 1;                                  // !
887     t_u8 AccessPolicy1 : 1;                                  // !
888     IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2;
889     t_u8 TID : 4;                                            // ! Unique identifier
890     IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
891 #else
892     IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
893     t_u8 TID : 4;                                            // ! Unique identifier
894     IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2;
895     t_u8 AccessPolicy1 : 1;                                  // !
896     t_u8 AccessPolicy2 : 1;                                  // !
897     t_u8 Aggregation : 1;                                    // ! Reserved
898     IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; // !
899                                                              // Legacy/Trigg
900     t_u8 UserPri : 3;                                        // ! 802.1d User Priority
901     IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
902     t_u8 Schedule : 1;
903     t_u8 Reserved17_23 : 7; // ! Reserved
904 #endif
905 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t;
906 
907 /** Data structure of WMM TSPEC Nominal Size */
908 typedef MLAN_PACK_START struct
909 {
910 #ifdef BIG_ENDIAN_SUPPORT
911     t_u16 Fixed : 1; // ! 1: Fixed size given in Size, 0: Var, size
912                      // is nominal
913     t_u16 Size : 15; // ! Nominal size in octets
914 #else
915     t_u16 Size : 15;        // ! Nominal size in octets
916     t_u16 Fixed : 1;        // ! 1: Fixed size given in Size, 0: Var, size
917                             // is nominal
918 #endif
919 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t;
920 
921 /** Data structure of WMM TSPEC SBWA */
922 typedef MLAN_PACK_START struct
923 {
924 #ifdef BIG_ENDIAN_SUPPORT
925     t_u16 Whole : 3;       // ! Whole portion
926     t_u16 Fractional : 13; // ! Fractional portion
927 #else
928     t_u16 Fractional : 13;  // ! Fractional portion
929     t_u16 Whole : 3;        // ! Whole portion
930 #endif
931 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA;
932 
933 /** Data structure of WMM TSPEC Body */
934 typedef MLAN_PACK_START struct
935 {
936     IEEEtypes_WMM_TSPEC_TS_Info_t TSInfo;
937     IEEEtypes_WMM_TSPEC_NomMSDUSize_t NomMSDUSize;
938     t_u16 MaximumMSDUSize;
939     t_u32 MinServiceInterval;
940     t_u32 MaxServiceInterval;
941     t_u32 InactivityInterval;
942     t_u32 SuspensionInterval;
943     t_u32 ServiceStartTime;
944     t_u32 MinimumDataRate;
945     t_u32 MeanDataRate;
946     t_u32 PeakDataRate;
947     t_u32 MaxBurstSize;
948     t_u32 DelayBound;
949     t_u32 MinPHYRate;
950     IEEEtypes_WMM_TSPEC_SBWA SurplusBWAllowance;
951     t_u16 MediumTime;
952 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_Body_t;
953 
954 /** Data structure of WMM TSPEC all elements */
955 typedef MLAN_PACK_START struct
956 {
957     t_u8 ElementId;
958     t_u8 Len;
959     t_u8 OuiType[4]; /* 00:50:f2:02 */
960     t_u8 OuiSubType; /* 01 */
961     t_u8 Version;
962 
963     IEEEtypes_WMM_TSPEC_Body_t TspecBody;
964 
965 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_t;
966 
967 /** WMM Action Category values */
968 typedef MLAN_PACK_START enum _IEEEtypes_ActionCategory_e {
969     IEEE_MGMT_ACTION_CATEGORY_SPECTRUM_MGMT  = 0,
970     IEEE_MGMT_ACTION_CATEGORY_QOS            = 1,
971     IEEE_MGMT_ACTION_CATEGORY_DLS            = 2,
972     IEEE_MGMT_ACTION_CATEGORY_BLOCK_ACK      = 3,
973     IEEE_MGMT_ACTION_CATEGORY_PUBLIC         = 4,
974     IEEE_MGMT_ACTION_CATEGORY_RADIO_RSRC     = 5,
975     IEEE_MGMT_ACTION_CATEGORY_FAST_BSS_TRANS = 6,
976     IEEE_MGMT_ACTION_CATEGORY_HT             = 7,
977     IEEE_MGMT_ACTION_CATEGORY_SA_QUERY       = 8,
978     IEEE_MGMT_ACTION_CATEGORY_PROTECTED_DUAL = 9,
979     IEEE_MGMT_ACTION_CATEGORY_WNM            = 10,
980     IEEE_MGMT_ACTION_CATEGORY_UNPROTECT_WNM  = 11,
981     IEEE_MGMT_ACTION_CATEGORY_WMM_TSPEC      = 17,
982     IEEE_MGMT_ACTION_CATEGORY_FST            = 18,
983     IEEE_MGMT_ACTION_CATEGORY_AV_STREAMING   = 19,
984     IEEE_MGMT_ACTION_CATEGORY_VENDOR_SPEC    = 127
985 } MLAN_PACK_END IEEEtypes_ActionCategory_e;
986 
987 /** IEEE Std 802.11-2016 - Table 9-354 WNM Action field values */
988 typedef MLAN_PACK_START enum _IEEEtypes_WNM_ActionFieldType_e {
989 
990     IEEE_MGMT_WNM_EVENT_REQUEST                   = 0,
991     IEEE_MGMT_WNM_EVENT_REPORT                    = 1,
992     IEEE_MGMT_WNM_DIAGNOSTIC_REQUEST              = 2,
993     IEEE_MGMT_WNM_DIAGNOSTIC_REPORT               = 3,
994     IEEE_MGMT_WNM_LOCATION_CFG_REQUEST            = 4,
995     IEEE_MGMT_WNM_LOCATION_CFG_RESPONSE           = 5,
996     IEEE_MGMT_WNM_BTM_QUERY                       = 6,
997     IEEE_MGMT_WNM_BTM_REQUEST                     = 7,
998     IEEE_MGMT_WNM_BTM_RESPONSE                    = 8,
999     IEEE_MGMT_WNM_FMS_REQUEST                     = 9,
1000     IEEE_MGMT_WNM_FMS_RESPONSE                    = 10,
1001     IEEE_MGMT_WNM_COLLOCATED_INTERFERENCE_REQUEST = 11,
1002     IEEE_MGMT_WNM_COLLOCATED_INTERFERENCE_REPORT  = 12,
1003     IEEE_MGMT_WNM_TFS_REQUEST                     = 13,
1004     IEEE_MGMT_WNM_TFS_RESPONSE                    = 14,
1005     IEEE_MGMT_WNM_TFS_NOTIFY                      = 15,
1006     IEEE_MGMT_WNM_SLEEP_MODE_REQUEST              = 16,
1007     IEEE_MGMT_WNM_SLEEP_MODE_RESPONSE             = 17,
1008     IEEE_MGMT_WNM_TIM_BROADCAST_REQUEST           = 18,
1009     IEEE_MGMT_WNM_TIM_BROADCAST_RESPONSE          = 19,
1010     IEEE_MGMT_WNM_QOS_TRAFFIC_CAPABILITY_UPDATE   = 20,
1011     IEEE_MGMT_WNM_CHANNEL_USAGE_REQUEST           = 21,
1012     IEEE_MGMT_WNM_CHANNEL_USAGE_RESPONSE          = 22,
1013     IEEE_MGMT_WNM_DMS_REQUEST                     = 23,
1014     IEEE_MGMT_WNM_DMS_RESPONSE                    = 24,
1015     IEEE_MGMT_WNM_TIMING_MEASUREMENT_REQUEST      = 25,
1016     IEEE_MGMT_WNM_NOTIFICATION_REQUEST            = 26,
1017     IEEE_MGMT_WNM_NOTIFICATION_RESPONSE           = 27,
1018     IEEE_MGMT_WNM_NOTIFY_RESPONSE                 = 28
1019 } MLAN_PACK_END IEEEtypes_WNM_ActionFieldType_e;
1020 
1021 #if CONFIG_11V
1022 /* IEEE Std 802.11-2016 - Figure 9-702 Request Mode field */
1023 #define IEEE_WNM_BTM_REQUEST_PREFERENCE_CAND_LIST_INCLUDED MBIT(0)
1024 #define IEEE_WNM_BTM_REQUEST_ABRIDGED                      MBIT(1)
1025 #define IEEE_WNM_BTM_REQUEST_DISASSOC_IMMINENT             MBIT(2)
1026 #define IEEE_WNM_BTM_REQUEST_BSS_TERMINATION_INCLUDED      MBIT(3)
1027 #define IEEE_WNM_BTM_REQUEST_ESS_DISASSOC_IMMINENT         MBIT(4)
1028 #endif
1029 
1030 /** WMM TSPEC operations */
1031 typedef MLAN_PACK_START enum _IEEEtypes_WMM_Tspec_Action_e {
1032 
1033     TSPEC_ACTION_CODE_ADDTS_REQ = 0,
1034     TSPEC_ACTION_CODE_ADDTS_RSP = 1,
1035     TSPEC_ACTION_CODE_DELTS     = 2,
1036 
1037 } MLAN_PACK_END IEEEtypes_WMM_Tspec_Action_e;
1038 
1039 /** WMM TSPEC Category Action Base */
1040 typedef MLAN_PACK_START struct
1041 {
1042     IEEEtypes_ActionCategory_e category;
1043     IEEEtypes_WMM_Tspec_Action_e action;
1044     t_u8 dialogToken;
1045 
1046 } MLAN_PACK_END IEEEtypes_WMM_Tspec_Action_Base_Tspec_t;
1047 
1048 /** WMM TSPEC AddTS request structure */
1049 typedef MLAN_PACK_START struct
1050 {
1051     IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
1052     t_u8 statusCode;
1053     IEEEtypes_WMM_TSPEC_t tspecIE;
1054 
1055     /* Place holder for additional elements after the TSPEC */
1056     t_u8 subElem[256];
1057 
1058 } MLAN_PACK_END IEEEtypes_Action_WMM_AddTsReq_t;
1059 
1060 /** WMM TSPEC AddTS response structure */
1061 typedef MLAN_PACK_START struct
1062 {
1063     IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
1064     t_u8 statusCode;
1065     IEEEtypes_WMM_TSPEC_t tspecIE;
1066 
1067     /* Place holder for additional elements after the TSPEC */
1068     t_u8 subElem[256];
1069 
1070 } MLAN_PACK_END IEEEtypes_Action_WMM_AddTsRsp_t;
1071 
1072 /** WMM TSPEC DelTS structure */
1073 typedef MLAN_PACK_START struct
1074 {
1075     IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
1076     t_u8 reasonCode;
1077     IEEEtypes_WMM_TSPEC_t tspecIE;
1078 
1079 } MLAN_PACK_END IEEEtypes_Action_WMM_DelTs_t;
1080 
1081 /** union of WMM TSPEC structures */
1082 typedef MLAN_PACK_START union
1083 {
1084     IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct;
1085 
1086     IEEEtypes_Action_WMM_AddTsReq_t addTsReq;
1087     IEEEtypes_Action_WMM_AddTsRsp_t addTsRsp;
1088     IEEEtypes_Action_WMM_DelTs_t delTs;
1089 
1090 } MLAN_PACK_END IEEEtypes_Action_WMMAC_t;
1091 
1092 /** union of WMM TSPEC & Action category */
1093 typedef MLAN_PACK_START union
1094 {
1095     IEEEtypes_ActionCategory_e category;
1096 
1097     IEEEtypes_Action_WMMAC_t wmmAc;
1098 
1099 } MLAN_PACK_END IEEEtypes_ActionFrame_t;
1100 
1101 /** action code for 20/40 BSS Coexsitence Management frame */
1102 #define BSS_20_40_COEX 0
1103 /** action code for FILS Discovery Management frame */
1104 #define FILS_DISCOVERY 34
1105 
1106 /** Data structure for subband set */
1107 typedef MLAN_PACK_START struct _IEEEtypes_SubbandSet_t
1108 {
1109     /** First channel */
1110     t_u8 first_chan;
1111     /** Number of channels */
1112     t_u8 no_of_chan;
1113     /** Maximum Tx power in dBm */
1114     t_u8 max_tx_pwr;
1115 } MLAN_PACK_END IEEEtypes_SubbandSet_t, *pIEEEtypes_SubbandSet_t;
1116 
1117 #ifdef STA_SUPPORT
1118 /** Data structure for Country IE */
1119 typedef MLAN_PACK_START struct _IEEEtypes_CountryInfoSet_t
1120 {
1121     /** Element ID */
1122     IEEEtypes_ElementId_e element_id;
1123     /** Length */
1124     t_u8 len;
1125     /** Country code */
1126     t_u8 country_code[COUNTRY_CODE_LEN];
1127     /** Set of subbands */
1128     IEEEtypes_SubbandSet_t sub_band[1];
1129 } MLAN_PACK_END IEEEtypes_CountryInfoSet_t, *pIEEEtypes_CountryInfoSet_t;
1130 
1131 /** Data structure for Country IE full set */
1132 typedef MLAN_PACK_START struct _IEEEtypes_CountryInfoFullSet_t
1133 {
1134     /** Element ID */
1135     IEEEtypes_ElementId_e element_id;
1136     /** Length */
1137     t_u8 len;
1138     /** Country code */
1139     t_u8 country_code[COUNTRY_CODE_LEN];
1140     /** Set of subbands */
1141     IEEEtypes_SubbandSet_t sub_band[MRVDRV_MAX_SUBBAND_802_11D];
1142 } MLAN_PACK_END IEEEtypes_CountryInfoFullSet_t, *pIEEEtypes_CountryInfoFullSet_t;
1143 
1144 #endif /* STA_SUPPORT */
1145 
1146 /** HT Capabilities Data */
1147 typedef MLAN_PACK_START struct _HTCap_t
1148 {
1149     /** HT Capabilities Info field */
1150     t_u16 ht_cap_info;
1151     /** A-MPDU Parameters field */
1152     t_u8 ampdu_param;
1153     /** Supported MCS Set field */
1154     t_u8 supported_mcs_set[16];
1155     /** HT Extended Capabilities field */
1156     t_u16 ht_ext_cap;
1157     /** Transmit Beamforming Capabilities field */
1158     t_u32 tx_bf_cap;
1159     /** Antenna Selection Capability field */
1160     t_u8 asel;
1161 } MLAN_PACK_END HTCap_t, *pHTCap_t;
1162 
1163 /** HT Information Data */
1164 typedef MLAN_PACK_START struct _HTInfo_t
1165 {
1166     /** Primary channel */
1167     t_u8 pri_chan;
1168     /** Field 2 */
1169     t_u8 field2;
1170     /** Field 3 */
1171     t_u16 field3;
1172     /** Field 4 */
1173     t_u16 field4;
1174     /** Bitmap indicating MCSs supported by all HT STAs in the BSS */
1175     t_u8 basic_mcs_set[16];
1176 } MLAN_PACK_END HTInfo_t, *pHTInfo_t;
1177 
1178 /** 20/40 BSS Coexistence Data */
1179 typedef MLAN_PACK_START struct _BSSCo2040_t
1180 {
1181     /** 20/40 BSS Coexistence value */
1182     t_u8 bss_co_2040_value;
1183 } MLAN_PACK_END BSSCo2040_t, *pBSSCo2040_t;
1184 
1185 #ifdef BIG_ENDIAN_SUPPORT
1186 /** Extended Capabilities Data */
1187 typedef MLAN_PACK_START struct _ExtCap_t
1188 {
1189     t_u8 Qos_Map : 1;              /* bit 0 */
1190     t_u8 EBR : 1;                  /* bit 1 */
1191     t_u8 SSPN_Interface : 1;       /* bit 2 */
1192     t_u8 Reserved35 : 1;           /* bit 3 */
1193     t_u8 MSGCF_Capa : 1;           /* bit 4 */
1194     t_u8 TDLSSupport : 1;          /* bit 5 */
1195     t_u8 TDLSProhibited : 1;       /* bit 6 */
1196     t_u8 TDLSChlSwitchProhib : 1;  /* bit 7 */
1197     t_u8 ChannelUsage : 1;         /* bit 8 */
1198     t_u8 SSID_List : 1;            /* bit 9 */
1199     t_u8 DMS : 1;                  /* bit 10 */
1200     t_u8 UTC : 1;                  /* bit 11 */
1201     t_u8 TDLSPeerUAPSDSupport : 1; /* bit 12 */
1202     t_u8 TDLSPeerPSMSupport : 1;   /* bit 13 */
1203     t_u8 TDLSChannelSwitching : 1; /* bit 14 */
1204     t_u8 Interworking : 1;         /* bit 15 */
1205     t_u8 TFS : 1;                  /* bit 16 */
1206     t_u8 WNM_Sleep : 1;            /* bit 17 */
1207     t_u8 TIM_Broadcast : 1;        /* bit 18 */
1208     t_u8 BSS_Transition : 1;       /* bit 19 */
1209     t_u8 QoSTrafficCap : 1;        /* bit 20 */
1210     t_u8 AC_StationCount : 1;      /* bit 21 */
1211     t_u8 MultipleBSSID : 1;        /* bit 22 */
1212     t_u8 TimingMeasurement : 1;    /* bit 23 */
1213     t_u8 Diagnostics : 1;          /* bit 24 */
1214     t_u8 MulticastDiagnostics : 1; /* bit 25 */
1215     t_u8 LocationTracking : 1;     /* bit 26 */
1216     t_u8 FMS : 1;                  /* bit 27 */
1217     t_u8 ProxyARPService : 1;      /* bit 28 */
1218     t_u8 CollocatedIntf : 1;       /* bit 29 */
1219     t_u8 CivicLocation : 1;        /* bit 30 */
1220     t_u8 GeospatialLocation : 1;   /* bit 31 */
1221     t_u8 BSS_CoexistSupport : 1;   /* bit 32 */
1222     t_u8 Reserved1 : 1;            /* bit 33 */
1223     t_u8 ExtChanSwitching : 1;     /* bit 34 */
1224     t_u8 RejectUnadmFrame : 1;     /* bit 35 */
1225     t_u8 PSMP_Capable : 1;         /* bit 36 */
1226     t_u8 Reserved5 : 1;            /* bit 37 */
1227     t_u8 SPSMP_Support : 1;        /* bit 38 */
1228     t_u8 Event : 1;                /* bit 39 */
1229 } MLAN_PACK_END ExtCap_t, *pExtCap_t;
1230 #else
1231 /** Extended Capabilities Data */
1232 typedef MLAN_PACK_START struct _ExtCap_t
1233 {
1234     /** Extended Capabilities value */
1235     t_u8 BSS_CoexistSupport : 1;   /* bit 0 */
1236     t_u8 Reserved1 : 1;            /* bit 1 */
1237     t_u8 ExtChanSwitching : 1;     /* bit 2 */
1238     t_u8 RejectUnadmFrame : 1;     /* bit 3 */
1239     t_u8 PSMP_Capable : 1;         /* bit 4 */
1240     t_u8 Reserved5 : 1;            /* bit 5 */
1241     t_u8 SPSMP_Support : 1;        /* bit 6 */
1242     t_u8 Event : 1;                /* bit 7 */
1243     t_u8 Diagnostics : 1;          /* bit 8 */
1244     t_u8 MulticastDiagnostics : 1; /* bit 9 */
1245     t_u8 LocationTracking : 1;     /* bit 10 */
1246     t_u8 FMS : 1;                  /* bit 11 */
1247     t_u8 ProxyARPService : 1;      /* bit 12 */
1248     t_u8 CollocatedIntf : 1;       /* bit 13 */
1249     t_u8 CivicLocation : 1;        /* bit 14 */
1250     t_u8 GeospatialLocation : 1;   /* bit 15 */
1251     t_u8 TFS : 1;                  /* bit 16 */
1252     t_u8 WNM_Sleep : 1;            /* bit 17 */
1253     t_u8 TIM_Broadcast : 1;        /* bit 18 */
1254     t_u8 BSS_Transition : 1;       /* bit 19 */
1255     t_u8 QoSTrafficCap : 1;        /* bit 20 */
1256     t_u8 AC_StationCount : 1;      /* bit 21 */
1257     t_u8 MultipleBSSID : 1;        /* bit 22 */
1258     t_u8 TimingMeasurement : 1;    /* bit 23 */
1259     t_u8 ChannelUsage : 1;         /* bit 24 */
1260     t_u8 SSID_List : 1;            /* bit 25 */
1261     t_u8 DMS : 1;                  /* bit 26 */
1262     t_u8 UTC : 1;                  /* bit 27 */
1263     t_u8 TDLSPeerUAPSDSupport : 1; /* bit 28 */
1264     t_u8 TDLSPeerPSMSupport : 1;   /* bit 29 */
1265     t_u8 TDLSChannelSwitching : 1; /* bit 30 */
1266     t_u8 Interworking : 1;         /* bit 31 */
1267     t_u8 Qos_Map : 1;              /* bit 32 */
1268     t_u8 EBR : 1;                  /* bit 33 */
1269     t_u8 SSPN_Interface : 1;       /* bit 34 */
1270     t_u8 Reserved35 : 1;           /* bit 35 */
1271     t_u8 MSGCF_Capa : 1;           /* bit 36 */
1272     t_u8 TDLSSupport : 1;          /* bit 37 */
1273     t_u8 TDLSProhibited : 1;       /* bit 38 */
1274     t_u8 TDLSChlSwitchProhib : 1;  /* bit 39 */
1275     t_u8 rsvdBit40 : 1;            /* bit 40 */
1276     t_u8 rsvdBit41 : 1;            /* bit 41 */
1277     t_u8 rsvdBit42 : 1;            /* bit 42 */
1278     t_u8 rsvdBit43 : 1;            /* bit 43 */
1279     t_u8 rsvdBit44 : 1;            /* bit 44 */
1280     t_u8 rsvdBit45 : 1;            /* bit 45 */
1281     t_u8 rsvdBit46 : 1;            /* bit 46 */
1282     t_u8 rsvdBit47 : 1;            /* bit 47 */
1283     t_u8 rsvdBit48 : 1;            /* bit 48 */
1284     t_u8 rsvdBit49 : 1;            /* bit 49 */
1285     t_u8 rsvdBit50 : 1;            /* bit 50 */
1286     t_u8 rsvdBit51 : 1;            /* bit 51 */
1287     t_u8 rsvdBit52 : 1;            /* bit 52 */
1288     t_u8 rsvdBit53 : 1;            /* bit 53 */
1289     t_u8 rsvdBit54 : 1;            /* bit 54 */
1290     t_u8 rsvdBit55 : 1;            /* bit 55 */
1291     t_u8 rsvdBit56 : 1;            /* bit 56 */
1292     t_u8 rsvdBit57 : 1;            /* bit 57 */
1293     t_u8 rsvdBit58 : 1;            /* bit 58 */
1294     t_u8 rsvdBit59 : 1;            /* bit 59 */
1295     t_u8 rsvdBit60 : 1;            /* bit 60 */
1296     t_u8 TDLSWildBandwidth : 1;    /* bit 61 */
1297     t_u8 OperModeNtf : 1;          /* bit 62 */
1298     t_u8 MaxAMSDU0 : 1;            /* bit 63 */
1299     t_u8 MaxAMSDU1 : 1;            /* bit 64 */
1300     t_u8 chanSchedMgnt : 1;        /* bit 65 */
1301     t_u8 rsvdBit66 : 1;            /* bit 66 */
1302     t_u8 NCC : 1;                  /* bit 67 */
1303     t_u8 rsvdBit68 : 1;            /* bit 68 */
1304     t_u8 CAQ : 1;                  /* bit 69 */
1305     t_u8 FTMR : 1;                 /* bit 70 */
1306     t_u8 FTMI : 1;                 /* bit 71 */
1307     t_u8 FILS : 1;                 /* bit 72 */
1308     t_u8 rsvdBit73 : 1;            /* bit 73 */
1309     t_u8 rsvdBit74 : 1;            /* bit 74 */
1310     t_u8 rsvdBit75 : 1;            /* bit 75 */
1311     t_u8 rsvdBit76 : 1;            /* bit 76 */
1312 #if CONFIG_11AX
1313     t_u8 TWTReq : 1;               /* bit 77 */
1314     t_u8 TWTResp : 1;              /* bit 78 */
1315 #else
1316     t_u8 rsvdBit77 : 1; /* bit 77 */
1317     t_u8 rsvdBit78 : 1; /* bit 78 */
1318 #endif
1319     t_u8 rsvdBit79 : 1;            /* bit 79 */
1320 
1321 } MLAN_PACK_END ExtCap_t, *pExtCap_t;
1322 #endif
1323 
1324 /** Overlapping BSS Scan Parameters Data */
1325 typedef MLAN_PACK_START struct _OverlapBSSScanParam_t
1326 {
1327     /** OBSS Scan Passive Dwell in milliseconds */
1328     t_u16 obss_scan_passive_dwell;
1329     /** OBSS Scan Active Dwell in milliseconds */
1330     t_u16 obss_scan_active_dwell;
1331     /** BSS Channel Width Trigger Scan Interval in seconds */
1332     t_u16 bss_chan_width_trigger_scan_int;
1333     /** OBSS Scan Passive Total Per Channel */
1334     t_u16 obss_scan_passive_total;
1335     /** OBSS Scan Active Total Per Channel */
1336     t_u16 obss_scan_active_total;
1337     /** BSS Width Channel Transition Delay Factor */
1338     t_u16 bss_width_chan_trans_delay;
1339     /** OBSS Scan Activity Threshold */
1340     t_u16 obss_scan_active_threshold;
1341 } MLAN_PACK_END OBSSScanParam_t, *pOBSSScanParam_t;
1342 
1343 /** HT Capabilities IE */
1344 typedef MLAN_PACK_START struct _IEEEtypes_HTCap_t
1345 {
1346     /** Generic IE header */
1347     IEEEtypes_Header_t ieee_hdr;
1348     /** HTCap struct */
1349     HTCap_t ht_cap;
1350 } MLAN_PACK_END IEEEtypes_HTCap_t, *pIEEEtypes_HTCap_t;
1351 
1352 /** HT Information IE */
1353 typedef MLAN_PACK_START struct _IEEEtypes_HTInfo_t
1354 {
1355     /** Generic IE header */
1356     IEEEtypes_Header_t ieee_hdr;
1357     /** HTInfo struct */
1358     HTInfo_t ht_info;
1359 } MLAN_PACK_END IEEEtypes_HTInfo_t, *pIEEEtypes_HTInfo_t;
1360 
1361 #if CONFIG_MULTI_BSSID_SUPPORT
1362 /** the AP which send the multi_bssid IE */
1363 #define MULTI_BSSID_AP 1
1364 /** the AP which don't send beacon */
1365 #define MULTI_BSSID_SUB_AP 2
1366 /** IEEEtypes_NotxBssCap_t */
1367 typedef MLAN_PACK_START struct _IEEEtypes_NotxBssCap_t
1368 {
1369     /** Nontransmitted BSSID Capability: Element ID */
1370     t_u8 element_id;
1371     /** Nontransmitted BSSID Capability : Length */
1372     t_u8 len;
1373     /** capability */
1374     t_u16 cap;
1375 } MLAN_PACK_END IEEEtypes_NotxBssCap_t, *pIEEEtypes_NotxBssCap_t;
1376 
1377 /** Multi BSSID IE */
1378 typedef MLAN_PACK_START struct _IEEEtypes_MultiBSSIDIndex_t
1379 {
1380     /** Generic IE header */
1381     IEEEtypes_Header_t ieee_hdr;
1382     /** BSSID Index */
1383     t_u8 bssid_index;
1384     /** DTIM Period (Optional, not Present in ProbeRsp) */
1385     t_u8 dtim_period;
1386     /** DTIM Count (Optional, not Present in ProbeRsp) */
1387     t_u8 dtim_count;
1388 } MLAN_PACK_END IEEEtypes_MultiBSSIDIndex_t, *pIEEEtypes_MultiBSSIDIndex_t;
1389 
1390 /** NonTransmitted BSSID Profile Subelement IE */
1391 /** SUBID for IEEEtypes_NonTransBSSIDCap_t */
1392 #define NONTRANS_BSSID_PROFILE_SUBELEM_ID 0
1393 
1394 /** NonTransmitted BSSID Capability IE */
1395 typedef MLAN_PACK_START struct _IEEEtypes_NonTransBSSIDProfile_t
1396 {
1397     /** Generic IE header */
1398     IEEEtypes_Header_t ieee_hdr;
1399     t_u8 profile_data[];
1400 } MLAN_PACK_END IEEEtypes_NonTransBSSIDProfile_t, *pIEEEtypes_NonTransBSSIDProfile_t;
1401 
1402 /** Multi BSSID IE */
1403 typedef MLAN_PACK_START struct _IEEEtypes_MultiBSSID_t
1404 {
1405     /** Generic IE header */
1406     IEEEtypes_Header_t ieee_hdr;
1407     /** Max BSSID Indicator */
1408     t_u8 max_bssid_indicator;
1409     /** Optional Subelement data*/
1410     t_u8 sub_elem_data[];
1411 } MLAN_PACK_END IEEEtypes_MultiBSSID_t, *pIEEEtypes_MultiBSSID_t;
1412 #endif
1413 
1414 /** 20/40 BSS Coexistence IE */
1415 typedef MLAN_PACK_START struct _IEEEtypes_2040BSSCo_t
1416 {
1417     /** Generic IE header */
1418     IEEEtypes_Header_t ieee_hdr;
1419     /** BSSCo2040_t struct */
1420     BSSCo2040_t bss_co_2040;
1421 } MLAN_PACK_END IEEEtypes_2040BSSCo_t, *pIEEEtypes_2040BSSCo_t;
1422 
1423 /** Extended Capabilities IE */
1424 typedef MLAN_PACK_START struct _IEEEtypes_ExtCap_t
1425 {
1426     /** Generic IE header */
1427     IEEEtypes_Header_t ieee_hdr;
1428     /** ExtCap_t struct */
1429     ExtCap_t ext_cap;
1430 } MLAN_PACK_END IEEEtypes_ExtCap_t, *pIEEEtypes_ExtCap_t;
1431 
1432 /** Overlapping BSS Scan Parameters IE */
1433 typedef MLAN_PACK_START struct _IEEEtypes_OverlapBSSScanParam_t
1434 {
1435     /** Generic IE header */
1436     IEEEtypes_Header_t ieee_hdr;
1437     /** OBSSScanParam_t struct */
1438     OBSSScanParam_t obss_scan_param;
1439 } MLAN_PACK_END IEEEtypes_OverlapBSSScanParam_t, *pIEEEtypes_OverlapBSSScanParam_t;
1440 
1441 /** VHT MCS rate set field, refer to 802.11ac */
1442 typedef MLAN_PACK_START struct _VHT_MCS_set
1443 {
1444     t_u16 rx_mcs_map;
1445     t_u16 rx_max_rate; /* bit 29-31 reserved */
1446     t_u16 tx_mcs_map;
1447     t_u16 tx_max_rate; /* bit 61-63 reserved */
1448 } MLAN_PACK_END VHT_MCS_set_t, *pVHT_MCS_set_t;
1449 
1450 /** VHT Capabilities info field, reference 802.11ac D1.4 p89 */
1451 typedef MLAN_PACK_START struct _VHT_capa
1452 {
1453 #if 0
1454 #ifdef BIG_ENDIAN_SUPPORT
1455     t_u8 mpdu_max_len:2;
1456     t_u8 chan_width:2;
1457     t_u8 rx_LDPC:1;
1458     t_u8 sgi_80:1;
1459     t_u8 sgi_160:1;
1460     t_u8 tx_STBC:1;
1461     t_u8 rx_STBC:3;
1462     t_u8 SU_beamformer_capa:1;
1463     t_u8 SU_beamformee_capa:1;
1464     t_u8 beamformer_ante_num:3;
1465     t_u8 sounding_dim_num:3;
1466     t_u8 MU_beamformer_capa:1;
1467     t_u8 MU_beamformee_capa:1;
1468     t_u8 VHT_TXOP_ps:1;
1469     t_u8 HTC_VHT_capa:1;
1470     t_u8 max_ampdu_len:3;
1471     t_u8 link_apapt_capa:2;
1472     t_u8 reserved_1:4;
1473 #else
1474     t_u8 reserved_1:4;
1475     t_u8 link_apapt_capa:2;
1476     t_u8 max_ampdu_len:3;
1477     t_u8 HTC_VHT_capa:1;
1478     t_u8 VHT_TXOP_ps:1;
1479     t_u8 MU_beamformee_capa:1;
1480     t_u8 MU_beamformer_capa:1;
1481     t_u8 sounding_dim_num:3;
1482     t_u8 beamformer_ante_num:3;
1483     t_u8 SU_beamformee_capa:1;
1484     t_u8 SU_beamformer_capa:1;
1485     t_u8 rx_STBC:3;
1486     t_u8 tx_STBC:1;
1487     t_u8 sgi_160:1;
1488     t_u8 sgi_80:1;
1489     t_u8 rx_LDPC:1;
1490     t_u8 chan_width:2;
1491     t_u8 mpdu_max_len:2;
1492 #endif /* BIG_ENDIAN_SUPPORT */
1493 #endif
1494     t_u32 vht_cap_info;
1495     VHT_MCS_set_t mcs_sets;
1496 } MLAN_PACK_END VHT_capa_t, *pVHT_capa_t;
1497 
1498 /** VHT Capabilities IE */
1499 typedef MLAN_PACK_START struct _IEEEtypes_VHTCap_t
1500 {
1501     /** Generic IE header */
1502     IEEEtypes_Header_t ieee_hdr;
1503     VHT_capa_t vht_cap;
1504 } MLAN_PACK_END IEEEtypes_VHTCap_t, *pIEEEtypes_VHTCap_t;
1505 
1506 #define VHT_CAP_CHWD_80MHZ    0
1507 #define VHT_CAP_CHWD_160MHZ   1
1508 #define VHT_CAP_CHWD_80_80MHZ 2
1509 
1510 /** VHT Operations IE */
1511 typedef MLAN_PACK_START struct _IEEEtypes_VHTOprat_t
1512 {
1513     /** Generic IE header */
1514     IEEEtypes_Header_t ieee_hdr;
1515     /** Channel width */
1516     t_u8 chan_width;
1517     /** Channel center frequency 1 */
1518     t_u8 chan_center_freq_1;
1519     /** Channel center frequency 2 */
1520     t_u8 chan_center_freq_2;
1521     /** Basic MCS set map, each 2 bits stands for a Nss */
1522     t_u16 basic_MCS_map;
1523 } MLAN_PACK_END IEEEtypes_VHTOprat_t, *pIEEEtypes_VHTOprat_t;
1524 
1525 #define VHT_OPER_CHWD_20_40MHZ 0
1526 #define VHT_OPER_CHWD_80MHZ    1U
1527 #define VHT_OPER_CHWD_160MHZ   2
1528 #define VHT_OPER_CHWD_80_80MHZ 3
1529 
1530 /** VHT Transmit Power Envelope IE */
1531 typedef MLAN_PACK_START struct _IEEEtypes_VHTtxpower_t
1532 {
1533     /** Generic IE header */
1534     IEEEtypes_Header_t ieee_hdr;
1535     /** maximum tx power */
1536     t_u8 max_tx_power;
1537     /** channel center frequency */
1538     t_u8 chan_center_freq;
1539     /** channel width */
1540     t_u8 chan_width;
1541 } MLAN_PACK_END IEEEtypes_VHTtxpower_t, *pIEEEtypes_VHTtxpower_t;
1542 
1543 /** Extended Power Constraint IE */
1544 typedef MLAN_PACK_START struct _IEEEtypes_ExtPwerCons_t
1545 {
1546     /** Generic IE header */
1547     IEEEtypes_Header_t ieee_hdr;
1548     /** channel width */
1549     t_u8 chan_width;
1550     /** local power constraint */
1551     t_u8 local_power_cons;
1552 } MLAN_PACK_END IEEEtypes_ExtPwerCons_t, *pIEEEtypes_ExtPwerCons_t;
1553 
1554 #if (CONFIG_11AC) || (CONFIG_ECSA)
1555 /*  IEEE Wide Bandwidth Channel Switch Element */
1556 /**
1557  *  Provided in beacons and probe responses.  Used to advertise when
1558  *    and to which channel it is changing to.  Only starting STAs in
1559  *    an IBSS and APs are allowed to originate a wide bandwidth chan
1560  *    switch element.
1561  */
1562 typedef MLAN_PACK_START struct
1563 {
1564     /** Generic IE header IEEE Element ID = 194*/
1565     IEEEtypes_Header_t ieee_hdr;
1566     t_u8 new_channel_width;
1567     t_u8 new_channel_center_freq0;
1568     t_u8 new_channel_center_freq1;
1569 } MLAN_PACK_END IEEEtypes_WideBWChanSwitch_t;
1570 
1571 /*  IEEE VHT Transmit Power Envelope Element */
1572 /**
1573  *  Provided in beacons and probe responses.  Used to advertise the max
1574  *    TX power in sepeate bandwidth and as a sub element of Channel Switch
1575  *    Wrapper IE.
1576  */
1577 typedef MLAN_PACK_START struct
1578 {
1579     /** Generic IE header IEEE Element ID = 195*/
1580     IEEEtypes_Header_t ieee_hdr;
1581     t_u8 tpc_info;                     /**< Transmit Power Information>*/
1582     t_u8 local_max_tp_20mhz;           /**< Local Maximum Transmit Power for 20 MHZ>*/
1583     t_u8 local_max_tp_40mhz;           /**< Local Maximum Transmit Power for 40 MHZ>*/
1584     t_u8 local_max_tp_80mhz;           /**< Local Maximum Transmit Power for 80 MHZ>*/
1585     t_u8 local_max_tp_160mhz_80_80mhz; /**< Local Maximum Transmit Power for 160/80+80 MHZ>*/
1586 } MLAN_PACK_END IEEEtypes_VhtTpcEnvelope_t;
1587 #endif
1588 
1589 #if CONFIG_ECSA
1590 /** data structure for extended channel switch */
1591 typedef MLAN_PACK_START struct
1592 {
1593     /** IEEE element ID = 60 */
1594     t_u8 element_id;
1595     /** Element length after id and len, set to 4 */
1596     t_u8 len;
1597     /** STA should not transmit any frames if 1 */
1598     t_u8 chan_switch_mode;
1599     /** Operate class # that AP/IBSS is moving to */
1600     t_u8 new_oper_class;
1601     /** Channel # that AP/IBSS is moving to */
1602     t_u8 new_channel_num;
1603     /** of TBTTs before channel switch */
1604     t_u8 chan_switch_count;
1605 } MLAN_PACK_END IEEEtypes_ExtChanSwitchAnn_t;
1606 #endif
1607 
1608 /** Extended BSS Load IE */
1609 typedef MLAN_PACK_START struct _IEEEtypes_ExtBSSload_t
1610 {
1611     /** Generic IE header */
1612     IEEEtypes_Header_t ieee_hdr;
1613     /** MIMO capability count */
1614     t_u8 MU_MIMO_capa_count;
1615     /** stream under utilization */
1616     t_u8 stream_underutilization;
1617     /** VHT 40 util */
1618     t_u8 VHT40_util;
1619     /** VHT 80 util */
1620     t_u8 VHT80_util;
1621     /** VHT 160 util */
1622     t_u8 VHT160_util;
1623 } MLAN_PACK_END IEEEtypes_ExtBSSload_t, *pIEEEtypes_ExtBSSload_t;
1624 
1625 /** Quiet Channel IE */
1626 typedef MLAN_PACK_START struct _IEEEtypes_QuietChan_t
1627 {
1628     /** Generic IE header */
1629     IEEEtypes_Header_t ieee_hdr;
1630     /** AP quiet mode */
1631     t_u8 AP_quiet_mode;
1632     /** Quiet count */
1633     t_u8 quiet_count;
1634     /** Quiet period */
1635     t_u8 quiet_period;
1636     /** Quiet duration */
1637     t_u16 quiet_dur;
1638     /** Quiet offset */
1639     t_u16 quiet_offset;
1640 } MLAN_PACK_END IEEEtypes_QuietChan_t, *pIEEEtypes_QuietChan_t;
1641 
1642 /** Wide Bandwidth Channel Switch IE */
1643 typedef MLAN_PACK_START struct _IEEEtypes_BWSwitch_t
1644 {
1645     /** Generic IE header */
1646     IEEEtypes_Header_t ieee_hdr;
1647     /** New channel width */
1648     t_u8 new_chan_width;
1649     /** New channel center frequency 1 */
1650     t_u8 new_chan_center_freq_1;
1651     /** New channel center frequency 2 */
1652     t_u8 new_chan_center_freq_2;
1653 } MLAN_PACK_END IEEEtypes_BWSwitch_t, *pIEEEtypes_BWSwitch_t;
1654 
1655 /** AID IE */
1656 typedef MLAN_PACK_START struct _IEEEtypes_AID_t
1657 {
1658     /** Generic IE header */
1659     IEEEtypes_Header_t ieee_hdr;
1660     /** AID number */
1661     t_u16 AID;
1662 } MLAN_PACK_END IEEEtypes_AID_t, *pIEEEtypes_AID_t;
1663 
1664 /** Operating Mode Notificaton IE */
1665 typedef MLAN_PACK_START struct _IEEEtypes_OperModeNtf_t
1666 {
1667     /** Generic IE header */
1668     IEEEtypes_Header_t ieee_hdr;
1669     /** Operating Mode */
1670     t_u8 oper_mode;
1671 } MLAN_PACK_END IEEEtypes_OperModeNtf_t, *pIEEEtypes_OperModeNtf_t;
1672 
1673 /** Maximum number of subbands in the IEEEtypes_SupportedChannels_t structure */
1674 #define WLAN_11H_MAX_SUBBANDS 5
1675 
1676 /** Maximum number of DFS channels configured in IEEEtypes_IBSS_DFS_t */
1677 #define WLAN_11H_MAX_IBSS_DFS_CHANNELS 25
1678 
1679 /**  IEEE Power Constraint element (7.3.2.15) */
1680 typedef MLAN_PACK_START struct
1681 {
1682     IEEEtypes_ElementId_e element_id; /**< IEEE Element ID = 32 */
1683     t_u8 len;                         /**< Element length after id and len */
1684     t_u8 local_constraint;            /**< Local power constraint applied to 11d chan info */
1685 } MLAN_PACK_END IEEEtypes_PowerConstraint_t;
1686 
1687 /**  IEEE Power Capability element (7.3.2.16) */
1688 typedef MLAN_PACK_START struct
1689 {
1690     IEEEtypes_ElementId_e element_id; /**< IEEE Element ID = 33 */
1691     t_u8 len;                         /**< Element length after id and len */
1692     t_s8 min_tx_power_capability;     /**< Minimum Transmit power (dBm) */
1693     t_s8 max_tx_power_capability;     /**< Maximum Transmit power (dBm) */
1694 } MLAN_PACK_END IEEEtypes_PowerCapability_t;
1695 
1696 /**  IEEE TPC Report element (7.3.2.18) */
1697 typedef MLAN_PACK_START struct
1698 {
1699     IEEEtypes_ElementId_e element_id; /**< IEEE Element ID = 35 */
1700     t_u8 len;                         /**< Element length after id and len */
1701     t_s8 tx_power;                    /**< Max power used to transmit the TPC Report frame (dBm) */
1702     t_s8 link_margin;                 /**< Link margin when TPC Request received (dB) */
1703 } MLAN_PACK_END IEEEtypes_TPCReport_t;
1704 
1705 /*  IEEE Supported Channel sub-band description (7.3.2.19) */
1706 /**
1707  *  Sub-band description used in the supported channels element.
1708  */
1709 typedef MLAN_PACK_START struct
1710 {
1711     t_u8 start_chan; /**< Starting channel in the subband */
1712     t_u8 num_chans;  /**< Number of channels in the subband */
1713 
1714 } MLAN_PACK_END IEEEtypes_SupportChan_Subband_t;
1715 
1716 /*  IEEE Supported Channel element (7.3.2.19) */
1717 /**
1718  *  Sent in association requests. Details the sub-bands and number
1719  *    of channels supported in each subband
1720  */
1721 typedef MLAN_PACK_START struct
1722 {
1723     IEEEtypes_ElementId_e element_id; /**< IEEE Element ID = 36 */
1724     t_u8 len;                         /**< Element length after id and len */
1725 
1726     /** Configured sub-bands information in the element */
1727     IEEEtypes_SupportChan_Subband_t subband[WLAN_11H_MAX_SUBBANDS];
1728 
1729 } MLAN_PACK_END IEEEtypes_SupportedChannels_t;
1730 
1731 /*  IEEE Channel Switch Announcement Element (7.3.2.20) */
1732 /**
1733  *  Provided in beacons and probe responses.  Used to advertise when
1734  *    and to which channel it is changing to.  Only starting STAs in
1735  *    an IBSS and APs are allowed to originate a chan switch element.
1736  */
1737 typedef MLAN_PACK_START struct
1738 {
1739     IEEEtypes_ElementId_e element_id; /**< IEEE Element ID = 37 */
1740     t_u8 len;                         /**< Element length after id and len */
1741     t_u8 chan_switch_mode;            /**< STA should not transmit any frames if 1 */
1742     t_u8 new_channel_num;             /**< Channel # that AP/IBSS is moving to */
1743     t_u8 chan_switch_count;           /**< # of TBTTs before channel switch */
1744 
1745 } MLAN_PACK_END IEEEtypes_ChanSwitchAnn_t;
1746 
1747 /*  IEEE Quiet Period Element (7.3.2.23) */
1748 /**
1749  *  Provided in beacons and probe responses.  Indicates times during
1750  *    which the STA should not be transmitting data.  Only starting STAs in
1751  *    an IBSS and APs are allowed to originate a quiet element.
1752  */
1753 typedef MLAN_PACK_START struct
1754 {
1755     IEEEtypes_ElementId_e element_id; /**< IEEE Element ID = 40 */
1756     t_u8 len;                         /**< Element length after id and len */
1757     t_u8 quiet_count;                 /**< Number of TBTTs until beacon with the quiet period */
1758     t_u8 quiet_period;                /**< Regular quiet period, # of TBTTS between periods */
1759     t_u16 quiet_duration;             /**< Duration of the quiet period in TUs */
1760     t_u16 quiet_offset;               /**< Offset in TUs from the TBTT for the quiet period */
1761 
1762 } MLAN_PACK_END IEEEtypes_Quiet_t;
1763 
1764 /**
1765 ***  @brief Map octet of the basic measurement report (7.3.2.22.1)
1766 **/
1767 typedef MLAN_PACK_START struct
1768 {
1769 #ifdef BIG_ENDIAN_SUPPORT
1770     t_u8 rsvd5_7 : 3;          /**< Reserved */
1771     t_u8 unmeasured : 1;       /**< Channel is unmeasured */
1772     t_u8 radar : 1;            /**< Radar detected on channel */
1773     t_u8 unidentified_sig : 1; /**< Unidentified signal found on channel */
1774     t_u8 ofdm_preamble : 1;    /**< OFDM preamble detected on channel */
1775     t_u8 bss : 1;              /**< At least one valid MPDU received on channel */
1776 #else
1777     t_u8 bss : 1;              /**< At least one valid MPDU received on channel */
1778     t_u8 ofdm_preamble : 1;    /**< OFDM preamble detected on channel */
1779     t_u8 unidentified_sig : 1; /**< Unidentified signal found on channel */
1780     t_u8 radar : 1;            /**< Radar detected on channel */
1781     t_u8 unmeasured : 1;       /**< Channel is unmeasured */
1782     t_u8 rsvd5_7 : 3;          /**< Reserved */
1783 #endif                         /* BIG_ENDIAN_SUPPORT */
1784 
1785 } MLAN_PACK_END MeasRptBasicMap_t;
1786 
1787 /*  IEEE DFS Channel Map field (7.3.2.24) */
1788 /**
1789  *  Used to list supported channels and provide a octet "map" field which
1790  *    contains a basic measurement report for that channel in the
1791  *    IEEEtypes_IBSS_DFS_t element
1792  */
1793 typedef MLAN_PACK_START struct
1794 {
1795     t_u8 channel_number;       /**< Channel number */
1796     MeasRptBasicMap_t rpt_map; /**< Basic measurement report for the channel */
1797 
1798 } MLAN_PACK_END IEEEtypes_ChannelMap_t;
1799 
1800 /*  IEEE IBSS DFS Element (7.3.2.24) */
1801 /**
1802  *  IBSS DFS element included in ad hoc beacons and probe responses.
1803  *    Provides information regarding the IBSS DFS Owner as well as the
1804  *    originating STAs supported channels and basic measurement results.
1805  */
1806 typedef MLAN_PACK_START struct
1807 {
1808     IEEEtypes_ElementId_e element_id;     /**< IEEE Element ID = 41 */
1809     t_u8 len;                             /**< Element length after id and len */
1810     t_u8 dfs_owner[MLAN_MAC_ADDR_LENGTH]; /**< DFS Owner STA Address */
1811     t_u8 dfs_recovery_interval;           /**< DFS Recovery time in TBTTs */
1812 
1813     /** Variable length map field, one Map entry for each supported channel */
1814     IEEEtypes_ChannelMap_t channel_map[WLAN_11H_MAX_IBSS_DFS_CHANNELS];
1815 
1816 } MLAN_PACK_END IEEEtypes_IBSS_DFS_t;
1817 
1818 /* 802.11h BSS information kept for each BSSID received in scan results */
1819 /**
1820  * IEEE BSS information needed from scan results for later processing in
1821  *    join commands
1822  */
1823 typedef struct
1824 {
1825     t_u8 sensed_11h;                              /**< Capability bit set or 11h IE found in this BSS */
1826 
1827     IEEEtypes_PowerConstraint_t power_constraint; /**< Power Constraint IE */
1828     IEEEtypes_PowerCapability_t power_capability; /**< Power Capability IE */
1829     IEEEtypes_TPCReport_t tpc_report;             /**< TPC Report IE */
1830     IEEEtypes_ChanSwitchAnn_t chan_switch_ann;    /**< Channel Switch Announcement IE */
1831     IEEEtypes_Quiet_t quiet;                      /**< Quiet IE */
1832     IEEEtypes_IBSS_DFS_t ibss_dfs;                /**< IBSS DFS Element IE */
1833 
1834 } wlan_11h_bss_info_t;
1835 
1836 #ifdef STA_SUPPORT
1837 /** Macro for maximum size of scan response buffer */
1838 #define MAX_SCAN_RSP_BUF (16 * 1024)
1839 
1840 /** Maximum number of channels that can be sent in user scan config */
1841 #define WLAN_USER_SCAN_CHAN_MAX 50U
1842 
1843 /** Maximum length of SSID list */
1844 #define MRVDRV_MAX_SSID_LIST_LENGTH 10
1845 
1846 /** Scan all the channels in specified band */
1847 #define BAND_SPECIFIED 0x80U
1848 
1849 /**
1850  *  IOCTL SSID List sub-structure sent in wlan_ioctl_user_scan_cfg
1851  *
1852  *  Used to specify SSID specific filters as well as SSID pattern matching
1853  *    filters for scan result processing in firmware.
1854  */
1855 typedef MLAN_PACK_START struct _wlan_user_scan_ssid
1856 {
1857     /** SSID */
1858     t_u8 ssid[MLAN_MAX_SSID_LENGTH + 1];
1859     /** Maximum length of SSID */
1860     t_u8 max_len;
1861 } MLAN_PACK_END wlan_user_scan_ssid;
1862 
1863 /**
1864  *  @brief IOCTL channel sub-structure sent in wlan_ioctl_user_scan_cfg
1865  *
1866  *  Multiple instances of this structure are included in the IOCTL command
1867  *   to configure a instance of a scan on the specific channel.
1868  */
1869 typedef MLAN_PACK_START struct _wlan_user_scan_chan
1870 {
1871     /** Channel Number to scan */
1872     t_u8 chan_number;
1873     /** Radio type: 'B/G' Band = 0, 'A' Band = 1 */
1874     t_u8 radio_type;
1875     /** Scan type: Active = 1, Passive = 2 */
1876     mlan_scan_type scan_type;
1877     /** Reserved */
1878     t_u8 reserved;
1879     /** Scan duration in milliseconds; if 0 default used */
1880     t_u32 scan_time;
1881 } MLAN_PACK_END wlan_user_scan_chan;
1882 
1883 #if CONFIG_SCAN_CHANNEL_GAP
1884 /** channel statictics */
1885 typedef MLAN_PACK_START struct _ChanStatistics_t
1886 {
1887     /** channle number */
1888     t_u8 chan_num;
1889     /** band info */
1890     Band_Config_t bandcfg;
1891     /** flags */
1892     t_u8 flags;
1893     /** noise */
1894     t_s8 noise;
1895     /** total network */
1896     t_u16 total_networks;
1897     /** scan duration */
1898     t_u16 cca_scan_duration;
1899     /** busy duration */
1900     t_u16 cca_busy_duration;
1901     /** min rss */
1902     t_u8 min_rss;
1903     /** max rssi */
1904     t_u8 max_rss;
1905 } MLAN_PACK_END ChanStatistics_t;
1906 #endif
1907 
1908 /**
1909  *  Input structure to configure an immediate scan cmd to firmware
1910  *
1911  *  Specifies a number of parameters to be used in general for the scan
1912  *    as well as a channel list (wlan_user_scan_chan) for each scan period
1913  *    desired.
1914  */
1915 typedef MLAN_PACK_START struct
1916 {
1917     /**
1918      *  Flag set to keep the previous scan table intact
1919      *
1920      *  If set, the scan results will accumulate, replacing any previous
1921      *   matched entries for a BSS with the new scan data
1922      */
1923     t_u8 keep_previous_scan;
1924     /**
1925      *  BSS mode to be sent in the firmware command
1926      *
1927      *  Field can be used to restrict the types of networks returned in the
1928      *    scan.  Valid settings are:
1929      *
1930      *   - MLAN_SCAN_MODE_BSS  (infrastructure)
1931      *   - MLAN_SCAN_MODE_IBSS (adhoc)
1932      *   - MLAN_SCAN_MODE_ANY  (unrestricted, adhoc and infrastructure)
1933      */
1934     t_u8 bss_mode;
1935     /**
1936      *  Configure the number of probe requests for active chan scans
1937      */
1938     t_u8 num_probes;
1939 #if CONFIG_SCAN_WITH_RSSIFILTER
1940     /**
1941      *  Threshold of RSSI
1942      */
1943     t_s16 rssi_threshold;
1944 #endif
1945     /**
1946      *  @brief Reserved
1947      */
1948     t_u8 reserved;
1949     /**
1950      *  @brief BSSID filter sent in the firmware command to limit the results
1951      */
1952     t_u8 specific_bssid[MLAN_MAC_ADDR_LENGTH];
1953     /**
1954      *  SSID filter list used in the to limit the scan results
1955      */
1956     wlan_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH];
1957     /**
1958      *  Variable number (fixed maximum) of channels to scan up
1959      */
1960     wlan_user_scan_chan chan_list[WLAN_USER_SCAN_CHAN_MAX];
1961 #if CONFIG_SCAN_CHANNEL_GAP
1962     /** scan channel gap */
1963     t_u16 scan_chan_gap;
1964 #endif
1965 } MLAN_PACK_END wlan_user_scan_cfg;
1966 #if CONFIG_BG_SCAN
1967 /** Default scan interval in millisecond*/
1968 #define DEFAULT_BGSCAN_INTERVAL 30000
1969 
1970 /** action get all, except pps/uapsd config */
1971 #define BG_SCAN_ACT_GET 0x0000
1972 /** action set all, except pps/uapsd config */
1973 #define BG_SCAN_ACT_SET 0x0001
1974 #if CONFIG_WMM_UAPSD
1975 /** action get pps/uapsd config */
1976 #define BG_SCAN_ACT_GET_PPS_UAPSD 0x0100
1977 /** action set pps/uapsd config */
1978 #define BG_SCAN_ACT_SET_PPS_UAPSD 0x0101
1979 #endif
1980 /** action set all */
1981 #define BG_SCAN_ACT_SET_ALL 0xff01
1982 /** ssid match */
1983 #define BG_SCAN_SSID_MATCH 0x0001
1984 /** ssid match and RSSI exceeded */
1985 #define BG_SCAN_SSID_RSSI_MATCH 0x0004
1986 /**wait for all channel scan to complete to report scan result*/
1987 #define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000
1988 /** Maximum number of channels that can be sent in bg scan config */
1989 #define WLAN_BG_SCAN_CHAN_MAX 38
1990 #if CONFIG_UNII4_BAND_SUPPORT
1991 /** max bgscan chan number, include UNII_4 channel */
1992 #define WLAN_BG_SCAN_CHAN_MAX_UNII_4 41
1993 #endif
1994 /** Min BGSCAN interval 30 second */
1995 #define MIN_BGSCAN_INTERVAL 30000
1996 /** default repeat count */
1997 #define DEF_REPEAT_COUNT 6
1998 #endif
1999 
2000 /** default rssi low threshold */
2001 #define DEFAULT_RSSI_LOW_THRESHOLD 70
2002 /** RSSI HYSTERSIS */
2003 #define RSSI_HYSTERESIS 4
2004 /** lowest rssi threshold */
2005 #define LOWEST_RSSI_THRESHOLD 82
2006 /** delta rssi */
2007 #define DELTA_RSSI 10
2008 #if CONFIG_SCAN_CHANNEL_GAP
2009 /** Scan channel gap */
2010 #define SCAN_CHANNEL_GAP_VALUE 50U
2011 #endif
2012 #if CONFIG_11AX
2013 typedef MLAN_PACK_START struct _IEEEtypes_Extension_t
2014 {
2015     /** Generic IE header */
2016     IEEEtypes_Header_t ieee_hdr;
2017     /** Element id extension */
2018     t_u8 ext_id;
2019     /** payload */
2020     t_u8 data[];
2021 } MLAN_PACK_END IEEEtypes_Extension_t, *pIEEEtypes_Extension_t;
2022 
2023 typedef MLAN_PACK_START struct _IEEEtypes_HeMcsNss_t
2024 {
2025     /** HE Rx MCS and NSS Set */
2026     t_u16 rx_mcs;
2027     /** HE Tx MCS and NSS Set*/
2028     t_u16 tx_mcs;
2029 } MLAN_PACK_END IEEEtypes_HeMcsNss_t, *pIEEEtypes_HeMcsNss_t;
2030 
2031 typedef MLAN_PACK_START struct _IEEEtypes_HECap_t
2032 {
2033     /** Generic IE header */
2034     IEEEtypes_Header_t ieee_hdr;
2035     /** Element id extension */
2036     t_u8 ext_id;
2037     /** he mac capability info */
2038     t_u8 he_mac_cap[6];
2039     /** he phy capability info */
2040     t_u8 he_phy_cap[11];
2041     /** he txrx mcs support , size would be 4 or 8 or 12 */
2042     t_u8 he_txrx_mcs_support[4];
2043     /** PPE Thresholds (optional) */
2044 } MLAN_PACK_END IEEEtypes_HECap_t, *pIEEEtypes_HECap_t;
2045 
2046 typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
2047 #ifdef BIG_ENDIAN_SUPPORT
2048     /** Reserved, including 6G Operation Info Pressent (bit17) */
2049     t_u8  reserved : 6;                             /* bit 18-23 */
2050     /* 6g operation info present */
2051     t_u8  he_6g_op_info_present :1;                 /* bit 17 */
2052     /** ER SU Disable */
2053     t_u8  er_su_disable : 1;                        /* bit 16 */
2054     /** Co-Hosted BSS */
2055     t_u16 co_located_bss : 1;                       /* bit 15 */
2056     /** VHT Operation Info Present */
2057     t_u16 vht_op_info_present : 1;                  /* bit 14 */
2058     /** TXOP Duration RTS Threshold */
2059     t_u16 txop_dur_rts_threshold : 10;              /* bit 4-13 */
2060     /** TWT Required */
2061     t_u16 twt_req : 1;                              /* bit 3 */
2062     /** Default PE Duration */
2063     t_u16 default_pe_dur : 3;                       /* bit 0-2 */
2064 #else
2065     /** Default PE Duration */
2066     t_u16 default_pe_dur : 3;                       /* bit 0-2 */
2067     /** TWT Required */
2068     t_u16 twt_req : 1;                              /* bit 3 */
2069     /** TXOP Duration RTS Threshold */
2070     t_u16 txop_dur_rts_threshold : 10;              /* bit 4-13 */
2071     /** VHT Operation Info Present */
2072     t_u16 vht_op_info_present : 1;                  /* bit 14 */
2073     /** Co-Hosted BSS */
2074     t_u16 co_located_bss : 1;                       /* bit 15 */
2075     /** ER SU Disable */
2076     t_u8  er_su_disable : 1;                        /* bit 16 */
2077     /* 6g operation info present */
2078     t_u8  he_6g_op_info_present :1;                 /* bit 17 */
2079     /** Reserved bit 18-23 */
2080     t_u8  reserved : 6;                             /* bit 18-23 */
2081 #endif
2082 } MLAN_PACK_END IEEEtypes_HeOpParam_t;
2083 
2084 typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t {
2085 #ifdef BIG_ENDIAN_SUPPORT
2086     /** BSS Color Disabled */
2087     t_u8 bss_color_disabled : 1;                    /* bit 7 */
2088     /** Partial BSS Color */
2089     t_u8 partial_bss_color : 1;                     /* bit 6 */
2090     /** BSS Color */
2091     t_u8 bss_color : 6;                             /* bit 0-5 */
2092 #else
2093     /** BSS Color */
2094     t_u8 bss_color : 6;                             /* bit 0-5 */
2095     /** Partial BSS Color */
2096     t_u8 partial_bss_color : 1;                     /* bit 6 */
2097     /** BSS Color Disabled */
2098     t_u8 bss_color_disabled : 1;                    /* bit 7 */
2099 #endif
2100 } MLAN_PACK_END IEEEtypes_HeBssColorInfo_t;
2101 
2102 typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
2103 #ifdef BIG_ENDIAN_SUPPORT
2104     /** Max HE-MAC for 8 SS */
2105     t_u8 max_mcs_8ss: 2;
2106     /** Max HE-MAC for 7 SS */
2107     t_u8 max_mcs_7ss: 2;
2108     /** Max HE-MAC for 6 SS */
2109     t_u8 max_mcs_6ss: 2;
2110     /** Max HE-MAC for 5 SS */
2111     t_u8 max_mcs_5ss: 2;
2112     /** Max HE-MAC for 4 SS */
2113     t_u8 max_mcs_4ss: 2;
2114     /** Max HE-MAC for 3 SS */
2115     t_u8 max_mcs_3ss: 2;
2116     /** Max HE-MAC for 2 SS */
2117     t_u8 max_mcs_2ss: 2;
2118     /** Max HE-MAC for 1 SS */
2119     t_u8 max_mcs_1ss: 2;
2120 #else
2121     /** Max HE-MAC for 1 SS */
2122     t_u8 max_mcs_1ss: 2;
2123     /** Max HE-MAC for 2 SS */
2124     t_u8 max_mcs_2ss: 2;
2125     /** Max HE-MAC for 3 SS */
2126     t_u8 max_mcs_3ss: 2;
2127     /** Max HE-MAC for 4 SS */
2128     t_u8 max_mcs_4ss: 2;
2129     /** Max HE-MAC for 5 SS */
2130     t_u8 max_mcs_5ss: 2;
2131     /** Max HE-MAC for 6 SS */
2132     t_u8 max_mcs_6ss: 2;
2133     /** Max HE-MAC for 7 SS */
2134     t_u8 max_mcs_7ss: 2;
2135     /** Max HE-MAC for 8 SS */
2136     t_u8 max_mcs_8ss: 2;
2137 #endif
2138 } MLAN_PACK_END IEEEtypes_HeMcsMap_t, *pIEEEtypes_HeMcsMap_t;
2139 
2140 typedef MLAN_PACK_START struct _IEEEtypes_HeOp_t {
2141     /** Generic IE header */
2142     IEEEtypes_Header_t ieee_hdr;
2143     /** Element id extension */
2144     t_u8 ext_id;
2145     /** HE Operation Parameters */
2146     IEEEtypes_HeOpParam_t           he_op_param;
2147     /** BSS Color Info */
2148     IEEEtypes_HeBssColorInfo_t      bss_color_info;
2149     /** Basic HE-MCS and NSS Set */
2150     IEEEtypes_HeMcsMap_t            basic_he_mcs_nss;
2151     /** Optional Field, including VHT Operation Info Max Co-Hosted BSSID Indicator, and 6Ghz Operation Info  */
2152     t_u8 option[9];
2153 } MLAN_PACK_END IEEEtypes_HeOp_t;
2154 #endif
2155 
2156 /** MBO IE header */
2157 #define MBO_IE_HEADER_LEN 6U
2158 
2159 /** MBO attribute header */
2160 #define MBO_ATTR_HEADER_LEN 2
2161 
2162 /*
2163 *****************************************************************************
2164 **
2165 **
2166 **                     802.11k RRM definitions
2167 **
2168 **
2169 *****************************************************************************
2170 */
2171 #if CONFIG_11K
2172 typedef MLAN_PACK_START struct _IEEEtypes_RrmEnabledCapabilities_t
2173 {
2174     /* First byte */
2175     t_u8 LinkMeas : 1;
2176     t_u8 NborRpt : 1;
2177     t_u8 ParallelMeas : 1;
2178     t_u8 RepeatMeas : 1;
2179     t_u8 BcnPassiveMeas : 1;
2180     t_u8 BcnActiveMeas : 1;
2181     t_u8 BcnTableMeas : 1;
2182     t_u8 BcnMeasRptCond : 1;
2183 
2184     /* Second byte */
2185     t_u8 FrameMeas : 1;
2186     t_u8 ChanLoadMeas : 1;
2187     t_u8 NoiseHistMeas : 1;
2188     t_u8 StatsMeas : 1;
2189     t_u8 LciMeas : 1;
2190     t_u8 LciAzimuth : 1;
2191     t_u8 TxStreamMeas : 1;
2192     t_u8 TrigTxStreamMeas : 1;
2193 
2194     /* Third byte */
2195     t_u8 ApChanRpt : 1;
2196     t_u8 RrmMib : 1;
2197     t_u8 OpChanMaxMeas : 3;
2198     t_u8 NonOpChanMaxMeas : 3;
2199 
2200     /* Fourth byte */
2201     t_u8 MeasPilot : 3;
2202     t_u8 MeasPilotTxInfo : 1;
2203     t_u8 NborRptTsfOffset : 1;
2204     t_u8 RcpiMeas : 1;
2205     t_u8 RsniMeas : 1;
2206     t_u8 BssAvgAccessDelay : 1;
2207 
2208     /* Fifth byte */
2209     t_u8 BssAvailAdmCap : 1;
2210     t_u8 AntennaInfo : 1;
2211     t_u8 FtmRangeReport : 1;
2212     t_u8 CivicLocation : 1;
2213     t_u8 Reserved : 4;
2214 } MLAN_PACK_END IEEEtypes_RrmEnabledCapabilities_t, *pIEEEtypes_RrmEnabledCapabilities_t;
2215 
2216 typedef MLAN_PACK_START struct _IEEEtypes_RrmElement_t
2217 {
2218     /** Element ID */
2219     t_u8 element_id;
2220     /** Length */
2221     t_u8 len;
2222 
2223     IEEEtypes_RrmEnabledCapabilities_t RrmEnabledCapabilities;
2224 } MLAN_PACK_END IEEEtypes_RrmElement_t, *pIEEEtypes_RrmElement_t;
2225 
2226 /** Mobility Domain element */
2227 typedef MLAN_PACK_START struct _MrvlIETypes_MobDomain_t
2228 {
2229     /** Header */
2230     IEEEtypes_Header_t header;
2231     /** Mobility Domain Identifier */
2232     t_u16 mob_domain_id;
2233     /** FT Capability and Policy */
2234     t_u8 ft_cap_policy;
2235 } MLAN_PACK_END MrvlIETypes_MobDomain_t;
2236 
2237 typedef MLAN_PACK_START enum _IEEEtypes_RRM_ActionFieldType_e {
2238     IEEE_MGMT_RRM_RADIO_MEASUREMENT_REQUEST = 0,
2239     IEEE_MGMT_RRM_RADIO_MEASUREMENT_REPORT  = 1,
2240     IEEE_MGMT_RRM_LINK_MEASUREMENT_REQUEST  = 2,
2241     IEEE_MGMT_RRM_LINK_MEASUREMENT_REPORT   = 3,
2242     IEEE_MGMT_RRM_NEIGHBOR_REPORT_REQUEST   = 4,
2243     IEEE_MGMT_RRM_NEIGHBOR_REPORT_RESPONSE  = 5
2244 } MLAN_PACK_END IEEEtypes_RRM_ActionFieldType_e;
2245 #endif
2246 
2247 #if CONFIG_BG_SCAN
2248 /**
2249  *  Input structure to configure bs scan cmd to firmware
2250  */
2251 typedef MLAN_PACK_START struct
2252 {
2253     /** action */
2254     t_u16 action;
2255     /** enable/disable */
2256     t_u8 enable;
2257     /**  BSS type:
2258      *   MLAN_SCAN_MODE_BSS  (infrastructure)
2259      *   MLAN_SCAN_MODE_IBSS (adhoc)
2260      *   MLAN_SCAN_MODE_ANY  (unrestricted, adhoc and infrastructure)
2261      */
2262     t_u8 bss_type;
2263     /** number of channel scanned during each scan */
2264     t_u8 chan_per_scan;
2265     /** interval between consecutive scan */
2266     t_u32 scan_interval;
2267     /** bit 0: ssid match bit 1: ssid match and SNR exceeded
2268      *  bit 2: ssid match and RSSI exceeded
2269      *  bit 31: wait for all channel scan to complete to report scan result
2270      */
2271     t_u32 report_condition;
2272     /* Configure the number of probe requests for active chan scans */
2273     t_u8 num_probes;
2274     /** RSSI threshold */
2275     t_u8 rssi_threshold;
2276     /** SNR threshold */
2277     t_u8 snr_threshold;
2278     /** repeat count */
2279     t_u16 repeat_count;
2280     /** start later flag */
2281     t_u16 start_later;
2282     /** SSID filter list used in the to limit the scan results */
2283     wlan_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH];
2284     /** Variable number (fixed maximum) of channels to scan up */
2285     wlan_user_scan_chan chan_list[WLAN_BG_SCAN_CHAN_MAX];
2286 #if CONFIG_SCAN_CHANNEL_GAP
2287     /** scan channel gap */
2288     t_u16 scan_chan_gap;
2289 #endif
2290 } MLAN_PACK_END wlan_bgscan_cfg;
2291 #endif /* ROAMING */
2292 #endif /* STA_SUPPORT */
2293 
2294 #ifdef PRAGMA_PACK
2295 #pragma pack(pop)
2296 #endif
2297 
2298 #if (CONFIG_11R) || (CONFIG_11K)
2299 /** Mobility domain IE */
2300 typedef MLAN_PACK_START struct _IEEEtypes_MobilityDomain_t
2301 {
2302     /** Generic IE header */
2303     IEEEtypes_Header_t ieee_hdr;
2304     /** Mobility Domain ID */
2305     t_u16 mdid;
2306     /** FT Capability policy */
2307     t_u8 ft_cap;
2308 } MLAN_PACK_END IEEEtypes_MobilityDomain_t;
2309 #endif
2310 
2311 /** BSSDescriptor_t
2312  *    Structure used to store information for beacon/probe response
2313  */
2314 typedef struct _BSSDescriptor_t
2315 {
2316     /** MAC address */
2317     mlan_802_11_mac_addr mac_address;
2318 
2319     /** SSID */
2320     mlan_802_11_ssid ssid;
2321 
2322     /** Transition MAC address */
2323     mlan_802_11_mac_addr trans_mac_address;
2324 
2325     /** Transition SSID */
2326     mlan_802_11_ssid trans_ssid;
2327 
2328 #if CONFIG_DRIVER_OWE
2329     /** OWE Transition mode */
2330     t_u8 owe_transition_mode;
2331 #endif
2332 
2333     /** WEP encryption requirement */
2334     t_u32 privacy;
2335 
2336     /** Receive signal strength in dBm */
2337     t_s32 rssi;
2338 
2339 #if CONFIG_SCAN_CHANNEL_GAP
2340     /** channel load */
2341     t_u16 chan_load;
2342     /** channel load */
2343     t_u16 chan_noise;
2344 #endif
2345 
2346     /** Channel */
2347     t_u8 channel;
2348 
2349     /** Freq */
2350     t_u32 freq;
2351 
2352     /** Beacon period */
2353     t_u16 beacon_period;
2354 
2355     /** DTIM period */
2356     t_u16 dtim_period;
2357 
2358     /** ATIM window */
2359     t_u32 atim_window;
2360 
2361     /** ERP flags */
2362     t_u8 erp_flags;
2363 
2364     /** Type of network in use */
2365     WLAN_802_11_NETWORK_TYPE network_type_use;
2366 
2367     /** Network infrastructure mode */
2368     mlan_bss_mode bss_mode;
2369 
2370     /** Network supported rates */
2371     WLAN_802_11_RATES supported_rates;
2372 
2373     /** Supported data rates */
2374     t_u8 data_rates[WLAN_SUPPORTED_RATES];
2375 
2376     /** Current channel bandwidth
2377      *  0 : 20MHZ
2378      *  1 : 40MHZ
2379      *  2 : 80MHZ
2380      *  3 : 160MHZ
2381      */
2382     t_u8 curr_bandwidth;
2383 
2384     /** Network band.
2385      * BAND_B(0x01): 'b' band
2386      * BAND_G(0x02): 'g' band
2387      * BAND_A(0X04): 'a' band
2388      */
2389     t_u16 bss_band;
2390 
2391     /** TSF record at driver receive the scan result from FW (in us) */
2392     unsigned int scan_result_tsf;
2393 
2394     /** TSF timestamp from the current firmware TSF */
2395     t_u64 network_tsf;
2396 
2397     /** TSF value included in the beacon/probe response */
2398     t_u8 time_stamp[8];
2399 
2400     /** PHY parameter set */
2401     IEEEtypes_PhyParamSet_t phy_param_set;
2402 
2403     /** SS parameter set */
2404     IEEEtypes_SsParamSet_t ss_param_set;
2405 
2406     /** Capability information */
2407     IEEEtypes_CapInfo_t cap_info;
2408 
2409     /** WMM IE */
2410     IEEEtypes_WmmParameter_t wmm_ie;
2411 
2412     /** 802.11h BSS information */
2413     /** Indicate disabling 11n when associate with AP */
2414     t_u8 disable_11n;
2415     /** 802.11n BSS information */
2416     /** HT Capabilities IE */
2417     IEEEtypes_HTCap_t *pht_cap;
2418     /** HT Capabilities Offset */
2419     /* t_u16 ht_cap_offset; */
2420     /** HT Information IE */
2421     IEEEtypes_HTInfo_t *pht_info;
2422     /** HT Information Offset */
2423     /* t_u16 ht_info_offset; */
2424 #if CONFIG_MULTI_BSSID_SUPPORT
2425     /** Flag to indicate this is multi_bssid_ap */
2426     t_u8 multi_bssid_ap;
2427     /** the mac address of multi-bssid AP */
2428     mlan_802_11_mac_addr multi_bssid_ap_addr;
2429 #endif
2430     /** 20/40 BSS Coexistence IE */
2431     IEEEtypes_2040BSSCo_t *pbss_co_2040;
2432     /** VHT Capabilities IE */
2433     IEEEtypes_VHTCap_t *pvht_cap;
2434     /** VHT Capabilities IE offset */
2435     /** VHT Operations IE */
2436     IEEEtypes_VHTOprat_t *pvht_oprat;
2437     /** VHT Operations IE offset */
2438     /** VHT Transmit Power Envelope IE */
2439     IEEEtypes_VHTtxpower_t *pvht_txpower;
2440     /** Operating Mode Notification IE */
2441     IEEEtypes_OperModeNtf_t *ppoper_mode;
2442     /** 20/40 BSS Coexistence Offset */
2443     t_u16 bss_co_2040_offset;
2444     /** Extended Capabilities IE */
2445     IEEEtypes_ExtCap_t *pext_cap;
2446     /** Extended Capabilities Offset */
2447     t_u16 ext_cap_offset;
2448     /** Overlapping BSS Scan Parameters IE */
2449     IEEEtypes_OverlapBSSScanParam_t *poverlap_bss_scan_param;
2450     /** Overlapping BSS Scan Parameters Offset */
2451     t_u16 overlap_bss_offset;
2452 
2453 #ifdef STA_SUPPORT
2454     /** Country information set */
2455     IEEEtypes_CountryInfoFullSet_t country_info;
2456 #endif /* STA_SUPPORT */
2457 
2458     /** WPA IE */
2459     IEEEtypes_VendorSpecific_t *pwpa_ie;
2460     /** WPA IE offset in the beacon buffer */
2461     t_u16 wpa_offset;
2462     /** RSN IE */
2463     IEEEtypes_Generic_t *prsn_ie;
2464     /** RSN IE offset in the beacon buffer */
2465     t_u16 rsn_offset;
2466 #ifdef STA_SUPPORT
2467     /** WAPI IE */
2468     IEEEtypes_Generic_t *pwapi_ie;
2469     /** WAPI IE offset in the beacon buffer */
2470     t_u16 wapi_offset;
2471 #endif
2472 
2473     /** Pointer to the returned scan response */
2474     t_u8 *pbeacon_buf;
2475     /** Length of the stored scan response */
2476     t_u32 beacon_buf_size;
2477     /** Max allocated size for updated scan response */
2478     t_u32 beacon_buf_size_max;
2479 
2480 #if CONFIG_WPA_SUPP
2481     /** Pointer to the returned scan response */
2482     t_u8 *ies;
2483     /** Length of the stored scan response */
2484     t_u32 ies_len;
2485 #endif
2486 
2487     /* Added for WMSDK */
2488 
2489     /*
2490      * Since we do not save the beacon buffer because it is too huge
2491      * for us we need to save selected data structures for later
2492      * perusal.
2493      */
2494     IEEEtypes_HTCap_t ht_cap_saved;
2495     IEEEtypes_HTInfo_t ht_info_saved;
2496     IEEEtypes_2040BSSCo_t bss_co_2040_saved;
2497 
2498 #if CONFIG_11AC
2499     IEEEtypes_VHTCap_t vht_cap_saved;
2500     IEEEtypes_VHTOprat_t vht_oprat_saved;
2501     IEEEtypes_VHTtxpower_t vht_txpower_saved;
2502     IEEEtypes_OperModeNtf_t poper_mode_saved;
2503 #endif
2504     IEEEtypes_ExtCap_t ext_cap_saved;
2505     bool ext_cap_exist;
2506 #if CONFIG_11AX
2507     /** HE Capability IE */
2508     IEEEtypes_HECap_t *phe_cap;
2509     /** HE Capability IE offset */
2510     t_u16 he_cap_offset;
2511     /** HE operation IE */
2512     IEEEtypes_HeOp_t *phe_oprat;
2513     /** HE operation IE offset */
2514     t_u16 he_oprat_offset;
2515     IEEEtypes_HECap_t he_cap_saved;
2516     IEEEtypes_HeOp_t he_oprat_saved;
2517 #endif
2518     /*
2519       fixme: The legacy code used IEEEtypes_RSN_IE_t which is of 24
2520       bytes. There seems to be confusion about the exact structure to
2521       use in this situation. Seems that 256 bytes are used by
2522       mlan_private (wpa_ie). We cannot use that much here. Lets take a
2523       reasonable amount.
2524     */
2525     unsigned char wpa_ie_buff[MLAN_WMSDK_MAX_WPA_IE_LEN];
2526     size_t wpa_ie_buff_len;
2527     unsigned char rsn_ie_buff[MLAN_WMSDK_MAX_WPA_IE_LEN];
2528     size_t rsn_ie_buff_len;
2529 
2530     bool wps_IE_exist;
2531     t_u16 wps_session;
2532 
2533     bool wpa2_entp_IE_exist;
2534     /** RSNX IE */
2535     IEEEtypes_Rsnx_t *prsnx_ie;
2536     IEEEtypes_Rsnx_t rsnx_ie_saved;
2537     /** RSNX IE offset in the beacon buffer */
2538     t_u16 rsnx_offset;
2539 
2540     bool brcm_ie_exist;
2541     bool epigram_ie_exist;
2542 #if (CONFIG_11R) || (CONFIG_11K)
2543     unsigned char md_ie_buff[MLAN_MAX_MDIE_LEN];
2544     size_t md_ie_buff_len;
2545     /* Mobility domain IE */
2546     IEEEtypes_MobilityDomain_t *pmd_ie;
2547     bool mob_domain_exist;
2548 #endif
2549 #if CONFIG_11K
2550     bool rm_cap_exist;
2551     IEEEtypes_RrmElement_t rm_cap_saved;
2552     unsigned char vendor_ie_buff[MLAN_MAX_VENDOR_IE_LEN];
2553     t_u8 vendor_ie_len;
2554     bool neighbor_report_supported;
2555 #endif
2556 #if CONFIG_11V
2557     bool bss_transition_supported;
2558 #endif
2559 #if CONFIG_DRIVER_MBO
2560     bool mbo_assoc_disallowed;
2561 #endif
2562 } BSSDescriptor_t, *pBSSDescriptor_t;
2563 
2564 #endif /* !_MLAN_IEEE_H_ */
2565