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