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