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