xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h (revision 8b3dca18206e1a0461492f082fa6e270b092c035)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: contains commnon ieee80211 definitions
22  */
23 
24 #ifndef _WLAN_CMN_IEEE80211_H_
25 #define _WLAN_CMN_IEEE80211_H_
26 #include <qdf_types.h>
27 #include <osdep.h>
28 
29 /* Subfields in Frame Control field (except Type and Subtype) */
30 #define WLAN_FC0_PVER      0x0003
31 #define WLAN_FC1_DIR_MASK  0x03
32 #define WLAN_FC1_TODS      0x01
33 #define WLAN_FC1_FROMDS    0x02
34 #define WLAN_FC1_DSTODS    0x03
35 #define WLAN_FC1_MOREFRAG  0x04
36 #define WLAN_FC1_RETRY     0x08
37 #define WLAN_FC1_PWRMGT    0x10
38 #define WLAN_FC1_MOREDATA  0x20
39 #define WLAN_FC1_ISWEP     0x40
40 #define WLAN_FC1_ORDER     0x80
41 
42 /* Definitions for Type subfield in Frame Control field */
43 #define WLAN_FC0_TYPE_MGMT        0
44 #define WLAN_FC0_TYPE_CTRL        1
45 #define WLAN_FC0_TYPE_DATA        2
46 
47 /* Definitions for management frame subtypes in Frame Control field */
48 #define WLAN_FC0_STYPE_ASSOC_REQ      0
49 #define WLAN_FC0_STYPE_ASSOC_RESP     1
50 #define WLAN_FC0_STYPE_REASSOC_REQ    2
51 #define WLAN_FC0_STYPE_REASSOC_RESP   3
52 #define WLAN_FC0_STYPE_PROBE_REQ      4
53 #define WLAN_FC0_STYPE_PROBE_RESP     5
54 #define WLAN_FC0_STYPE_BEACON         8
55 #define WLAN_FC0_STYPE_ATIM           9
56 #define WLAN_FC0_STYPE_DISASSOC      10
57 #define WLAN_FC0_STYPE_AUTH          11
58 #define WLAN_FC0_STYPE_DEAUTH        12
59 #define WLAN_FC0_STYPE_ACTION        13
60 
61 /* Definitions for control frame subtypes in Frame Control field */
62 #define WLAN_FC0_STYPE_PSPOLL        10
63 #define WLAN_FC0_STYPE_RTS           11
64 #define WLAN_FC0_STYPE_CTS           12
65 #define WLAN_FC0_STYPE_ACK           13
66 #define WLAN_FC0_STYPE_CFEND         14
67 #define WLAN_FC0_STYPE_CFENDACK      15
68 
69 /* Definitions for data frame subtypes in Frame Control field */
70 #define WLAN_FC0_STYPE_DATA                0
71 #define WLAN_FC0_STYPE_DATA_CFACK          1
72 #define WLAN_FC0_STYPE_DATA_CFPOLL         2
73 #define WLAN_FC0_STYPE_DATA_CFACKPOLL      3
74 #define WLAN_FC0_STYPE_NULLFUNC            4
75 #define WLAN_FC0_STYPE_CFACK               5
76 #define WLAN_FC0_STYPE_CFPOLL              6
77 #define WLAN_FC0_STYPE_CFACKPOLL           7
78 #define WLAN_FC0_STYPE_QOS_DATA            8
79 #define WLAN_FC0_STYPE_QOS_DATA_CFACK      9
80 #define WLAN_FC0_STYPE_QOS_DATA_CFPOLL    10
81 #define WLAN_FC0_STYPE_QOS_DATA_CFACKPOLL 11
82 #define WLAN_FC0_STYPE_QOS_NULL           12
83 #define WLAN_FC0_STYPE_QOS_CFPOLL         14
84 #define WLAN_FC0_STYPE_QOS_CFACKPOLL      15
85 
86 /* Get Type/Subtype subfields in Frame Control field */
87 #define WLAN_FC0_GET_TYPE(fc)    (((fc) & 0x0c) >> 2)
88 #define WLAN_FC0_GET_STYPE(fc)   (((fc) & 0xf0) >> 4)
89 
90 /* Definitions related to sequence number processing, TID, etc. */
91 #define WLAN_INVALID_MGMT_SEQ   0xffff
92 #define WLAN_SEQ_MASK           0x0fff
93 #define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0)))
94 #define WLAN_GET_SEQ_SEQ(seq) \
95 	(((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4)
96 #define WLAN_QOS_TID_MASK       0x0f
97 #define WLAN_TID_SIZE           17
98 #define WLAN_NONQOS_SEQ         16
99 
100 /* Length of Timestamp field */
101 #define WLAN_TIMESTAMP_LEN         8
102 
103 /* Length of Beacon Interval field */
104 #define WLAN_BEACONINTERVAL_LEN    2
105 
106 /* Length of Capability Information field */
107 #define WLAN_CAPABILITYINFO_LEN    2
108 
109 /* Length of Listen Interval field */
110 #define WLAN_LISTENINTERVAL_LEN    2
111 
112 /* Length of Status code field */
113 #define WLAN_STATUSCODE_LEN        2
114 
115 /* Length of AID field */
116 #define WLAN_AID_LEN               2
117 
118 /* Assoc resp IE offset Capability(2) + Status Code(2) + AID(2) */
119 #define WLAN_ASSOC_RSP_IES_OFFSET \
120 	(WLAN_CAPABILITYINFO_LEN  + WLAN_STATUSCODE_LEN + WLAN_AID_LEN)
121 
122 /* Assoc req IE offset - Capability(2) + LI(2) */
123 #define WLAN_ASSOC_REQ_IES_OFFSET \
124 	(WLAN_CAPABILITYINFO_LEN + WLAN_LISTENINTERVAL_LEN)
125 
126 /* Reassoc req IE offset - Capability(2) + LI(2) + current AP address(6) */
127 #define WLAN_REASSOC_REQ_IES_OFFSET \
128 	(WLAN_CAPABILITYINFO_LEN + WLAN_LISTENINTERVAL_LEN + QDF_MAC_ADDR_SIZE)
129 
130 /* Probe response IE offset - timestamp(8) + Beacon Int(2) + Cap info(2) */
131 #define WLAN_PROBE_RESP_IES_OFFSET \
132 	(WLAN_TIMESTAMP_LEN + WLAN_BEACONINTERVAL_LEN + WLAN_CAPABILITYINFO_LEN)
133 
134 /* Beacon IE offset - timestamp(8) + Beacon Int(2) + Cap info(2) */
135 #define WLAN_BEACON_IES_OFFSET \
136 	(WLAN_TIMESTAMP_LEN + WLAN_BEACONINTERVAL_LEN + WLAN_CAPABILITYINFO_LEN)
137 
138 /* Length (in bytes) of MAC header in 3 address format */
139 #define WLAN_MAC_HDR_LEN_3A 24
140 
141 #define IEEE80211_CCMP_HEADERLEN    8
142 #define IEEE80211_HT_CTRL_LEN       4
143 #define IEEE80211_CCMP_MICLEN       8
144 #define WLAN_IEEE80211_GCMP_HEADERLEN    8
145 #define WLAN_IEEE80211_GCMP_MICLEN       16
146 
147 #define IEEE80211_FC1_RETRY         0x08
148 #define IEEE80211_FC1_WEP           0x40
149 #define IEEE80211_FC1_ORDER         0x80
150 
151 #define WLAN_HDR_IV_LEN            3
152 #define WLAN_HDR_EXT_IV_BIT        0x20
153 #define WLAN_HDR_EXT_IV_LEN        4
154 
155 #define WLAN_SEQ_SEQ_SHIFT 4
156 
157 #define P2P_WFA_OUI {0x50, 0x6f, 0x9a}
158 #define P2P_WFA_VER 0x09
159 
160 #define WSC_OUI 0x0050f204
161 #define MBO_OCE_OUI 0x506f9a16
162 #define MBO_OCE_OUI_SIZE 4
163 #define REDUCED_WAN_METRICS_ATTR 103
164 #define OCE_DISALLOW_ASSOC_ATTR  0x4
165 #define AP_TX_PWR_ATTR 107
166 #define OCE_SUBNET_ID_ATTR 108
167 #define OCE_SUBNET_ID_LEN 6
168 #define OSEN_OUI 0x506f9a12
169 
170 /* WCN IE */
171 /* Microsoft OUI */
172 #define WCN_OUI 0xf25000
173 /* WCN */
174 #define WCN_OUI_TYPE 0x04
175 #define WME_OUI 0xf25000
176 #define WME_OUI_TYPE 0x02
177 #define WME_PARAM_OUI_SUBTYPE 0x01
178 #define WME_INFO_OUI_SUBTYPE 0x00
179  /* Atheros OUI */
180 #define ATH_OUI 0x7f0300
181 #define ATH_OUI_TYPE 0x01
182 /* Atheros Extended Cap Type */
183 #define ATH_OUI_EXTCAP_TYPE 0x04
184 /* QCA Bandwidth NSS Mapping Type */
185 #define ATH_OUI_BW_NSS_MAP_TYPE 0x05
186 #define SFA_OUI 0x964000
187 #define SFA_OUI_TYPE 0x14
188 /* QCA OUI (in little endian) */
189 #define QCA_OUI 0xf0fd8c
190 #define QCN_OUI_TYPE_CMN 0x01
191 #define QCA_OUI_WHC_TYPE  0x00
192 #define QCA_OUI_WHC_REPT_TYPE 0x01
193 
194 /* Extender vendor specific IE */
195 #define QCA_OUI_EXTENDER_TYPE           0x03
196 
197 #define ADAPTIVE_11R_OUI      0x964000
198 #define ADAPTIVE_11R_OUI_TYPE 0x2C
199 
200 #define OUI_LENGTH              4
201 #define OUI_TYPE_BITS           24
202 #define MAX_ADAPTIVE_11R_IE_LEN 8
203 
204 /* Minimum length of Non-Inheritance element (inclusive of the IE header) */
205 #define MIN_NONINHERITANCEELEM_LEN 5
206 
207 /*
208  * sae single pmk vendor specific IE details
209  * Category     Data
210  * Type         0xDD
211  * Length       0x05
212  * OUI          0x00 40 96
213  * Type         0x03
214  * Data         Don’t care (EX, 0x05)
215  */
216 #define SAE_SINGLE_PMK_OUI          0x964000
217 #define SAE_SINGLE_PMK_TYPE         0x03
218 #define MAX_SAE_SINGLE_PMK_IE_LEN   8
219 
220 /* Temporary vendor specific IE for 11n pre-standard interoperability */
221 #define VENDOR_HT_OUI       0x00904c
222 #define VENDOR_HT_CAP_ID    51
223 #define VENDOR_HT_INFO_ID   52
224 
225 #define VHT_INTEROP_OUI 0x00904c
226 #define VHT_INTEROP_TYPE 0x04
227 #define VHT_INTEROP_OUI_SUBTYPE 0x08
228 #define VHT_INTEROP_OUI_SUBTYPE_VENDORSPEC 0x18
229 
230 /* ATH HE OUI ( in little endian) */
231 #define ATH_HE_OUI                  0x741300
232 #define ATH_HE_CAP_SUBTYPE          0x01
233 #define ATH_HE_OP_SUBTYPE           0x02
234 
235 /* EPR information element flags */
236 #define ERP_NON_ERP_PRESENT   0x01
237 #define ERP_USE_PROTECTION    0x02
238 #define ERP_LONG_PREAMBLE     0x04
239 
240 #define QCA_OUI_WHC_AP_INFO_SUBTYPE 0x00
241 
242 #define WLAN_MAX_IE_LEN                255
243 #define WLAN_RSN_IE_LEN                22
244 
245 /* Individual element IEs length checks */
246 
247 /* Maximum supported basic/mandatory rates are 12 */
248 #define WLAN_SUPPORTED_RATES_IE_MAX_LEN          12
249 #define WLAN_FH_PARAM_IE_MAX_LEN                 5
250 #define WLAN_DS_PARAM_IE_MAX_LEN                 1
251 #define WLAN_CF_PARAM_IE_MAX_LEN                 6
252 #define WLAN_COUNTRY_IE_MIN_LEN                  3
253 #define WLAN_QUIET_IE_MAX_LEN                    6
254 #define WLAN_CSA_IE_MAX_LEN                      3
255 #define WLAN_XCSA_IE_MAX_LEN                     4
256 #define WLAN_SECCHANOFF_IE_MAX_LEN               1
257 #define WLAN_EXT_SUPPORTED_RATES_IE_MAX_LEN      12
258 
259 #define WLAN_EXTCAP_IE_MAX_LEN                   15
260 #define WLAN_FILS_INDICATION_IE_MIN_LEN          2
261 #define WLAN_MOBILITY_DOMAIN_IE_MAX_LEN          3
262 #define WLAN_OPMODE_IE_MAX_LEN                   1
263 #define WLAN_IBSSDFS_IE_MIN_LEN                  7
264 #define WLAN_IBSS_IE_MAX_LEN                     2
265 #define WLAN_REQUEST_IE_MAX_LEN                  255
266 #define WLAN_RM_CAPABILITY_IE_MAX_LEN            5
267 #define WLAN_RNR_IE_MIN_LEN                      5
268 #define WLAN_RNR_TBTT_OFFSET_INVALID             255
269 #define WLAN_TPE_IE_MIN_LEN                      2
270 #define WLAN_MAX_NUM_TPE_IE                      8
271 
272 /* Wide band channel switch IE length */
273 #define WLAN_WIDE_BW_CHAN_SWITCH_IE_LEN          3
274 
275 /* Number of max TX power elements supported plus size of Transmit Power
276  * Information element.
277  */
278 #define WLAN_TPE_IE_MAX_LEN                      9
279 
280 /* Max channel switch time IE length */
281 #define WLAN_MAX_CHAN_SWITCH_TIME_IE_LEN         4
282 
283 #define WLAN_MAX_SRP_IE_LEN                      21
284 #define WLAN_MAX_MUEDCA_IE_LEN                   14
285 #define WLAN_MAX_HE_6G_CAP_IE_LEN                3
286 #define WLAN_MAX_HEOP_IE_LEN                     16
287 #define WLAN_HEOP_OUI_TYPE                       "\x24"
288 #define WLAN_HEOP_OUI_SIZE                       1
289 
290 /* HT capability flags */
291 #define WLAN_HTCAP_C_ADVCODING             0x0001
292 #define WLAN_HTCAP_C_CHWIDTH40             0x0002
293 /* Capable of SM Power Save (Static) */
294 #define WLAN_HTCAP_C_SMPOWERSAVE_STATIC    0x0000
295 /* Capable of SM Power Save (Dynamic) */
296 #define WLAN_HTCAP_C_SMPOWERSAVE_DYNAMIC   0x0004
297 /* Reserved */
298 #define WLAN_HTCAP_C_SM_RESERVED           0x0008
299 /* SM enabled, no SM Power Save */
300 #define WLAN_HTCAP_C_SMPOWERSAVE_DISABLED            0x000c
301 #define WLAN_HTCAP_C_GREENFIELD            0x0010
302 #define WLAN_HTCAP_C_SHORTGI20             0x0020
303 #define WLAN_HTCAP_C_SHORTGI40             0x0040
304 #define WLAN_HTCAP_C_TXSTBC                0x0080
305 #define WLAN_HTCAP_C_TXSTBC_S                   7
306 /* 2 bits */
307 #define WLAN_HTCAP_C_RXSTBC                0x0300
308 #define WLAN_HTCAP_C_RXSTBC_S                   8
309 #define WLAN_HTCAP_C_DELAYEDBLKACK         0x0400
310 /* 1 = 8K, 0 = 3839B */
311 #define WLAN_HTCAP_C_MAXAMSDUSIZE          0x0800
312 #define WLAN_HTCAP_C_DSSSCCK40             0x1000
313 #define WLAN_HTCAP_C_PSMP                  0x2000
314 #define WLAN_HTCAP_C_INTOLERANT40          0x4000
315 #define WLAN_HTCAP_C_LSIGTXOPPROT          0x8000
316 /* Spatial Multiplexing (SM) capabitlity bitmask */
317 #define WLAN_HTCAP_C_SM_MASK               0x000c
318 
319 /* VHT Operation  */
320 /* 20/40 MHz Operating Channel */
321 #define WLAN_VHTOP_CHWIDTH_2040          0
322 /* 80 MHz Operating Channel */
323 #define WLAN_VHTOP_CHWIDTH_80            1
324 /* 160 MHz Operating Channel */
325 #define WLAN_VHTOP_CHWIDTH_160           2
326 /* 80 + 80 MHz Operating Channel */
327 #define WLAN_VHTOP_CHWIDTH_80_80         3
328 /* 160 MHz Operating Channel  (revised signalling) */
329 #define WLAN_VHTOP_CHWIDTH_REVSIG_160    1
330 /* 80 + 80 MHz Operating Channel  (revised signalling) */
331 #define WLAN_VHTOP_CHWIDTH_REVSIG_80_80  1
332 
333 #define WLAN_HEOP_FIXED_PARAM_LENGTH       7
334 #define WLAN_HEOP_VHTOP_LENGTH             3
335 #define WLAN_HEOP_CO_LOCATED_BSS_LENGTH    1
336 
337 #define WLAN_HEOP_VHTOP_PRESENT_MASK       0x00004000  /* B14 */
338 #define WLAN_HEOP_CO_LOCATED_BSS_MASK      0x00008000  /* B15 */
339 #define WLAN_HEOP_6GHZ_INFO_PRESENT_MASK   0X00020000  /* B17 */
340 
341 #define WLAN_HE_6GHZ_CHWIDTH_20           0 /* 20MHz Oper Ch width */
342 #define WLAN_HE_6GHZ_CHWIDTH_40           1 /* 40MHz Oper Ch width */
343 #define WLAN_HE_6GHZ_CHWIDTH_80           2 /* 80MHz Oper Ch width */
344 #define WLAN_HE_6GHZ_CHWIDTH_160_80_80    3 /* 160/80+80 MHz Oper Ch width */
345 
346 #define WLAN_HE_NON_SRG_PD_SR_DISALLOWED 0x02
347 #define WLAN_HE_NON_SRG_OFFSET_PRESENT 0x04
348 
349 #ifdef WLAN_FEATURE_11BE
350 #define WLAN_EHT_CHWIDTH_20           0 /* 20MHz Oper Ch width */
351 #define WLAN_EHT_CHWIDTH_40           1 /* 40MHz Oper Ch width */
352 #define WLAN_EHT_CHWIDTH_80           2 /* 80MHz Oper Ch width */
353 #define WLAN_EHT_CHWIDTH_160          3 /* 160MHz Oper Ch width */
354 #define WLAN_EHT_CHWIDTH_320          4 /* 320MHz Oper Ch width */
355 #endif
356 
357 /* Max length of 802.11 subelement */
358 #define WLAN_MAX_SUBELEM_LEN          255
359 
360 #define WLAN_RATE_VAL              0x7f
361 #define WLAN_BASIC_RATE_MASK       0x80
362 
363 #define WLAN_RV(v)     ((v) & WLAN_RATE_VAL)
364 
365 #define WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY       127
366 #define WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY      126
367 #define WLAN_BSS_MEMBERSHIP_SELECTOR_GLK          125
368 #define WLAN_BSS_MEMBERSHIP_SELECTOR_EPD          124
369 #define WLAN_BSS_MEMBERSHIP_SELECTOR_SAE_H2E      123
370 #define WLAN_BSS_MEMBERSHIP_SELECTOR_HE_PHY       122
371 
372 /* EXT cap bit definitions based on IEEE 802.11az D4.0 - 9.4.2.26 */
373 #define WLAN_EXT_CAPA11_NTB_RANGING_RESPONDER          BIT(2)
374 #define WLAN_EXT_CAPA11_TB_RANGING_RESPONDER           BIT(3)
375 #define WLAN_EXT_CAPA11_PASSIVE_TB_RANGING_RESPONDER   BIT(4)
376 #define WLAN_EXT_CAPA11_PASSIVE_TB_RANGING_INITIATOR   BIT(5)
377 
378 #define WLAN_CHAN_IS_5GHZ(chanidx) \
379 	((chanidx > 30) ? true : false)
380 #define WLAN_CHAN_IS_2GHZ(chanidx) \
381 	(((chanidx > 0) && (chanidx < 15)) ? true : false)
382 
383 /* Check if revised signalling is being used for VHT160 in vhtop */
384 #define WLAN_IS_REVSIG_VHT160(vhtop) (((vhtop)->vht_op_chwidth == \
385 	WLAN_VHTOP_CHWIDTH_REVSIG_160) && \
386 	((vhtop)->vht_op_ch_freq_seg2 != 0) && \
387 	(abs((vhtop)->vht_op_ch_freq_seg2 - (vhtop)->vht_op_ch_freq_seg1) == 8))
388 
389 /* Check if revised signalling is being used for VHT80p80 in vhtop */
390 #define WLAN_IS_REVSIG_VHT80_80(vhtop) (((vhtop)->vht_op_chwidth == \
391 	WLAN_VHTOP_CHWIDTH_REVSIG_80_80) && \
392 	((vhtop)->vht_op_ch_freq_seg2 != 0) && \
393 	(abs((vhtop)->vht_op_ch_freq_seg2 - (vhtop)->vht_op_ch_freq_seg1) > 8))
394 
395 /* Check if channel width is HE160 in HE 6ghz params */
396 #define WLAN_IS_HE160(he_6g_param) (((he_6g_param)->width == \
397 	WLAN_HE_6GHZ_CHWIDTH_160_80_80) && \
398 	((he_6g_param)->chan_freq_seg1 != 0) && \
399 	(abs((he_6g_param)->chan_freq_seg1 - \
400 	(he_6g_param)->chan_freq_seg0) == 8))
401 
402 /* Check if channel width is HE80p80 in HE 6ghz params */
403 #define WLAN_IS_HE80_80(he_6g_param) (((he_6g_param)->width == \
404 	WLAN_HE_6GHZ_CHWIDTH_160_80_80) && \
405 	((he_6g_param)->chan_freq_seg1 != 0) && \
406 	(abs((he_6g_param)->chan_freq_seg1 - \
407 	(he_6g_param)->chan_freq_seg0) > 8))
408 
409 #define LE_READ_2(p) \
410 	((uint16_t)\
411 	((((const uint8_t *)(p))[0]) |\
412 	(((const uint8_t *)(p))[1] <<  8)))
413 
414 #define LE_READ_4(p) \
415 	((uint32_t)\
416 	((((const uint8_t *)(p))[0]) |\
417 	(((const uint8_t *)(p))[1] <<  8) |  \
418 	(((const uint8_t *)(p))[2] << 16) |\
419 	(((const uint8_t *)(p))[3] << 24)))
420 
421 #define BE_READ_4(p) \
422 	((uint32_t)\
423 	((((const uint8_t *)(p))[0] << 24) |\
424 	(((const uint8_t *)(p))[1] << 16) |\
425 	(((const uint8_t *)(p))[2] <<  8) |\
426 	(((const uint8_t *)(p))[3])))
427 
428 /**
429  * enum ext_chan_offset: extension channel offset
430  * @WLAN_HTINFO_EXTOFFSET_NA: no extension channel is present
431  * @WLAN_HTINFO_EXTOFFSET_ABOVE: above control channel
432  * @WLAN_HTINFO_EXTOFFSET_UNDEF: undefined
433  * @WLAN_HTINFO_EXTOFFSET_BELOW: below control channel
434  */
435 enum ext_chan_offset {
436 	WLAN_HTINFO_EXTOFFSET_NA    = 0,
437 	WLAN_HTINFO_EXTOFFSET_ABOVE = 1,
438 	WLAN_HTINFO_EXTOFFSET_UNDEF = 2,
439 	WLAN_HTINFO_EXTOFFSET_BELOW = 3
440 };
441 
442 /**
443  * enum element_ie :- Management information element
444  * @WLAN_ELEMID_SSID: ssid IE
445  * @WLAN_ELEMID_RATES: Rates IE
446  * @WLAN_ELEMID_FHPARMS: FH param IE
447  * @WLAN_ELEMID_DSPARMS: DS Param IE
448  * @WLAN_ELEMID_CFPARMS : CF Param IE
449  * @WLAN_ELEMID_TIM: TIM IE
450  * @WLAN_ELEMID_IBSSPARMS: Ibss params IE
451  * @WLAN_ELEMID_COUNTRY: Country code IE
452  * @WLAN_ELEMID_REQINFO: Req Info IE
453  * @WLAN_ELEMID_QBSS_LOAD: Qbss load IE
454  * @WLAN_ELEMID_TCLAS: TCLAS IE
455  * @WLAN_ELEMID_CHALLENGE: Challenge IE
456  * @WLAN_ELEMID_PWRCNSTR: Power cn IE
457  * @WLAN_ELEMID_PWRCAP: power cap IE
458  * @WLAN_ELEMID_TPCREQ: TPC req IE
459  * @WLAN_ELEMID_TPCREP: TPC rsp IE
460  * @WLAN_ELEMID_SUPPCHAN: Supported channel IE
461  * @WLAN_ELEMID_CHANSWITCHANN: Channel switch IE
462  * @WLAN_ELEMID_MEASREQ: Measurement request IE
463  * @WLAN_ELEMID_MEASREP: Measurement Resp IE
464  * @WLAN_ELEMID_QUIET: Quiet IE
465  * @WLAN_ELEMID_IBSSDFS: IBSS DFS IE
466  * @WLAN_ELEMID_ERP: ERP IE
467  * @WLAN_ELEMID_TCLAS_PROCESS: TCLAS process IE
468  * @WLAN_ELEMID_HTCAP_ANA: HTT Capability IE
469  * @WLAN_ELEMID_RSN: RSN IE
470  * @WLAN_ELEMID_XRATES: Extended rate IE
471  * @WLAN_ELEMID_HTCAP_VENDOR: HT cap vendor IE
472  * @WLAN_ELEMID_HTINFO_VENDOR: HT info vendor IE
473  * @WLAN_ELEMID_MOBILITY_DOMAIN: MD IE
474  * @WLAN_ELEMID_FT: FT IE
475  * @WLAN_ELEMID_TIMEOUT_INTERVAL: Timeout interval IE
476  * @WLAN_ELEMID_SUPP_OP_CLASS: OP class IE
477  * @WLAN_ELEMID_EXTCHANSWITCHANN: Extended Channel switch IE
478  * @WLAN_ELEMID_HTINFO_ANA: HT info IE
479  * @WLAN_ELEMID_SECCHANOFFSET: Sec channel Offset IE
480  * @WLAN_ELEMID_WAPI: WAPI IE
481  * @WLAN_ELEMID_TIME_ADVERTISEMENT: Time IE
482  * @WLAN_ELEMID_RRM: Radio resource measurement IE
483  * @WLAN_ELEMID_MULTIPLE_BSSID: Multiple BSSID IE
484  * @WLAN_ELEMID_2040_COEXT: 20-40 COext ext IE
485  * @WLAN_ELEMID_2040_INTOL:20-40 INT OL IE
486  * @WLAN_ELEMID_OBSS_SCAN: OBSS scan IE
487  * @WLAN_ELEMID_MMIE: 802.11w Management MIC IE
488  * @WLAN_ELEMID_NONTX_BSSID_CAP: Nontransmitted BSSID Capability IE
489  * @WLAN_ELEMID_MULTI_BSSID_IDX: Multiple BSSID index
490  * @WLAN_ELEMID_FMS_DESCRIPTOR: 802.11v FMS descriptor IE
491  * @WLAN_ELEMID_FMS_REQUEST: 802.11v FMS request IE
492  * @WLAN_ELEMID_FMS_RESPONSE: 802.11v FMS response IE
493  * @WLAN_ELEMID_BSSMAX_IDLE_PERIOD = 90: BSS MAX IDLE PERIOD
494  * @WLAN_ELEMID_TFS_REQUEST: TFS req IE
495  * @WLAN_ELEMID_TFS_RESPONSE: TFS resp IE
496  * @WLAN_ELEMID_TIM_BCAST_REQUEST: TIM bcast req IE
497  * @WLAN_ELEMID_TIM_BCAST_RESPONSE: TIM bcast resp IE
498  * @WLAN_ELEMID_INTERWORKING: Interworking IE
499  * @WLAN_ELEMID_QOS_MAP: QOS MAP IE
500  * @WLAN_ELEMID_XCAPS: Extended capability IE
501  * @WLAN_ELEMID_TPC: TPC IE
502  * @WLAN_ELEMID_CCKM: CCKM IE
503  * @WLAN_ELEMID_VHTCAP: VHT Capabilities
504  * @WLAN_ELEMID_VHTOP: VHT Operation
505  * @WLAN_ELEMID_EXT_BSS_LOAD: Extended BSS Load
506  * @WLAN_ELEMID_WIDE_BAND_CHAN_SWITCH: Wide Band Channel Switch
507  * @WLAN_ELEMID_VHT_TX_PWR_ENVLP: VHT Transmit Power Envelope
508  * @WLAN_ELEMID_CHAN_SWITCH_WRAP: Channel Switch Wrapper
509  * @WLAN_ELEMID_AID: AID
510  * @WLAN_ELEMID_QUIET_CHANNEL: Quiet Channel
511  * @WLAN_ELEMID_OP_MODE_NOTIFY: Operating Mode Notification
512  * @WLAN_ELEMID_VENDOR: vendor private
513  * @WLAN_ELEMID_FRAGMENT: Fragment
514  * @WLAN_ELEMID_EXTN_ELEM: extended IE
515  */
516 enum element_ie {
517 	WLAN_ELEMID_SSID             = 0,
518 	WLAN_ELEMID_RATES            = 1,
519 	WLAN_ELEMID_FHPARMS          = 2,
520 	WLAN_ELEMID_DSPARMS          = 3,
521 	WLAN_ELEMID_CFPARMS          = 4,
522 	WLAN_ELEMID_TIM              = 5,
523 	WLAN_ELEMID_IBSSPARMS        = 6,
524 	WLAN_ELEMID_COUNTRY          = 7,
525 	/* 8-9 reserved */
526 	WLAN_ELEMID_REQINFO          = 10,
527 	WLAN_ELEMID_QBSS_LOAD        = 11,
528 	WLAN_ELEMID_EDCAPARMS        = 12,
529 	WLAN_ELEMID_TCLAS            = 14,
530 	WLAN_ELEMID_CHALLENGE        = 16,
531 	/* 17-31 reserved for challenge text extension */
532 	WLAN_ELEMID_PWRCNSTR         = 32,
533 	WLAN_ELEMID_PWRCAP           = 33,
534 	WLAN_ELEMID_TPCREQ           = 34,
535 	WLAN_ELEMID_TPCREP           = 35,
536 	WLAN_ELEMID_SUPPCHAN         = 36,
537 	WLAN_ELEMID_CHANSWITCHANN    = 37,
538 	WLAN_ELEMID_MEASREQ          = 38,
539 	WLAN_ELEMID_MEASREP          = 39,
540 	WLAN_ELEMID_QUIET            = 40,
541 	WLAN_ELEMID_IBSSDFS          = 41,
542 	WLAN_ELEMID_ERP              = 42,
543 	WLAN_ELEMID_TCLAS_PROCESS    = 44,
544 	WLAN_ELEMID_HTCAP_ANA        = 45,
545 	WLAN_ELEMID_QOS_CAPABILITY   = 46,
546 	WLAN_ELEMID_RSN              = 48,
547 	WLAN_ELEMID_XRATES           = 50,
548 	WLAN_ELEMID_HTCAP_VENDOR     = 51,
549 	WLAN_ELEMID_HTINFO_VENDOR    = 52,
550 	WLAN_ELEMID_MOBILITY_DOMAIN  = 54,
551 	WLAN_ELEMID_FT               = 55,
552 	WLAN_ELEMID_TIMEOUT_INTERVAL = 56,
553 	WLAN_ELEMID_SUPP_OP_CLASS    = 59,
554 	WLAN_ELEMID_EXTCHANSWITCHANN = 60,
555 	WLAN_ELEMID_HTINFO_ANA       = 61,
556 	WLAN_ELEMID_SECCHANOFFSET    = 62,
557 	WLAN_ELEMID_WAPI             = 68,
558 	WLAN_ELEMID_TIME_ADVERTISEMENT = 69,
559 	WLAN_ELEMID_RRM              = 70,
560 	WLAN_ELEMID_MULTIPLE_BSSID   = 71,
561 	WLAN_ELEMID_2040_COEXT       = 72,
562 	WLAN_ELEMID_2040_INTOL       = 73,
563 	WLAN_ELEMID_OBSS_SCAN        = 74,
564 	WLAN_ELEMID_MMIE             = 76,
565 	WLAN_ELEMID_NONTX_BSSID_CAP  = 83,
566 	WLAN_ELEMID_MULTI_BSSID_IDX  = 85,
567 	WLAN_ELEMID_FMS_DESCRIPTOR   = 86,
568 	WLAN_ELEMID_FMS_REQUEST      = 87,
569 	WLAN_ELEMID_FMS_RESPONSE     = 88,
570 	WLAN_ELEMID_BSSMAX_IDLE_PERIOD = 90,
571 	WLAN_ELEMID_TFS_REQUEST      = 91,
572 	WLAN_ELEMID_TFS_RESPONSE     = 92,
573 	WLAN_ELEMID_TIM_BCAST_REQUEST  = 94,
574 	WLAN_ELEMID_TIM_BCAST_RESPONSE = 95,
575 	WLAN_ELEMID_INTERWORKING     = 107,
576 	WLAN_ELEMID_QOS_MAP          = 110,
577 	WLAN_ELEMID_XCAPS            = 127,
578 	WLAN_ELEMID_TPC              = 150,
579 	WLAN_ELEMID_CCKM             = 156,
580 	WLAN_ELEMID_VHTCAP           = 191,
581 	WLAN_ELEMID_VHTOP            = 192,
582 	WLAN_ELEMID_EXT_BSS_LOAD     = 193,
583 	WLAN_ELEMID_WIDE_BAND_CHAN_SWITCH = 194,
584 	WLAN_ELEMID_VHT_TX_PWR_ENVLP = 195,
585 	WLAN_ELEMID_CHAN_SWITCH_WRAP = 196,
586 	WLAN_ELEMID_AID              = 197,
587 	WLAN_ELEMID_QUIET_CHANNEL    = 198,
588 	WLAN_ELEMID_OP_MODE_NOTIFY   = 199,
589 	WLAN_ELEMID_REDUCED_NEIGHBOR_REPORT = 201,
590 	WLAN_ELEMID_VENDOR           = 221,
591 	WLAN_ELEMID_FILS_INDICATION  = 240,
592 	WLAN_ELEMID_FRAGMENT         = 242,
593 	WLAN_ELEMID_RSNXE            = 244,
594 	WLAN_ELEMID_EXTN_ELEM        = 255,
595 };
596 
597 /**
598  * enum extn_element_ie :- extended management information element
599  * @WLAN_EXTN_ELEMID_HECAP:  HE capabilities IE
600  * @WLAN_EXTN_ELEMID_HEOP:   HE Operation IE
601  * @WLAN_EXTN_ELEMID_MUEDCA: MU-EDCA IE
602  * @WLAN_EXTN_ELEMID_HE_6G_CAP: HE 6GHz Band Capabilities IE
603  * @WLAN_EXTN_ELEMID_SRP:    spatial reuse parameter IE
604  * @WLAN_EXTN_ELEMID_MAX_CHAN_SWITCH_TIME: Maximum Channel Switch Time IE
605  * @WLAN_EXTN_ELEMID_NONINHERITANCE: Non inheritance IE
606  * @WLAN_EXTN_ELEMID_EHTOP: EHT Operation IE
607  * @WLAN_EXTN_ELEMID_MULTI_LINK: Multi-Link IE
608  * @WLAN_EXTN_ELEMID_EHTCAP: EHT Capabilities IE
609  * @WLAN_EXTN_ELEMID_T2LM: TID-to-link mapping IE
610  * @WLAN_EXTN_ELEMID_MULTI_LINK_TRAFFIC_IND: Multi-link Traffic Indication IE
611  */
612 enum extn_element_ie {
613 	WLAN_EXTN_ELEMID_HECAP       = 35,
614 	WLAN_EXTN_ELEMID_HEOP        = 36,
615 	WLAN_EXTN_ELEMID_MUEDCA      = 38,
616 	WLAN_EXTN_ELEMID_SRP         = 39,
617 	WLAN_EXTN_ELEMID_MAX_CHAN_SWITCH_TIME = 52,
618 	WLAN_EXTN_ELEMID_NONINHERITANCE = 56,
619 	WLAN_EXTN_ELEMID_HE_6G_CAP   = 59,
620 	WLAN_EXTN_ELEMID_ESP         = 11,
621 #ifdef WLAN_FEATURE_11BE
622 	WLAN_EXTN_ELEMID_EHTOP       = 106,
623 #endif
624 #ifdef WLAN_FEATURE_11BE_MLO
625 	WLAN_EXTN_ELEMID_MULTI_LINK  = 107,
626 #endif
627 #ifdef WLAN_FEATURE_11BE
628 	WLAN_EXTN_ELEMID_EHTCAP      = 108,
629 #endif
630 	WLAN_EXTN_ELEMID_T2LM        = 109,
631 	WLAN_EXTN_ELEMID_MULTI_LINK_TRAFFIC_IND = 110,
632 };
633 
634 /**
635  * enum wlan_reason_code - wlan reason codes Reason codes
636  * (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45)
637  * @REASON_UNSPEC_FAILURE: Unspecified reason
638  * @REASON_PREV_AUTH_NOT_VALID: Previous authentication no longer valid
639  * @REASON_DEAUTH_NETWORK_LEAVING: Deauthenticated because sending station
640  * is leaving (or has left) IBSS or ESS
641  * @REASON_DISASSOC_DUE_TO_INACTIVITY: Disassociated due to inactivity
642  * @REASON_DISASSOC_AP_BUSY: Disassociated because AP is unable
643  * to handle all currently associated STAs
644  * @REASON_CLASS2_FRAME_FROM_NON_AUTH_STA: Class 2 frame received from
645  * nonauthenticated station
646  * @REASON_CLASS3_FRAME_FROM_NON_ASSOC_STA: Class 3 frame received from
647  * nonassociated station
648  * @REASON_DISASSOC_NETWORK_LEAVING: Disassociated because sending station
649  * is leaving (or has left) BSS
650  * @REASON_STA_NOT_AUTHENTICATED: Station requesting (re)association
651  * is not authenticated with responding station
652  * @REASON_BAD_PWR_CAPABILITY: Disassociated because the
653  * information in the Power Capability element is unacceptable
654  * @REASON_BAD_SUPPORTED_CHANNELS: Disassociated because the
655  * information in the Supported Channels element is unacceptable
656  * @REASON_DISASSOC_BSS_TRANSITION: Disassociated due to BSS transition
657  * management
658  * @REASON_INVALID_IE: Invalid element, i.e., an element defined in this
659  * standard for which the content does not meet the specifications in Clause 9
660  * @REASON_MIC_FAILURE: Message integrity code (MIC) failure
661  * @REASON_4WAY_HANDSHAKE_TIMEOUT: 4-Way Handshake timeout
662  * @REASON_GROUP_KEY_UPDATE_TIMEOUT: Group Key Handshake timeout
663  * @REASON_IN_4WAY_DIFFERS: Information element in 4-Way Handshake
664  * different from (Re)Association Request/Probe Response/Beacon frame
665  * @REASON_INVALID_GROUP_CIPHER: Invalid group cipher
666  * @REASON_INVALID_PAIRWISE_CIPHER: Invalid pairwise cipher
667  * @REASON_INVALID_AKMP: Invalid AKMP
668  * @REASON_UNSUPPORTED_RSNE_VER: Unsupported RSNE version
669  * @REASON_INVALID_RSNE_CAPABILITIES: Invalid RSNE capabilities
670  * @REASON_1X_AUTH_FAILURE: IEEE 802.1X authentication failed
671  * @REASON_CIPHER_SUITE_REJECTED: Cipher suite rejected because of the
672  * security policy
673  * @REASON_TDLS_PEER_UNREACHABLE: TDLS direct-link teardown due to TDLS
674  * peer STA unreachable via the TDLS direct link
675  * @REASON_TDLS_UNSPEC: TDLS direct-link teardown for unspecified
676  * reason
677  * @REASON_DISASSOC_SSP_REQUESTED: Disassociated because session terminated
678  * by SSP request
679  * @REASON_NO_SSP_ROAMING_AGREEMENT: Disassociated because of lack of SSP
680  * roaming agreement
681  * REASON_BAD_CIPHER_OR_AKM: Requested service rejected because of SSP
682  * cipher suite or AKM requirement
683  * @REASON_LOCATION_NOT_AUTHORIZED: Requested service not authorized in
684  * this location
685  * @REASON_SERVICE_CHANGE_PRECLUDES_TS: TS deleted because QoS AP
686  * lacks sufficient bandwidth for this QoS STA due to a change in BSS service
687  * characteristics or operational mode (e.g., an HT BSS change from 40 MHz
688  * channel to 20 MHz channel)
689  * @REASON_QOS_UNSPECIFIED: Disassociated for unspecified, QoS-related
690  * reason
691  * @REASON_NO_BANDWIDTH: Disassociated because QoS AP lacks sufficient
692  * bandwidth for this QoS STA
693  * @REASON_XS_UNACKED_FRAMES: Disassociated because excessive number of
694  * frames need to be acknowledged, but are not acknowledged due to AP
695  * transmissions and/or poor channel conditions
696  * @REASON_EXCEEDED_TXOP: Disassociated because STA is transmitting outside
697  * the limits of its TXOPs
698  * @REASON_STA_LEAVING: Requested from peer STA as the STA is leaving the
699  * BSS (or resetting)
700  * @REASON_END_TS_BA_DLS: Requesting STA is no longer using the stream
701  * or session
702  * @REASON_UNKNOWN_TS_BA: Requesting STA received frames using a
703  * mechanism for which setup has not been completed
704  * @REASON_TIMEDOUT:  Requested from peer STA due to timeout
705  * @REASON_PEERKEY_MISMATCH: Peer STA does not support the requested
706  * cipher suite
707  * @REASON_AUTHORIZED_ACCESS_LIMIT_REACHED: Disassociated because
708  * authorized access limit reached
709  * @REASON_EXTERNAL_SERVICE_REQUIREMENTS: Disassociated due to external
710  * service requirements
711  * @REASON_INVALID_FT_ACTION_FRAME_COUNT: Invalid FT Action frame count
712  * @REASON_INVALID_PMKID: Invalid pairwise master key identifier (PMKID)
713  * @REASON_INVALID_MDE: Invalid MDE
714  * @REASON_INVALID_FTE: Invalid FTE
715  * @REASON_MESH_PEERING_CANCELLED: Mesh peering canceled for unknown
716  * reasons
717  * @REASON_MESH_MAX_PEERS: The mesh STA has reached the supported maximum
718  * number of peer mesh STAs
719  * @REASON_MESH_CONFIG_POLICY_VIOLATION: The received information violates
720  * the Mesh Configuration policy configured in the mesh STA profile
721  * @REASON_MESH_CLOSE_RCVD: The mesh STA has received a Mesh Peering Close
722  * frame requesting to close the mesh peering
723  * @REASON_MESH_MAX_RETRIES: The mesh STA has resent dot11MeshMaxRetries
724  * Mesh Peering Open frames, without receiving a Mesh Peering Confirm frame
725  * @REASON_MESH_CONFIRM_TIMEOUT: The confirmTimer for the mesh peering
726  * instance times out.
727  * @REASON_MESH_INVALID_GTK: The mesh STA fails to unwrap the GTK or
728  * the values in the wrapped contents do not match
729  * @REASON_MESH_INCONSISTENT_PARAMS: The mesh STA receives inconsistent
730  * information about the mesh parameters between mesh peering Management frames
731  * @REASON_MESH_INVALID_SECURITY_CAP: The mesh STA fails the authenticated
732  * mesh peering exchange because due to failure in selecting either the pairwise
733  * ciphersuite or group ciphersuite
734  * @REASON_MESH_PATH_ERROR_NO_PROXY_INFO: The mesh STA does not have proxy
735  * information for this external destination.
736  * @REASON_MESH_PATH_ERROR_NO_FORWARDING_INFO: The mesh STA does not have
737  * forwarding information for this destination.
738  * @REASON_MESH_PATH_ERROR_DEST_UNREACHABLE: The mesh STA determines that
739  * the link to the next hop of an active path in its forwarding information is
740  * no longer usable.
741  * @REASON_MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS: The Deauthentication frame
742  * was sent because the MAC address of the STA already exists in the mesh BSS
743  * @REASON_MESH_CHANNEL_SWITCH_REGULATORY_REQ: The mesh STA performs
744  * channel switch to meet regulatory requirements.
745  * @REASON_MESH_CHANNEL_SWITCH_UNSPECIFIED: The mesh STA performs channel
746  * switching with unspecified reason.
747  * @REASON_POOR_RSSI_CONDITIONS: Disassociated due to poor RSSI conditions
748  *
749  *
750  * Internal reason codes: Add any internal reason code just after
751  * REASON_PROP_START and decrease the value of REASON_PROP_START
752  * accordingly.
753  *
754  * @REASON_PROP_START: Start of prop reason code
755  * @REASON_OCI_MISMATCH: Reason OCI Mismatch happens
756  * @REASON_HOST_TRIGGERED_ROAM_FAILURE: Reason host triggered roam failed
757  * @REASON_FW_TRIGGERED_ROAM_FAILURE: Firmware triggered roam failed
758  * @REASON_GATEWAY_REACHABILITY_FAILURE: Due to NUD failure
759  * @REASON_UNSUPPORTED_CHANNEL_CSA: due to unsuppoerted channel in CSA
760  * @REASON_OPER_CHANNEL_DISABLED_INDOOR: as channel is disabled in indoor
761  * @REASON_OPER_CHANNEL_USER_DISABLED: due to channel disabled by user
762  * @REASON_DEVICE_RECOVERY: due to SSR
763  * @REASON_KEY_TIMEOUT: due to key Timeout
764  * @REASON_OPER_CHANNEL_BAND_CHANGE: due to change in BAND
765  * @REASON_IFACE_DOWN: as interface is going down
766  * @REASON_PEER_XRETRY_FAIL: due to sta kickout with reason no ACK
767  * @REASON_PEER_INACTIVITY: due to sta kickout with reason inactivity
768  * @REASON_SA_QUERY_TIMEOUT: due to sta kickout due to SA query timeout
769  * @REASON_CHANNEL_SWITCH_FAILED: as channel switch failed
770  * @REASON_BEACON_MISSED: due to beacon miss
771  * @REASON_USER_TRIGGERED_ROAM_FAILURE: Reason user triggered roam failed
772  * @REASON_HOST_TRIGGERED_SILENT_DEAUTH: deauth without sending deauth frame
773  */
774 enum wlan_reason_code {
775 	REASON_UNSPEC_FAILURE = 1,
776 	REASON_PREV_AUTH_NOT_VALID = 2,
777 	REASON_DEAUTH_NETWORK_LEAVING = 3,
778 	REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
779 	REASON_DISASSOC_AP_BUSY = 5,
780 	REASON_CLASS2_FRAME_FROM_NON_AUTH_STA = 6,
781 	REASON_CLASS3_FRAME_FROM_NON_ASSOC_STA = 7,
782 	REASON_DISASSOC_NETWORK_LEAVING = 8,
783 	REASON_STA_NOT_AUTHENTICATED = 9,
784 	REASON_BAD_PWR_CAPABILITY = 10,
785 	REASON_BAD_SUPPORTED_CHANNELS = 11,
786 	REASON_DISASSOC_BSS_TRANSITION = 12,
787 	REASON_INVALID_IE = 13,
788 	REASON_MIC_FAILURE = 14,
789 	REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
790 	REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,
791 	REASON_IN_4WAY_DIFFERS = 17,
792 	REASON_INVALID_GROUP_CIPHER = 18,
793 	REASON_INVALID_PAIRWISE_CIPHER = 19,
794 	REASON_INVALID_AKMP = 20,
795 	REASON_UNSUPPORTED_RSNE_VER = 21,
796 	REASON_INVALID_RSNE_CAPABILITIES = 22,
797 	REASON_1X_AUTH_FAILURE = 23,
798 	REASON_CIPHER_SUITE_REJECTED = 24,
799 	REASON_TDLS_PEER_UNREACHABLE = 25,
800 	REASON_TDLS_UNSPEC = 26,
801 	REASON_DISASSOC_SSP_REQUESTED = 27,
802 	REASON_NO_SSP_ROAMING_AGREEMENT = 28,
803 	REASON_BAD_CIPHER_OR_AKM = 29,
804 	REASON_LOCATION_NOT_AUTHORIZED = 30,
805 	REASON_SERVICE_CHANGE_PRECLUDES_TS = 31,
806 	REASON_QOS_UNSPECIFIED = 32,
807 	REASON_NO_BANDWIDTH = 33,
808 	REASON_XS_UNACKED_FRAMES = 34,
809 	REASON_EXCEEDED_TXOP = 35,
810 	REASON_STA_LEAVING = 36,
811 	REASON_END_TS_BA_DLS = 37,
812 	REASON_UNKNOWN_TS_BA = 38,
813 	REASON_TIMEDOUT = 39,
814 	REASON_PEERKEY_MISMATCH = 45,
815 	REASON_AUTHORIZED_ACCESS_LIMIT_REACHED = 46,
816 	REASON_EXTERNAL_SERVICE_REQUIREMENTS = 47,
817 	REASON_INVALID_FT_ACTION_FRAME_COUNT = 48,
818 	REASON_INVALID_PMKID = 49,
819 	REASON_INVALID_MDE = 50,
820 	REASON_INVALID_FTE = 51,
821 	REASON_MESH_PEERING_CANCELLED = 52,
822 	REASON_MESH_MAX_PEERS = 53,
823 	REASON_MESH_CONFIG_POLICY_VIOLATION = 54,
824 	REASON_MESH_CLOSE_RCVD = 55,
825 	REASON_MESH_MAX_RETRIES = 56,
826 	REASON_MESH_CONFIRM_TIMEOUT = 57,
827 	REASON_MESH_INVALID_GTK = 58,
828 	REASON_MESH_INCONSISTENT_PARAMS = 59,
829 	REASON_MESH_INVALID_SECURITY_CAP = 60,
830 	REASON_MESH_PATH_ERROR_NO_PROXY_INFO = 61,
831 	REASON_MESH_PATH_ERROR_NO_FORWARDING_INFO = 62,
832 	REASON_MESH_PATH_ERROR_DEST_UNREACHABLE = 63,
833 	REASON_MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64,
834 	REASON_MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65,
835 	REASON_MESH_CHANNEL_SWITCH_UNSPECIFIED = 66,
836 	REASON_POOR_RSSI_CONDITIONS = 71,
837 	/* 72–65535 reserved */
838 
839 	/* Internal reason codes */
840 
841 	/*
842 	 * Internal reason codes: Add any internal reason code just after
843 	 * REASON_PROP_START and decrease the value of REASON_PROP_START
844 	 * accordingly.
845 	 */
846 	REASON_PROP_START = 65517,
847 	REASON_OCI_MISMATCH = 65518,
848 	REASON_HOST_TRIGGERED_ROAM_FAILURE  = 65519,
849 	REASON_FW_TRIGGERED_ROAM_FAILURE = 65520,
850 	REASON_GATEWAY_REACHABILITY_FAILURE = 65521,
851 	REASON_UNSUPPORTED_CHANNEL_CSA = 65522,
852 	REASON_OPER_CHANNEL_DISABLED_INDOOR = 65523,
853 	REASON_OPER_CHANNEL_USER_DISABLED = 65524,
854 	REASON_DEVICE_RECOVERY = 65525,
855 	REASON_KEY_TIMEOUT = 65526,
856 	REASON_OPER_CHANNEL_BAND_CHANGE = 65527,
857 	REASON_IFACE_DOWN = 65528,
858 	REASON_PEER_XRETRY_FAIL = 65529,
859 	REASON_PEER_INACTIVITY = 65530,
860 	REASON_SA_QUERY_TIMEOUT = 65531,
861 	REASON_CHANNEL_SWITCH_FAILED = 65532,
862 	REASON_BEACON_MISSED = 65533,
863 	REASON_USER_TRIGGERED_ROAM_FAILURE = 65534,
864 	REASON_HOST_TRIGGERED_SILENT_DEAUTH = 65535,
865 };
866 
867 /**
868  * enum wlan_status_code - wlan status codes
869  * (IEEE Std 802.11-2016, 9.4.1.9, Table 9-46)
870  * @STATUS_SUCCESS: Success full
871  * @STATUS_UNSPECIFIED_FAILURE: Unspecified failure.
872  * @STATUS_TDLS_WAKEUP_REJECT: TDLS wakeup schedule rejected but alternative
873  * schedule provided.
874  * @STATUS_SECURITY_DISABLED: Security disabled.
875  * @STATUS_UNACCEPTABLE_LIFETIME: Unacceptable lifetime.
876  * @STATUS_NOT_IN_SAME_BSS: Not in same BSS.
877  * @STATUS_CAPS_UNSUPPORTED: Cannot support all requested capabilities in the
878  * Capability Information field.
879  * @STATUS_REASSOC_NO_ASSOC: Reassociation denied due to inability to confirm
880  * that association exists.
881  * @STATUS_ASSOC_DENIED_UNSPEC: Association denied due to reason outside the
882  * scope of this standard.
883  * @STATUS_NOT_SUPPORTED_AUTH_ALG: Responding STA does not support the specified
884  * authentication algorithm.
885  * @STATUS_UNKNOWN_AUTH_TRANSACTION: Received an Authentication frame with
886  * authentication transaction sequence number out of expected sequence.
887  * @STATUS_CHALLENGE_FAIL: Authentication rejected because of challenge failure.
888  * @STATUS_AUTH_TIMEOUT: Authentication rejected due to timeout waiting for next
889  * frame in sequence.
890  * @STATUS_AP_UNABLE_TO_HANDLE_NEW_STA: Association denied because AP is unable
891  * to handle additional associated STAs.
892  * @STATUS_ASSOC_DENIED_RATES: Association denied due to requesting STA not
893  * supporting all of the data rates in the BSSBasicRateSet parameter,
894  * the Basic HT-MCS Set field of the HT Operation parameter, or the Basic
895  * VHT-MCS and NSS Set field in the VHT Operation parameter.
896  * @STATUS_ASSOC_DENIED_NOSHORT: Association denied due to requesting
897  * STA not supporting the short preamble option.
898  * @STATUS_SPEC_MGMT_REQUIRED: Association request rejected because Spectrum
899  * Management capability is required.
900  * @STATUS_PWR_CAPABILITY_NOT_VALID: Association request rejected because the
901  * information in the Power Capability element is unacceptable.
902  * @STATUS_SUPPORTED_CHANNEL_NOT_VALID: Association request rejected because
903  * the information in the Supported Channels element is unacceptable.
904  * @STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME: Association denied due to requesting
905  * STA not supporting the Short Slot Time option.
906  * @STATUS_ASSOC_DENIED_NO_HT: Association denied because the requesting STA
907  * does not support HT features.
908  * @STATUS_R0KH_UNREACHABLE: R0KH unreachable.
909  * @STATUS_ASSOC_DENIED_NO_PCO: Association denied because the requesting STA
910  * does not support the phased coexistence operation (PCO) transition time
911  * required by the AP.
912  * @STATUS_ASSOC_REJECTED_TEMPORARILY: Association request rejected temporarily,
913  * try again later.
914  * @STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION: Robust management frame policy
915  * violation.
916  * @STATUS_UNSPECIFIED_QOS_FAILURE: Unspecified, QoS-related failure.
917  * @STATUS_DENIED_INSUFFICIENT_BANDWIDTH: Association denied because QoS AP or
918  * PCP has insufficient bandwidth to handle another QoS STA.
919  * @STATUS_DENIED_POOR_CHANNEL_CONDITIONS: Association denied due to excessive
920  * frame loss rates and/or poor conditions on current operating channel.
921  * @STATUS_DENIED_QOS_NOT_SUPPORTED: Association (with QoS BSS) denied because
922  * the requesting STA does not support the QoS facility.
923  * @STATUS_REQUEST_DECLINED: The request has been declined.
924  * @STATUS_INVALID_PARAMETERS: The request has not been successful as one
925  * or more parameters have invalid values.
926  * @STATUS_REJECTED_WITH_SUGGESTED_CHANGES: The allocation or TS has not been
927  * created because the request cannot be honored; however, a suggested TSPEC/DMG
928  * TSPEC is provided so that the initiating STA can attempt to set another
929  * allocation or TS with the suggested changes to the TSPEC/DMG TSPEC
930  * @STATUS_INVALID_IE: Invalid element, i.e., an element defined in this
931  * standard for which the content does not meet the specifications in Clause 9.
932  * @STATUS_GROUP_CIPHER_NOT_VALID: Invalid group cipher.
933  * @STATUS_PAIRWISE_CIPHER_NOT_VALID: Invalid pairwise cipher.
934  * @STATUS_AKMP_NOT_VALID: Invalid AKMP.
935  * @STATUS_UNSUPPORTED_RSN_IE_VERSION: Unsupported RSNE version.
936  * @STATUS_INVALID_RSN_IE_CAPAB: Invalid RSNE capabilities.
937  * @STATUS_CIPHER_REJECTED_PER_POLICY: Cipher suite rejected because of security
938  * policy.
939  * @STATUS_TS_NOT_CREATED: The TS or allocation has not been created; however,
940  * the HC or PCP might be capable of creating a TS or allocation, in response to
941  * a request, after the time indicated in the TS Delay element.
942  * @STATUS_DIRECT_LINK_NOT_ALLOWED: Direct link is not allowed in the BSS by
943  * policy.
944  * @STATUS_DEST_STA_NOT_PRESENT: The Destination STA is not present within this
945  * BSS.
946  * @STATUS_DEST_STA_NOT_QOS_STA: The Destination STA is not a QoS STA.
947  * @STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE: Association denied because the
948  * listen interval is too large.
949  * @STATUS_INVALID_FT_ACTION_FRAME_COUNT: Invalid FT Action frame count.
950  * @STATUS_INVALID_PMKID: Invalid pairwise master key identifier (PMKID).
951  *
952  * Internal status codes: Add any internal status code just after
953  * STATUS_PROP_START and decrease the value of STATUS_PROP_START
954  * accordingly.
955  *
956  * @STATUS_PROP_START: Start of prop status codes.
957  * @STATUS_NO_NETWORK_FOUND: No network found
958  * @STATUS_AUTH_TX_FAIL: Failed to sent AUTH on air
959  * @STATUS_AUTH_NO_ACK_RECEIVED: No ack received for Auth tx
960  * @STATUS_AUTH_NO_RESP_RECEIVED: No Auth response for Auth tx
961  * @STATUS_ASSOC_TX_FAIL: Failed to sent Assoc on air
962  * @STATUS_ASSOC_NO_ACK_RECEIVED: No ack received for Assoc tx
963  * @STATUS_ASSOC_NO_RESP_RECEIVED: No Assoc response for Assoc tx
964  */
965 enum wlan_status_code {
966 	STATUS_SUCCESS = 0,
967 	STATUS_UNSPECIFIED_FAILURE = 1,
968 	STATUS_TDLS_WAKEUP_REJECT = 3,
969 	STATUS_SECURITY_DISABLED = 5,
970 	STATUS_UNACCEPTABLE_LIFETIME = 6,
971 	STATUS_NOT_IN_SAME_BSS = 7,
972 	STATUS_CAPS_UNSUPPORTED = 10,
973 	STATUS_REASSOC_NO_ASSOC = 11,
974 	STATUS_ASSOC_DENIED_UNSPEC = 12,
975 	STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
976 	STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
977 	STATUS_CHALLENGE_FAIL = 15,
978 	STATUS_AUTH_TIMEOUT = 16,
979 	STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
980 	STATUS_ASSOC_DENIED_RATES = 18,
981 	STATUS_ASSOC_DENIED_NOSHORT = 19,
982 	STATUS_SPEC_MGMT_REQUIRED = 22,
983 	STATUS_PWR_CAPABILITY_NOT_VALID = 23,
984 	STATUS_SUPPORTED_CHANNEL_NOT_VALID = 24,
985 	STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME = 25,
986 	STATUS_ASSOC_DENIED_NO_HT = 27,
987 	STATUS_R0KH_UNREACHABLE = 28,
988 	STATUS_ASSOC_DENIED_NO_PCO = 29,
989 	STATUS_ASSOC_REJECTED_TEMPORARILY = 30,
990 	STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31,
991 	STATUS_UNSPECIFIED_QOS_FAILURE = 32,
992 	STATUS_DENIED_INSUFFICIENT_BANDWIDTH = 33,
993 	STATUS_DENIED_POOR_CHANNEL_CONDITIONS = 34,
994 	STATUS_DENIED_QOS_NOT_SUPPORTED = 35,
995 	STATUS_REQUEST_DECLINED = 37,
996 	STATUS_INVALID_PARAMETERS = 38,
997 	STATUS_REJECTED_WITH_SUGGESTED_CHANGES = 39,
998 	STATUS_INVALID_IE = 40,
999 	STATUS_GROUP_CIPHER_NOT_VALID = 41,
1000 	STATUS_PAIRWISE_CIPHER_NOT_VALID = 42,
1001 	STATUS_AKMP_NOT_VALID = 43,
1002 	STATUS_UNSUPPORTED_RSN_IE_VERSION = 44,
1003 	STATUS_INVALID_RSN_IE_CAPAB = 45,
1004 	STATUS_CIPHER_REJECTED_PER_POLICY = 46,
1005 	STATUS_TS_NOT_CREATED = 47,
1006 	STATUS_DIRECT_LINK_NOT_ALLOWED = 48,
1007 	STATUS_DEST_STA_NOT_PRESENT = 49,
1008 	STATUS_DEST_STA_NOT_QOS_STA = 50,
1009 	STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE = 51,
1010 	STATUS_INVALID_FT_ACTION_FRAME_COUNT = 52,
1011 	STATUS_INVALID_PMKID = 53,
1012 
1013 	/* Error STATUS code for intenal usage*/
1014 	STATUS_PROP_START = 65528,
1015 	STATUS_NO_NETWORK_FOUND = 65528,
1016 	STATUS_AUTH_TX_FAIL = 65529,
1017 	STATUS_AUTH_NO_ACK_RECEIVED = 65530,
1018 	STATUS_AUTH_NO_RESP_RECEIVED = 65531,
1019 	STATUS_ASSOC_TX_FAIL = 65532,
1020 	STATUS_ASSOC_NO_ACK_RECEIVED = 65533,
1021 	STATUS_ASSOC_NO_RESP_RECEIVED = 65534,
1022 };
1023 
1024 #define WLAN_OUI_SIZE 4
1025 #define WLAN_MAX_CIPHER 6
1026 #define WLAN_RSN_SELECTOR_LEN 4
1027 #define WLAN_WPA_SELECTOR_LEN 4
1028 #define PMKID_LEN 16
1029 #define MAX_PMK_LEN 64
1030 #define MAX_PMKID 4
1031 #define MAX_KEK_LENGTH 64
1032 #define MAX_KCK_LEN 32
1033 #define REPLAY_CTR_LEN 8
1034 #define KCK_KEY_LEN 16
1035 #define KEK_KEY_LEN 16
1036 #define KCK_192BIT_KEY_LEN 24
1037 #define KEK_256BIT_KEY_LEN 32
1038 
1039 #define WLAN_MAX_SECURE_LTF_KEYSEED_LEN 48
1040 #define WLAN_MIN_SECURE_LTF_KEYSEED_LEN 32
1041 
1042 #define WLAN_WPA_OUI 0xf25000
1043 #define WLAN_WPA_OUI_TYPE 0x01
1044 #define WPA_VERSION 1
1045 #define WLAN_WPA_SEL(x) (((x) << 24) | WLAN_WPA_OUI)
1046 
1047 #define WLAN_RSN_OUI 0xac0f00
1048 #define WLAN_CCKM_OUI 0x964000
1049 #define WLAN_CCKM_ASE_UNSPEC 0
1050 #define WLAN_WPA_CCKM_AKM 0x00964000
1051 #define WLAN_RSN_CCKM_AKM 0x00964000
1052 #define WLAN_RSN_DPP_AKM 0x029A6F50
1053 #define WLAN_RSN_OSEN_AKM 0x019A6F50
1054 
1055 #define RSN_VERSION 1
1056 #define WLAN_RSN_SEL(x) (((x) << 24) | WLAN_RSN_OUI)
1057 #define WLAN_CCKM_SEL(x) (((x) << 24) | WLAN_CCKM_OUI)
1058 
1059 #define WLAN_CSE_NONE                    0x00
1060 #define WLAN_CSE_WEP40                   0x01
1061 #define WLAN_CSE_TKIP                    0x02
1062 #define WLAN_CSE_RESERVED                0x03
1063 #define WLAN_CSE_CCMP                    0x04
1064 #define WLAN_CSE_WEP104                  0x05
1065 #define WLAN_CSE_AES_CMAC                0x06
1066 #define WLAN_CSE_GCMP_128                0x08
1067 #define WLAN_CSE_GCMP_256                0x09
1068 #define WLAN_CSE_CCMP_256                0x0A
1069 #define WLAN_CSE_BIP_GMAC_128            0x0B
1070 #define WLAN_CSE_BIP_GMAC_256            0x0C
1071 #define WLAN_CSE_BIP_CMAC_256            0x0D
1072 
1073 #define WLAN_AKM_IEEE8021X        0x01
1074 #define WLAN_AKM_PSK              0x02
1075 #define WLAN_AKM_FT_IEEE8021X     0x03
1076 #define WLAN_AKM_FT_PSK           0x04
1077 #define WLAN_AKM_SHA256_IEEE8021X 0x05
1078 #define WLAN_AKM_SHA256_PSK       0x06
1079 #define WLAN_AKM_SAE              0x08
1080 #define WLAN_AKM_FT_SAE           0x09
1081 #define WLAN_AKM_SUITEB_EAP_SHA256 0x0B
1082 #define WLAN_AKM_SUITEB_EAP_SHA384 0x0C
1083 #define WLAN_AKM_FT_SUITEB_EAP_SHA384 0x0D
1084 #define WLAN_AKM_FILS_SHA256      0x0E
1085 #define WLAN_AKM_FILS_SHA384      0x0F
1086 #define WLAN_AKM_FILS_FT_SHA256   0x10
1087 #define WLAN_AKM_FILS_FT_SHA384   0x11
1088 #define WLAN_AKM_OWE              0x12
1089 
1090 #define WLAN_ASE_NONE                    0x00
1091 #define WLAN_ASE_8021X_UNSPEC            0x01
1092 #define WLAN_ASE_8021X_PSK               0x02
1093 #define WLAN_ASE_FT_IEEE8021X            0x20
1094 #define WLAN_ASE_FT_PSK                  0x40
1095 #define WLAN_ASE_SHA256_IEEE8021X        0x80
1096 #define WLAN_ASE_SHA256_PSK              0x100
1097 #define WLAN_ASE_WPS                     0x200
1098 
1099 #define RSN_CAP_MFP_CAPABLE 0x80
1100 #define RSN_CAP_MFP_REQUIRED 0x40
1101 
1102 /* FILS Discovery */
1103 #define WLAN_ACTION_FILS_DISCOVERY         34
1104 #define WLAN_FD_FRAMECNTL_CAP              0x0020
1105 #define WLAN_FD_FRAMECNTL_SHORTSSID        0x0040
1106 #define WLAN_FD_FRAMECNTL_CH_CENTERFREQ    0x0200
1107 #define WLAN_FD_FRAMECNTL_LEN_PRES         0x1000
1108 #define WLAN_FD_FRAMECNTL_SHORTSSID_LEN    0x0003
1109 
1110 #define WLAN_FD_SSID_LEN_PRES(_v)          ((_v) & 0x1F)
1111 #define WLAN_FD_IS_CAP_PRESENT(_v)         ((_v) & WLAN_FD_FRAMECNTL_CAP)
1112 #define WLAN_FD_IS_LEN_PRESENT(_v)         ((_v) & WLAN_FD_FRAMECNTL_LEN_PRES)
1113 #define WLAN_FD_IS_FRAMECNTL_CH_CENTERFREQ(_v)\
1114 					((_v) & WLAN_FD_FRAMECNTL_CH_CENTERFREQ)
1115 
1116 #define WLAN_FD_CAP_LEN                    2
1117 #define WLAN_FD_CAP_ESS_S                  0
1118 #define WLAN_FD_CAP_PRIVACY_S              1
1119 #define WLAN_FD_CAP_BSS_CHWIDTH_S          2
1120 #define WLAN_FD_CAP_NSS_S                  5
1121 #define WLAN_FD_CAP_PHY_INDEX_S            2
1122 #define WLAN_FD_CAP_MIN_RATE_S             5
1123 
1124 #define WLAN_FD_CHWIDTH_20                 0
1125 #define WLAN_FD_CHWIDTH_40                 1
1126 #define WLAN_FD_CHWIDTH_80                 2
1127 #define WLAN_FD_CHWIDTH_160_80_80          3
1128 #define WLAN_FD_CHWIDTH_320                4
1129 
1130 #define WLAN_FD_CAP_NSS_GTE_5              4
1131 #define WLAN_FD_CAP_NSS_MODE_1             1
1132 #define WLAN_FD_CAP_NSS_MODE_2             2
1133 #define WLAN_FD_CAP_NSS_MODE_3             3
1134 #define WLAN_FD_CAP_NSS_MODE_4             4
1135 #define WLAN_FD_CAP_NSS_MODE_5             5
1136 #define WLAN_FD_CAP_NSS_MODE_6             6
1137 #define WLAN_FD_CAP_NSS_MODE_7             7
1138 #define WLAN_FD_CAP_NSS_MODE_8             8
1139 
1140 #define WLAN_FD_CAP_ESS_ENABLE             1
1141 
1142 #define WLAN_FD_CAP_PHY_INDEX_NON_HT_OFDM  1
1143 #define WLAN_FD_CAP_PHY_INDEX_HT           2
1144 #define WLAN_FD_CAP_PHY_INDEX_VHT          3
1145 #define WLAN_FD_CAP_PHY_INDEX_HE           4
1146 #ifdef WLAN_FEATURE_11BE
1147 #define WLAN_FD_CAP_PHY_INDEX_EHT          5
1148 #endif /* WLAN_FEATURE_11BE */
1149 
1150 #define WLAN_FD_CAP_MIN_RATE               0
1151 
1152 /**
1153  * struct element_info - defines length of a memory block and memory block
1154  * @len: length of memory block
1155  * @ptr: memory block pointer
1156  */
1157 struct element_info {
1158 	uint32_t len;
1159 	uint8_t *ptr;
1160 };
1161 
1162 /**
1163  * struct wlan_rsn_ie_hdr: rsn ie header
1164  * @elem_id: RSN element id WLAN_ELEMID_RSN.
1165  * @len: rsn ie length
1166  * @version: RSN ver
1167  */
1168 struct wlan_rsn_ie_hdr {
1169 	u8 elem_id;
1170 	u8 len;
1171 	u8 version[2];
1172 };
1173 
1174 #define WLAN_RSN_IE_MIN_LEN             2
1175 #define WLAN_WAPI_IE_MIN_LEN            20
1176 
1177 /**
1178  * struct wlan_wpa_ie_hdr: wpa ie header
1179  * @elem_id: Wpa element id, vender specific.
1180  * @len: wpa ie length
1181  * @oui: 24-bit OUI followed by 8-bit OUI type
1182  * @version: wpa ver
1183  */
1184 struct wlan_wpa_ie_hdr {
1185 	u8 elem_id;
1186 	u8 len;
1187 	u8 oui[4];
1188 	u8 version[2];
1189 };
1190 
1191 #define WAPI_VERSION 1
1192 #define WLAN_WAPI_OUI 0x721400
1193 
1194 #define WLAN_WAPI_SEL(x) (((x) << 24) | WLAN_WAPI_OUI)
1195 
1196 #define WLAN_WAI_CERT_OR_SMS4 0x01
1197 #define WLAN_WAI_PSK 0x02
1198 
1199 /**
1200  * struct wlan_frame_hdr: generic IEEE 802.11 frames
1201  * @i_fc: frame control
1202  * @i_dur: duration field
1203  * @i_addr1: mac address 1
1204  * @i_addr2: mac address 2
1205  * @i_addr3: mac address 3
1206  * @i_seq: seq info
1207  */
1208 struct wlan_frame_hdr {
1209 	uint8_t i_fc[2];
1210 	uint8_t i_dur[2];
1211 	union {
1212 		struct {
1213 			uint8_t i_addr1[QDF_MAC_ADDR_SIZE];
1214 			uint8_t i_addr2[QDF_MAC_ADDR_SIZE];
1215 			uint8_t i_addr3[QDF_MAC_ADDR_SIZE];
1216 		};
1217 		uint8_t i_addr_all[3 * QDF_MAC_ADDR_SIZE];
1218 	};
1219 	uint8_t i_seq[2];
1220 } qdf_packed;
1221 
1222 struct wlan_frame_hdr_qos {
1223 	uint8_t i_fc[2];
1224 	uint8_t i_dur[2];
1225 	union {
1226 		struct {
1227 			uint8_t i_addr1[QDF_MAC_ADDR_SIZE];
1228 			uint8_t i_addr2[QDF_MAC_ADDR_SIZE];
1229 			uint8_t i_addr3[QDF_MAC_ADDR_SIZE];
1230 		};
1231 		uint8_t i_addr_all[3 * QDF_MAC_ADDR_SIZE];
1232 	};
1233 	uint8_t i_seq[2];
1234 	uint8_t i_qos[2];
1235 } qdf_packed;
1236 
1237 struct wlan_frame_hdr_qos_addr4 {
1238 	uint8_t i_fc[2];
1239 	uint8_t i_dur[2];
1240 	union {
1241 		struct {
1242 			uint8_t i_addr1[QDF_MAC_ADDR_SIZE];
1243 			uint8_t i_addr2[QDF_MAC_ADDR_SIZE];
1244 			uint8_t i_addr3[QDF_MAC_ADDR_SIZE];
1245 		};
1246 		uint8_t i_addr_all[3 * QDF_MAC_ADDR_SIZE];
1247 	};
1248 	uint8_t i_seq[2];
1249 	uint8_t i_addr4[QDF_MAC_ADDR_SIZE];
1250 	uint8_t i_qos[2];
1251 } qdf_packed;
1252 
1253 /* sequence number offset base on begin of mac header */
1254 #define WLAN_SEQ_CTL_OFFSET         22
1255 #define WLAN_LOW_SEQ_NUM_MASK       0x000F
1256 #define WLAN_HIGH_SEQ_NUM_MASK      0x0FF0
1257 #define WLAN_HIGH_SEQ_NUM_OFFSET    4
1258 
1259 /**
1260  * struct wlan_seq_ctl: sequence number control
1261  * @frag_num: frag number
1262  * @seq_num_lo: sequence number low byte
1263  * @seq_num_hi: sequence number high byte
1264  */
1265 struct wlan_seq_ctl {
1266 	uint8_t frag_num:4;
1267 	uint8_t seq_num_lo:4;
1268 	uint8_t seq_num_hi:8;
1269 } qdf_packed;
1270 
1271 /**
1272  * union wlan_capability : wlan_capability info
1273  * @value: capability value
1274  */
1275 union wlan_capability {
1276 	struct caps {
1277 		uint16_t ess:1;
1278 		uint16_t ibss:1;
1279 		uint16_t cf_pollable:1;
1280 		uint16_t cf_poll_request:1;
1281 		uint16_t privacy:1;
1282 		uint16_t short_preamble:1;
1283 		uint16_t pbcc:1;
1284 		uint16_t channel_agility:1;
1285 		uint16_t spectrum_management:1;
1286 		uint16_t qos:1;
1287 		uint16_t short_slot_time:1;
1288 		uint16_t apsd:1;
1289 		uint16_t reserved2:1;
1290 		uint16_t dsss_ofdm:1;
1291 		uint16_t del_block_ack:1;
1292 		uint16_t immed_block_ack:1;
1293 	} wlan_caps;
1294 	uint16_t value;
1295 } qdf_packed;
1296 
1297 /**
1298  * struct ie_header : IE header
1299  * @ie_id: Element Id
1300  * @ie_len: IE Length
1301  */
1302 struct ie_header {
1303 	uint8_t ie_id;
1304 	uint8_t ie_len;
1305 } qdf_packed;
1306 
1307 /**
1308  * struct extn_ie_header : Extension IE header
1309  * @ie_id: Element Id
1310  * @ie_len: IE Length
1311  * @ie_extn_id: extension id
1312  */
1313 struct extn_ie_header {
1314 	uint8_t ie_id;
1315 	uint8_t ie_len;
1316 	uint8_t ie_extn_id;
1317 } qdf_packed;
1318 
1319 
1320 /**
1321  * struct ie_ssid : ssid IE
1322  * @ssid_id: SSID Element Id
1323  * @ssid_len: SSID IE Length
1324  * @ssid: ssid value
1325  */
1326 struct ie_ssid {
1327 	uint8_t ssid_id;
1328 	uint8_t ssid_len;
1329 	uint8_t ssid[WLAN_SSID_MAX_LEN];
1330 } qdf_packed;
1331 
1332 /**
1333  * struct ds_ie : ds IE
1334  * @ie: DS Element Id
1335  * @len: DS IE Length
1336  * @cur_chan: channel info
1337  */
1338 struct ds_ie {
1339 	uint8_t ie;
1340 	uint8_t len;
1341 	uint8_t cur_chan;
1342 } qdf_packed;
1343 
1344 /**
1345  * struct erp_ie: ERP IE
1346  * @ie: ERP Element Id
1347  * @len: ERP IE Length
1348  * @value: EP Info
1349  */
1350 struct erp_ie {
1351 	uint8_t ie;
1352 	uint8_t len;
1353 	uint8_t value;
1354 } qdf_packed;
1355 
1356 /**
1357  * struct htcap_cmn_ie: HT common IE info
1358  * @hc_cap: HT capabilities
1359  * @ampdu_param: ampdu params
1360  * @mcsset: supported MCS set
1361  * @extcap: extended HT capabilities
1362  * @txbf_cap: txbf capabilities
1363  * @antenna: antenna capabilities
1364  */
1365 struct htcap_cmn_ie {
1366 	uint16_t hc_cap;
1367 	uint8_t ampdu_param;
1368 	uint8_t mcsset[16];
1369 	uint16_t extcap;
1370 	uint32_t txbf_cap;
1371 	uint8_t antenna;
1372 } qdf_packed;
1373 
1374 /**
1375  * struct htcap_ie: HT Capability IE
1376  * @id: HT IE
1377  * @len: HT IE LEN
1378  * @ie: HT cap info
1379  */
1380 struct htcap_ie {
1381 	uint8_t id;
1382 	uint8_t len;
1383 	struct htcap_cmn_ie ie;
1384 } qdf_packed;
1385 
1386 /**
1387  * struct fils_indication_ie: FILS indication IE element
1388  * @id: id
1389  * @len: len
1390  * @public_key_identifiers_cnt: public key identifiers count
1391  * @realm_identifiers_cnt: realm identifiers count
1392  * @is_ip_config_supported: whether ip config is supported in AP
1393  * @is_cache_id_present: whether cache identifier is present
1394  * @is_hessid_present: whether hessid is present
1395  * @is_fils_sk_auth_supported: FILS shared key authentication is supported
1396  * @is_fils_sk_auth_pfs_supported: FILS shared key auth with PFS is supported
1397  * @is_pk_auth_supported: FILS public key authentication is supported
1398  * @reserved: reserved
1399  * @variable_data: pointer to data depends on initial variables
1400  */
1401 struct fils_indication_ie {
1402 	uint8_t id;
1403 	uint8_t len;
1404 	uint16_t public_key_identifiers_cnt:3;
1405 	uint16_t realm_identifiers_cnt:3;
1406 	uint16_t is_ip_config_supported:1;
1407 	uint16_t is_cache_id_present:1;
1408 	uint16_t is_hessid_present:1;
1409 	uint16_t is_fils_sk_auth_supported:1;
1410 	uint16_t is_fils_sk_auth_pfs_supported:1;
1411 	uint16_t is_pk_auth_supported:1;
1412 	uint16_t reserved:4;
1413 	uint8_t variable_data[253];
1414 } qdf_packed;
1415 
1416 #define WLAN_VENDOR_HT_IE_OFFSET_LEN    4
1417 
1418 /**
1419  * struct wlan_vendor_ie_htcap: vendor private HT Capability IE
1420  * @id: HT IE
1421  * @hlen: HT IE len
1422  * @oui: vendor OUI
1423  * @oui_type: Oui type
1424  * @ie: HT cap info
1425  */
1426 struct wlan_vendor_ie_htcap {
1427 	uint8_t id;
1428 	uint8_t hlen;
1429 	uint8_t oui[3];
1430 	uint8_t oui_type;
1431 	struct htcap_cmn_ie ie;
1432 } qdf_packed;
1433 
1434 /**
1435  * struct wlan_ie_htinfo_cmn: ht info comman
1436  * @hi_ctrlchannel: control channel
1437  * @hi_extchoff: B0-1 extension channel offset
1438  * @hi_txchwidth: B2 recommended xmiss width set
1439  * @hi_rifsmode: rifs mode
1440  * @hi_ctrlaccess: controlled access only
1441  * @hi_serviceinterval: B5-7 svc interval granularity
1442  * @uhi_opmode: B0-1 operating mode
1443  * @hi_nongfpresent: B2 non greenfield devices present
1444  * @hi_txburstlimit: B3 transmit burst limit
1445  * @hi_obssnonhtpresent: B4 OBSS non-HT STA present
1446  * @hi_reserved0: B5-15 reserved
1447  * @hi_reserved2: B0-5 reserved
1448  * @hi_dualbeacon: B6 dual beacon
1449  * @hi_dualctsprot: B7 dual CTS protection
1450  * @hi_stbcbeacon: B8 STBC beacon
1451  * @hi_lsigtxopprot: B9 l-sig txop protection full support
1452  * @hi_pcoactive: B10 pco active
1453  * @hi_pcophase: B11 pco phase
1454  * @hi_reserved1: B12-15 reserved
1455  * @hi_basicmcsset[16]: basic MCS set
1456  */
1457 struct wlan_ie_htinfo_cmn {
1458 	uint8_t hi_ctrlchannel;
1459 	uint8_t hi_extchoff:2,
1460 		hi_txchwidth:1,
1461 		hi_rifsmode:1,
1462 		hi_ctrlaccess:1,
1463 		hi_serviceinterval:3;
1464 	uint16_t hi_opmode:2,
1465 		hi_nongfpresent:1,
1466 		hi_txburstlimit:1,
1467 		hi_obssnonhtpresent:1,
1468 		hi_reserved0:11;
1469 	uint16_t hi_reserved2:6,
1470 		hi_dualbeacon:1,
1471 		hi_dualctsprot:1,
1472 		hi_stbcbeacon:1,
1473 		hi_lsigtxopprot:1,
1474 		hi_pcoactive:1,
1475 		hi_pcophase:1,
1476 		hi_reserved1:4;
1477 	uint8_t  hi_basicmcsset[16];
1478 } qdf_packed;
1479 
1480 /**
1481  * struct wlan_ie_htinfo: HT info IE
1482  * @hi_id: HT info IE
1483  * @hi_len: HT info IE len
1484  * @hi_ie: HT info info
1485  */
1486 struct wlan_ie_htinfo {
1487 	uint8_t hi_id;
1488 	uint8_t hi_len;
1489 	struct wlan_ie_htinfo_cmn  hi_ie;
1490 } qdf_packed;
1491 
1492 /**
1493  * struct wlan_ie_htinfo: vendor private HT info IE
1494  * @hi_id: HT info IE
1495  * @hi_len: HT info IE len
1496  * @hi_oui: vendor OUI
1497  * @hi_ouitype: Oui type
1498  * @hi_ie: HT info info
1499  */
1500 struct wlan_vendor_ie_htinfo {
1501 	uint8_t hi_id;
1502 	uint8_t hi_len;
1503 	uint8_t hi_oui[3];
1504 	uint8_t hi_ouitype;
1505 	struct wlan_ie_htinfo_cmn hi_ie;
1506 } qdf_packed;
1507 
1508 #define WLAN_VENDOR_VHTCAP_IE_OFFSET    7
1509 #define WLAN_VENDOR_VHTOP_IE_OFFSET     21
1510 
1511 /**
1512  * struct wlan_ie_vhtcaps - VHT capabilities
1513  * @elem_id: VHT caps IE
1514  * @elem_len: VHT caps IE len
1515  * @max_mpdu_len: MPDU length
1516  * @supported_channel_widthset: channel width set
1517  * @ldpc_coding: LDPC coding capability
1518  * @shortgi80: short GI 80 support
1519  * @shortgi160and80plus80: short Gi 160 & 80+80 support
1520  * @tx_stbc; Tx STBC cap
1521  * @tx_stbc: Rx STBC cap
1522  * @su_beam_former: SU beam former cap
1523  * @su_beam_formee: SU beam formee cap
1524  * @csnof_beamformer_antSup: Antenna support for beamforming
1525  * @num_soundingdim: Sound dimensions
1526  * @mu_beam_former: MU beam former cap
1527  * @mu_beam_formee: MU beam formee cap
1528  * @vht_txops: TXOP power save
1529  * @htc_vhtcap: HTC VHT capability
1530  * @max_ampdu_lenexp: AMPDU length
1531  * @vht_link_adapt: VHT link adapatation capable
1532  * @rx_antpattern: Rx Antenna pattern
1533  * @tx_antpattern: Tx Antenna pattern
1534  * @rx_mcs_map: RX MCS map
1535  * @rx_high_sup_data_rate : highest RX supported data rate
1536  * @tx_mcs_map: TX MCS map
1537  * @tx_sup_data_rate: highest TX supported data rate
1538  */
1539 struct wlan_ie_vhtcaps {
1540 	uint8_t elem_id;
1541 	uint8_t elem_len;
1542 	uint32_t max_mpdu_len:2;
1543 	uint32_t supported_channel_widthset:2;
1544 	uint32_t ldpc_coding:1;
1545 	uint32_t shortgi80:1;
1546 	uint32_t shortgi160and80plus80:1;
1547 	uint32_t tx_stbc:1;
1548 	uint32_t rx_stbc:3;
1549 	uint32_t su_beam_former:1;
1550 	uint32_t su_beam_formee:1;
1551 	uint32_t csnof_beamformer_antSup:3;
1552 	uint32_t num_soundingdim:3;
1553 	uint32_t mu_beam_former:1;
1554 	uint32_t mu_beam_formee:1;
1555 	uint32_t vht_txops:1;
1556 	uint32_t htc_vhtcap:1;
1557 	uint32_t max_ampdu_lenexp:3;
1558 	uint32_t vht_link_adapt:2;
1559 	uint32_t rx_antpattern:1;
1560 	uint32_t tx_antpattern:1;
1561 	uint32_t unused:2;
1562 	uint16_t rx_mcs_map;
1563 	uint16_t rx_high_sup_data_rate:13;
1564 	uint16_t reserved2:3;
1565 	uint16_t tx_mcs_map;
1566 	uint16_t tx_sup_data_rate:13;
1567 	uint16_t reserved3:3;
1568 } qdf_packed;
1569 
1570 /**
1571  * struct wlan_ie_vhtop: VHT op IE
1572  * @elem_id: VHT op IE
1573  * @elem_len: VHT op IE len
1574  * @vht_op_chwidth: BSS Operational Channel width
1575  * @vht_op_ch_freq_seg1: Channel Center frequency
1576  * @vht_op_ch_freq_seg2: Channel Center frequency for 80+80MHz
1577  * @vhtop_basic_mcs_set: Basic MCS set
1578  */
1579 struct wlan_ie_vhtop {
1580 	uint8_t elem_id;
1581 	uint8_t elem_len;
1582 	uint8_t vht_op_chwidth;
1583 	uint8_t vht_op_ch_freq_seg1;
1584 	uint8_t vht_op_ch_freq_seg2;
1585 	uint16_t vhtop_basic_mcs_set;
1586 } qdf_packed;
1587 
1588 #define WLAN_HE_PHYCAP_160_SUPPORT BIT(2)
1589 #define WLAN_HE_PHYCAP_80_80_SUPPORT BIT(3)
1590 #define WLAN_HE_MACCAP_LEN 6
1591 #define WLAN_HE_PHYCAP_LEN 11
1592 #define WLAN_HE_MAX_MCS_MAPS 3
1593 /**
1594  * struct wlan_ie_hecaps - HT capabilities
1595  * @elem_id: HE caps IE
1596  * @elem_len: HE caps IE len
1597  * @elem_id_extn: HE caps extension id
1598  * @he_mac_cap: HE mac capabilities
1599  * @he_phy_cap: HE phy capabilities
1600  * @phy_cap_bytes: HT phy capability bytes
1601  * @supported_ch_width_set: Supported channel width set
1602  * @mcs_bw_map: MCS NSS map per bandwidth
1603  * @rx_mcs_map: RX MCS map
1604  * @tx_mcs_map: TX MCS map
1605  */
1606 struct wlan_ie_hecaps {
1607 	uint8_t elem_id;
1608 	uint8_t elem_len;
1609 	uint8_t elem_id_extn;
1610 	uint8_t he_mac_cap[WLAN_HE_MACCAP_LEN];
1611 	union {
1612 		uint8_t phy_cap_bytes[WLAN_HE_PHYCAP_LEN];
1613 		struct {
1614 			uint32_t reserved:1;
1615 			uint32_t supported_ch_width_set:7;
1616 		} qdf_packed;
1617 	} qdf_packed he_phy_cap;
1618 	struct {
1619 		uint16_t rx_mcs_map;
1620 		uint16_t tx_mcs_map;
1621 	} qdf_packed mcs_bw_map[WLAN_HE_MAX_MCS_MAPS];
1622 } qdf_packed;
1623 
1624 /**
1625  * struct subelem_header: Subelement header
1626  * @subelem_id: Subelement ID
1627  * @subelem_len: Subelement length
1628  */
1629 struct subelem_header {
1630 	uint8_t subelem_id;
1631 	uint8_t subelem_len;
1632 } qdf_packed;
1633 
1634 #ifdef WLAN_FEATURE_11BE
1635 #define WLAN_EHT_MACCAP_LEN 2
1636 #define WLAN_EHT_PHYCAP_LEN 9
1637 
1638 #define WLAN_EHT_MAX_MCS_MAPS 3
1639 
1640 #define EHTCAP_MAC_EPCSPRIACCESS_IDX                    0
1641 #define EHTCAP_MAC_EPCSPRIACCESS_BITS                   1
1642 #define EHTCAP_MAC_EHTOMCTRL_IDX                        1
1643 #define EHTCAP_MAC_EHTOMCTRL_BITS                       1
1644 #define EHTCAP_MAC_TRIGGERED_TXOP_MODE1_IDX             2
1645 #define EHTCAP_MAC_TRIGGERED_TXOP_MODE1_BITS            1
1646 #define EHTCAP_MAC_TRIGGERED_TXOP_MODE2_IDX             3
1647 #define EHTCAP_MAC_TRIGGERED_TXOP_MODE2_BITS            1
1648 #define EHTCAP_MAC_RESTRICTED_TWT_IDX                   4
1649 #define EHTCAP_MAC_RESTRICTED_TWT_BITS                  1
1650 #define EHTCAP_MAC_SCS_TRAFFIC_DESC_IDX                 5
1651 #define EHTCAP_MAC_SCS_TRAFFIC_DESC_BITS                1
1652 #define EHTCAP_MAC_MAX_MPDU_LEN_IDX                     6
1653 #define EHTCAP_MAC_MAX_MPDU_LEN_BITS                    2
1654 #define EHTCAP_MAC_MAX_A_MPDU_LEN_IDX                   8
1655 #define EHTCAP_MAC_MAX_A_MPDU_LEN_BITS                  1
1656 #define EHTCAP_MAC_TRS_SUPPORT_IDX                      9
1657 #define EHTCAP_MAC_TRS_SUPPORT_BITS                     1
1658 #define EHTCAP_MAC_TXOP_RET_SUPPP_IN_SHARING_MODE2_IDX  10
1659 #define EHTCAP_MAC_TXOP_RET_SUPPP_IN_SHARING_MODE2_BITS 1
1660 
1661 #define EHTCAP_PHY_320MHZIN6GHZ_IDX                     1
1662 #define EHTCAP_PHY_320MHZIN6GHZ_BITS                    1
1663 #define EHTCAP_PHY_242TONERUBWLT20MHZ_IDX               2
1664 #define EHTCAP_PHY_242TONERUBWLT20MHZ_BITS              1
1665 #define EHTCAP_PHY_NDP4XEHTLTFAND320NSGI_IDX            3
1666 #define EHTCAP_PHY_NDP4XEHTLTFAND320NSGI_BITS           1
1667 #define EHTCAP_PHY_PARTIALBWULMU_IDX                    4
1668 #define EHTCAP_PHY_PARTIALBWULMU_BITS                   1
1669 #define EHTCAP_PHY_SUBFMR_IDX                           5
1670 #define EHTCAP_PHY_SUBFMR_BITS                          1
1671 #define EHTCAP_PHY_SUBFME_IDX                           6
1672 #define EHTCAP_PHY_SUBFME_BITS                          1
1673 #define EHTCAP_PHY_BFMESSLT80MHZ_IDX                    7
1674 #define EHTCAP_PHY_BFMESSLT80MHZ_BITS                   3
1675 #define EHTCAP_PHY_BFMESS160MHZ_IDX                     10
1676 #define EHTCAP_PHY_BFMESS160MHZ_BITS                    3
1677 #define EHTCAP_PHY_BFMESS320MHZ_IDX                     13
1678 #define EHTCAP_PHY_BFMESS320MHZ_BITS                    3
1679 #define EHTCAP_PHY_NUMSOUNDLT80MHZ_IDX                  16
1680 #define EHTCAP_PHY_NUMSOUNDLT80MHZ_BITS                 3
1681 #define EHTCAP_PHY_NUMSOUND160MHZ_IDX                   19
1682 #define EHTCAP_PHY_NUMSOUND160MHZ_BITS                  3
1683 #define EHTCAP_PHY_NUMSOUND320MHZ_IDX                   22
1684 #define EHTCAP_PHY_NUMSOUND320MHZ_BITS                  3
1685 #define EHTCAP_PHY_NG16SUFB_IDX                         25
1686 #define EHTCAP_PHY_NG16SUFB_BITS                        1
1687 #define EHTCAP_PHY_NG16MUFB_IDX                         26
1688 #define EHTCAP_PHY_NG16MUFB_BITS                        1
1689 #define EHTCAP_PHY_CODBK42SUFB_IDX                      27
1690 #define EHTCAP_PHY_CODBK42SUFB_BITS                     1
1691 #define EHTCAP_PHY_CODBK75MUFB_IDX                      28
1692 #define EHTCAP_PHY_CODBK75MUFB_BITS                     1
1693 #define EHTCAP_PHY_TRIGSUBFFB_IDX                       29
1694 #define EHTCAP_PHY_TRIGSUBFFB_BITS                      1
1695 #define EHTCAP_PHY_TRIGMUBFPARTBWFB_IDX                 30
1696 #define EHTCAP_PHY_TRIGMUBFPARTBWFB_BITS                1
1697 #define EHTCAP_PHY_TRIGCQIFB_IDX                        31
1698 #define EHTCAP_PHY_TRIGCQIFB_BITS                       1
1699 
1700 #define EHTCAP_PHY_PARTBWDLMUMIMO_IDX                   32
1701 #define EHTCAP_PHY_PARTBWDLMUMIMO_BITS                  1
1702 #define EHTCAP_PHY_PSRSR_IDX                            33
1703 #define EHTCAP_PHY_PSRSR_BITS                           1
1704 #define EHTCAP_PHY_PWRBSTFACTOR_IDX                     34
1705 #define EHTCAP_PHY_PWRBSTFACTOR_BITS                    1
1706 #define EHTCAP_PHY_4XEHTLTFAND800NSGI_IDX               35
1707 #define EHTCAP_PHY_4XEHTLTFAND800NSGI_BITS              1
1708 #define EHTCAP_PHY_MAXNC_IDX                            36
1709 #define EHTCAP_PHY_MAXNC_BITS                           4
1710 #define EHTCAP_PHY_NONTRIGCQIFB_IDX                     40
1711 #define EHTCAP_PHY_NONTRIGCQIFB_BITS                    1
1712 #define EHTCAP_PHY_TX1024AND4096QAMLS242TONERU_IDX      41
1713 #define EHTCAP_PHY_TX1024AND4096QAMLS242TONERU_BITS     1
1714 #define EHTCAP_PHY_RX1024AND4096QAMLS242TONERU_IDX      42
1715 #define EHTCAP_PHY_RX1024AND4096QAMLS242TONERU_BITS     1
1716 #define EHTCAP_PHY_PPETHRESPRESENT_IDX                  43
1717 #define EHTCAP_PHY_PPETHRESPRESENT_BITS                 1
1718 #define EHTCAP_PHY_CMNNOMPKTPAD_IDX                     44
1719 #define EHTCAP_PHY_CMNNOMPKTPAD_BITS                    2
1720 #define EHTCAP_PHY_MAXNUMEHTLTF_IDX                     46
1721 #define EHTCAP_PHY_MAXNUMEHTLTF_BITS                    5
1722 #define EHTCAP_PHY_SUPMCS15_IDX                         51
1723 #define EHTCAP_PHY_SUPMCS15_BITS                        4
1724 #define EHTCAP_PHY_EHTDUPIN6GHZ_IDX                     55
1725 #define EHTCAP_PHY_EHTDUPIN6GHZ_BITS                    1
1726 #define EHTCAP_PHY_20MHZOPSTARXNDPWIDERBW_IDX           56
1727 #define EHTCAP_PHY_20MHZOPSTARXNDPWIDERBW_BITS          1
1728 #define EHTCAP_PHY_NONOFDMAULMUMIMOLT80MHZ_IDX          57
1729 #define EHTCAP_PHY_NONOFDMAULMUMIMOLT80MHZ_BITS         1
1730 #define EHTCAP_PHY_NONOFDMAULMUMIMO160MHZ_IDX           58
1731 #define EHTCAP_PHY_NONOFDMAULMUMIMO160MHZ_BITS          1
1732 #define EHTCAP_PHY_NONOFDMAULMUMIMO320MHZ_IDX           59
1733 #define EHTCAP_PHY_NONOFDMAULMUMIMO320MHZ_BITS          1
1734 #define EHTCAP_PHY_MUBFMRLT80MHZ_IDX                    60
1735 #define EHTCAP_PHY_MUBFMRLT80MHZ_BITS                   1
1736 #define EHTCAP_PHY_MUBFMR160MHZ_IDX                     61
1737 #define EHTCAP_PHY_MUBFMR160MHZ_BITS                    1
1738 #define EHTCAP_PHY_MUBFMR320MHZ_IDX                     62
1739 #define EHTCAP_PHY_MUBFMR320MHZ_BITS                    1
1740 #define EHTCAP_PHY_TB_SOUNDING_FEEDBACK_RL_IDX          63
1741 #define EHTCAP_PHY_TB_SOUNDING_FEEDBACK_RL_BITS         1
1742 #define EHTCAP_PHY_RX_1K_QAM_IN_WIDER_BW_DL_OFDMA_IDX   64
1743 #define EHTCAP_PHY_RX_1K_QAM_IN_WIDER_BW_DL_OFDMA_BITS  1
1744 #define EHTCAP_PHY_RX_4K_QAM_IN_WIDER_BW_DL_OFDMA_IDX   65
1745 #define EHTCAP_PHY_RX_4K_QAM_IN_WIDER_BW_DL_OFDMA_BITS  1
1746 
1747 #define EHTCAP_RX_MCS_NSS_MAP_IDX                       0
1748 #define EHTCAP_RX_MCS_NSS_MAP_BITS                      4
1749 #define EHTCAP_TX_MCS_NSS_MAP_IDX                       4
1750 #define EHTCAP_TX_MCS_NSS_MAP_BITS                      4
1751 
1752 #define EHTCAP_PPET_NSS_IDX               0
1753 #define EHTCAP_PPET_NSS_BITS              4
1754 #define EHTCAP_PPET_RU_INDEX_BITMASK_IDX  4
1755 #define EHTCAP_PPET_RU_INDEX_BITMASK_BITS 5
1756 
1757 #define EHTOP_INFO_PRESENT_IDX                           0
1758 #define EHTOP_INFO_PRESENT_BITS                          1
1759 #define EHTOP_PARAM_DISABLED_SC_BITMAP_PRESENT_IDX       1
1760 #define EHTOP_PARAM_DISABLED_SC_BITMAP_PRESENT_BITS      1
1761 #define EHTOP_DEFAULT_PE_DURATION_IDX                    2
1762 #define EHTOP_DEFAULT_PE_DURATION_BITS                   1
1763 #define EHTOP_GRP_ADDRESSED_BU_IND_LIMIT_IDX             3
1764 #define EHTOP_GRP_ADDRESSED_BU_IND_LIMIT_BITS            1
1765 #define EHTOP_GRP_ADDRESSED_BU_IND_EXPONENT_IDX          4
1766 #define EHTOP_GRP_ADDRESSED_BU_IND_EXPONENT_BITS         2
1767 
1768 #define EHTOP_INFO_CHAN_WIDTH_IDX          0
1769 #define EHTOP_INFO_CHAN_WIDTH_BITS         3
1770 
1771 #define EHTOP_RX_MCS_NSS_MAP_IDX                       0
1772 #define EHTOP_RX_MCS_NSS_MAP_BITS                      4
1773 #define EHTOP_TX_MCS_NSS_MAP_IDX                       4
1774 #define EHTOP_TX_MCS_NSS_MAP_BITS                      4
1775 
1776 #define MAX_EHT_MCS_NSS_MAP_LEN 9
1777 
1778 /**
1779  * struct eht_basic_mcs_nss_set - EHT Basic mcs nss set
1780  * @max_nss_mcs_0_7: Rx, Tx Max Nss That Supports EHT-MCS 0-7
1781  * @max_nss_mcs_8_9: Rx, Tx Max Nss That Supports EHT-MCS 8-9
1782  * @max_nss_mcs_10_11: Rx, Tx Max Nss That Supports EHT-MCS 10-11
1783  * @max_nss_mcs_12_13: Rx, Tx Max Nss That Supports EHT-MCS 12-13
1784  */
1785 struct eht_basic_mcs_nss_set {
1786 	uint8_t max_nss_mcs_0_7;
1787 	uint8_t max_nss_mcs_8_9;
1788 	uint8_t max_nss_mcs_10_11;
1789 	uint8_t max_nss_mcs_12_13;
1790 } qdf_packed;
1791 
1792 /**
1793  * struct wlan_ie_ehtcaps - EHT capabilities
1794  * @elem_id: EHT caps IE
1795  * @elem_len: EHT caps IE len
1796  * @elem_id_extn: EHT caps extension id
1797  * @eht_mac_cap: EHT mac capabilities
1798  * @eht_phy_cap: EHT phy capabilities
1799  * @phy_cap_bytes: EHT phy capability bytes
1800  * @supported_ch_width_set: Supported channel width set
1801  * @mcs_bw_map: MCS NSS map per bandwidth
1802  * @rx_mcs_map: RX MCS map
1803  * @tx_mcs_map: TX MCS map
1804  */
1805 struct wlan_ie_ehtcaps {
1806 	uint8_t elem_id;
1807 	uint8_t elem_len;
1808 	uint8_t elem_id_extn;
1809 	uint8_t eht_mac_cap[WLAN_EHT_MACCAP_LEN];
1810 	union {
1811 		uint8_t phy_cap_bytes[WLAN_EHT_PHYCAP_LEN];
1812 		struct {
1813 			uint32_t reserved:1;
1814 			uint32_t supported_ch_width_set:7;
1815 		} qdf_packed;
1816 	} qdf_packed eht_phy_cap;
1817 	union {
1818 		struct {
1819 			uint8_t max_nss_mcs_0_9;
1820 			uint8_t max_nss_mcs_10_11;
1821 			uint8_t max_nss_mcs_12_13;
1822 		} qdf_packed mcs_bw_map[WLAN_EHT_MAX_MCS_MAPS];
1823 		struct eht_basic_mcs_nss_set mcs_bw_map_20_sta;
1824 		uint8_t mcs_nss_map_bytes[MAX_EHT_MCS_NSS_MAP_LEN];
1825 	} qdf_packed;
1826 } qdf_packed;
1827 
1828 /**
1829  * struct wlan_ie_ehtops - EHT operation element
1830  * @elem_id: EHT caps IE
1831  * @elem_len: EHT caps IE len
1832  * @elem_id_extn: EHT caps extension id
1833  * @ehtop_param: EHT Operation Parameters
1834  * @basic_mcs_nss_set: EHT basic mcs nss set
1835  * @control: Control field in EHT Operation Information
1836  * @ccfs0: EHT Channel Centre Frequency Segment0 information
1837  * @ccfs1: EHT Channel Centre Frequency Segment1 information
1838  * @disabled_sub_chan_bitmap: Bitmap to indicate 20MHz subchannel is punctured
1839  *                            or not
1840  */
1841 struct wlan_ie_ehtops {
1842 	uint8_t elem_id;
1843 	uint8_t elem_len;
1844 	uint8_t elem_id_extn;
1845 	uint8_t ehtop_param;
1846 	struct eht_basic_mcs_nss_set basic_mcs_nss_set;
1847 	uint8_t control;
1848 	uint8_t ccfs0;
1849 	uint8_t ccfs1;
1850 	uint8_t disabled_sub_chan_bitmap[2];
1851 } qdf_packed;
1852 
1853 #ifdef WLAN_FEATURE_11BE_MLO
1854 #define WLAN_MLO_MAX_VDEVS 2
1855 
1856 /* Size in octets of the BSS Parameters Change Count (sub)field */
1857 #define WLAN_ML_BSSPARAMCHNGCNT_SIZE                    1
1858 
1859 /**
1860  * struct wlan_ie_multilink - Fixed fields in Multi-Link IE
1861  * @elem_id: Element ID
1862  * @elem_len: Element length
1863  * @elem_id_ext: Element ID extension
1864  * @mlcontrol: Multi-Link element Control field
1865  */
1866 struct wlan_ie_multilink {
1867 	uint8_t elem_id;
1868 	uint8_t elem_len;
1869 	uint8_t elem_id_ext;
1870 	uint16_t mlcontrol;
1871 } qdf_packed;
1872 
1873 /**
1874  * struct wlan_sta_profile - Per STA profile IE
1875  * @sub_elem_id: Sub element ID
1876  * @per_sta_len: Per STA profile length
1877  * @sta_control: STA control field
1878  * @num_data: Number of valid data bytes
1879  * @data: Per STA profile IE elements
1880  */
1881 struct wlan_sta_profile {
1882 	uint8_t sub_elem_id;
1883 	uint8_t per_sta_len;
1884 	uint16_t sta_control;
1885 	uint8_t num_data;
1886 	uint8_t *data;
1887 } qdf_packed;
1888 
1889 /**
1890  * struct wlan_ml_probe_req - Multi-Link Probe req IE
1891  * @ml_ie_ff: Multi Link IE fixed field
1892  * @common_info_len: Common info length
1893  * @mld_id: MLD ID
1894  * @sta_profile: STA profile IE
1895  */
1896 struct wlan_ml_probe_req {
1897 	struct wlan_ie_multilink ml_ie_ff;
1898 	uint8_t common_info_len;
1899 	uint8_t mld_id;
1900 	struct wlan_sta_profile sta_profile[WLAN_MLO_MAX_VDEVS];
1901 } qdf_packed;
1902 /* The above fixed fields may be followed by:
1903  * Common Info (variable size)
1904  * Link Info (variable size)
1905  */
1906 
1907 /* Definitions related to Multi-Link element Control field applicable across
1908  * variants.
1909  */
1910 
1911 /* The below fields and subfields have been transitioned to D1.5, and the rest
1912  * will be checked and transitioned to D1.5 separately:
1913  * 1. Presence bitmap subfield in the Multi-Link Control field.
1914  * 2. Common Info Length subfield of Common Info field.
1915  * 3. STA Control field in Per-STA Profile subelement in Basic variant
1916  *    Multi-Link element Link Info field.
1917  * 4. STA Info Length subfield in STA Info field in Per-STA Profile subelement
1918  *    in Basic variant Multi-Link element Link Info field.
1919  * 5. EML Capabilities subfield of Common Info field.
1920  * 6. MLD Capabilities subfield of Common Info field.
1921  */
1922 
1923 /* Size in octets of Multi-Link element Control field */
1924 #define WLAN_ML_CTRL_SIZE                                          2
1925 
1926 /* Definitions for subfields in Multi-Link element Control field. Any unused
1927  * bits are reserved.
1928  */
1929 /* Type */
1930 #define WLAN_ML_CTRL_TYPE_IDX                                       0
1931 #define WLAN_ML_CTRL_TYPE_BITS                                      3
1932 /* Presence Bitmap */
1933 #define WLAN_ML_CTRL_PBM_IDX                                        4
1934 #define WLAN_ML_CTRL_PBM_BITS                                       12
1935 
1936 /**
1937  * enum wlan_ml_variant - Encoding for Type subfield in Multi-Link element
1938  * Control field, which provides the Multi-Link element variant.
1939  * Note: In case of holes in the enumeration, scheme for invalid value
1940  * determination should be changed.
1941  * @WLAN_ML_VARIANT_BASIC: Basic variant
1942  * @WLAN_ML_VARIANT_PROBEREQ: Probe Request variant
1943  * @WLAN_ML_VARIANT_RECONFIG: Reconfiguration variant
1944  * @WLAN_ML_VARIANT_TDLS: TDLS variant
1945  * @WLAN_ML_VARIANT_PRIORITYACCESS: Priority Access variant
1946  * @WLAN_ML_VARIANT_INVALIDSTART: Start of invalid value range
1947  */
1948 enum wlan_ml_variant {
1949 	WLAN_ML_VARIANT_BASIC = 0,
1950 	WLAN_ML_VARIANT_PROBEREQ = 1,
1951 	WLAN_ML_VARIANT_RECONFIG = 2,
1952 	WLAN_ML_VARIANT_TDLS = 3,
1953 	WLAN_ML_VARIANT_PRIORITYACCESS = 4,
1954 	WLAN_ML_VARIANT_INVALIDSTART,
1955 };
1956 
1957 /**
1958  *  enum wlan_ml_linfo_subelementid - IDs for subelements in Multi-Link element
1959  *  Link Info field.
1960  *  @WLAN_ML_LINFO_SUBELEMID_PERSTAPROFILE: Per-STA Profile
1961  *  @WLAN_ML_LINFO_SUBELEMID_VENDOR: Vendor specific
1962  *  @WLAN_ML_LINFO_SUBELEMID_FRAGMENT: Fragment
1963  */
1964 enum wlan_ml_linfo_subelementid {
1965 	WLAN_ML_LINFO_SUBELEMID_PERSTAPROFILE  = 0,
1966 	WLAN_ML_LINFO_SUBELEMID_VENDOR = 221,
1967 	WLAN_ML_LINFO_SUBELEMID_FRAGMENT = 254,
1968 };
1969 
1970 /* End of definitions related to Multi-Link element Control field applicable
1971  * across variants.
1972  */
1973 
1974 /* Definitions related to Basic variant Multi-Link element. */
1975 
1976 /* Definitions for bits in the Presence Bitmap subfield in Basic variant
1977  * Multi-Link element Control field. Any unused bits are reserved.
1978  */
1979 /* Link ID Info Present */
1980 #define WLAN_ML_BV_CTRL_PBM_LINKIDINFO_P               ((uint16_t)BIT(0))
1981 /* BSS Parameters Change Count Present */
1982 #define WLAN_ML_BV_CTRL_PBM_BSSPARAMCHANGECNT_P        ((uint16_t)BIT(1))
1983 /* Medium Synchronization Delay Information Present */
1984 #define WLAN_ML_BV_CTRL_PBM_MEDIUMSYNCDELAYINFO_P      ((uint16_t)BIT(2))
1985 /* EML Capabilities Present */
1986 #define WLAN_ML_BV_CTRL_PBM_EMLCAP_P                   ((uint16_t)BIT(3))
1987 /* MLD Capabilities and operation Present */
1988 #define WLAN_ML_BV_CTRL_PBM_MLDCAPANDOP_P              ((uint16_t)BIT(4))
1989 /* MLD ID Present */
1990 #define WLAN_ML_BV_CTRL_PBM_MLDID_P                    ((uint16_t)BIT(5))
1991 
1992 /* Definitions related to Basic variant Multi-Link element Common Info field */
1993 
1994 /* Size in octets of Common Info Length subfield of Common Info field in
1995  * Basic variant Multi-Link element.
1996  */
1997 /* Common Info Length  */
1998 #define WLAN_ML_BV_CINFO_LENGTH_SIZE                               1
1999 
2000 /* Size in octets of Link ID Info subfield in Basic variant Multi-Link element
2001  * Common Info field.
2002  */
2003 #define WLAN_ML_BV_CINFO_LINKIDINFO_SIZE                            1
2004 
2005 /* Definitions for sub-sub fields in Link ID Info subfield in Basic variant
2006  * Multi-Link element Common Info field. Any unused bits are reserved.
2007  */
2008 /* Link ID */
2009 #define WLAN_ML_BV_CINFO_LINKIDINFO_LINKID_IDX                      0
2010 #define WLAN_ML_BV_CINFO_LINKIDINFO_LINKID_BITS                     4
2011 
2012 /* Size in octets of Medium Synchronization Delay Information subfield in Basic
2013  * variant Multi-Link element Common Info field.
2014  */
2015 #define WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_SIZE                      2
2016 
2017 /* Definitions for sub-sub fields in Medium Synchronization Delay Information
2018  * subfield in Basic variant Multi-Link element Common Info field.
2019  */
2020 /* Medium Synchronization Duration */
2021 #define WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_DURATION_IDX             0
2022 #define WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_DURATION_BITS            8
2023 /* Medium Synchronization OFDM ED Threshold  */
2024 #define WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_OFDMEDTHRESH_IDX         8
2025 #define WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_OFDMEDTHRESH_BITS        4
2026 /* Medium Synchronization Maximum Number Of TXOPs  */
2027 #define WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_MAXTXOPS_IDX             12
2028 #define WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_MAXTXOPS_BITS            4
2029 
2030 /* Size in octets of EML Capabilities subfield in Basic variant Multi-Link
2031  * element Common Info field.
2032  */
2033 #define WLAN_ML_BV_CINFO_EMLCAP_SIZE                                2
2034 
2035 /* Definitions for sub-sub fields in EML Capabilities subfield in Basic variant
2036  * Multi-Link element Common Info field as per IEEE P802.11be/D1.5.
2037  * Any unused bits are reserved.
2038  */
2039 /* EMLSR Support */
2040 #define WLAN_ML_BV_CINFO_EMLCAP_EMLSRSUPPORT_IDX                    0
2041 #define WLAN_ML_BV_CINFO_EMLCAP_EMLSRSUPPORT_BITS                   1
2042 /* EMLSR Delay */
2043 #define WLAN_ML_BV_CINFO_EMLCAP_EMLSR_PADDINGDELAY_IDX              1
2044 #define WLAN_ML_BV_CINFO_EMLCAP_EMLSR_PADDINGDELAY_BITS             3
2045 /* EMLSR Transition Delay */
2046 #define WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_IDX                 4
2047 #define WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_BITS                3
2048 /* EMLMR Support */
2049 #define WLAN_ML_BV_CINFO_EMLCAP_EMLMRSUPPORT_IDX                    7
2050 #define WLAN_ML_BV_CINFO_EMLCAP_EMLMRSUPPORT_BITS                   1
2051 /* EMLMR Delay */
2052 #define WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_IDX                      8
2053 #define WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_BITS                     3
2054 /* Transition Timeout */
2055 #define WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_IDX                    11
2056 #define WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_BITS                   4
2057 
2058 /**
2059  * wlan_ml_bv_cinfo_emlcap_emlsr_padding_delay - Encoding for EMLSR Padding
2060  * Delay sub field in EML Capabilities subfield in Basic variant Multi-Link
2061  * element Common Info field.
2062  * Note: In case of holes in the enumeration, scheme for invalid value
2063  * determination should be changed.
2064  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_0US: EMLSR delay of 0 us
2065  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_32US: EMLSR delay of 32 us
2066  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_64US: EMLSR delay of 64 us
2067  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_128US: EMLSR delay of 128 us
2068  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_256US: EMLSR delay of 256 us
2069  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_INVALIDSTART: Start of invalid value
2070  * range
2071  */
2072 enum wlan_ml_bv_cinfo_emlcap_emlsr_padding_delay {
2073 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_0US = 0,
2074 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_32US = 1,
2075 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_64US = 2,
2076 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_128US = 3,
2077 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_256US = 4,
2078 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRDELAY_INVALIDSTART,
2079 };
2080 
2081 /**
2082  * wlan_ml_bv_cinfo_emlsr_transition_delay - Encoding for EMLSR
2083  * Transition delay in EML Capabilities subfield in Basic variant
2084  * Multi-Link element Common Info field.
2085  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_0US: EMLSR transition delay of 0 us
2086  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_16US: EMLSR transition delay of
2087  * 16 us
2088  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_32US: EMLSR transition delay of
2089  * 32 us
2090  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_64US: EMLSR transition delay of
2091  * 64 us
2092  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_128US: EMLSR transition delay of
2093  * 128 us
2094  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_256US: EMLSR transition delay of
2095  * 256 us
2096  * @WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_INVALIDSTART: Start of invalid
2097  * value range
2098  */
2099 enum wlan_ml_bv_cinfo_emlsr_transition_delay {
2100 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_0US = 0,
2101 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_16US = 1,
2102 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_32US = 2,
2103 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_64US = 3,
2104 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_128US = 4,
2105 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_256US = 5,
2106 	WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_INVALIDSTART,
2107 };
2108 
2109 /**
2110  * wlan_ml_bv_cinfo_emlcap_emlmrdelay - Encoding for EMLMR Delay sub-sub field
2111  * in EML Capabilities subfield in Basic variant Multi-Link element Common Info
2112  * field.
2113  * Note: In case of holes in the enumeration, scheme for invalid value
2114  * determination should be changed.
2115  * @WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_0US: EMLMR delay of 0 us
2116  * @WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_32US: EMLMR delay of 32 us
2117  * @WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_64US: EMLMR delay of 64 us
2118  * @WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_128US: EMLMR delay of 128 us
2119  * @WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_256US: EMLMR delay of 256 us
2120  * @WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_INVALIDSTART: Start of invalid
2121  * value range
2122  */
2123 enum wlan_ml_bv_cinfo_emlcap_emlmrdelay {
2124 	WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_0US = 0,
2125 	WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_32US = 1,
2126 	WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_64US = 2,
2127 	WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_128US = 3,
2128 	WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_256US = 4,
2129 	WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_INVALIDSTART,
2130 };
2131 
2132 /**
2133  * wlan_ml_bv_cinfo_emlcap_transtimeout - Encoding for Transition Timeout
2134  * sub-sub field in EML Capabilities subfield in Basic variant Multi-Link
2135  * element Common Info field.
2136  * Note: a) In case of holes in the enumeration, scheme for invalid value
2137  * determination should be changed. b) A mathematical formula could have been
2138  * used instead of an enumeration. However, the standard explicitly lists out
2139  * values instead of using a formula, and we reflect this accordingly using an
2140  * enumeration.
2141  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_0TU: Transition Timeout value of 0 TUs
2142  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_128MU: Transition Timeout value of 128μs
2143  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_256MU: Transition Timeout value of 256μs
2144  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_512MU: Transition Timeout value of 512μs
2145  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_1TU: Transition Timeout value of 1 TU
2146  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_2TU: Transition Timeout value of 2 TUs
2147  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_4TU: Transition Timeout value of 4 TUs
2148  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_8TU: Transition Timeout value of 8 TUs
2149  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_16TU: Transition Timeout value of 16
2150  * TUs
2151  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_32TU: Transition Timeout value of 32
2152  * TUs
2153  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_64TU: Transition Timeout value of 64
2154  * TUs
2155  * WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_128TU: Transition Timeout value of 128
2156  * TUs
2157  * @WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_INVALIDSTART: Start of invalid value
2158  * range
2159  */
2160 enum wlan_ml_bv_cinfo_emlcap_transtimeout {
2161 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_0TU = 0,
2162 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_128MU = 1,
2163 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_256MU = 2,
2164 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_512MU = 3,
2165 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_1TU = 4,
2166 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_2TU = 5,
2167 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_4TU = 6,
2168 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_8TU = 7,
2169 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_16TU = 8,
2170 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_32TU = 9,
2171 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_64TU = 10,
2172 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_128TU = 11,
2173 	WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_INVALIDSTART,
2174 };
2175 
2176 /* Size in octets of MLD Capabilities and operation subfield in Basic variant
2177  * Multi-Link element Common Info field as per IEEE P802.11be/D1.5.
2178  */
2179 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_SIZE                                2
2180 
2181 /* Definitions for sub-sub fields in MLD Capabilities subfield in Basic variant
2182  * Multi-Link element Common Info field. Any unused bits are reserved.
2183  */
2184 /* Maximum Number Of Simultaneous Links */
2185 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_MAXSIMULLINKS_IDX                   0
2186 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_MAXSIMULLINKS_BITS                  4
2187 /* SRS Support */
2188 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_SRSSUPPORT_IDX                      4
2189 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_SRSSUPPORT_BITS                     1
2190 /* TID-To-Link Mapping Negotiation Supported */
2191 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_TIDTOLINKMAPNEGSUPPORT_IDX          5
2192 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_TIDTOLINKMAPNEGSUPPORT_BITS         2
2193 /* Frequency Separation For STR */
2194 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_STRFREQSEPARATION_IDX               7
2195 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_STRFREQSEPARATION_BITS              5
2196 /* AAR Support */
2197 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_AARSUPPORT_IDX                      12
2198 #define WLAN_ML_BV_CINFO_MLDCAPANDOP_AARSUPPORT_BITS                     1
2199 
2200 /* Size in octets of MLD ID subfield in Basic variant Multi-Link
2201  * element Common Info field.
2202  */
2203 #define WLAN_ML_BV_CINFO_MLDID_SIZE                                      1
2204 
2205 /* Max value in octets of Common Info Length subfield of Common Info field in
2206  * Basic variant Multi-Link element
2207  */
2208 #define WLAN_ML_BV_CINFO_LENGTH_MAX \
2209 	(WLAN_ML_BV_CINFO_LENGTH_SIZE + \
2210 	 QDF_MAC_ADDR_SIZE + \
2211 	 WLAN_ML_BV_CINFO_LINKIDINFO_SIZE + \
2212 	 WLAN_ML_BSSPARAMCHNGCNT_SIZE + \
2213 	 WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_SIZE + \
2214 	 WLAN_ML_BV_CINFO_EMLCAP_SIZE + \
2215 	 WLAN_ML_BV_CINFO_MLDCAPANDOP_SIZE + \
2216 	 WLAN_ML_BV_CINFO_MLDID_SIZE)
2217 
2218 /* End of definitions related to Basic variant Multi-Link element Common Info
2219  * field.
2220  */
2221 
2222 /* Definitions related to Basic variant Multi-Link element Link Info field */
2223 
2224 /* Basic variant Multi-Link element Link Info field contains zero or more
2225  * subelements.
2226  */
2227 
2228 /**
2229  * struct wlan_ml_bv_linfo_perstaprof - Fixed fields of Per-STA Profile
2230  * subelement in Basic variant Multi-Link element Link Info field
2231  * @subelem_id: Subelement ID
2232  * @subelem_len: Subelement length
2233  * @stacontrol: STA Control
2234  */
2235 struct wlan_ml_bv_linfo_perstaprof {
2236 	uint8_t subelem_id;
2237 	uint8_t subelem_len;
2238 	uint16_t stacontrol;
2239 } qdf_packed;
2240 
2241 /* The above fixed fields may be followed by:
2242  * STA Info (variable size)
2243  * STA Profile (variable size)
2244  */
2245 
2246 /* Size in octets of STA Control field of Per-STA Profile subelement in Basic
2247  * variant Multi-Link element Link Info field.
2248  */
2249 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_SIZE                   2
2250 
2251 /* Definitions for subfields in STA Control field of Per-STA Profile subelement
2252  * in Basic variant Multi-Link element Link Info field. Any unused bits are
2253  * reserved.
2254  */
2255 /* Link ID */
2256 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_LINKID_IDX              0
2257 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_LINKID_BITS             4
2258 /* Complete Profile */
2259 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_CMPLTPROF_IDX           4
2260 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_CMPLTPROF_BITS          1
2261 /* MAC Address Present */
2262 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_MACADDRP_IDX            5
2263 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_MACADDRP_BITS           1
2264 /* Beacon Interval Present */
2265 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_BCNINTP_IDX             6
2266 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_BCNINTP_BITS            1
2267 /* TSF Offset Present */
2268 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_TSFOFFSETP_IDX          7
2269 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_TSFOFFSETP_BITS         1
2270 /* DTIM Info Present */
2271 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_DTIMINFOP_IDX           8
2272 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_DTIMINFOP_BITS          1
2273 /* NSTR Link Pair Present */
2274 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRLINKPRP_IDX         9
2275 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRLINKPRP_BITS        1
2276 /* NSTR Bitmap Size */
2277 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_IDX            10
2278 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_BITS           1
2279 /* BSS Parameters Change Count Present */
2280 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_BSSPARAMCHNGCNTP_IDX    11
2281 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_BSSPARAMCHNGCNTP_BITS   1
2282 
2283 /* Definitions for subfields in STA Info field of Per-STA Profile subelement
2284  * in Basic variant Multi-Link element Link Info field.
2285  */
2286 /* STA Info Length */
2287 #define WLAN_ML_BV_LINFO_PERSTAPROF_STAINFO_LENGTH_SIZE             1
2288 
2289 /* Size in octets of the TSF Offset in STA info field of Per-STA Profile
2290  * subelement in Basic variant Multi-Link element Link Info field.
2291  */
2292 #define WLAN_ML_TSF_OFFSET_SIZE             8
2293 
2294 /**
2295  * wlan_ml_bv_linfo_perstaprof_stactrl_nstrbmsz - Encoding for NSTR Bitmap Size
2296  * in STA Control field of Per-STA Profile subelement in Basic variant
2297  * Multi-Link element Link Info field.
2298  * Note: In case of holes in the enumeration, scheme for invalid value
2299  * determination should be changed.
2300  * @WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_1_OCTET: NSTR Indication
2301  * Bitmap size of 1 octet
2302  * @WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_2_OCTETS: NSTR Indication
2303  * Bitmap size of 2 octets
2304  * @WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_INVALIDSTART: Start of invalid
2305  * value range
2306  */
2307 enum wlan_ml_bv_linfo_perstaprof_stactrl_nstrbmsz {
2308 	WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_1_OCTET = 0,
2309 	WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_2_OCTETS = 1,
2310 	WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_INVALIDSTART,
2311 };
2312 
2313 /* Max size in octets of the NSTR Bitmap in STA Control field of Per-STA Profile
2314  * subelement in Basic variant Multi-Link element Link Info field.
2315  */
2316 #define WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_MAX 2
2317 
2318 /**
2319  * struct wlan_ml_bv_linfo_perstaprof_stainfo_dtiminfo - DTIM info in STA info
2320  * in Per-STA Profile subelement in Basic variant Multi-Link element Link Info
2321  * field.
2322  * @dtimcount: DTIM Count
2323  * @dtimperiod: DTIM Period
2324  */
2325 struct wlan_ml_bv_linfo_perstaprof_stainfo_dtiminfo {
2326 	uint8_t dtimcount;
2327 	uint8_t dtimperiod;
2328 } qdf_packed;
2329 
2330 /* Max value in octets of STA Info Length in STA Info field of Per-STA Profile
2331  * subelement in Basic variant Multi-Link element Link Info field.
2332  */
2333 #define WLAN_ML_BV_LINFO_PERSTAPROF_STAINFO_LENGTH_MAX \
2334 	(WLAN_ML_BV_LINFO_PERSTAPROF_STAINFO_LENGTH_SIZE + \
2335 	 QDF_MAC_ADDR_SIZE + \
2336 	 WLAN_BEACONINTERVAL_LEN + \
2337 	 WLAN_ML_TSF_OFFSET_SIZE + \
2338 	 sizeof(struct wlan_ml_bv_linfo_perstaprof_stainfo_dtiminfo) + \
2339 	 WLAN_ML_BV_LINFO_PERSTAPROF_STACTRL_NSTRBMSZ_MAX + \
2340 	 WLAN_ML_BSSPARAMCHNGCNT_SIZE)
2341 
2342 /* End of definitions related to Basic variant Multi-Link element Link Info
2343  * field.
2344  */
2345 
2346 /* End of definitions related to Basic variant Multi-Link element. */
2347 
2348 /* Definitions related to Probe Req Multi-Link element Link Info field */
2349 
2350 /* Probe Req variant Multi-Link element Link Info field contains zero or more
2351  * subelements.
2352  */
2353 
2354 /**
2355  * struct wlan_ml_prv_linfo_perstaprof - Fixed fields of Per-STA Profile
2356  * subelement in Probe Request variant Multi-Link element Link Info field
2357  * @subelem_id: Subelement ID
2358  * @subelem_len: Subelement length
2359  * @stacontrol: STA Control
2360  */
2361 struct wlan_ml_prv_linfo_perstaprof {
2362 	uint8_t subelem_id;
2363 	uint8_t subelem_len;
2364 	uint16_t stacontrol;
2365 } qdf_packed;
2366 
2367 /* The above fixed fields may be followed by:
2368  * STA Profile (variable size)
2369  */
2370 
2371 /* Size in octets of STA Control field of Per-STA Profile subelement in Basic
2372  * variant Multi-Link element Link Info field.
2373  */
2374 #define WLAN_ML_PRV_LINFO_PERSTAPROF_STACTRL_SIZE                   2
2375 
2376 /* Definitions for subfields in STA Control field of Per-STA Profile subelement
2377  * in Probe Req variant Multi-Link element Link Info field. Any unused bits are
2378  * reserved.
2379  */
2380 /* Link ID */
2381 #define WLAN_ML_PRV_LINFO_PERSTAPROF_STACTRL_LINKID_IDX              0
2382 #define WLAN_ML_PRV_LINFO_PERSTAPROF_STACTRL_LINKID_BITS             4
2383 /* Complete Profile */
2384 #define WLAN_ML_PRV_LINFO_PERSTAPROF_STACTRL_CMPLTPROF_IDX           4
2385 #define WLAN_ML_PRV_LINFO_PERSTAPROF_STACTRL_CMPLTPROF_BITS          1
2386 
2387 /* Definitions for bits in the Presence Bitmap subfield in Probe Req variant
2388  * Multi-Link element Control field. Any unused bits are reserved.
2389  */
2390 /* MLD ID Present */
2391 #define WLAN_ML_PRV_CTRL_PBM_MLDID_P               ((uint16_t)BIT(0))
2392 /* Size in octets of Common Info Length subfield of Common Info field in
2393  * Probe Req variant Multi-Link element.
2394  */
2395 /* Common Info Length  */
2396 #define WLAN_ML_PRV_CINFO_LENGTH_SIZE                               1
2397 
2398 /* Size in octets of MLD ID subfield in Probe Req variant Multi-Link
2399  * element Common Info field.
2400  */
2401 #define WLAN_ML_PRV_CINFO_MLDID_SIZE                                1
2402 
2403 /* Max value in octets of Common Info Length subfield of Common Info field in
2404  * Probe Req variant Multi-Link element
2405  */
2406 #define WLAN_ML_PRV_CINFO_LENGTH_MAX \
2407 	(WLAN_ML_PRV_CINFO_LENGTH_SIZE + \
2408 	 WLAN_ML_PRV_CINFO_MLDID_SIZE)
2409 
2410 /* End of definitions related to Probe Request variant Multi-Link element. */
2411 
2412 /* Definitions related to Reconfiguration variant Multi-Link element (per
2413  * IEEE802.11be D2.1.1)
2414  */
2415 
2416 /* Definitions for bits in the Presence Bitmap subfield in Reconfiguration
2417  * variant Multi-Link element Control field. Any unused bits are reserved.
2418  */
2419 /* MLD MAC Address Present */
2420 #define WLAN_ML_RV_CTRL_PBM_MLDMACADDR_P               ((uint16_t)BIT(0))
2421 
2422 /* Definitions related to Reconfiguration variant Multi-Link element Common Info
2423  * field.
2424  */
2425 
2426 /* Size in octets of Common Info Length subfield of Common Info field in
2427  * Reconfiguration variant Multi-Link element.
2428  */
2429 #define WLAN_ML_RV_CINFO_LENGTH_SIZE                               1
2430 
2431 /* End of definitions related to Reconfiguration variant Multi-Link element
2432  * Common Info field.
2433  */
2434 
2435 /* Definitions related to Reconfiguration variant Multi-Link element Link Info
2436  * field
2437  */
2438 
2439 /**
2440  * struct wlan_ml_rv_linfo_perstaprof - Fixed fields of Per-STA Profile
2441  * subelement in Reconfiguration variant Multi-Link element Link Info field
2442  * @subelem_id: Subelement ID
2443  * @subelem_len: Subelement length
2444  * @stacontrol: STA Control
2445  */
2446 struct wlan_ml_rv_linfo_perstaprof {
2447 	uint8_t subelem_id;
2448 	uint8_t subelem_len;
2449 	uint16_t stacontrol;
2450 } qdf_packed;
2451 
2452 /* The above fixed fields may be followed by:
2453  * STA Info (variable size)
2454  */
2455 
2456 /* Size in octets of STA Control field of Per-STA Profile subelement in
2457  * Reconfiguration variant Multi-Link element Link Info field.
2458  */
2459 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_SIZE                   2
2460 
2461 /* Definitions for subfields in STA Control field of Per-STA Profile subelement
2462  * in Reconfiguration variant Multi-Link element Link Info field. Any unused
2463  * bits are reserved.
2464  */
2465 /* Link ID */
2466 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_LINKID_IDX              0
2467 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_LINKID_BITS             4
2468 /* Complete Profile */
2469 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_CMPLTPROF_IDX           4
2470 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_CMPLTPROF_BITS          1
2471 /* MAC Address Present */
2472 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_MACADDRP_IDX            5
2473 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_MACADDRP_BITS           1
2474 /* Delete Timer Present */
2475 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_DELTIMERP_IDX           6
2476 #define WLAN_ML_RV_LINFO_PERSTAPROF_STACTRL_DELTIMERP_BITS          1
2477 
2478 /* Definitions for subfields in STA Info field of Per-STA Profile subelement
2479  * in Reconfiguration variant Multi-Link element Link Info field.
2480  */
2481 
2482 /* STA Info Length */
2483 #define WLAN_ML_RV_LINFO_PERSTAPROF_STAINFO_LENGTH_SIZE             1
2484 
2485 /* Size in octets of the Delete Timer subfield in STA info field of Per-STA
2486  * Profile subelement in Reconfiguration variant Multi-Link element Link Info
2487  * field.
2488  */
2489 #define WLAN_ML_RV_LINFO_PERSTAPROF_STAINFO_DELTIMER_SIZE           2
2490 
2491 /* Max value in octets of STA Info Length in STA Info field of Per-STA Profile
2492  * subelement in Reconfiguration variant Multi-Link element Link Info field.
2493  */
2494 #define WLAN_ML_RV_LINFO_PERSTAPROF_STAINFO_LENGTH_MAX \
2495 	(WLAN_ML_RV_LINFO_PERSTAPROF_STAINFO_LENGTH_SIZE + \
2496 	 QDF_MAC_ADDR_SIZE + \
2497 	 WLAN_ML_RV_LINFO_PERSTAPROF_STAINFO_DELTIMER_SIZE)
2498 
2499 /* End of definitions related to Reconfiguration variant Multi-Link element Link
2500  * Info field.
2501  */
2502 
2503 /* End of definitions related to Reconfiguration variant Multi-Link element. */
2504 
2505 /*
2506  * Definitions related to MLO specific aspects of Reduced Neighbor Report
2507  * element.
2508  */
2509 
2510 /*
2511  * Definitions for MLD Parameters subfield in TBTT Information field present as
2512  * part of TBTT Information Set in Neighbor AP Information field of Reduced
2513  * Neighbor Report element.
2514  */
2515 /* MLD ID */
2516 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_MLDID_IDX                  0
2517 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_MLDID_BITS                 8
2518 /* Link ID */
2519 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_LINKID_IDX                 8
2520 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_LINKID_BITS                4
2521 /* BSS Parameters Change Count */
2522 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_BSSPARAMCHANGECNT_IDX      12
2523 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_BSSPARAMCHANGECNT_BITS     8
2524 /* All Updates Included */
2525 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_ALLUPDATESINC_IDX          20
2526 #define WLAN_RNR_NBRAPINFO_TBTTINFO_MLDPARAMS_ALLUPDATESINC_BITS         1
2527 
2528 /*
2529  * End of definitions related to MLO specific aspects of Reduced Neighbor Report
2530  * element.
2531  */
2532 #endif /* WLAN_FEATURE_11BE_MLO */
2533 #endif /* WLAN_FEATURE_11BE */
2534 
2535 #ifdef WLAN_FEATURE_11BE
2536 /**
2537  * struct wlan_ie_tid_to_link_mapping - TID-to-link mapping IE
2538  * @elem_id: T2LM IE
2539  * @elem_len: T2LM IE len
2540  * @elem_id_extn: T2LM extension id
2541  * @data: Variable length data described below
2542  */
2543 struct wlan_ie_tid_to_link_mapping {
2544 	uint8_t elem_id;
2545 	uint8_t elem_len;
2546 	uint8_t elem_id_extn;
2547 	uint8_t data[];
2548 } qdf_packed;
2549 
2550 /* The variable length data in wlan_ie_tid_to_link_mapping structure has the
2551  * following fields.
2552  * - TID-to-link mapping control ( 1 octet)
2553  * - Link mapping presence indicator (0 or 1 octet)
2554  * - Link mapping of TID 0(optional) to TID 7(optional). Each field has 0 or 2
2555  *   octets.
2556  */
2557 
2558 /* Definitions related TID-to-link mapping control*/
2559 /* Direction */
2560 #define WLAN_T2LM_CONTROL_DIRECTION_IDX                         0
2561 #define WLAN_T2LM_CONTROL_DIRECTION_BITS                        2
2562 /* Default link mapping */
2563 #define WLAN_T2LM_CONTROL_DEFAULT_LINK_MAPPING_IDX              2
2564 #define WLAN_T2LM_CONTROL_DEFAULT_LINK_MAPPING_BITS             1
2565 /* Bit3 to Bit7 are reserved*/
2566 /* Link mapping presence indicator */
2567 #define WLAN_T2LM_CONTROL_LINK_MAPPING_PRESENCE_INDICATOR_IDX   8
2568 #define WLAN_T2LM_CONTROL_LINK_MAPPING_PRESENCE_INDICATOR_BITS  8
2569 
2570 /**
2571  * struct wlan_ie_multi_link_traffic_indication - Multi-link traffic indication
2572  * element
2573  * @elem_id: Multi-link traffic indication IE
2574  * @elem_len: Multi-link traffic indication IE length
2575  * @elem_id_extn: Multi-link traffic indication extension ID
2576  * @ml_traffic_ind_control: Multi-link traffic indication control
2577  * @per_link_traffic_ind_list: Indicates the per-link traffic indication. Each
2578  *                             bit in the per_link_traffic_ind_list corresponds
2579  *                             to a link of the MLD.
2580  */
2581 struct wlan_ie_multi_link_traffic_indication {
2582 	uint8_t elem_id;
2583 	uint8_t elem_len;
2584 	uint8_t elem_id_extn;
2585 	uint16_t ml_traffic_ind_control;
2586 	uint16_t per_link_traffic_ind_list[];
2587 } qdf_packed;
2588 #endif /* WLAN_FEATURE_11BE */
2589 
2590 /**
2591  * struct he_oper_6g_param: 6 Ghz params for HE
2592  * @primary_channel: HE 6GHz Primary channel number
2593  * @width: HE 6GHz BSS Channel Width
2594  * @duplicate_beacon: HE 6GHz Duplicate beacon field
2595  * @reserved: Reserved bits
2596  * @chan_freq_seg0: HE 6GHz Channel Centre Frequency Segment 0
2597  * @chan_freq_seg1: HE 6GHz Channel Centre Frequency Segment 1
2598  * @minimum_rate: HE 6GHz Minimum Rate
2599  */
2600 struct he_oper_6g_param {
2601 	uint8_t primary_channel;
2602 	uint8_t width:2,
2603 		duplicate_beacon:1,
2604 		reserved:5;
2605 	uint8_t chan_freq_seg0;
2606 	uint8_t chan_freq_seg1;
2607 	uint8_t minimum_rate;
2608 } qdf_packed;
2609 
2610 /**
2611  * struct wlan_country_ie: country IE
2612  * @ie: country IE
2613  * @len: IE len
2614  * @cc: country code
2615  */
2616 struct wlan_country_ie {
2617 	uint8_t ie;
2618 	uint8_t len;
2619 	uint8_t cc[3];
2620 } qdf_packed;
2621 
2622 /**
2623  * struct wlan_country_ie: country IE
2624  * @ie: QBSS IE
2625  * @len: IE len
2626  * @station_count: number of station associated
2627  * @qbss_chan_load: qbss channel load
2628  * @qbss_load_avail: qbss_load_avail
2629  */
2630 struct qbss_load_ie {
2631 	uint8_t ie;
2632 	uint8_t len;
2633 	uint16_t station_count;
2634 	uint8_t qbss_chan_load;
2635 	uint16_t qbss_load_avail;
2636 } qdf_packed;
2637 
2638 /**
2639  * struct wlan_bcn_frame: beacon frame fixed params
2640  * @timestamp: the value of sender's TSFTIMER
2641  * @beacon_interval: beacon interval
2642  * @capability: capability
2643  * @ie: variable IE
2644  */
2645 struct wlan_bcn_frame {
2646 	uint8_t timestamp[8];
2647 	uint16_t beacon_interval;
2648 	union wlan_capability capability;
2649 	struct ie_header ie;
2650 } qdf_packed;
2651 
2652 #define WLAN_TIM_IE_MIN_LENGTH             4
2653 
2654 /**
2655  * struct wlan_tim_ie: tim IE
2656  * @tim_ie: Time IE
2657  * @tim_len: TIM IE len
2658  * @tim_count: dtim count
2659  * @tim_period: dtim period
2660  * @tim_bitctl: bitmap control
2661  * @tim_bitmap: variable length bitmap
2662  */
2663 struct wlan_tim_ie {
2664 	uint8_t tim_ie;         /* WLAN_ELEMID_TIM */
2665 	uint8_t tim_len;
2666 	uint8_t tim_count;      /* DTIM count */
2667 	uint8_t tim_period;     /* DTIM period */
2668 	uint8_t tim_bitctl;     /* bitmap control */
2669 	uint8_t tim_bitmap[251];  /* variable-length bitmap */
2670 } qdf_packed;
2671 
2672 /**
2673  * struct rsn_mdie: mobility domain IE
2674  * @rsn_id: RSN IE id
2675  * @rsn_len: RSN IE len
2676  * @mobility_domain: mobility domain info
2677  * @ft_capab: ft capability
2678  *
2679  * Reference 9.4.2.47 Mobility Domain element (MDE) of 802.11-2016
2680  */
2681 struct rsn_mdie {
2682 	uint8_t rsn_id;
2683 	uint8_t rsn_len;
2684 	uint8_t mobility_domain[2];
2685 	uint8_t ft_capab;
2686 } qdf_packed;
2687 
2688 /**
2689  * struct srp_ie: Spatial reuse parameter IE
2690  * @srp_id: SRP IE id
2691  * @srp_len: SRP IE len
2692  * @srp_id_extn: SRP Extension ID
2693  * @sr_control: sr control
2694  * @non_srg_obsspd_max_offset: non srg obsspd max offset
2695  * @srg_obss_pd_min_offset: srg obss pd min offset
2696  * @srg_obss_pd_max_offset: srg obss pd max offset
2697  * @srg_bss_color_bitmap: srg bss color bitmap
2698  * @srg_partial_bssid_bitmap: srg partial bssid bitmap
2699  */
2700 struct wlan_srp_ie {
2701 	uint8_t srp_id;
2702 	uint8_t srp_len;
2703 	uint8_t srp_id_extn;
2704 	uint8_t sr_control;
2705 	union {
2706 		struct {
2707 			uint8_t non_srg_obsspd_max_offset;
2708 			uint8_t srg_obss_pd_min_offset;
2709 			uint8_t srg_obss_pd_max_offset;
2710 			uint8_t srg_bss_color_bitmap[8];
2711 			uint8_t srg_partial_bssid_bitmap[8];
2712 		} qdf_packed nonsrg_srg_info;
2713 		struct {
2714 			uint8_t non_srg_obsspd_max_offset;
2715 		} qdf_packed nonsrg_info;
2716 		struct {
2717 			uint8_t srg_obss_pd_min_offset;
2718 			uint8_t srg_obss_pd_max_offset;
2719 			uint8_t srg_bss_color_bitmap[8];
2720 			uint8_t srg_partial_bssid_bitmap[8];
2721 		} qdf_packed srg_info;
2722 	};
2723 } qdf_packed;
2724 
2725 #define ESP_INFORMATION_LIST_LENGTH 3
2726 #define MAX_ESP_INFORMATION_FIELD 4
2727 /*
2728  * enum access_category: tells about access category in ESP paramameter
2729  * @ESP_AC_BK: ESP access category for background
2730  * @ESP_AC_BE: ESP access category for best effort
2731  * @ESP_AC_VI: ESP access category for video
2732  * @ESP_AC_VO: ESP access category for Voice
2733  */
2734 enum access_category {
2735 	ESP_AC_BK,
2736 	ESP_AC_BE,
2737 	ESP_AC_VI,
2738 	ESP_AC_VO,
2739 
2740 };
2741 /*
2742  * struct wlan_esp_info: structure for Esp information parameter
2743  * @access_category: access category info
2744  * @reserved: reserved
2745  * @data_format: two bits in length and tells about data format
2746  * i.e. 0 = No aggregation is expected to be performed for MSDUs or MPDUs with
2747  * the Type subfield equal to Data for the corresponding AC
2748  * 1 = A-MSDU aggregation is expected to be performed for MSDUs for the
2749  * corresponding AC, but A-MPDU aggregation is not expected to be performed
2750  * for MPDUs with the Type subfield equal to Data for the corresponding AC
2751  * 2 = A-MPDU aggregation is expected to be performed for MPDUs with the Type
2752  * subfield equal to Data for the corresponding AC, but A-MSDU aggregation is
2753  * not expected to be performed for MSDUs for the corresponding AC
2754  * 3 = A-MSDU aggregation is expected to be performed for MSDUs for the
2755  * corresponding AC and A-MPDU aggregation is expected to be performed for
2756  * MPDUs with the Type subfield equal to Data for the corresponding AC
2757  * @ba_window_size: BA Window Size subfield is three bits in length and
2758  * indicates the size of the Block Ack window that is
2759  * expected for the corresponding access category
2760  * @estimated_air_fraction: Estimated Air Time Fraction subfield is 8 bits in
2761  * length and contains an unsigned integer that represents
2762  * the predicted percentage of time, linearly scaled with 255 representing
2763  * 100%, that a new STA joining the
2764  * BSS will be allocated for PPDUs that contain only
2765  * MPDUs with the Type
2766  * subfield equal to Data of the
2767  * corresponding access category for that STA.
2768  * @ppdu_duration: Data PPDU Duration Target field
2769  * is 8 bits in length and is
2770  * an unsigned integer that indicates the
2771  * expected target duration of PPDUs that contain only MPDUs with the Type
2772  * subfield equal to Data for the
2773  * corresponding access category in units of 50 μs
2774  */
2775 struct wlan_esp_info {
2776 	uint8_t access_category:2;
2777 	uint8_t reserved:1;
2778 	uint8_t data_format:2;
2779 	uint8_t ba_window_size:3;
2780 	uint8_t estimated_air_fraction;
2781 	uint8_t ppdu_duration;
2782 };
2783 
2784 /**
2785  * struct wlan_esp_ie: struct for ESP information
2786  * @esp_id: ESP IE id
2787  * @esp_len: ESP IE len
2788  * @esp_id_extn: ESP Extension ID
2789  * @esp_info_AC_BK: ESP information related to BK category
2790  * @esp_info_AC_BE: ESP information related to BE category
2791  * @esp_info_AC_VI: ESP information related to VI category
2792  * @esp_info_AC_VO: ESP information related to VO category
2793  */
2794 struct wlan_esp_ie {
2795 	uint8_t esp_id;
2796 	uint8_t esp_len;
2797 	uint8_t esp_id_extn;
2798 	struct wlan_esp_info esp_info_AC_BK;
2799 	struct wlan_esp_info esp_info_AC_BE;
2800 	struct wlan_esp_info esp_info_AC_VI;
2801 	struct wlan_esp_info esp_info_AC_VO;
2802 } qdf_packed;
2803 
2804 /**
2805  * struct wlan_ext_cap_ie - struct for extended capabilities information
2806  * @ext_cap_id: Extended capabilities id
2807  * @ext_cap_len: Extended capabilities IE len
2808  * @ext_caps: Variable length extended capabilities information
2809  */
2810 struct wlan_ext_cap_ie {
2811 	uint8_t ext_cap_id;
2812 	uint8_t ext_cap_len;
2813 	uint8_t ext_caps[];
2814 } qdf_packed;
2815 
2816 /* EHT caps fixed field = 2 bytes (EHT mac caps) + 9 bytes (EHT phy caps) */
2817 #define EHT_CAP_FIXED_FIELDS         11
2818 #define EHT_CAP_320M_MCS_MAP_LEN      3
2819 #define EHT_CAP_160M_MCS_MAP_LEN      3
2820 #define EHT_CAP_80M_MCS_MAP_LEN       3
2821 #define EHT_CAP_20M_MCS_MAP_LEN       4
2822 #define EHT_CAP_OUI_LEN               3
2823 
2824 /**
2825  * struct wlan_eht_cap_info - struct for eht capabilities information
2826  * @EPCS_pri_access: EPCS priority access support
2827  * @eht_om_ctl: EHT OM control support
2828  * @triggered_txop_sharing_mode1: Triggered TXOP sharing support mode 1 support
2829  * @triggered_txop_sharing_mode2: Triggered TXOP sharing mode 2 support
2830  * @restricted_twt: Restricted TWT support
2831  * @scs_traffic_desc: SCS traffic description support
2832  * @max_mpdu_len: Maximum MPDU length
2833  * @max_a_mpdu_len_exponent_ext: Maximum A-MPDU Length Exponent Extension
2834  * @eht_trs_support: EHT TRS SUPPORT
2835  * @txop_return_support_txop_share_m2: TXOP Return Support in TXOP Share Mode 2
2836  * @reserved3: reserved bits
2837  * @reserved2: reserved bits
2838  * @support_320mhz_6ghz: support 320mhz in 6gz
2839  * @ru_242tone_wt_20mhz: Support For 242-tone RU In BW Wider Than 20 MHz
2840  * @ndp_4x_eht_ltf_3dot2_us_gi: NDP With 4 EHT-LTF And 3.2 μs GI
2841  * @partial_bw_mu_mimo: Partial Bandwidth UL MU-MIMO
2842  * @su_beamformer: SU Beamformer
2843  * @su_beamformee: SU Beamformer
2844  * @bfee_ss_le_80mhz: Beamformee SS (≤ 80 MHz)
2845  * @bfee_ss_160mhz: Beamformee SS (= 160 MHz)
2846  * @bfee_ss_320mhz: Beamformee SS (= 320 MHz)
2847  * @num_sounding_dim_le_80mhz: Number Of Sounding Dimensions (≤ 80 MHz)
2848  * @num_sounding_dim_160mhz: Number Of Sounding Dimensions (= 160 MHz)
2849  * @num_sounding_dim_320mhz: Number Of Sounding Dimensions (= 320 MHz)
2850  * @ng_16_su_feedback: Ng = 16 SU Feedback
2851  * @ng_16_mu_feedback: Ng = 16 MU Feedback
2852  * @cb_sz_4_2_su_feedback: Codebook Size SU Feedback
2853  * @cb_sz_7_5_su_feedback: Codebook Size SU Feedback
2854  * @trig_su_bforming_feedback: Triggered SU Beamforming Feedback
2855  * @trig_mu_bforming_partial_bw_feedback: Triggered MU Partial
2856    Beamforming Feedback
2857  * @triggered_cqi_feedback: Triggered SU Beamforming Feedback
2858  * @partial_bw_dl_mu_mimo: Partial Bandwidth DL MU-MIMO
2859  * @psr_based_sr: PSR-based SR Support
2860  * @power_boost_factor: Power Boost Factor Support
2861  * @eht_mu_ppdu_4x_ltf_0_8_us_gi: EHT MU PPDU With 4 EHT-LTF And 0.8 μs GI
2862  * @max_nc: Max Nc
2863  * @non_trig_cqi_feedback: Non-Triggered CQI Feedback
2864  * @tx_1024_4096_qam_lt_242_tone_ru: Tx 1024-QAM And 4096-QAM < 242-tone
2865    RU Support
2866  * @rx_1024_4096_qam_lt_242_tone_ru: Rx 1024-QAM And 4096-QAM < 242-tone
2867    RU Support
2868  * @ppet_present: PPE Thresholds Present
2869  * @common_nominal_pkt_padding: Common Nominal Packet Padding
2870  * @max_num_eht_ltf: Maximum Number Of Supported EHT-LTFs
2871  * @mcs_15: Support Of MCS 15
2872  * @eht_dup_6ghz: Support Of EHT DUP In 6 GHz
2873  * @op_sta_rx_ndp_wider_bw_20mhz: Support For 20 MHz Operating STA
2874    Receiving NDP With Wider Bandwidth
2875  * @non_ofdma_ul_mu_mimo_le_80mhz: Non-OFDMA UL MU-MIMO (BW ≤ 80 MHz)
2876  * @non_ofdma_ul_mu_mimo_160mhz: Non-OFDMA UL MU-MIMO (BW ≤ 160 MHz)
2877  * @non_ofdma_ul_mu_mimo_320mhz: Non-OFDMA UL MU-MIMO (BW ≤ 320 MHz)
2878  * @mu_bformer_le_80mhz: MU Beamformer (BW ≤ 80 MHz)
2879  * @mu_bformer_160mhz: MU Beamformer (BW ≤ 160 MHz)
2880  * @mu_bformer_320mhz: MU Beamformer (BW ≤ 320 MHz)
2881  * @tb_sounding_feedback_rl: TB sounding feedback rate limit
2882  * @rx_1k_qam_in_wider_bw_dl_ofdma: Rx 1024-QAM in wider bandwidth DL
2883  *                                 OFDMA support
2884  * @rx_4k_qam_in_wider_bw_dl_ofdma: Rx 4096-QAM in wider bandwidth DL
2885  *                                 OFDMA support
2886  * @reserved3: reserved bits
2887  * @bw_20_rx_max_nss_for_mcs_0_to_7: Max Rx NSS for MCS 0 to 7 (BW = 20MHz)
2888  * @bw_20_tx_max_nss_for_mcs_0_to_7: Max Tx NSS for MCS 0 to 7 (BW = 20MHz)
2889  * @bw_20_rx_max_nss_for_mcs_8_and_9: Max Rx NSS for MCS 8 and 9 (BW = 20MHz)
2890  * @bw_20_tx_max_nss_for_mcs_8_and_9: Max Tx NSS for MCS 8 and 9 (BW = 20MHz)
2891  * @bw_20_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
2892  *                                      (BW = 20MHz)
2893  * @bw_20_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
2894  *                                      (BW = 20MHz)
2895  * @bw_20_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
2896  *                                      (BW = 20MHz)
2897  * @bw_20_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
2898  *                                      (BW = 20MHz)
2899  * @bw_le_80_rx_max_nss_for_mcs_0_to_9: Max Rx NSS for MCS 0 to 9 (BW <= 80MHz)
2900  * @bw_le_80_tx_max_nss_for_mcs_0_to_9: Max Tx NSS for MCS 0 to 9 (BW <= 80MHz)
2901  * @bw_le_80_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
2902  *                                        (BW <= 80MHz)
2903  * @bw_le_80_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
2904  *                                        (BW <= 80MHz)
2905  * @bw_le_80_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
2906  *                                        (BW <= 80MHz)
2907  * @bw_le_80_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
2908  *                                        (BW <= 80MHz)
2909  * @bw_160_rx_max_nss_for_mcs_0_to_9: Max Rx NSS for MCS 0 to 9 (BW = 160MHz)
2910  * @bw_160_tx_max_nss_for_mcs_0_to_9: Max Tx NSS for MCS 0 to 9 (BW = 160MHz)
2911  * @bw_160_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
2912  *                                      (BW = 160MHz)
2913  * @bw_160_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
2914  *                                      (BW = 160MHz)
2915  * @bw_160_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
2916  *                                      (BW = 160MHz)
2917  * @bw_160_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
2918  *                                      (BW = 160MHz)
2919  * @bw_320_rx_max_nss_for_mcs_0_to_9: Max Rx NSS for MCS 0 to 9 (BW = 320MHz)
2920  * @bw_320_tx_max_nss_for_mcs_0_to_9: Max Tx NSS for MCS 0 to 9 (BW = 320MHz)
2921  * @bw_320_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
2922  *                                      (BW = 320MHz)
2923  * @bw_320_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
2924  *                                      (BW = 320MHz)
2925  * @bw_320_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
2926  *                                      (BW = 320MHz)
2927  * @bw_320_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
2928  *                                      (BW = 320MHz)
2929  */
2930 struct wlan_eht_cap_info {
2931 #ifndef ANI_LITTLE_BIT_ENDIAN
2932 	uint16_t reserved:5;
2933 	uint16_t txop_return_support_txop_share_m2:1;
2934 	uint16_t eht_trs_support:1;
2935 	uint16_t max_a_mpdu_len_exponent_ext:1;
2936 	uint16_t max_mpdu_len:2;
2937 	uint16_t scs_traffic_desc:1;
2938 	uint16_t restricted_twt:1;
2939 	uint16_t triggered_txop_sharing_mode2:1;
2940 	uint16_t triggered_txop_sharing_mode1:1;
2941 	uint16_t eht_om_ctl:1;
2942 	uint16_t epcs_pri_access:1;
2943 
2944 	uint32_t triggered_cqi_feedback:1;
2945 	uint32_t trig_mu_bforming_partial_bw_feedback:1;
2946 	uint32_t trig_su_bforming_feedback:1;
2947 	uint32_t cb_sz_7_5_su_feedback:1;
2948 	uint32_t cb_sz_4_2_su_feedback:1;
2949 	uint32_t ng_16_mu_feedback:1;
2950 	uint32_t ng_16_su_feedback:1;
2951 	uint32_t num_sounding_dim_320mhz:3;
2952 	uint32_t num_sounding_dim_160mhz:3;
2953 	uint32_t num_sounding_dim_le_80mhz:3;
2954 	uint32_t bfee_ss_320mhz:3;
2955 	uint32_t bfee_ss_160mhz:3;
2956 	uint32_t bfee_ss_le_80mhz:3;
2957 	uint32_t su_beamformee:1;
2958 	uint32_t su_beamformer:1;
2959 	uint32_t partial_bw_mu_mimo:1;
2960 	uint32_t ndp_4x_eht_ltf_3dot2_us_gi:1;
2961 	uint32_t ru_242tone_wt_20mhz:1;
2962 	uint32_t support_320mhz_6ghz:1;
2963 	uint32_t reserved2:1;
2964 
2965 	uint32_t tb_sounding_feedback_rl:1;
2966 	uint32_t mu_bformer_320mhz:1;
2967 	uint32_t mu_bformer_160mhz:1;
2968 	uint32_t mu_bformer_le_80mhz:1;
2969 	uint32_t non_ofdma_ul_mu_mimo_320mhz:1;
2970 	uint32_t non_ofdma_ul_mu_mimo_160mhz:1;
2971 	uint32_t non_ofdma_ul_mu_mimo_le_80mhz:1;
2972 	uint32_t op_sta_rx_ndp_wider_bw_20mhz:1;
2973 	uint32_t eht_dup_6ghz:1;
2974 	uint32_t mcs_15:4;
2975 	uint32_t max_num_eht_ltf:5;
2976 	uint32_t common_nominal_pkt_padding:2;
2977 	uint32_t ppet_present:1;
2978 	uint32_t rx_1024_4096_qam_lt_242_tone_ru:1;
2979 	uint32_t tx_1024_4096_qam_lt_242_tone_ru:1;
2980 	uint32_t non_trig_cqi_feedback:1;
2981 	uint32_t max_nc:4;
2982 	uint32_t eht_mu_ppdu_4x_ltf_0_8_us_gi:1;
2983 	uint32_t power_boost_factor:1;
2984 	uint32_t psr_based_sr:1;
2985 	uint32_t partial_bw_dl_mu_mimo:1;
2986 
2987 	uint8_t reserved3:6;
2988 	uint8_t rx_4k_qam_in_wider_bw_dl_ofdma:1;
2989 	uint8_t rx_1k_qam_in_wider_bw_dl_ofdma:1;
2990 
2991 	uint32_t bw_20_rx_max_nss_for_mcs_12_and_13:4;
2992 	uint32_t bw_20_tx_max_nss_for_mcs_12_and_13:4;
2993 	uint32_t bw_20_rx_max_nss_for_mcs_10_and_11:4;
2994 	uint32_t bw_20_tx_max_nss_for_mcs_10_and_11:4;
2995 	uint32_t bw_20_rx_max_nss_for_mcs_8_and_9:4;
2996 	uint32_t bw_20_tx_max_nss_for_mcs_8_and_9:4;
2997 	uint32_t bw_20_rx_max_nss_for_mcs_0_to_7:4;
2998 	uint32_t bw_20_tx_max_nss_for_mcs_0_to_7:4;
2999 
3000 	uint32_t bw_le_80_rx_max_nss_for_mcs_12_and_13:4;
3001 	uint32_t bw_le_80_tx_max_nss_for_mcs_12_and_13:4;
3002 	uint32_t bw_le_80_rx_max_nss_for_mcs_10_and_11:4;
3003 	uint32_t bw_le_80_tx_max_nss_for_mcs_10_and_11:4;
3004 	uint32_t bw_le_80_rx_max_nss_for_mcs_0_to_9:4;
3005 	uint32_t bw_le_80_tx_max_nss_for_mcs_0_to_9:4;
3006 	uint32_t bw_160_rx_max_nss_for_mcs_12_and_13:4;
3007 	uint32_t bw_160_tx_max_nss_for_mcs_12_and_13:4;
3008 
3009 	uint32_t bw_160_rx_max_nss_for_mcs_10_and_11:4;
3010 	uint32_t bw_160_tx_max_nss_for_mcs_10_and_11:4;
3011 	uint32_t bw_160_rx_max_nss_for_mcs_0_to_9:4;
3012 	uint32_t bw_160_tx_max_nss_for_mcs_0_to_9:4;
3013 	uint32_t bw_320_rx_max_nss_for_mcs_12_and_13:4;
3014 	uint32_t bw_320_tx_max_nss_for_mcs_12_and_13:4;
3015 	uint32_t bw_320_rx_max_nss_for_mcs_10_and_11:4;
3016 	uint32_t bw_320_tx_max_nss_for_mcs_10_and_11:4;
3017 
3018 	uint8_t bw_320_rx_max_nss_for_mcs_0_to_9:4;
3019 	uint8_t bw_320_tx_max_nss_for_mcs_0_to_9:4;
3020 
3021 #else
3022 	uint16_t epcs_pri_access:1;
3023 	uint16_t eht_om_ctl:1;
3024 	uint16_t triggered_txop_sharing_mode1:1;
3025 	uint16_t triggered_txop_sharing_mode2:1;
3026 	uint16_t restricted_twt:1;
3027 	uint16_t scs_traffic_desc:1;
3028 	uint16_t max_mpdu_len:2;
3029 	uint16_t max_a_mpdu_len_exponent_ext:1;
3030 	uint16_t eht_trs_support:1;
3031 	uint16_t txop_return_support_txop_share_m2:1;
3032 	uint16_t reserved:5;
3033 
3034 	uint32_t reserved2:1;
3035 	uint32_t support_320mhz_6ghz:1;
3036 	uint32_t ru_242tone_wt_20mhz:1;
3037 	uint32_t ndp_4x_eht_ltf_3dot2_us_gi:1;
3038 	uint32_t partial_bw_mu_mimo:1;
3039 	uint32_t su_beamformer:1;
3040 	uint32_t su_beamformee:1;
3041 	uint32_t bfee_ss_le_80mhz:3;
3042 	uint32_t bfee_ss_160mhz:3;
3043 	uint32_t bfee_ss_320mhz:3;
3044 	uint32_t num_sounding_dim_le_80mhz:3;
3045 	uint32_t num_sounding_dim_160mhz:3;
3046 	uint32_t num_sounding_dim_320mhz:3;
3047 	uint32_t ng_16_su_feedback:1;
3048 	uint32_t ng_16_mu_feedback:1;
3049 	uint32_t cb_sz_4_2_su_feedback:1;
3050 	uint32_t cb_sz_7_5_su_feedback:1;
3051 	uint32_t trig_su_bforming_feedback:1;
3052 	uint32_t trig_mu_bforming_partial_bw_feedback:1;
3053 	uint32_t triggered_cqi_feedback:1;
3054 
3055 	uint32_t partial_bw_dl_mu_mimo:1;
3056 	uint32_t psr_based_sr:1;
3057 	uint32_t power_boost_factor:1;
3058 	uint32_t eht_mu_ppdu_4x_ltf_0_8_us_gi:1;
3059 	uint32_t max_nc:4;
3060 	uint32_t non_trig_cqi_feedback:1;
3061 	uint32_t tx_1024_4096_qam_lt_242_tone_ru:1;
3062 	uint32_t rx_1024_4096_qam_lt_242_tone_ru:1;
3063 	uint32_t ppet_present:1;
3064 	uint32_t common_nominal_pkt_padding:2;
3065 	uint32_t max_num_eht_ltf:5;
3066 	uint32_t mcs_15:4;
3067 	uint32_t eht_dup_6ghz:1;
3068 	uint32_t op_sta_rx_ndp_wider_bw_20mhz:1;
3069 	uint32_t non_ofdma_ul_mu_mimo_le_80mhz:1;
3070 	uint32_t non_ofdma_ul_mu_mimo_160mhz:1;
3071 	uint32_t non_ofdma_ul_mu_mimo_320mhz:1;
3072 	uint32_t mu_bformer_le_80mhz:1;
3073 	uint32_t mu_bformer_160mhz:1;
3074 	uint32_t mu_bformer_320mhz:1;
3075 	uint32_t tb_sounding_feedback_rl:1;
3076 
3077 	uint8_t rx_1k_qam_in_wider_bw_dl_ofdma:1;
3078 	uint8_t rx_4k_qam_in_wider_bw_dl_ofdma:1;
3079 	uint8_t reserved3:6;
3080 
3081 	uint32_t bw_20_rx_max_nss_for_mcs_0_to_7:4;
3082 	uint32_t bw_20_tx_max_nss_for_mcs_0_to_7:4;
3083 	uint32_t bw_20_rx_max_nss_for_mcs_8_and_9:4;
3084 	uint32_t bw_20_tx_max_nss_for_mcs_8_and_9:4;
3085 	uint32_t bw_20_rx_max_nss_for_mcs_10_and_11:4;
3086 	uint32_t bw_20_tx_max_nss_for_mcs_10_and_11:4;
3087 	uint32_t bw_20_rx_max_nss_for_mcs_12_and_13:4;
3088 	uint32_t bw_20_tx_max_nss_for_mcs_12_and_13:4;
3089 
3090 	uint32_t bw_le_80_rx_max_nss_for_mcs_0_to_9:4;
3091 	uint32_t bw_le_80_tx_max_nss_for_mcs_0_to_9:4;
3092 	uint32_t bw_le_80_rx_max_nss_for_mcs_10_and_11:4;
3093 	uint32_t bw_le_80_tx_max_nss_for_mcs_10_and_11:4;
3094 	uint32_t bw_le_80_rx_max_nss_for_mcs_12_and_13:4;
3095 	uint32_t bw_le_80_tx_max_nss_for_mcs_12_and_13:4;
3096 
3097 	uint32_t bw_160_rx_max_nss_for_mcs_0_to_9:4;
3098 	uint32_t bw_160_tx_max_nss_for_mcs_0_to_9:4;
3099 	uint32_t bw_160_rx_max_nss_for_mcs_10_and_11:4;
3100 	uint32_t bw_160_tx_max_nss_for_mcs_10_and_11:4;
3101 	uint32_t bw_160_rx_max_nss_for_mcs_12_and_13:4;
3102 	uint32_t bw_160_tx_max_nss_for_mcs_12_and_13:4;
3103 
3104 	uint32_t bw_320_rx_max_nss_for_mcs_0_to_9:4;
3105 	uint32_t bw_320_tx_max_nss_for_mcs_0_to_9:4;
3106 	uint32_t bw_320_rx_max_nss_for_mcs_10_and_11:4;
3107 	uint32_t bw_320_tx_max_nss_for_mcs_10_and_11:4;
3108 	uint8_t bw_320_rx_max_nss_for_mcs_12_and_13:4;
3109 	uint8_t bw_320_tx_max_nss_for_mcs_12_and_13:4;
3110 #endif
3111 } qdf_packed;
3112 
3113 /**
3114  * wlan_eht_cap_info_network_endian - struct for eht capabilities information
3115  * @epcs_pri_access: EPCS priority access support
3116  * @eht_om_ctl: EHT OM control support
3117  * @triggered_txop_sharing_mode1: Triggered TXOP sharing mode 1 support
3118  * @triggered_txop_sharing_mode2: Triggered TXOP sharing mode 2 support
3119  * @restricted_twt: Restricted TWT support
3120  * @scs_traffic_desc: SCS traffic description support
3121  * @max_mpdu_len: Maximum MPDU length
3122  * @max_a_mpdu_len_exponent_ext: Maximum A-MPDU Length Exponent Extension
3123  * @eht_trs_support: EHT TRS SUPPORT
3124  * @txop_return_support_txop_share_m2: TXOP Return Support in TXOP Share Mode 2
3125  * @reserved3: reserved bits
3126  * @reserved2: reserved bits
3127  * @support_320mhz_6ghz: support 320mhz in 6gz
3128  * @ru_242tone_wt_20mhz: Support For 242-tone RU In BW Wider Than 20 MHz
3129  * @ndp_4x_eht_ltf_3dot2_us_gi: NDP With 4 EHT-LTF And 3.2 μs GI
3130  * @partial_bw_mu_mimo: Partial Bandwidth UL MU-MIMO
3131  * @su_beamformer: SU Beamformer
3132  * @su_beamformee: SU Beamformer
3133  * @bfee_ss_le_80mhz: Beamformee SS (≤ 80 MHz)
3134  * @bfee_ss_160mhz: Beamformee SS (= 160 MHz)
3135  * @bfee_ss_320mhz: Beamformee SS (= 320 MHz)
3136  * @num_sounding_dim_le_80mhz: Number Of Sounding Dimensions (≤ 80 MHz)
3137  * @num_sounding_dim_160mhz: Number Of Sounding Dimensions (= 160 MHz)
3138  * @num_sounding_dim_320mhz: Number Of Sounding Dimensions (= 320 MHz)
3139  * @ng_16_su_feedback: Ng = 16 SU Feedback
3140  * @ng_16_mu_feedback: Ng = 16 MU Feedback
3141  * @cb_sz_4_2_su_feedback: Codebook Size SU Feedback
3142  * @cb_sz_7_5_su_feedback: Codebook Size SU Feedback
3143  * @trig_su_bforming_feedback: Triggered SU Beamforming Feedback
3144  * @trig_mu_bforming_partial_bw_feedback: Triggered MU Partial
3145    Beamforming Feedback
3146  * @triggered_cqi_feedback: Triggered SU Beamforming Feedback
3147  * @partial_bw_dl_mu_mimo: Partial Bandwidth DL MU-MIMO
3148  * @psr_based_sr: PSR-based SR Support
3149  * @power_boost_factor: Power Boost Factor Support
3150  * @eht_mu_ppdu_4x_ltf_0_8_us_gi: EHT MU PPDU With 4 EHT-LTF And 0.8 μs GI
3151  * @max_nc: Max Nc
3152  * @non_trig_cqi_feedback: Non-Triggered CQI Feedback
3153  * @tx_1024_4096_qam_lt_242_tone_ru: Tx 1024-QAM And 4096-QAM < 242-tone
3154    RU Support
3155  * @rx_1024_4096_qam_lt_242_tone_ru: Rx 1024-QAM And 4096-QAM < 242-tone
3156    RU Support
3157  * @ppet_present: PPE Thresholds Present
3158  * @common_nominal_pkt_padding: Common Nominal Packet Padding
3159  * @max_num_eht_ltf: Maximum Number Of Supported EHT-LTFs
3160  * @mcs_15: Support Of MCS 15
3161  * @eht_dup_6ghz: Support Of EHT DUP In 6 GHz
3162  * @op_sta_rx_ndp_wider_bw_20mhz: Support For 20 MHz Operating STA
3163    Receiving NDP With Wider Bandwidth
3164  * @non_ofdma_ul_mu_mimo_le_80mhz: Non-OFDMA UL MU-MIMO (BW ≤ 80 MHz)
3165  * @non_ofdma_ul_mu_mimo_160mhz: Non-OFDMA UL MU-MIMO (BW ≤ 160 MHz)
3166  * @non_ofdma_ul_mu_mimo_320mhz: Non-OFDMA UL MU-MIMO (BW ≤ 320 MHz)
3167  * @mu_bformer_le_80mhz: MU Beamformer (BW ≤ 80 MHz)
3168  * @mu_bformer_160mhz: MU Beamformer (BW ≤ 160 MHz)
3169  * @mu_bformer_320mhz: MU Beamformer (BW ≤ 320 MHz)
3170  * @tb_sounding_feedback_rl: TB sounding feedback rate limit
3171  * @rx_1k_qam_in_wider_bw_dl_ofdma: Rx 1024-QAM in wider bandwidth DL
3172  *                                 OFDMA support
3173  * @rx_4k_qam_in_wider_bw_dl_ofdma: Rx 4096-QAM in wider bandwidth DL
3174  *                                 OFDMA support
3175  * @reserved3: reserved bits
3176  * @bw_20_rx_max_nss_for_mcs_0_to_7: Max Rx NSS for MCS 0 to 7 (BW = 20MHz)
3177  * @bw_20_tx_max_nss_for_mcs_0_to_7: Max Tx NSS for MCS 0 to 7 (BW = 20MHz)
3178  * @bw_20_rx_max_nss_for_mcs_8_and_9: Max Rx NSS for MCS 8 and 9 (BW = 20MHz)
3179  * @bw_20_tx_max_nss_for_mcs_8_and_9: Max Tx NSS for MCS 8 and 9 (BW = 20MHz
3180  * @bw_20_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
3181  *                                      (BW = 20MHz)
3182  * @bw_20_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
3183  *                                      (BW = 20MHz)
3184  * @bw_20_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
3185  *                                      (BW = 20MHz)
3186  * @bw_20_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
3187  *                                      (BW = 20MHz)
3188  * @bw_le_80_rx_max_nss_for_mcs_0_to_9: Max Rx NSS for MCS 0 to 9 (BW <= 80MHz)
3189  * @bw_le_80_tx_max_nss_for_mcs_0_to_9: Max Tx NSS for MCS 0 to 9 (BW <= 80MHz)
3190  * @bw_le_80_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
3191  *                                        (BW <= 80MHz)
3192  * @bw_le_80_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
3193  *                                        (BW <= 80MHz)
3194  * @bw_le_80_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
3195  *                                        (BW <= 80MHz)
3196  * @bw_le_80_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
3197  *                                        (BW <= 80MHz)
3198  * @bw_160_rx_max_nss_for_mcs_0_to_9: Max Rx NSS for MCS 0 to 9 (BW = 160MHz)
3199  * @bw_160_tx_max_nss_for_mcs_0_to_9: Max Tx NSS for MCS 0 to 9 (BW = 160MHz)
3200  * @bw_160_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
3201  *                                      (BW = 160MHz)
3202  * @bw_160_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
3203  *                                      (BW = 160MHz)
3204  * @bw_160_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
3205  *                                      (BW = 160MHz)
3206  * @bw_160_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
3207  *                                      (BW = 160MHz)
3208  * @bw_320_rx_max_nss_for_mcs_0_to_9: Max Rx NSS for MCS 0 to 9 (BW = 320MHz)
3209  * @bw_320_tx_max_nss_for_mcs_0_to_9: Max Tx NSS for MCS 0 to 9 (BW = 320MHz)
3210  * @bw_320_rx_max_nss_for_mcs_10_and_11: Max Rx NSS for MCS 10 and 11
3211  *                                      (BW = 320MHz)
3212  * @bw_320_tx_max_nss_for_mcs_10_and_11: Max Tx NSS for MCS 10 and 11
3213  *                                      (BW = 320MHz)
3214  * @bw_320_rx_max_nss_for_mcs_12_and_13: Max Rx NSS for MCS 12 and 13
3215  *                                      (BW = 320MHz)
3216  * @bw_320_tx_max_nss_for_mcs_12_and_13: Max Tx NSS for MCS 12 and 13
3217  *                                      (BW = 320MHz)
3218  */
3219 struct wlan_eht_cap_info_network_endian {
3220 	uint16_t epcs_pri_access:1;
3221 	uint16_t eht_om_ctl:1;
3222 	uint16_t triggered_txop_sharing_mode1:1;
3223 	uint16_t triggered_txop_sharing_mode2:1;
3224 	uint16_t restricted_twt:1;
3225 	uint16_t scs_traffic_desc:1;
3226 	uint16_t max_mpdu_len:2;
3227 	uint16_t max_a_mpdu_len_exponent_ext:1;
3228 	uint16_t eht_trs_support:1;
3229 	uint16_t txop_return_support_txop_share_m2:1;
3230 	uint16_t reserved:5;
3231 
3232 	uint32_t reserved2:1;
3233 	uint32_t support_320mhz_6ghz:1;
3234 	uint32_t ru_242tone_wt_20mhz:1;
3235 	uint32_t ndp_4x_eht_ltf_3dot2_us_gi:1;
3236 	uint32_t partial_bw_mu_mimo:1;
3237 	uint32_t su_beamformer:1;
3238 	uint32_t su_beamformee:1;
3239 	uint32_t bfee_ss_le_80mhz:3;
3240 	uint32_t bfee_ss_160mhz:3;
3241 	uint32_t bfee_ss_320mhz:3;
3242 	uint32_t num_sounding_dim_le_80mhz:3;
3243 	uint32_t num_sounding_dim_160mhz:3;
3244 	uint32_t num_sounding_dim_320mhz:3;
3245 	uint32_t ng_16_su_feedback:1;
3246 	uint32_t ng_16_mu_feedback:1;
3247 	uint32_t cb_sz_4_2_su_feedback:1;
3248 	uint32_t cb_sz_7_5_su_feedback:1;
3249 	uint32_t trig_su_bforming_feedback:1;
3250 	uint32_t trig_mu_bforming_partial_bw_feedback:1;
3251 	uint32_t triggered_cqi_feedback:1;
3252 
3253 	uint32_t partial_bw_dl_mu_mimo:1;
3254 	uint32_t psr_based_sr:1;
3255 	uint32_t power_boost_factor:1;
3256 	uint32_t eht_mu_ppdu_4x_ltf_0_8_us_gi:1;
3257 	uint32_t max_nc:4;
3258 	uint32_t non_trig_cqi_feedback:1;
3259 	uint32_t tx_1024_4096_qam_lt_242_tone_ru:1;
3260 	uint32_t rx_1024_4096_qam_lt_242_tone_ru:1;
3261 	uint32_t ppet_present:1;
3262 	uint32_t common_nominal_pkt_padding:2;
3263 	uint32_t max_num_eht_ltf:5;
3264 	uint32_t mcs_15:4;
3265 	uint32_t eht_dup_6ghz:1;
3266 	uint32_t op_sta_rx_ndp_wider_bw_20mhz:1;
3267 	uint32_t non_ofdma_ul_mu_mimo_le_80mhz:1;
3268 	uint32_t non_ofdma_ul_mu_mimo_160mhz:1;
3269 	uint32_t non_ofdma_ul_mu_mimo_320mhz:1;
3270 	uint32_t mu_bformer_le_80mhz:1;
3271 	uint32_t mu_bformer_160mhz:1;
3272 	uint32_t mu_bformer_320mhz:1;
3273 	uint32_t tb_sounding_feedback_rl:1;
3274 
3275 	uint8_t rx_1k_qam_in_wider_bw_dl_ofdma:1;
3276 	uint8_t rx_4k_qam_in_wider_bw_dl_ofdma:1;
3277 	uint8_t reserved3:6;
3278 
3279 	uint32_t bw_20_rx_max_nss_for_mcs_0_to_7:4;
3280 	uint32_t bw_20_tx_max_nss_for_mcs_0_to_7:4;
3281 	uint32_t bw_20_rx_max_nss_for_mcs_8_and_9:4;
3282 	uint32_t bw_20_tx_max_nss_for_mcs_8_and_9:4;
3283 	uint32_t bw_20_rx_max_nss_for_mcs_10_and_11:4;
3284 	uint32_t bw_20_tx_max_nss_for_mcs_10_and_11:4;
3285 	uint32_t bw_20_rx_max_nss_for_mcs_12_and_13:4;
3286 	uint32_t bw_20_tx_max_nss_for_mcs_12_and_13:4;
3287 
3288 	uint32_t bw_le_80_rx_max_nss_for_mcs_0_to_9:4;
3289 	uint32_t bw_le_80_tx_max_nss_for_mcs_0_to_9:4;
3290 	uint32_t bw_le_80_rx_max_nss_for_mcs_10_and_11:4;
3291 	uint32_t bw_le_80_tx_max_nss_for_mcs_10_and_11:4;
3292 	uint32_t bw_le_80_rx_max_nss_for_mcs_12_and_13:4;
3293 	uint32_t bw_le_80_tx_max_nss_for_mcs_12_and_13:4;
3294 
3295 	uint32_t bw_160_rx_max_nss_for_mcs_0_to_9:4;
3296 	uint32_t bw_160_tx_max_nss_for_mcs_0_to_9:4;
3297 	uint32_t bw_160_rx_max_nss_for_mcs_10_and_11:4;
3298 	uint32_t bw_160_tx_max_nss_for_mcs_10_and_11:4;
3299 	uint32_t bw_160_rx_max_nss_for_mcs_12_and_13:4;
3300 	uint32_t bw_160_tx_max_nss_for_mcs_12_and_13:4;
3301 
3302 	uint32_t bw_320_rx_max_nss_for_mcs_0_to_9:4;
3303 	uint32_t bw_320_tx_max_nss_for_mcs_0_to_9:4;
3304 	uint32_t bw_320_rx_max_nss_for_mcs_10_and_11:4;
3305 	uint32_t bw_320_tx_max_nss_for_mcs_10_and_11:4;
3306 	uint8_t bw_320_rx_max_nss_for_mcs_12_and_13:4;
3307 } qdf_packed;
3308 
3309 /**
3310  * struct oce_reduced_wan_metrics: struct for oce wan metrics
3311  * @downlink_av_cap: Download available capacity
3312  * @uplink_av_cap: Upload available capacity
3313  */
3314 struct oce_reduced_wan_metrics {
3315 	uint8_t downlink_av_cap:4;
3316 	uint8_t uplink_av_cap:4;
3317 };
3318 
3319 /**
3320  * is_wpa_oui() - If vendor IE is WPA type
3321  * @frm: vendor IE pointer
3322  *
3323  * API to check if vendor IE is WPA
3324  *
3325  * Return: true if its WPA IE
3326  */
3327 static inline bool
3328 is_wpa_oui(uint8_t *frm)
3329 {
3330 	return (frm[1] > 3) && (LE_READ_4(frm + 2) ==
3331 		((WLAN_WPA_OUI_TYPE << 24) | WLAN_WPA_OUI));
3332 }
3333 
3334 /**
3335  * is_wps_oui() - If vendor IE is WPS type
3336  * @frm: vendor IE pointer
3337  *
3338  * API to check if vendor IE is WPS
3339  *
3340  * Return: true if its WPS IE
3341  */
3342 static inline bool
3343 is_wps_oui(const uint8_t *frm)
3344 {
3345 	return frm[1] > 3 && BE_READ_4(frm + 2) == WSC_OUI;
3346 }
3347 
3348 /**
3349  * is_mbo_oce_oui() - If vendor IE is MBO/OCE type
3350  * @frm: vendor IE pointer
3351  *
3352  * API to check if vendor IE is MBO/OCE
3353  *
3354  * Return: true if its MBO/OCE IE
3355  */
3356 static inline bool
3357 is_mbo_oce_oui(const uint8_t *frm)
3358 {
3359 	return frm[1] > 3 && BE_READ_4(frm + 2) == MBO_OCE_OUI;
3360 }
3361 
3362 /**
3363  * is_wcn_oui() - If vendor IE is WCN type
3364  * @frm: vendor IE pointer
3365  *
3366  * API to check if vendor IE is WCN
3367  *
3368  * Return: true if its WCN IE
3369  */
3370 static inline bool
3371 is_wcn_oui(uint8_t *frm)
3372 {
3373 	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
3374 		((WCN_OUI_TYPE << 24) | WCN_OUI));
3375 }
3376 
3377 static inline bool
3378 is_qcn_oui(uint8_t *frm)
3379 {
3380 	return ((frm[1] > 4) && (LE_READ_4(frm + 2) ==
3381 		((QCN_OUI_TYPE_CMN << 24) | QCA_OUI)));
3382 }
3383 
3384 #define WLAN_VENDOR_WME_IE_LEN 24
3385 /**
3386  * is_wme_param() - If vendor IE is WME param type
3387  * @frm: vendor IE pointer
3388  *
3389  * API to check if vendor IE is WME param
3390  *
3391  * Return: true if its WME param IE
3392  */
3393 static inline bool
3394 is_wme_param(const uint8_t *frm)
3395 {
3396 	return (frm[1] > 5) && (LE_READ_4(frm + 2) ==
3397 			((WME_OUI_TYPE << 24) | WME_OUI)) &&
3398 			(frm[6] == WME_PARAM_OUI_SUBTYPE);
3399 }
3400 
3401 /**
3402  * is_wme_info() - If vendor IE is WME info type
3403  * @frm: vendor IE pointer
3404  *
3405  * API to check if vendor IE is WME info
3406  *
3407  * Return: true if its WME info IE
3408  */
3409 static inline bool
3410 is_wme_info(const uint8_t *frm)
3411 {
3412 	return (frm[1] > 5) && (LE_READ_4(frm + 2) ==
3413 		((WME_OUI_TYPE << 24) | WME_OUI)) &&
3414 		(frm[6] == WME_INFO_OUI_SUBTYPE);
3415 }
3416 
3417 #define WLAN_VENDOR_ATHCAPS_IE_LEN 9
3418 /**
3419  * is_atheros_oui() - If vendor IE is Atheros type
3420  * @frm: vendor IE pointer
3421  *
3422  * API to check if vendor IE is Atheros
3423  *
3424  * Return: true if its Atheros IE
3425  */
3426 static inline bool
3427 is_atheros_oui(const uint8_t *frm)
3428 {
3429 	return (frm[1] > 3) && LE_READ_4(frm + 2) ==
3430 		((ATH_OUI_TYPE << 24) | ATH_OUI);
3431 }
3432 
3433 #define WLAN_VENDOR_ATH_EXTCAP_IE_LEN 10
3434 /**
3435  * is_atheros_extcap_oui() - If vendor IE is Atheros ext cap
3436  * @frm: vendor IE pointer
3437  *
3438  * API to check if vendor IE is Atheros ext cap
3439  *
3440  * Return: true if its Atheros ext cap IE
3441  */
3442 static inline int
3443 is_atheros_extcap_oui(uint8_t *frm)
3444 {
3445 	return (frm[1] > 3) && (LE_READ_4(frm + 2) ==
3446 		((ATH_OUI_EXTCAP_TYPE << 24) | ATH_OUI));
3447 }
3448 
3449 #define WLAN_VENDOR_SFA_IE_LEN 5
3450 /**
3451  * is_sfa_oui() - If vendor IE is SFA type
3452  * @frm: vendor IE pointer
3453  *
3454  * API to check if vendor IE is SFA
3455  *
3456  * Return: true if its SFA IE
3457  */
3458 static inline bool
3459 is_sfa_oui(uint8_t *frm)
3460 {
3461 	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
3462 		((SFA_OUI_TYPE << 24) | SFA_OUI));
3463 }
3464 
3465 /**
3466  * is_p2p_oui() - If vendor IE is P2P type
3467  * @frm: vendor IE pointer
3468  *
3469  * API to check if vendor IE is P2P
3470  *
3471  * Return: true if its P2P IE
3472  */
3473 static inline bool
3474 is_p2p_oui(const uint8_t *frm)
3475 {
3476 	const uint8_t wfa_oui[3] = P2P_WFA_OUI;
3477 
3478 	return (frm[1] >= 4) &&
3479 		(frm[2] == wfa_oui[0]) &&
3480 		(frm[3] == wfa_oui[1]) &&
3481 		(frm[4] == wfa_oui[2]) &&
3482 		(frm[5] == P2P_WFA_VER);
3483 }
3484 
3485 #define WLAN_VENDOR_SON_IE_LEN 31
3486 /**
3487  * is_qca_son_oui() - If vendor IE is QCA WHC type
3488  * @frm: vendor IE pointer
3489  * @whc_subtype: subtype
3490  *
3491  * API to check if vendor IE is QCA WHC
3492  *
3493  * Return: true if its QCA WHC IE
3494  */
3495 static inline bool
3496 is_qca_son_oui(uint8_t *frm, uint8_t whc_subtype)
3497 {
3498 	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
3499 		((QCA_OUI_WHC_TYPE << 24) | QCA_OUI)) &&
3500 		(*(frm + 6) == whc_subtype);
3501 }
3502 
3503 /**
3504  * is_qca_son_rept_oui() - If vendor IE is QCA WHC repeater type
3505  * @frm: vendor IE pointer
3506  * @whc_subtype: subtype
3507  *
3508  * API to check if vendor IE is QCA WHC REPT
3509  *
3510  * Return: true if its QCA WHC REPT IE
3511  */
3512 static inline bool
3513 is_qca_son_rept_oui(u_int8_t *frm, u_int8_t whc_subtype)
3514 {
3515 	return ((frm[1] > 4) && (LE_READ_4(frm + 2) ==
3516 		((QCA_OUI_WHC_REPT_TYPE << 24) | QCA_OUI)) &&
3517 		(*(frm + 6) == whc_subtype));
3518 }
3519 
3520 /**
3521  * is_ht_cap() - If vendor IE is vendor HT cap type
3522  * @frm: vendor IE pointer
3523  *
3524  * API to check if vendor IE is vendor HT cap
3525  *
3526  * Return: true if its vendor HT cap IE
3527  */
3528 static inline bool
3529 is_ht_cap(uint8_t *frm)
3530 {
3531 	return (frm[1] > 3) && (BE_READ_4(frm + 2) ==
3532 		((VENDOR_HT_OUI << 8) | VENDOR_HT_CAP_ID));
3533 }
3534 
3535 /**
3536  * is_ht_info() - If vendor IE is vendor HT info type
3537  * @frm: vendor IE pointer
3538  *
3539  * API to check if vendor IE is vendor HT info
3540  *
3541  * Return: true if its vendor HT info IE
3542  */
3543 static inline bool
3544 is_ht_info(uint8_t *frm)
3545 {
3546 	return (frm[1] > 3) && (BE_READ_4(frm + 2) ==
3547 		((VENDOR_HT_OUI << 8) | VENDOR_HT_INFO_ID));
3548 }
3549 
3550 /**
3551  * is_interop_vht() - If vendor IE is VHT interop
3552  * @frm: vendor IE pointer
3553  *
3554  * API to check if vendor IE is VHT interop
3555  *
3556  * Return: true if its VHT interop IE
3557  */
3558 static inline bool
3559 is_interop_vht(uint8_t *frm)
3560 {
3561 	return (frm[1] > 12) && (BE_READ_4(frm + 2) ==
3562 		((VHT_INTEROP_OUI << 8) | VHT_INTEROP_TYPE)) &&
3563 		((*(frm + 6) == VHT_INTEROP_OUI_SUBTYPE) ||
3564 		(*(frm + 6) == VHT_INTEROP_OUI_SUBTYPE_VENDORSPEC));
3565 }
3566 
3567 /**
3568  * is_bwnss_oui() - If vendor IE is BW NSS type
3569  * @frm: vendor IE pointer
3570  *
3571  * API to check if vendor IE is BW NSS
3572  *
3573  * Return: true if its BW NSS IE
3574  */
3575 static inline bool
3576 is_bwnss_oui(uint8_t *frm)
3577 {
3578 	return (frm[1] > 3) && (LE_READ_4(frm + 2) ==
3579 		((ATH_OUI_BW_NSS_MAP_TYPE << 24) | ATH_OUI));
3580 }
3581 
3582 #define WLAN_BWNSS_MAP_OFFSET 7
3583 
3584 /**
3585  * is_he_cap_oui() - If vendor IE is HE CAP OUI
3586  * @frm: vendor IE pointer
3587  *
3588  * API to check if vendor IE is HE CAP
3589  *
3590  * Return: true if its HE CAP IE
3591  */
3592 static inline bool
3593 is_he_cap_oui(uint8_t *frm)
3594 {
3595 	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
3596 		((ATH_HE_CAP_SUBTYPE << 24) | ATH_HE_OUI));
3597 }
3598 
3599 /**
3600  * is_he_op_oui() - If vendor IE is HE OP OUI
3601  * @frm: vendor IE pointer
3602  *
3603  * API to check if vendor IE is HE OP OUT
3604  *
3605  * Return: true if its HE OP OUI
3606  */
3607 static inline bool
3608 is_he_op_oui(uint8_t *frm)
3609 {
3610 	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
3611 		((ATH_HE_OP_SUBTYPE << 24) | ATH_HE_OUI));
3612 }
3613 
3614 /**
3615  * is_extender_oui() - If vendor IE is EXTENDER OUI
3616  * @frm: vendor IE pointer
3617  *
3618  * API to check if vendor IE is EXTENDER OUI
3619  *
3620  * Return: true if its EXTENDER OUI
3621  */
3622 static inline bool
3623 is_extender_oui(uint8_t *frm)
3624 {
3625 	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
3626 		((QCA_OUI_EXTENDER_TYPE << 24) | QCA_OUI));
3627 }
3628 
3629 /**
3630  * is_adaptive_11r_oui() - Function to check if vendor IE is ADAPTIVE 11R OUI
3631  * @frm: vendor IE pointer
3632  *
3633  * API to check if vendor IE is ADAPTIVE 11R OUI
3634  *
3635  * Return: true if its ADAPTIVE 11r OUI
3636  */
3637 static inline bool
3638 is_adaptive_11r_oui(uint8_t *frm)
3639 {
3640 	return (frm[1] > OUI_LENGTH) && (LE_READ_4(frm + 2) ==
3641 		((ADAPTIVE_11R_OUI_TYPE << OUI_TYPE_BITS) | ADAPTIVE_11R_OUI));
3642 }
3643 
3644 /**
3645  * is_sae_single_pmk_oui() - Fun to check if vendor IE is sae single pmk OUI
3646  * @frm: vendor IE pointer
3647  *
3648  * API to check if vendor IE is sae single pmk OUI
3649  *
3650  * Return: true if its sae single pmk OUI
3651  */
3652 static inline bool
3653 is_sae_single_pmk_oui(uint8_t *frm)
3654 {
3655 	return (frm[1] > OUI_LENGTH) && (LE_READ_4(frm + 2) ==
3656 		((SAE_SINGLE_PMK_TYPE << OUI_TYPE_BITS) | SAE_SINGLE_PMK_OUI));
3657 }
3658 
3659 /**
3660  * wlan_parse_oce_reduced_wan_metrics_ie() - parse oce wan metrics
3661  * @mbo_oce_ie: MBO/OCE ie ptr
3662  * @wan_metrics: out structure for the reduced wan metric
3663  *
3664  * API, function to parse reduced wan metric
3665  *
3666  * Return: true if oce wan metrics is present
3667  */
3668 static inline bool
3669 wlan_parse_oce_reduced_wan_metrics_ie(uint8_t *mbo_oce_ie,
3670 	struct oce_reduced_wan_metrics *wan_metrics)
3671 {
3672 	uint8_t len, attribute_len, attribute_id;
3673 	uint8_t *ie;
3674 
3675 	if (!mbo_oce_ie)
3676 		return false;
3677 
3678 	ie = mbo_oce_ie;
3679 	len = ie[1];
3680 	ie += 2;
3681 
3682 	if (len <= MBO_OCE_OUI_SIZE)
3683 		return false;
3684 
3685 	ie += MBO_OCE_OUI_SIZE;
3686 	len -= MBO_OCE_OUI_SIZE;
3687 
3688 	while (len > 2) {
3689 		attribute_id = ie[0];
3690 		attribute_len = ie[1];
3691 		len -= 2;
3692 		if (attribute_len > len)
3693 			return false;
3694 
3695 		if (attribute_id == REDUCED_WAN_METRICS_ATTR) {
3696 			wan_metrics->downlink_av_cap = ie[2] & 0xff;
3697 			wan_metrics->uplink_av_cap = ie[2] >> 4;
3698 			return true;
3699 		}
3700 
3701 		ie += (attribute_len + 2);
3702 		len -= attribute_len;
3703 	}
3704 
3705 	return false;
3706 }
3707 
3708 /**
3709  * wlan_parse_oce_subnet_id_ie() - parse oce subnet id IE
3710  * @mbo_oce_ie: MBO/OCE IE pointer
3711  *
3712  * While parsing vendor IE, is_mbo_oce_oui() API does sanity of
3713  * length and attribute ID for MBO_OCE_OUI and after passing the
3714  * sanity only mbo_oce IE is stored in scan cache.
3715  * It is a callers responsiblity to get the mbo_oce_ie pointer
3716  * using util_scan_entry_mbo_oce() API, which points to mbo_oce
3717  * stored in scan cache. Thus caller is responsible for ensuring
3718  * the length of the IE is consistent with the embedded length.
3719  *
3720  * Return: true if oce subnet id is present, else false
3721  */
3722 static inline bool
3723 wlan_parse_oce_subnet_id_ie(uint8_t *mbo_oce_ie)
3724 {
3725 	uint8_t len, attribute_len, attribute_id;
3726 	uint8_t *ie;
3727 
3728 	if (!mbo_oce_ie)
3729 		return false;
3730 
3731 	ie = mbo_oce_ie;
3732 	len = ie[1];
3733 	ie += 2;
3734 
3735 	if (len <= MBO_OCE_OUI_SIZE)
3736 		return false;
3737 
3738 	ie += MBO_OCE_OUI_SIZE;
3739 	len -= MBO_OCE_OUI_SIZE;
3740 
3741 	while (len > 2) {
3742 		attribute_id = ie[0];
3743 		attribute_len = ie[1];
3744 		len -= 2;
3745 		if (attribute_len > len)
3746 			return false;
3747 
3748 		if (attribute_id == OCE_SUBNET_ID_ATTR)
3749 			return true;
3750 
3751 		ie += (attribute_len + 2);
3752 		len -= attribute_len;
3753 	}
3754 
3755 	return false;
3756 }
3757 
3758 /**
3759  * wlan_parse_oce_assoc_disallowed_ie() - parse oce assoc disallowed IE
3760  * @mbo_oce_ie: MBO/OCE ie ptr
3761  * @reason: reason for disallowing assoc.
3762  *
3763  * API, function to parse OCE assoc disallowed param from the OCE MBO IE
3764  *
3765  * Return: true if assoc disallowed field is present in the IE
3766  */
3767 static inline bool
3768 wlan_parse_oce_assoc_disallowed_ie(uint8_t *mbo_oce_ie, uint8_t *reason)
3769 {
3770 	uint8_t len, attribute_len, attribute_id;
3771 	uint8_t *ie;
3772 
3773 	if (!mbo_oce_ie)
3774 		return false;
3775 
3776 	ie = mbo_oce_ie;
3777 	len = ie[1];
3778 	ie += 2;
3779 
3780 	if (len <= MBO_OCE_OUI_SIZE)
3781 		return false;
3782 
3783 	ie += MBO_OCE_OUI_SIZE;
3784 	len -= MBO_OCE_OUI_SIZE;
3785 
3786 	while (len > 2) {
3787 		attribute_id = ie[0];
3788 		attribute_len = ie[1];
3789 		len -= 2;
3790 		if (attribute_len > len)
3791 			return false;
3792 
3793 		if (attribute_id == OCE_DISALLOW_ASSOC_ATTR) {
3794 			*reason = ie[2];
3795 			return true;
3796 		}
3797 
3798 		ie += (attribute_len + 2);
3799 		len -= attribute_len;
3800 	}
3801 
3802 	return false;
3803 }
3804 
3805 /*
3806  * wlan_parse_oce_ap_tx_pwr_ie() - parse oce ap tx pwr
3807  * @mbo_oce_ie: MBO/OCE ie ptr
3808  * @ap_tx_pwr: pointer to hold value of ap_tx_pwr in dbm
3809  *
3810  * Return: true if oce ap tx pwr is present, else false
3811  */
3812 static inline bool
3813 wlan_parse_oce_ap_tx_pwr_ie(uint8_t *mbo_oce_ie, int8_t *ap_tx_pwr_dbm)
3814 {
3815 	uint8_t len, attribute_len, attribute_id;
3816 	uint8_t *ie;
3817 	int8_t ap_tx_power_in_2_complement;
3818 
3819 	if (!mbo_oce_ie)
3820 		return false;
3821 
3822 	ie = mbo_oce_ie;
3823 	len = ie[1];
3824 	ie += 2;
3825 
3826 	if (len <= MBO_OCE_OUI_SIZE)
3827 		return false;
3828 
3829 	ie += MBO_OCE_OUI_SIZE;
3830 	len -= MBO_OCE_OUI_SIZE;
3831 
3832 	while (len > 2) {
3833 		attribute_id = ie[0];
3834 		attribute_len = ie[1];
3835 		len -= 2;
3836 		if (attribute_len > len)
3837 			return false;
3838 
3839 		if (attribute_id == AP_TX_PWR_ATTR) {
3840 			ap_tx_power_in_2_complement = ie[2];
3841 			*ap_tx_pwr_dbm =
3842 				(int8_t)(256 - ap_tx_power_in_2_complement);
3843 			return true;
3844 		}
3845 
3846 		ie += (attribute_len + 2);
3847 		len -= attribute_len;
3848 	}
3849 
3850 	return false;
3851 }
3852 
3853 /**
3854  * enum mlme_csa_event_ies_present_flag - IE present flag in CSA event
3855  * @MLME_CSA_IE_PRESENT: CSA IE is present
3856  * @MLME_XCSA_IE_PRESENT: extend CSA IE is present
3857  * @MLME_WBW_IE_PRESENT: wide bandwidth channel switch IE is present
3858  * @MLME_CSWRAP_IE_EXTENDED_PRESENT: channel switch wrapper IE is present
3859  */
3860 enum mlme_csa_event_ies_present_flag {
3861 	MLME_CSA_IE_PRESENT    = 0x00000001,
3862 	MLME_XCSA_IE_PRESENT   = 0x00000002,
3863 	MLME_WBW_IE_PRESENT    = 0x00000004,
3864 	MLME_CSWRAP_IE_EXTENDED_PRESENT = 0x00000008,
3865 };
3866 
3867 /**
3868  * struct csa_offload_params - STA CSA offload request parameters
3869  * @channel: channel
3870  * @switch_mode: switch mode
3871  * @sec_chan_offset: secondary channel offset
3872  * @new_ch_width: new channel width
3873  * @new_ch_freq_seg1: channel center freq 1
3874  * @new_ch_freq_seg2: channel center freq 2
3875  * @ies_present_flag: BIT MAP of MLME_CSA_EVENT_IES_PRESENT_FLAG
3876  * @bssid: BSSID which triggers CSA
3877  */
3878 struct csa_offload_params {
3879 	uint8_t channel;
3880 	uint32_t csa_chan_freq;
3881 	uint8_t switch_mode;
3882 	uint8_t sec_chan_offset;
3883 	uint8_t new_ch_width;
3884 	uint8_t new_op_class;
3885 	uint8_t new_ch_freq_seg1;
3886 	uint8_t new_ch_freq_seg2;
3887 	uint32_t ies_present_flag;
3888 	struct qdf_mac_addr bssid;
3889 };
3890 #endif /* _WLAN_CMN_IEEE80211_DEFS_H_ */
3891