1 /* 2 * IEEE 802.11 Frame type definitions 3 * Copyright (c) 2002-2015, Jouni Malinen <j@w1.fi> 4 * Copyright (c) 2007-2008 Intel Corporation 5 * 6 * This software may be distributed under the terms of the BSD license. 7 * See README for more details. 8 */ 9 10 #ifndef IEEE802_11_DEFS_H 11 #define IEEE802_11_DEFS_H 12 13 #include <utils/common.h> 14 15 /* IEEE 802.11 defines */ 16 17 #define WLAN_FC_PVER 0x0003 18 #define WLAN_FC_TODS 0x0100 19 #define WLAN_FC_FROMDS 0x0200 20 #define WLAN_FC_MOREFRAG 0x0400 21 #define WLAN_FC_RETRY 0x0800 22 #define WLAN_FC_PWRMGT 0x1000 23 #define WLAN_FC_MOREDATA 0x2000 24 #define WLAN_FC_ISWEP 0x4000 25 #define WLAN_FC_ORDER 0x8000 26 27 #define WLAN_FC_GET_TYPE(fc) (((fc) & 0x000c) >> 2) 28 #define WLAN_FC_GET_STYPE(fc) (((fc) & 0x00f0) >> 4) 29 30 #define WLAN_INVALID_MGMT_SEQ 0xFFFF 31 32 #define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0))) 33 #define WLAN_GET_SEQ_SEQ(seq) \ 34 (((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4) 35 36 #define WLAN_FC_TYPE_MGMT 0 37 #define WLAN_FC_TYPE_CTRL 1 38 #define WLAN_FC_TYPE_DATA 2 39 40 /* management */ 41 #define WLAN_FC_STYPE_ASSOC_REQ 0 42 #define WLAN_FC_STYPE_ASSOC_RESP 1 43 #define WLAN_FC_STYPE_REASSOC_REQ 2 44 #define WLAN_FC_STYPE_REASSOC_RESP 3 45 #define WLAN_FC_STYPE_PROBE_REQ 4 46 #define WLAN_FC_STYPE_PROBE_RESP 5 47 #define WLAN_FC_STYPE_BEACON 8 48 #define WLAN_FC_STYPE_ATIM 9 49 #define WLAN_FC_STYPE_DISASSOC 10 50 #define WLAN_FC_STYPE_AUTH 11 51 #define WLAN_FC_STYPE_DEAUTH 12 52 #define WLAN_FC_STYPE_ACTION 13 53 54 /* control */ 55 #define WLAN_FC_STYPE_PSPOLL 10 56 #define WLAN_FC_STYPE_RTS 11 57 #define WLAN_FC_STYPE_CTS 12 58 #define WLAN_FC_STYPE_ACK 13 59 #define WLAN_FC_STYPE_CFEND 14 60 #define WLAN_FC_STYPE_CFENDACK 15 61 62 /* data */ 63 #define WLAN_FC_STYPE_DATA 0 64 #define WLAN_FC_STYPE_DATA_CFACK 1 65 #define WLAN_FC_STYPE_DATA_CFPOLL 2 66 #define WLAN_FC_STYPE_DATA_CFACKPOLL 3 67 #define WLAN_FC_STYPE_NULLFUNC 4 68 #define WLAN_FC_STYPE_CFACK 5 69 #define WLAN_FC_STYPE_CFPOLL 6 70 #define WLAN_FC_STYPE_CFACKPOLL 7 71 #define WLAN_FC_STYPE_QOS_DATA 8 72 #define WLAN_FC_STYPE_QOS_DATA_CFACK 9 73 #define WLAN_FC_STYPE_QOS_DATA_CFPOLL 10 74 #define WLAN_FC_STYPE_QOS_DATA_CFACKPOLL 11 75 #define WLAN_FC_STYPE_QOS_NULL 12 76 #define WLAN_FC_STYPE_QOS_CFPOLL 14 77 #define WLAN_FC_STYPE_QOS_CFACKPOLL 15 78 79 /* Authentication algorithms */ 80 #define WLAN_AUTH_OPEN 0 81 #define WLAN_AUTH_SHARED_KEY 1 82 #define WLAN_AUTH_FT 2 83 #define WLAN_AUTH_SAE 3 84 #define WLAN_AUTH_LEAP 128 85 86 #define WLAN_AUTH_CHALLENGE_LEN 128 87 88 #define WLAN_CAPABILITY_ESS BIT(0) 89 #define WLAN_CAPABILITY_IBSS BIT(1) 90 #define WLAN_CAPABILITY_CF_POLLABLE BIT(2) 91 #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3) 92 #define WLAN_CAPABILITY_PRIVACY BIT(4) 93 #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5) 94 #define WLAN_CAPABILITY_PBCC BIT(6) 95 #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7) 96 #define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8) 97 #define WLAN_CAPABILITY_QOS BIT(9) 98 #define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10) 99 #define WLAN_CAPABILITY_APSD BIT(11) 100 #define WLAN_CAPABILITY_RADIO_MEASUREMENT BIT(12) 101 #define WLAN_CAPABILITY_DSSS_OFDM BIT(13) 102 #define WLAN_CAPABILITY_DELAYED_BLOCK_ACK BIT(14) 103 #define WLAN_CAPABILITY_IMM_BLOCK_ACK BIT(15) 104 105 /* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */ 106 #define WLAN_STATUS_SUCCESS 0 107 #define WLAN_STATUS_UNSPECIFIED_FAILURE 1 108 #define WLAN_STATUS_TDLS_WAKEUP_ALTERNATE 2 109 #define WLAN_STATUS_TDLS_WAKEUP_REJECT 3 110 #define WLAN_STATUS_SECURITY_DISABLED 5 111 #define WLAN_STATUS_UNACCEPTABLE_LIFETIME 6 112 #define WLAN_STATUS_NOT_IN_SAME_BSS 7 113 #define WLAN_STATUS_CAPS_UNSUPPORTED 10 114 #define WLAN_STATUS_REASSOC_NO_ASSOC 11 115 #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12 116 #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13 117 #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14 118 #define WLAN_STATUS_CHALLENGE_FAIL 15 119 #define WLAN_STATUS_AUTH_TIMEOUT 16 120 #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17 121 #define WLAN_STATUS_ASSOC_DENIED_RATES 18 122 /* IEEE 802.11b */ 123 #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19 124 #define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20 125 #define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21 126 /* IEEE 802.11h */ 127 #define WLAN_STATUS_SPEC_MGMT_REQUIRED 22 128 #define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23 129 #define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24 130 /* IEEE 802.11g */ 131 #define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25 132 #define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 26 133 #define WLAN_STATUS_ASSOC_DENIED_NO_HT 27 134 #define WLAN_STATUS_R0KH_UNREACHABLE 28 135 #define WLAN_STATUS_ASSOC_DENIED_NO_PCO 29 136 /* IEEE 802.11w */ 137 #define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30 138 #define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31 139 #define WLAN_STATUS_UNSPECIFIED_QOS_FAILURE 32 140 #define WLAN_STATUS_REQUEST_DECLINED 37 141 #define WLAN_STATUS_INVALID_PARAMETERS 38 142 /* IEEE 802.11i */ 143 #define WLAN_STATUS_INVALID_IE 40 144 #define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41 145 #define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42 146 #define WLAN_STATUS_AKMP_NOT_VALID 43 147 #define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44 148 #define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45 149 #define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46 150 #define WLAN_STATUS_TS_NOT_CREATED 47 151 #define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48 152 #define WLAN_STATUS_DEST_STA_NOT_PRESENT 49 153 #define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50 154 #define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51 155 /* IEEE 802.11r */ 156 #define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52 157 #define WLAN_STATUS_INVALID_PMKID 53 158 #define WLAN_STATUS_INVALID_MDIE 54 159 #define WLAN_STATUS_INVALID_FTIE 55 160 #define WLAN_STATUS_GAS_ADV_PROTO_NOT_SUPPORTED 59 161 #define WLAN_STATUS_NO_OUTSTANDING_GAS_REQ 60 162 #define WLAN_STATUS_GAS_RESP_NOT_RECEIVED 61 163 #define WLAN_STATUS_STA_TIMED_OUT_WAITING_FOR_GAS_RESP 62 164 #define WLAN_STATUS_GAS_RESP_LARGER_THAN_LIMIT 63 165 #define WLAN_STATUS_REQ_REFUSED_HOME 64 166 #define WLAN_STATUS_ADV_SRV_UNREACHABLE 65 167 #define WLAN_STATUS_REQ_REFUSED_SSPN 67 168 #define WLAN_STATUS_REQ_REFUSED_UNAUTH_ACCESS 68 169 #define WLAN_STATUS_INVALID_RSNIE 72 170 #define WLAN_STATUS_ANTI_CLOGGING_TOKEN_REQ 76 171 #define WLAN_STATUS_FINITE_CYCLIC_GROUP_NOT_SUPPORTED 77 172 #define WLAN_STATUS_TRANSMISSION_FAILURE 79 173 #define WLAN_STATUS_REJECTED_WITH_SUGGESTED_BSS_TRANSITION 82 174 #define WLAN_STATUS_PENDING_ADMITTING_FST_SESSION 86 175 #define WLAN_STATUS_QUERY_RESP_OUTSTANDING 95 176 #define WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL 99 177 #define WLAN_STATUS_ASSOC_DENIED_NO_VHT 104 178 179 /* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */ 180 #define WLAN_REASON_UNSPECIFIED 1 181 #define WLAN_REASON_PREV_AUTH_NOT_VALID 2 182 #define WLAN_REASON_DEAUTH_LEAVING 3 183 #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4 184 #define WLAN_REASON_DISASSOC_AP_BUSY 5 185 #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 186 #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7 187 #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8 188 #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 189 /* IEEE 802.11h */ 190 #define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10 191 #define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11 192 /* IEEE 802.11i */ 193 #define WLAN_REASON_INVALID_IE 13 194 #define WLAN_REASON_MICHAEL_MIC_FAILURE 14 195 #define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15 196 #define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16 197 #define WLAN_REASON_IE_IN_4WAY_DIFFERS 17 198 #define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18 199 #define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19 200 #define WLAN_REASON_AKMP_NOT_VALID 20 201 #define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21 202 #define WLAN_REASON_INVALID_RSN_IE_CAPAB 22 203 #define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23 204 #define WLAN_REASON_CIPHER_SUITE_REJECTED 24 205 #define WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE 25 206 #define WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26 207 /* IEEE 802.11e */ 208 #define WLAN_REASON_DISASSOC_LOW_ACK 34 209 /* IEEE 802.11s */ 210 #define WLAN_REASON_MESH_PEERING_CANCELLED 52 211 #define WLAN_REASON_MESH_MAX_PEERS 53 212 #define WLAN_REASON_MESH_CONFIG_POLICY_VIOLATION 54 213 #define WLAN_REASON_MESH_CLOSE_RCVD 55 214 #define WLAN_REASON_MESH_MAX_RETRIES 56 215 #define WLAN_REASON_MESH_CONFIRM_TIMEOUT 57 216 #define WLAN_REASON_MESH_INVALID_GTK 58 217 #define WLAN_REASON_MESH_INCONSISTENT_PARAMS 59 218 #define WLAN_REASON_MESH_INVALID_SECURITY_CAP 60 219 220 221 /* Information Element IDs */ 222 #define WLAN_EID_SSID 0 223 #define WLAN_EID_SUPP_RATES 1 224 #define WLAN_EID_FH_PARAMS 2 225 #define WLAN_EID_DS_PARAMS 3 226 #define WLAN_EID_CF_PARAMS 4 227 #define WLAN_EID_TIM 5 228 #define WLAN_EID_IBSS_PARAMS 6 229 #define WLAN_EID_COUNTRY 7 230 #define WLAN_EID_BSS_LOAD 11 231 #define WLAN_EID_CHALLENGE 16 232 /* EIDs defined by IEEE 802.11h - START */ 233 #define WLAN_EID_PWR_CONSTRAINT 32 234 #define WLAN_EID_PWR_CAPABILITY 33 235 #define WLAN_EID_TPC_REQUEST 34 236 #define WLAN_EID_TPC_REPORT 35 237 #define WLAN_EID_SUPPORTED_CHANNELS 36 238 #define WLAN_EID_CHANNEL_SWITCH 37 239 #define WLAN_EID_MEASURE_REQUEST 38 240 #define WLAN_EID_MEASURE_REPORT 39 241 #define WLAN_EID_QUITE 40 242 #define WLAN_EID_IBSS_DFS 41 243 /* EIDs defined by IEEE 802.11h - END */ 244 #define WLAN_EID_ERP_INFO 42 245 #define WLAN_EID_HT_CAP 45 246 #define WLAN_EID_QOS 46 247 #define WLAN_EID_RSN 48 248 #define WLAN_EID_EXT_SUPP_RATES 50 249 #define WLAN_EID_NEIGHBOR_REPORT 52 250 #define WLAN_EID_MOBILITY_DOMAIN 54 251 #define WLAN_EID_FAST_BSS_TRANSITION 55 252 #define WLAN_EID_TIMEOUT_INTERVAL 56 253 #define WLAN_EID_RIC_DATA 57 254 #define WLAN_EID_SUPPORTED_OPERATING_CLASSES 59 255 #define WLAN_EID_EXT_CHANSWITCH_ANN 60 256 #define WLAN_EID_HT_OPERATION 61 257 #define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62 258 #define WLAN_EID_WAPI 68 259 #define WLAN_EID_TIME_ADVERTISEMENT 69 260 #define WLAN_EID_RRM_ENABLED_CAPABILITIES 70 261 #define WLAN_EID_20_40_BSS_COEXISTENCE 72 262 #define WLAN_EID_20_40_BSS_INTOLERANT 73 263 #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74 264 #define WLAN_EID_MMIE 76 265 #define WLAN_EID_SSID_LIST 84 266 #define WLAN_EID_BSS_MAX_IDLE_PERIOD 90 267 #define WLAN_EID_TFS_REQ 91 268 #define WLAN_EID_TFS_RESP 92 269 #define WLAN_EID_WNMSLEEP 93 270 #define WLAN_EID_TIME_ZONE 98 271 #define WLAN_EID_LINK_ID 101 272 #define WLAN_EID_INTERWORKING 107 273 #define WLAN_EID_ADV_PROTO 108 274 #define WLAN_EID_QOS_MAP_SET 110 275 #define WLAN_EID_ROAMING_CONSORTIUM 111 276 #define WLAN_EID_MESH_CONFIG 113 277 #define WLAN_EID_MESH_ID 114 278 #define WLAN_EID_PEER_MGMT 117 279 #define WLAN_EID_EXT_CAPAB 127 280 #define WLAN_EID_AMPE 139 281 #define WLAN_EID_MIC 140 282 #define WLAN_EID_CCKM 156 283 #define WLAN_EID_MULTI_BAND 158 284 #define WLAN_EID_SESSION_TRANSITION 164 285 #define WLAN_EID_VHT_CAP 191 286 #define WLAN_EID_VHT_OPERATION 192 287 #define WLAN_EID_VHT_EXTENDED_BSS_LOAD 193 288 #define WLAN_EID_VHT_WIDE_BW_CHSWITCH 194 289 #define WLAN_EID_VHT_TRANSMIT_POWER_ENVELOPE 195 290 #define WLAN_EID_VHT_CHANNEL_SWITCH_WRAPPER 196 291 #define WLAN_EID_VHT_AID 197 292 #define WLAN_EID_VHT_QUIET_CHANNEL 198 293 #define WLAN_EID_VHT_OPERATING_MODE_NOTIFICATION 199 294 #define WLAN_EID_VENDOR_SPECIFIC 221 295 296 297 /* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */ 298 #define WLAN_ACTION_SPECTRUM_MGMT 0 299 #define WLAN_ACTION_QOS 1 300 #define WLAN_ACTION_DLS 2 301 #define WLAN_ACTION_BLOCK_ACK 3 302 #define WLAN_ACTION_PUBLIC 4 303 #define WLAN_ACTION_RADIO_MEASUREMENT 5 304 #define WLAN_ACTION_FT 6 305 #define WLAN_ACTION_HT 7 306 #define WLAN_ACTION_SA_QUERY 8 307 #define WLAN_ACTION_PROTECTED_DUAL 9 308 #define WLAN_ACTION_WNM 10 309 #define WLAN_ACTION_UNPROTECTED_WNM 11 310 #define WLAN_ACTION_TDLS 12 311 #define WLAN_ACTION_SELF_PROTECTED 15 312 #define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */ 313 #define WLAN_ACTION_FST 18 314 #define WLAN_ACTION_VENDOR_SPECIFIC 127 315 316 /* Public action codes */ 317 #define WLAN_PA_20_40_BSS_COEX 0 318 #define WLAN_PA_VENDOR_SPECIFIC 9 319 #define WLAN_PA_GAS_INITIAL_REQ 10 320 #define WLAN_PA_GAS_INITIAL_RESP 11 321 #define WLAN_PA_GAS_COMEBACK_REQ 12 322 #define WLAN_PA_GAS_COMEBACK_RESP 13 323 #define WLAN_TDLS_DISCOVERY_RESPONSE 14 324 325 /* Protected Dual of Public Action frames */ 326 #define WLAN_PROT_DSE_ENABLEMENT 1 327 #define WLAN_PROT_DSE_DEENABLEMENT 2 328 #define WLAN_PROT_EXT_CSA 4 329 #define WLAN_PROT_MEASUREMENT_REQ 5 330 #define WLAN_PROT_MEASUREMENT_REPORT 6 331 #define WLAN_PROT_DSE_POWER_CONSTRAINT 8 332 #define WLAN_PROT_VENDOR_SPECIFIC 9 333 #define WLAN_PROT_GAS_INITIAL_REQ 10 334 #define WLAN_PROT_GAS_INITIAL_RESP 11 335 #define WLAN_PROT_GAS_COMEBACK_REQ 12 336 #define WLAN_PROT_GAS_COMEBACK_RESP 13 337 338 /* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */ 339 #define WLAN_SA_QUERY_REQUEST 0 340 #define WLAN_SA_QUERY_RESPONSE 1 341 342 #define WLAN_SA_QUERY_TR_ID_LEN 2 343 344 /* TDLS action codes */ 345 #define WLAN_TDLS_SETUP_REQUEST 0 346 #define WLAN_TDLS_SETUP_RESPONSE 1 347 #define WLAN_TDLS_SETUP_CONFIRM 2 348 #define WLAN_TDLS_TEARDOWN 3 349 #define WLAN_TDLS_PEER_TRAFFIC_INDICATION 4 350 #define WLAN_TDLS_CHANNEL_SWITCH_REQUEST 5 351 #define WLAN_TDLS_CHANNEL_SWITCH_RESPONSE 6 352 #define WLAN_TDLS_PEER_PSM_REQUEST 7 353 #define WLAN_TDLS_PEER_PSM_RESPONSE 8 354 #define WLAN_TDLS_PEER_TRAFFIC_RESPONSE 9 355 #define WLAN_TDLS_DISCOVERY_REQUEST 10 356 357 /* Radio Measurement Action codes */ 358 #define WLAN_RRM_RADIO_MEASUREMENT_REQUEST 0 359 #define WLAN_RRM_RADIO_MEASUREMENT_REPORT 1 360 #define WLAN_RRM_LINK_MEASUREMENT_REQUEST 2 361 #define WLAN_RRM_LINK_MEASUREMENT_REPORT 3 362 #define WLAN_RRM_NEIGHBOR_REPORT_REQUEST 4 363 #define WLAN_RRM_NEIGHBOR_REPORT_RESPONSE 5 364 365 /* Radio Measurement capabilities (from RRM Capabilities IE) */ 366 /* byte 1 (out of 5) */ 367 #define WLAN_RRM_CAPS_LINK_MEASUREMENT BIT(0) 368 #define WLAN_RRM_CAPS_NEIGHBOR_REPORT BIT(1) 369 /* byte 2 (out of 5) */ 370 #define WLAN_RRM_CAPS_LCI_MEASUREMENT BIT(4) 371 /* byte 5 (out of 5) */ 372 #define WLAN_RRM_CAPS_FTM_RANGE_REPORT BIT(2) 373 374 /* 375 * IEEE P802.11-REVmc/D5.0, 9.4.2.21.19 (Fine Timing Measurement Range 376 * request) - Minimum AP count 377 */ 378 #define WLAN_RRM_RANGE_REQ_MAX_MIN_AP 15 379 380 /* Timeout Interval Type */ 381 #define WLAN_TIMEOUT_REASSOC_DEADLINE 1 382 #define WLAN_TIMEOUT_KEY_LIFETIME 2 383 #define WLAN_TIMEOUT_ASSOC_COMEBACK 3 384 385 /* Interworking element (IEEE 802.11u) - Access Network Options */ 386 #define INTERWORKING_ANO_ACCESS_NETWORK_MASK 0x0f 387 #define INTERWORKING_ANO_INTERNET 0x10 388 #define INTERWORKING_ANO_ASRA 0x20 389 #define INTERWORKING_ANO_ESR 0x40 390 #define INTERWORKING_ANO_UESA 0x80 391 392 #define INTERWORKING_ANT_PRIVATE 0 393 #define INTERWORKING_ANT_PRIVATE_WITH_GUEST 1 394 #define INTERWORKING_ANT_CHARGEABLE_PUBLIC 2 395 #define INTERWORKING_ANT_FREE_PUBLIC 3 396 #define INTERWORKING_ANT_PERSONAL_DEVICE 4 397 #define INTERWORKING_ANT_EMERGENCY_SERVICES 5 398 #define INTERWORKING_ANT_TEST 6 399 #define INTERWORKING_ANT_WILDCARD 15 400 401 /* Advertisement Protocol ID definitions (IEEE Std 802.11u-2011) */ 402 enum adv_proto_id { 403 ACCESS_NETWORK_QUERY_PROTOCOL = 0, 404 MIH_INFO_SERVICE = 1, 405 MIH_CMD_AND_EVENT_DISCOVERY = 2, 406 EMERGENCY_ALERT_SYSTEM = 3, 407 ADV_PROTO_VENDOR_SPECIFIC = 221 408 }; 409 410 /* Access Network Query Protocol info ID definitions (IEEE Std 802.11u-2011) */ 411 enum anqp_info_id { 412 ANQP_QUERY_LIST = 256, 413 ANQP_CAPABILITY_LIST = 257, 414 ANQP_VENUE_NAME = 258, 415 ANQP_EMERGENCY_CALL_NUMBER = 259, 416 ANQP_NETWORK_AUTH_TYPE = 260, 417 ANQP_ROAMING_CONSORTIUM = 261, 418 ANQP_IP_ADDR_TYPE_AVAILABILITY = 262, 419 ANQP_NAI_REALM = 263, 420 ANQP_3GPP_CELLULAR_NETWORK = 264, 421 ANQP_AP_GEOSPATIAL_LOCATION = 265, 422 ANQP_AP_CIVIC_LOCATION = 266, 423 ANQP_AP_LOCATION_PUBLIC_URI = 267, 424 ANQP_DOMAIN_NAME = 268, 425 ANQP_EMERGENCY_ALERT_URI = 269, 426 ANQP_TDLS_CAPABILITY = 270, 427 ANQP_EMERGENCY_NAI = 271, 428 ANQP_NEIGHBOR_REPORT = 272, 429 ANQP_VENUE_URL = 277, 430 ANQP_ADVICE_OF_CHARGE = 278, 431 ANQP_LOCAL_CONTENT = 279, 432 ANQP_VENDOR_SPECIFIC = 56797 433 }; 434 435 /* NAI Realm list - EAP Method subfield - Authentication Parameter ID */ 436 enum nai_realm_eap_auth_param { 437 NAI_REALM_EAP_AUTH_EXPANDED_EAP_METHOD = 1, 438 NAI_REALM_EAP_AUTH_NON_EAP_INNER_AUTH = 2, 439 NAI_REALM_EAP_AUTH_INNER_AUTH_EAP_METHOD = 3, 440 NAI_REALM_EAP_AUTH_EXPANDED_INNER_EAP_METHOD = 4, 441 NAI_REALM_EAP_AUTH_CRED_TYPE = 5, 442 NAI_REALM_EAP_AUTH_TUNNELED_CRED_TYPE = 6, 443 NAI_REALM_EAP_AUTH_VENDOR_SPECIFIC = 221 444 }; 445 446 enum nai_realm_eap_auth_inner_non_eap { 447 NAI_REALM_INNER_NON_EAP_PAP = 1, 448 NAI_REALM_INNER_NON_EAP_CHAP = 2, 449 NAI_REALM_INNER_NON_EAP_MSCHAP = 3, 450 NAI_REALM_INNER_NON_EAP_MSCHAPV2 = 4 451 }; 452 453 enum nai_realm_eap_cred_type { 454 NAI_REALM_CRED_TYPE_SIM = 1, 455 NAI_REALM_CRED_TYPE_USIM = 2, 456 NAI_REALM_CRED_TYPE_NFC_SECURE_ELEMENT = 3, 457 NAI_REALM_CRED_TYPE_HARDWARE_TOKEN = 4, 458 NAI_REALM_CRED_TYPE_SOFTOKEN = 5, 459 NAI_REALM_CRED_TYPE_CERTIFICATE = 6, 460 NAI_REALM_CRED_TYPE_USERNAME_PASSWORD = 7, 461 NAI_REALM_CRED_TYPE_NONE = 8, 462 NAI_REALM_CRED_TYPE_ANONYMOUS = 9, 463 NAI_REALM_CRED_TYPE_VENDOR_SPECIFIC = 10 464 }; 465 466 /* 467 * IEEE P802.11-REVmc/D5.0 Table 9-81 - Measurement type definitions for 468 * measurement requests 469 */ 470 enum measure_type { 471 MEASURE_TYPE_BASIC = 0, 472 MEASURE_TYPE_CCA = 1, 473 MEASURE_TYPE_RPI_HIST = 2, 474 MEASURE_TYPE_CHANNEL_LOAD = 3, 475 MEASURE_TYPE_NOISE_HIST = 4, 476 MEASURE_TYPE_BEACON = 5, 477 MEASURE_TYPE_FRAME = 6, 478 MEASURE_TYPE_STA_STATISTICS = 7, 479 MEASURE_TYPE_LCI = 8, 480 MEASURE_TYPE_TRANSMIT_STREAM = 9, 481 MEASURE_TYPE_MULTICAST_DIAG = 10, 482 MEASURE_TYPE_LOCATION_CIVIC = 11, 483 MEASURE_TYPE_LOCATION_ID = 12, 484 MEASURE_TYPE_DIRECTIONAL_CHAN_QUALITY = 13, 485 MEASURE_TYPE_DIRECTIONAL_MEASURE = 14, 486 MEASURE_TYPE_DIRECTIONAL_STATS = 15, 487 MEASURE_TYPE_FTM_RANGE = 16, 488 MEASURE_TYPE_MEASURE_PAUSE = 255, 489 }; 490 491 /* IEEE Std 802.11-2012 Table 8-71 - Location subject definition */ 492 enum location_subject { 493 LOCATION_SUBJECT_LOCAL = 0, 494 LOCATION_SUBJECT_REMOTE = 1, 495 LOCATION_SUBJECT_3RD_PARTY = 2, 496 }; 497 498 /* 499 * IEEE P802.11-REVmc/D5.0 Table 9-94 - Optional subelement IDs for LCI request 500 */ 501 enum lci_req_subelem { 502 LCI_REQ_SUBELEM_AZIMUTH_REQ = 1, 503 LCI_REQ_SUBELEM_ORIGINATOR_MAC_ADDR = 2, 504 LCI_REQ_SUBELEM_TARGET_MAC_ADDR = 3, 505 LCI_REQ_SUBELEM_MAX_AGE = 4, 506 }; 507 508 #ifdef _MSC_VER 509 #pragma pack(push, 1) 510 #endif /* _MSC_VER */ 511 512 struct ieee80211_hdr { 513 le16 frame_control; 514 le16 duration_id; 515 u8 addr1[6]; 516 u8 addr2[6]; 517 u8 addr3[6]; 518 le16 seq_ctrl; 519 /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame 520 */ 521 } STRUCT_PACKED; 522 523 #define IEEE80211_DA_FROMDS addr1 524 #define IEEE80211_BSSID_FROMDS addr2 525 #define IEEE80211_SA_FROMDS addr3 526 527 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr)) 528 529 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4)) 530 531 struct ieee80211_mgmt { 532 le16 frame_control; 533 le16 duration; 534 u8 da[6]; 535 u8 sa[6]; 536 u8 bssid[6]; 537 le16 seq_ctrl; 538 union { 539 struct { 540 le16 auth_alg; 541 le16 auth_transaction; 542 le16 status_code; 543 /* possibly followed by Challenge text */ 544 u8 variable[]; 545 } STRUCT_PACKED auth; 546 struct { 547 le16 reason_code; 548 u8 variable[]; 549 } STRUCT_PACKED deauth; 550 struct { 551 le16 capab_info; 552 le16 listen_interval; 553 /* followed by SSID and Supported rates */ 554 u8 variable[]; 555 } STRUCT_PACKED assoc_req; 556 struct { 557 le16 capab_info; 558 le16 status_code; 559 le16 aid; 560 /* followed by Supported rates */ 561 u8 variable[]; 562 } STRUCT_PACKED assoc_resp, reassoc_resp; 563 struct { 564 le16 capab_info; 565 le16 listen_interval; 566 u8 current_ap[6]; 567 /* followed by SSID and Supported rates */ 568 u8 variable[]; 569 } STRUCT_PACKED reassoc_req; 570 struct { 571 le16 reason_code; 572 u8 variable[]; 573 } STRUCT_PACKED disassoc; 574 struct { 575 u8 timestamp[8]; 576 le16 beacon_int; 577 le16 capab_info; 578 /* followed by some of SSID, Supported rates, 579 * FH Params, DS Params, CF Params, IBSS Params, TIM */ 580 u8 variable[]; 581 } STRUCT_PACKED beacon; 582 /* probe_req: only variable items: SSID, Supported rates */ 583 struct { 584 u8 timestamp[8]; 585 le16 beacon_int; 586 le16 capab_info; 587 /* followed by some of SSID, Supported rates, 588 * FH Params, DS Params, CF Params, IBSS Params */ 589 u8 variable[]; 590 } STRUCT_PACKED probe_resp; 591 struct { 592 u8 category; 593 union { 594 struct { 595 u8 action_code; 596 u8 dialog_token; 597 u8 status_code; 598 u8 variable[]; 599 } STRUCT_PACKED wmm_action; 600 struct{ 601 u8 action_code; 602 u8 element_id; 603 u8 length; 604 u8 switch_mode; 605 u8 new_chan; 606 u8 switch_count; 607 } STRUCT_PACKED chan_switch; 608 struct { 609 u8 action; 610 u8 sta_addr[ETH_ALEN]; 611 u8 target_ap_addr[ETH_ALEN]; 612 u8 variable[]; /* FT Request */ 613 } STRUCT_PACKED ft_action_req; 614 struct { 615 u8 action; 616 u8 sta_addr[ETH_ALEN]; 617 u8 target_ap_addr[ETH_ALEN]; 618 le16 status_code; 619 u8 variable[]; /* FT Request */ 620 } STRUCT_PACKED ft_action_resp; 621 struct { 622 u8 action; 623 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 624 } STRUCT_PACKED sa_query_req; 625 struct { 626 u8 action; /* */ 627 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 628 } STRUCT_PACKED sa_query_resp; 629 struct { 630 u8 action; 631 u8 dialogtoken; 632 u8 variable[]; 633 } STRUCT_PACKED wnm_sleep_req; 634 struct { 635 u8 action; 636 u8 dialogtoken; 637 le16 keydata_len; 638 u8 variable[]; 639 } STRUCT_PACKED wnm_sleep_resp; 640 struct { 641 u8 action; 642 u8 variable[]; 643 } STRUCT_PACKED public_action; 644 struct { 645 u8 action; /* 9 */ 646 u8 oui[3]; 647 /* Vendor-specific content */ 648 u8 variable[]; 649 } STRUCT_PACKED vs_public_action; 650 struct { 651 u8 action; /* 7 */ 652 u8 dialog_token; 653 u8 req_mode; 654 le16 disassoc_timer; 655 u8 validity_interval; 656 /* BSS Termination Duration (optional), 657 * Session Information URL (optional), 658 * BSS Transition Candidate List 659 * Entries */ 660 u8 variable[]; 661 } STRUCT_PACKED bss_tm_req; 662 struct { 663 u8 action; /* 8 */ 664 u8 dialog_token; 665 u8 status_code; 666 u8 bss_termination_delay; 667 /* Target BSSID (optional), 668 * BSS Transition Candidate List 669 * Entries (optional) */ 670 u8 variable[]; 671 } STRUCT_PACKED bss_tm_resp; 672 struct { 673 u8 action; /* 6 */ 674 u8 dialog_token; 675 u8 query_reason; 676 /* BSS Transition Candidate List 677 * Entries (optional) */ 678 u8 variable[]; 679 } STRUCT_PACKED bss_tm_query; 680 struct { 681 u8 action; /* 15 */ 682 u8 variable[]; 683 } STRUCT_PACKED slf_prot_action; 684 struct { 685 u8 action; 686 u8 variable[]; 687 } STRUCT_PACKED fst_action; 688 struct { 689 u8 action; 690 u8 dialog_token; 691 u8 variable[]; 692 } STRUCT_PACKED rrm; 693 } u; 694 } STRUCT_PACKED action; 695 } u; 696 } STRUCT_PACKED; 697 698 699 #define IEEE80211_MAX_MMPDU_SIZE 2304 700 701 /* Rx MCS bitmask is in the first 77 bits of supported_mcs_set */ 702 #define IEEE80211_HT_MCS_MASK_LEN 10 703 704 /* HT Capabilities element */ 705 struct ieee80211_ht_capabilities { 706 le16 ht_capabilities_info; 707 u8 a_mpdu_params; /* Maximum A-MPDU Length Exponent B0..B1 708 * Minimum MPDU Start Spacing B2..B4 709 * Reserved B5..B7 */ 710 u8 supported_mcs_set[16]; 711 le16 ht_extended_capabilities; 712 le32 tx_bf_capability_info; 713 u8 asel_capabilities; 714 } STRUCT_PACKED; 715 716 717 /* HT Operation element */ 718 struct ieee80211_ht_operation { 719 u8 primary_chan; 720 /* Five octets of HT Operation Information */ 721 u8 ht_param; /* B0..B7 */ 722 le16 operation_mode; /* B8..B23 */ 723 le16 param; /* B24..B39 */ 724 u8 basic_mcs_set[16]; 725 } STRUCT_PACKED; 726 727 728 struct ieee80211_obss_scan_parameters { 729 le16 scan_passive_dwell; 730 le16 scan_active_dwell; 731 le16 width_trigger_scan_interval; 732 le16 scan_passive_total_per_channel; 733 le16 scan_active_total_per_channel; 734 le16 channel_transition_delay_factor; 735 le16 scan_activity_threshold; 736 } STRUCT_PACKED; 737 738 739 struct ieee80211_vht_capabilities { 740 le32 vht_capabilities_info; 741 struct { 742 le16 rx_map; 743 le16 rx_highest; 744 le16 tx_map; 745 le16 tx_highest; 746 } vht_supported_mcs_set; 747 } STRUCT_PACKED; 748 749 struct ieee80211_vht_operation { 750 u8 vht_op_info_chwidth; 751 u8 vht_op_info_chan_center_freq_seg0_idx; 752 u8 vht_op_info_chan_center_freq_seg1_idx; 753 le16 vht_basic_mcs_set; 754 } STRUCT_PACKED; 755 756 struct ieee80211_ampe_ie { 757 u8 selected_pairwise_suite[4]; 758 u8 local_nonce[32]; 759 u8 peer_nonce[32]; 760 /* Followed by 761 * Key Replay Counter[8] (optional) 762 * (only in Mesh Group Key Inform/Acknowledge frames) 763 * GTKdata[variable] (optional) 764 * (MGTK[variable] || Key RSC[8] || GTKExpirationTime[4]) 765 * IGTKdata[variable] (optional) 766 * (Key ID[2], IPN[6], IGTK[variable] in IGTK KDE format) 767 */ 768 } STRUCT_PACKED; 769 770 #ifdef _MSC_VER 771 #pragma pack(pop) 772 #endif /* _MSC_VER */ 773 774 #define ERP_INFO_NON_ERP_PRESENT BIT(0) 775 #define ERP_INFO_USE_PROTECTION BIT(1) 776 #define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2) 777 778 #define OVERLAPPING_BSS_TRANS_DELAY_FACTOR 5 779 780 /* HT Capabilities Info field within HT Capabilities element */ 781 #define HT_CAP_INFO_LDPC_CODING_CAP ((u16) BIT(0)) 782 #define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET ((u16) BIT(1)) 783 #define HT_CAP_INFO_SMPS_MASK ((u16) (BIT(2) | BIT(3))) 784 #define HT_CAP_INFO_SMPS_STATIC ((u16) 0) 785 #define HT_CAP_INFO_SMPS_DYNAMIC ((u16) BIT(2)) 786 #define HT_CAP_INFO_SMPS_DISABLED ((u16) (BIT(2) | BIT(3))) 787 #define HT_CAP_INFO_GREEN_FIELD ((u16) BIT(4)) 788 #define HT_CAP_INFO_SHORT_GI20MHZ ((u16) BIT(5)) 789 #define HT_CAP_INFO_SHORT_GI40MHZ ((u16) BIT(6)) 790 #define HT_CAP_INFO_TX_STBC ((u16) BIT(7)) 791 #define HT_CAP_INFO_RX_STBC_MASK ((u16) (BIT(8) | BIT(9))) 792 #define HT_CAP_INFO_RX_STBC_1 ((u16) BIT(8)) 793 #define HT_CAP_INFO_RX_STBC_12 ((u16) BIT(9)) 794 #define HT_CAP_INFO_RX_STBC_123 ((u16) (BIT(8) | BIT(9))) 795 #define HT_CAP_INFO_DELAYED_BA ((u16) BIT(10)) 796 #define HT_CAP_INFO_MAX_AMSDU_SIZE ((u16) BIT(11)) 797 #define HT_CAP_INFO_DSSS_CCK40MHZ ((u16) BIT(12)) 798 /* B13 - Reserved (was PSMP support during P802.11n development) */ 799 #define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14)) 800 #define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15)) 801 802 /* HT Extended Capabilities field within HT Capabilities element */ 803 #define EXT_HT_CAP_INFO_PCO ((u16) BIT(0)) 804 #define EXT_HT_CAP_INFO_PCO_TRANS_TIME_MASK ((u16) (BIT(1) | BIT(2))) 805 #define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET 1 806 /* B3..B7 - Reserved */ 807 #define EXT_HT_CAP_INFO_MCS_FEEDBACK_MASK ((u16) (BIT(8) | BIT(9))) 808 #define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET 8 809 #define EXT_HT_CAP_INFO_HTC_SUPPORT ((u16) BIT(10)) 810 #define EXT_HT_CAP_INFO_RD_RESPONDER ((u16) BIT(11)) 811 /* B12..B15 - Reserved */ 812 813 /* Transmit Beanforming Capabilities within HT Capabilities element */ 814 #define TX_BF_CAP_IMPLICIT_TXBF_RX_CAP ((u32) BIT(0)) 815 #define TX_BF_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1)) 816 #define TX_BF_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2)) 817 #define TX_BF_CAP_RX_NDP_CAP ((u32) BIT(3)) 818 #define TX_BF_CAP_TX_NDP_CAP ((u32) BIT(4)) 819 #define TX_BF_CAP_IMPLICIT_TX_BF_CAP ((u32) BIT(5)) 820 #define TX_BF_CAP_CALIBRATION_MASK ((u32) (BIT(6) | BIT(7)) 821 #define TX_BF_CAP_CALIB_OFFSET 6 822 #define TX_BF_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8)) 823 #define TX_BF_CAP_EXPLICIT_NONCOMPR_STEERING_CAP ((u32) BIT(9)) 824 #define TX_BF_CAP_EXPLICIT_COMPR_STEERING_CAP ((u32) BIT(10)) 825 #define TX_BF_CAP_EXPLICIT_TX_BF_CSI_FEEDBACK_MASK ((u32) (BIT(10) | BIT(11))) 826 #define TX_BF_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11 827 #define TX_BF_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13 828 #define TX_BF_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15 829 #define TX_BF_CAP_MINIMAL_GROUPING_OFFSET 17 830 #define TX_BF_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19 831 #define TX_BF_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21 832 #define TX_BF_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23 833 #define TX_BF_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25 834 #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_MASK ((u32) (BIT(27) | BIT(28))) 835 #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_OFFSET 27 836 /* B29..B31 - Reserved */ 837 838 /* ASEL Capability field within HT Capabilities element */ 839 #define ASEL_CAP_ASEL_CAPABLE ((u8) BIT(0)) 840 #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1)) 841 #define ASEL_CAP_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2)) 842 #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3)) 843 #define ASEL_CAP_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4)) 844 #define ASEL_CAP_RX_AS_CAP ((u8) BIT(5)) 845 #define ASEL_CAP_TX_SOUNDING_PPDUS_CAP ((u8) BIT(6)) 846 /* B7 - Reserved */ 847 848 /* First octet of HT Operation Information within HT Operation element */ 849 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1)) 850 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0)) 851 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1)) 852 #define HT_INFO_HT_PARAM_STA_CHNL_WIDTH ((u8) BIT(2)) 853 #define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3)) 854 /* B4..B7 - Reserved */ 855 856 /* HT Protection (B8..B9 of HT Operation Information) */ 857 #define HT_PROT_NO_PROTECTION 0 858 #define HT_PROT_NONMEMBER_PROTECTION 1 859 #define HT_PROT_20MHZ_PROTECTION 2 860 #define HT_PROT_NON_HT_MIXED 3 861 /* Bits within ieee80211_ht_operation::operation_mode (BIT(0) maps to B8 in 862 * HT Operation Information) */ 863 #define HT_OPER_OP_MODE_HT_PROT_MASK ((u16) (BIT(0) | BIT(1))) /* B8..B9 */ 864 #define HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT ((u16) BIT(2)) /* B10 */ 865 /* BIT(3), i.e., B11 in HT Operation Information field - Reserved */ 866 #define HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT ((u16) BIT(4)) /* B12 */ 867 /* BIT(5)..BIT(15), i.e., B13..B23 - Reserved */ 868 869 /* Last two octets of HT Operation Information (BIT(0) = B24) */ 870 /* B24..B29 - Reserved */ 871 #define HT_OPER_PARAM_DUAL_BEACON ((u16) BIT(6)) 872 #define HT_OPER_PARAM_DUAL_CTS_PROTECTION ((u16) BIT(7)) 873 #define HT_OPER_PARAM_STBC_BEACON ((u16) BIT(8)) 874 #define HT_OPER_PARAM_LSIG_TXOP_PROT_FULL_SUPP ((u16) BIT(9)) 875 #define HT_OPER_PARAM_PCO_ACTIVE ((u16) BIT(10)) 876 #define HT_OPER_PARAM_PCO_PHASE ((u16) BIT(11)) 877 /* B36..B39 - Reserved */ 878 879 #define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126 880 #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 881 882 /* VHT Defines */ 883 #define VHT_CAP_MAX_MPDU_LENGTH_7991 ((u32) BIT(0)) 884 #define VHT_CAP_MAX_MPDU_LENGTH_11454 ((u32) BIT(1)) 885 #define VHT_CAP_MAX_MPDU_LENGTH_MASK ((u32) BIT(0) | BIT(1)) 886 #define VHT_CAP_MAX_MPDU_LENGTH_MASK_SHIFT 0 887 #define VHT_CAP_SUPP_CHAN_WIDTH_160MHZ ((u32) BIT(2)) 888 #define VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ ((u32) BIT(3)) 889 #define VHT_CAP_SUPP_CHAN_WIDTH_MASK ((u32) BIT(2) | BIT(3)) 890 #define VHT_CAP_RXLDPC ((u32) BIT(4)) 891 #define VHT_CAP_SHORT_GI_80 ((u32) BIT(5)) 892 #define VHT_CAP_SHORT_GI_160 ((u32) BIT(6)) 893 #define VHT_CAP_TXSTBC ((u32) BIT(7)) 894 #define VHT_CAP_RXSTBC_1 ((u32) BIT(8)) 895 #define VHT_CAP_RXSTBC_2 ((u32) BIT(9)) 896 #define VHT_CAP_RXSTBC_3 ((u32) BIT(8) | BIT(9)) 897 #define VHT_CAP_RXSTBC_4 ((u32) BIT(10)) 898 #define VHT_CAP_RXSTBC_MASK ((u32) BIT(8) | BIT(9) | \ 899 BIT(10)) 900 #define VHT_CAP_RXSTBC_MASK_SHIFT 8 901 #define VHT_CAP_SU_BEAMFORMER_CAPABLE ((u32) BIT(11)) 902 #define VHT_CAP_SU_BEAMFORMEE_CAPABLE ((u32) BIT(12)) 903 #define VHT_CAP_BEAMFORMEE_STS_MAX ((u32) BIT(13) | \ 904 BIT(14) | BIT(15)) 905 #define VHT_CAP_BEAMFORMEE_STS_MAX_SHIFT 13 906 #define VHT_CAP_BEAMFORMEE_STS_OFFSET 13 907 #define VHT_CAP_SOUNDING_DIMENSION_MAX ((u32) BIT(16) | \ 908 BIT(17) | BIT(18)) 909 #define VHT_CAP_SOUNDING_DIMENSION_MAX_SHIFT 16 910 #define VHT_CAP_SOUNDING_DIMENSION_OFFSET 16 911 #define VHT_CAP_MU_BEAMFORMER_CAPABLE ((u32) BIT(19)) 912 #define VHT_CAP_MU_BEAMFORMEE_CAPABLE ((u32) BIT(20)) 913 #define VHT_CAP_VHT_TXOP_PS ((u32) BIT(21)) 914 #define VHT_CAP_HTC_VHT ((u32) BIT(22)) 915 916 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_1 ((u32) BIT(23)) 917 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_2 ((u32) BIT(24)) 918 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_3 ((u32) BIT(23) | BIT(24)) 919 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_4 ((u32) BIT(25)) 920 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_5 ((u32) BIT(23) | BIT(25)) 921 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_6 ((u32) BIT(24) | BIT(25)) 922 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX ((u32) BIT(23) | \ 923 BIT(24) | BIT(25)) 924 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX_SHIFT 23 925 #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB ((u32) BIT(27)) 926 #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27)) 927 #define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28)) 928 #define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29)) 929 930 #define VHT_OPMODE_CHANNEL_WIDTH_MASK ((u8) BIT(0) | BIT(1)) 931 #define VHT_OPMODE_CHANNEL_RxNSS_MASK ((u8) BIT(4) | BIT(5) | \ 932 BIT(6)) 933 #define VHT_OPMODE_NOTIF_RX_NSS_SHIFT 4 934 935 #define VHT_RX_NSS_MAX_STREAMS 8 936 937 /* VHT channel widths */ 938 #define VHT_CHANWIDTH_USE_HT 0 939 #define VHT_CHANWIDTH_80MHZ 1 940 #define VHT_CHANWIDTH_160MHZ 2 941 #define VHT_CHANWIDTH_80P80MHZ 3 942 943 #define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs) 944 * 00:50:F2 */ 945 #define WPA_IE_VENDOR_TYPE 0x0050f201 946 #define WMM_IE_VENDOR_TYPE 0x0050f202 947 #define WPS_IE_VENDOR_TYPE 0x0050f204 948 #define OUI_WFA 0x506f9a 949 #define P2P_IE_VENDOR_TYPE 0x506f9a09 950 #define WFD_IE_VENDOR_TYPE 0x506f9a0a 951 #define WFD_OUI_TYPE 10 952 #define HS20_IE_VENDOR_TYPE 0x506f9a10 953 #define OSEN_IE_VENDOR_TYPE 0x506f9a12 954 #define MBO_IE_VENDOR_TYPE 0x506f9a16 955 #define MBO_OUI_TYPE 22 956 957 #define WMM_OUI_TYPE 2 958 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0 959 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1 960 #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2 961 #define WMM_VERSION 1 962 963 #define WMM_ACTION_CODE_ADDTS_REQ 0 964 #define WMM_ACTION_CODE_ADDTS_RESP 1 965 #define WMM_ACTION_CODE_DELTS 2 966 967 #define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0 968 #define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1 969 /* 2 - Reserved */ 970 #define WMM_ADDTS_STATUS_REFUSED 3 971 /* 4-255 - Reserved */ 972 973 /* WMM TSPEC Direction Field Values */ 974 #define WMM_TSPEC_DIRECTION_UPLINK 0 975 #define WMM_TSPEC_DIRECTION_DOWNLINK 1 976 /* 2 - Reserved */ 977 #define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3 978 979 /* 980 * WMM Information Element (used in (Re)Association Request frames; may also be 981 * used in Beacon frames) 982 */ 983 struct wmm_information_element { 984 /* Element ID: 221 (0xdd); Length: 7 */ 985 /* required fields for WMM version 1 */ 986 u8 oui[3]; /* 00:50:f2 */ 987 u8 oui_type; /* 2 */ 988 u8 oui_subtype; /* 0 */ 989 u8 version; /* 1 for WMM version 1.0 */ 990 u8 qos_info; /* AP/STA specific QoS info */ 991 992 } STRUCT_PACKED; 993 994 #define WMM_QOSINFO_AP_UAPSD 0x80 995 996 #define WMM_QOSINFO_STA_AC_MASK 0x0f 997 #define WMM_QOSINFO_STA_SP_MASK 0x03 998 #define WMM_QOSINFO_STA_SP_SHIFT 5 999 1000 #define WMM_AC_AIFSN_MASK 0x0f 1001 #define WMM_AC_AIFNS_SHIFT 0 1002 #define WMM_AC_ACM 0x10 1003 #define WMM_AC_ACI_MASK 0x60 1004 #define WMM_AC_ACI_SHIFT 5 1005 1006 #define WMM_AC_ECWMIN_MASK 0x0f 1007 #define WMM_AC_ECWMIN_SHIFT 0 1008 #define WMM_AC_ECWMAX_MASK 0xf0 1009 #define WMM_AC_ECWMAX_SHIFT 4 1010 1011 struct wmm_ac_parameter { 1012 u8 aci_aifsn; /* AIFSN, ACM, ACI */ 1013 u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */ 1014 le16 txop_limit; 1015 } STRUCT_PACKED; 1016 1017 /* 1018 * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association 1019 * Response frmaes) 1020 */ 1021 struct wmm_parameter_element { 1022 /* Element ID: 221 (0xdd); Length: 24 */ 1023 /* required fields for WMM version 1 */ 1024 u8 oui[3]; /* 00:50:f2 */ 1025 u8 oui_type; /* 2 */ 1026 u8 oui_subtype; /* 1 */ 1027 u8 version; /* 1 for WMM version 1.0 */ 1028 u8 qos_info; /* AP/STA specific QoS info */ 1029 u8 reserved; /* 0 */ 1030 struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */ 1031 1032 } STRUCT_PACKED; 1033 1034 /* WMM TSPEC Element */ 1035 struct wmm_tspec_element { 1036 u8 eid; /* 221 = 0xdd */ 1037 u8 length; /* 6 + 55 = 61 */ 1038 u8 oui[3]; /* 00:50:f2 */ 1039 u8 oui_type; /* 2 */ 1040 u8 oui_subtype; /* 2 */ 1041 u8 version; /* 1 */ 1042 /* WMM TSPEC body (55 octets): */ 1043 u8 ts_info[3]; 1044 le16 nominal_msdu_size; 1045 le16 maximum_msdu_size; 1046 le32 minimum_service_interval; 1047 le32 maximum_service_interval; 1048 le32 inactivity_interval; 1049 le32 suspension_interval; 1050 le32 service_start_time; 1051 le32 minimum_data_rate; 1052 le32 mean_data_rate; 1053 le32 peak_data_rate; 1054 le32 maximum_burst_size; 1055 le32 delay_bound; 1056 le32 minimum_phy_rate; 1057 le16 surplus_bandwidth_allowance; 1058 le16 medium_time; 1059 } STRUCT_PACKED; 1060 1061 1062 /* Access Categories / ACI to AC coding */ 1063 enum wmm_ac { 1064 WMM_AC_BE = 0 /* Best Effort */, 1065 WMM_AC_BK = 1 /* Background */, 1066 WMM_AC_VI = 2 /* Video */, 1067 WMM_AC_VO = 3 /* Voice */, 1068 WMM_AC_NUM = 4 1069 }; 1070 1071 1072 #define HS20_INDICATION_OUI_TYPE 16 1073 #define HS20_ANQP_OUI_TYPE 17 1074 #define HS20_OSEN_OUI_TYPE 18 1075 #define HS20_STYPE_QUERY_LIST 1 1076 #define HS20_STYPE_CAPABILITY_LIST 2 1077 #define HS20_STYPE_OPERATOR_FRIENDLY_NAME 3 1078 #define HS20_STYPE_WAN_METRICS 4 1079 #define HS20_STYPE_CONNECTION_CAPABILITY 5 1080 #define HS20_STYPE_NAI_HOME_REALM_QUERY 6 1081 #define HS20_STYPE_OPERATING_CLASS 7 1082 #define HS20_STYPE_OSU_PROVIDERS_LIST 8 1083 #define HS20_STYPE_ICON_REQUEST 10 1084 #define HS20_STYPE_ICON_BINARY_FILE 11 1085 1086 #define HS20_DGAF_DISABLED 0x01 1087 #define HS20_PPS_MO_ID_PRESENT 0x02 1088 #define HS20_ANQP_DOMAIN_ID_PRESENT 0x04 1089 #define HS20_VERSION 0x10 /* Release 2 */ 1090 1091 /* WNM-Notification WFA vendors specific subtypes */ 1092 #define HS20_WNM_SUB_REM_NEEDED 0 1093 #define HS20_WNM_DEAUTH_IMMINENT_NOTICE 1 1094 1095 #define HS20_DEAUTH_REASON_CODE_BSS 0 1096 #define HS20_DEAUTH_REASON_CODE_ESS 1 1097 1098 /* MBO v0.0_r19, 4.2: MBO Attributes */ 1099 /* Table 4-5: MBO Attributes */ 1100 enum mbo_attr_id { 1101 MBO_ATTR_ID_AP_CAPA_IND = 1, 1102 MBO_ATTR_ID_NON_PREF_CHAN_REPORT = 2, 1103 MBO_ATTR_ID_CELL_DATA_CAPA = 3, 1104 MBO_ATTR_ID_ASSOC_DISALLOW = 4, 1105 MBO_ATTR_ID_CELL_DATA_PREF = 5, 1106 MBO_ATTR_ID_TRANSITION_REASON = 6, 1107 MBO_ATTR_ID_TRANSITION_REJECT_REASON = 7, 1108 MBO_ATTR_ID_ASSOC_RETRY_DELAY = 8, 1109 }; 1110 1111 /* MBO v0.0_r19, 4.2.1: MBO AP Capability Indication Attribute */ 1112 /* Table 4-7: MBO AP Capability Indication Field Values */ 1113 #define MBO_AP_CAPA_CELL_AWARE BIT(6) 1114 1115 /* MBO v0.0_r19, 4.2.2: Non-preferred Channel Report Attribute */ 1116 /* Table 4-10: Reason Code Field Values */ 1117 enum mbo_non_pref_chan_reason { 1118 MBO_NON_PREF_CHAN_REASON_UNSPECIFIED = 0, 1119 MBO_NON_PREF_CHAN_REASON_RSSI = 1, 1120 MBO_NON_PREF_CHAN_REASON_EXT_INTERFERENCE = 2, 1121 MBO_NON_PREF_CHAN_REASON_INT_INTERFERENCE = 3, 1122 }; 1123 1124 /* MBO v0.0_r19, 4.2.3: Cellular Data Capabilities Attribute */ 1125 /* Table 4-13: Cellular Data Connectivity Field */ 1126 enum mbo_cellular_capa { 1127 MBO_CELL_CAPA_AVAILABLE = 1, 1128 MBO_CELL_CAPA_NOT_AVAILABLE = 2, 1129 MBO_CELL_CAPA_NOT_SUPPORTED = 3, 1130 }; 1131 1132 /* MBO v0.0_r19, 4.2.4: Association Disallowed Attribute */ 1133 /* Table 4-15: Reason Code Field Values */ 1134 enum mbo_assoc_disallow_reason { 1135 MBO_ASSOC_DISALLOW_REASON_UNSPECIFIED = 1, 1136 MBO_ASSOC_DISALLOW_REASON_MAX_STA = 2, 1137 MBO_ASSOC_DISALLOW_REASON_AIR_INTERFERENCE = 3, 1138 MBO_ASSOC_DISALLOW_REASON_AUTH_SERVER_OVERLOAD = 4, 1139 MBO_ASSOC_DISALLOW_REASON_LOW_RSSI = 5, 1140 }; 1141 1142 /* MBO v0.0_r19, 4.2.5: Cellular Data Connection Preference Attribute */ 1143 /* Table 4-17: Cellular Preference Field Values */ 1144 enum mbo_cell_pref { 1145 MBO_CELL_PREF_EXCLUDED = 0, 1146 MBO_CELL_PREF_NO_USE = 1, 1147 MBO_CELL_PREF_USE = 255 1148 }; 1149 1150 /* MBO v0.0_r19, 4.2.6: Transition Reason Code Attribute */ 1151 /* Table 4-19: Transition Reason Code Field Values */ 1152 enum mbo_transition_reason { 1153 MBO_TRANSITION_REASON_UNSPECIFIED = 0, 1154 MBO_TRANSITION_REASON_FRAME_LOSS = 1, 1155 MBO_TRANSITION_REASON_DELAY = 2, 1156 MBO_TRANSITION_REASON_BANDWIDTH = 3, 1157 MBO_TRANSITION_REASON_LOAD_BALANCE = 4, 1158 MBO_TRANSITION_REASON_RSSI = 5, 1159 MBO_TRANSITION_REASON_RETRANSMISSIONS = 6, 1160 MBO_TRANSITION_REASON_INTERFERENCE = 7, 1161 MBO_TRANSITION_REASON_GRAY_ZONE = 8, 1162 MBO_TRANSITION_REASON_PREMIUM_AP = 9, 1163 }; 1164 1165 /* MBO v0.0_r19, 4.2.7: Transition Rejection Reason Code Attribute */ 1166 /* Table 4-21: Transition Rejection Reason Code Field Values */ 1167 enum mbo_transition_reject_reason { 1168 MBO_TRANSITION_REJECT_REASON_UNSPECIFIED = 0, 1169 MBO_TRANSITION_REJECT_REASON_FRAME_LOSS = 1, 1170 MBO_TRANSITION_REJECT_REASON_DELAY = 2, 1171 MBO_TRANSITION_REJECT_REASON_QOS_CAPACITY = 3, 1172 MBO_TRANSITION_REJECT_REASON_RSSI = 4, 1173 MBO_TRANSITION_REJECT_REASON_INTERFERENCE = 5, 1174 MBO_TRANSITION_REJECT_REASON_SERVICES = 6, 1175 }; 1176 1177 /* MBO v0.0_r19, 4.4: WNM-Notification vendor subelements */ 1178 enum wfa_wnm_notif_subelem_id { 1179 WFA_WNM_NOTIF_SUBELEM_NON_PREF_CHAN_REPORT = 2, 1180 WFA_WNM_NOTIF_SUBELEM_CELL_DATA_CAPA = 3, 1181 }; 1182 1183 /* MBO v0.0_r25, 4.3: MBO ANQP-elements */ 1184 #define MBO_ANQP_OUI_TYPE 0x12 1185 #define MBO_ANQP_SUBTYPE_CELL_CONN_PREF 1 1186 1187 /* Wi-Fi Direct (P2P) */ 1188 1189 #define P2P_OUI_TYPE 9 1190 1191 enum p2p_attr_id { 1192 P2P_ATTR_STATUS = 0, 1193 P2P_ATTR_MINOR_REASON_CODE = 1, 1194 P2P_ATTR_CAPABILITY = 2, 1195 P2P_ATTR_DEVICE_ID = 3, 1196 P2P_ATTR_GROUP_OWNER_INTENT = 4, 1197 P2P_ATTR_CONFIGURATION_TIMEOUT = 5, 1198 P2P_ATTR_LISTEN_CHANNEL = 6, 1199 P2P_ATTR_GROUP_BSSID = 7, 1200 P2P_ATTR_EXT_LISTEN_TIMING = 8, 1201 P2P_ATTR_INTENDED_INTERFACE_ADDR = 9, 1202 P2P_ATTR_MANAGEABILITY = 10, 1203 P2P_ATTR_CHANNEL_LIST = 11, 1204 P2P_ATTR_NOTICE_OF_ABSENCE = 12, 1205 P2P_ATTR_DEVICE_INFO = 13, 1206 P2P_ATTR_GROUP_INFO = 14, 1207 P2P_ATTR_GROUP_ID = 15, 1208 P2P_ATTR_INTERFACE = 16, 1209 P2P_ATTR_OPERATING_CHANNEL = 17, 1210 P2P_ATTR_INVITATION_FLAGS = 18, 1211 P2P_ATTR_OOB_GO_NEG_CHANNEL = 19, 1212 P2P_ATTR_SERVICE_HASH = 21, 1213 P2P_ATTR_SESSION_INFORMATION_DATA = 22, 1214 P2P_ATTR_CONNECTION_CAPABILITY = 23, 1215 P2P_ATTR_ADVERTISEMENT_ID = 24, 1216 P2P_ATTR_ADVERTISED_SERVICE = 25, 1217 P2P_ATTR_SESSION_ID = 26, 1218 P2P_ATTR_FEATURE_CAPABILITY = 27, 1219 P2P_ATTR_PERSISTENT_GROUP = 28, 1220 P2P_ATTR_VENDOR_SPECIFIC = 221 1221 }; 1222 1223 #define P2P_MAX_GO_INTENT 15 1224 1225 /* P2P Capability - Device Capability bitmap */ 1226 #define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0) 1227 #define P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY BIT(1) 1228 #define P2P_DEV_CAPAB_CONCURRENT_OPER BIT(2) 1229 #define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3) 1230 #define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4) 1231 #define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5) 1232 1233 /* P2P Capability - Group Capability bitmap */ 1234 #define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0) 1235 #define P2P_GROUP_CAPAB_PERSISTENT_GROUP BIT(1) 1236 #define P2P_GROUP_CAPAB_GROUP_LIMIT BIT(2) 1237 #define P2P_GROUP_CAPAB_INTRA_BSS_DIST BIT(3) 1238 #define P2P_GROUP_CAPAB_CROSS_CONN BIT(4) 1239 #define P2P_GROUP_CAPAB_PERSISTENT_RECONN BIT(5) 1240 #define P2P_GROUP_CAPAB_GROUP_FORMATION BIT(6) 1241 #define P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION BIT(7) 1242 1243 /* P2PS Coordination Protocol Transport Bitmap */ 1244 #define P2PS_FEATURE_CAPAB_UDP_TRANSPORT BIT(0) 1245 #define P2PS_FEATURE_CAPAB_MAC_TRANSPORT BIT(1) 1246 1247 struct p2ps_feature_capab { 1248 u8 cpt; 1249 u8 reserved; 1250 } STRUCT_PACKED; 1251 1252 /* Invitation Flags */ 1253 #define P2P_INVITATION_FLAGS_TYPE BIT(0) 1254 1255 /* P2P Manageability */ 1256 #define P2P_MAN_DEVICE_MANAGEMENT BIT(0) 1257 #define P2P_MAN_CROSS_CONNECTION_PERMITTED BIT(1) 1258 #define P2P_MAN_COEXISTENCE_OPTIONAL BIT(2) 1259 1260 enum p2p_status_code { 1261 P2P_SC_SUCCESS = 0, 1262 P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1, 1263 P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2, 1264 P2P_SC_FAIL_LIMIT_REACHED = 3, 1265 P2P_SC_FAIL_INVALID_PARAMS = 4, 1266 P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5, 1267 P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6, 1268 P2P_SC_FAIL_NO_COMMON_CHANNELS = 7, 1269 P2P_SC_FAIL_UNKNOWN_GROUP = 8, 1270 P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9, 1271 P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10, 1272 P2P_SC_FAIL_REJECTED_BY_USER = 11, 1273 P2P_SC_SUCCESS_DEFERRED = 12, 1274 }; 1275 1276 enum p2p_role_indication { 1277 P2P_DEVICE_NOT_IN_GROUP = 0x00, 1278 P2P_CLIENT_IN_A_GROUP = 0x01, 1279 P2P_GO_IN_A_GROUP = 0x02, 1280 }; 1281 1282 #define P2P_WILDCARD_SSID "DIRECT-" 1283 #define P2P_WILDCARD_SSID_LEN 7 1284 1285 /* P2P action frames */ 1286 enum p2p_act_frame_type { 1287 P2P_NOA = 0, 1288 P2P_PRESENCE_REQ = 1, 1289 P2P_PRESENCE_RESP = 2, 1290 P2P_GO_DISC_REQ = 3 1291 }; 1292 1293 /* P2P public action frames */ 1294 enum p2p_action_frame_type { 1295 P2P_GO_NEG_REQ = 0, 1296 P2P_GO_NEG_RESP = 1, 1297 P2P_GO_NEG_CONF = 2, 1298 P2P_INVITATION_REQ = 3, 1299 P2P_INVITATION_RESP = 4, 1300 P2P_DEV_DISC_REQ = 5, 1301 P2P_DEV_DISC_RESP = 6, 1302 P2P_PROV_DISC_REQ = 7, 1303 P2P_PROV_DISC_RESP = 8 1304 }; 1305 1306 enum p2p_service_protocol_type { 1307 P2P_SERV_ALL_SERVICES = 0, 1308 P2P_SERV_BONJOUR = 1, 1309 P2P_SERV_UPNP = 2, 1310 P2P_SERV_WS_DISCOVERY = 3, 1311 P2P_SERV_WIFI_DISPLAY = 4, 1312 P2P_SERV_P2PS = 11, 1313 P2P_SERV_VENDOR_SPECIFIC = 255 1314 }; 1315 1316 enum p2p_sd_status { 1317 P2P_SD_SUCCESS = 0, 1318 P2P_SD_PROTO_NOT_AVAILABLE = 1, 1319 P2P_SD_REQUESTED_INFO_NOT_AVAILABLE = 2, 1320 P2P_SD_BAD_REQUEST = 3 1321 }; 1322 1323 1324 enum wifi_display_subelem { 1325 WFD_SUBELEM_DEVICE_INFO = 0, 1326 WFD_SUBELEM_ASSOCIATED_BSSID = 1, 1327 WFD_SUBELEM_AUDIO_FORMATS = 2, 1328 WFD_SUBELEM_VIDEO_FORMATS = 3, 1329 WFD_SUBELEM_3D_VIDEO_FORMATS = 4, 1330 WFD_SUBELEM_CONTENT_PROTECTION = 5, 1331 WFD_SUBELEM_COUPLED_SINK = 6, 1332 WFD_SUBELEM_EXT_CAPAB = 7, 1333 WFD_SUBELEM_LOCAL_IP_ADDRESS = 8, 1334 WFD_SUBELEM_SESSION_INFO = 9 1335 }; 1336 1337 /* 802.11s */ 1338 #define MESH_SYNC_METHOD_NEIGHBOR_OFFSET 1 1339 #define MESH_SYNC_METHOD_VENDOR 255 1340 #define MESH_PATH_PROTOCOL_HWMP 1 1341 #define MESH_PATH_PROTOCOL_VENDOR 255 1342 #define MESH_PATH_METRIC_AIRTIME 1 1343 #define MESH_PATH_METRIC_VENDOR 255 1344 /* IEEE 802.11s - Mesh Capability */ 1345 #define MESH_CAP_ACCEPT_ADDITIONAL_PEER BIT(0) 1346 #define MESH_CAP_MCCA_SUPPORTED BIT(1) 1347 #define MESH_CAP_MCCA_ENABLED BIT(2) 1348 #define MESH_CAP_FORWARDING BIT(3) 1349 #define MESH_CAP_MBCA_ENABLED BIT(4) 1350 #define MESH_CAP_TBTT_ADJUSTING BIT(5) 1351 #define MESH_CAP_MESH_PS_LEVEL BIT(6) 1352 1353 enum plink_action_field { 1354 PLINK_OPEN = 1, 1355 PLINK_CONFIRM, 1356 PLINK_CLOSE 1357 }; 1358 1359 #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */ 1360 #define VENDOR_VHT_TYPE 0x04 1361 #define VENDOR_VHT_SUBTYPE 0x08 1362 #define VENDOR_VHT_SUBTYPE2 0x00 1363 1364 #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */ 1365 1366 /* cipher suite selectors */ 1367 #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 1368 #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 1369 #define WLAN_CIPHER_SUITE_TKIP 0x000FAC02 1370 /* reserved: 0x000FAC03 */ 1371 #define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 1372 #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 1373 #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 1374 #define WLAN_CIPHER_SUITE_NO_GROUP_ADDR 0x000FAC07 1375 #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 1376 #define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09 1377 #define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A 1378 #define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B 1379 #define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C 1380 #define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D 1381 1382 #define WLAN_CIPHER_SUITE_SMS4 0x00147201 1383 1384 #define WLAN_CIPHER_SUITE_CKIP 0x00409600 1385 #define WLAN_CIPHER_SUITE_CKIP_CMIC 0x00409601 1386 #define WLAN_CIPHER_SUITE_CMIC 0x00409602 1387 #define WLAN_CIPHER_SUITE_KRK 0x004096FF /* for nl80211 use only */ 1388 1389 /* AKM suite selectors */ 1390 #define WLAN_AKM_SUITE_8021X 0x000FAC01 1391 #define WLAN_AKM_SUITE_PSK 0x000FAC02 1392 #define WLAN_AKM_SUITE_FT_8021X 0x000FAC03 1393 #define WLAN_AKM_SUITE_FT_PSK 0x000FAC04 1394 #define WLAN_AKM_SUITE_8021X_SHA256 0x000FAC05 1395 #define WLAN_AKM_SUITE_PSK_SHA256 0x000FAC06 1396 #define WLAN_AKM_SUITE_8021X_SUITE_B 0x000FAC11 1397 #define WLAN_AKM_SUITE_8021X_SUITE_B_192 0x000FAC12 1398 #define WLAN_AKM_SUITE_CCKM 0x00409600 1399 #define WLAN_AKM_SUITE_OSEN 0x506f9a01 1400 1401 1402 /* IEEE 802.11v - WNM Action field values */ 1403 enum wnm_action { 1404 WNM_EVENT_REQ = 0, 1405 WNM_EVENT_REPORT = 1, 1406 WNM_DIAGNOSTIC_REQ = 2, 1407 WNM_DIAGNOSTIC_REPORT = 3, 1408 WNM_LOCATION_CFG_REQ = 4, 1409 WNM_LOCATION_CFG_RESP = 5, 1410 WNM_BSS_TRANS_MGMT_QUERY = 6, 1411 WNM_BSS_TRANS_MGMT_REQ = 7, 1412 WNM_BSS_TRANS_MGMT_RESP = 8, 1413 WNM_FMS_REQ = 9, 1414 WNM_FMS_RESP = 10, 1415 WNM_COLLOCATED_INTERFERENCE_REQ = 11, 1416 WNM_COLLOCATED_INTERFERENCE_REPORT = 12, 1417 WNM_TFS_REQ = 13, 1418 WNM_TFS_RESP = 14, 1419 WNM_TFS_NOTIFY = 15, 1420 WNM_SLEEP_MODE_REQ = 16, 1421 WNM_SLEEP_MODE_RESP = 17, 1422 WNM_TIM_BROADCAST_REQ = 18, 1423 WNM_TIM_BROADCAST_RESP = 19, 1424 WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20, 1425 WNM_CHANNEL_USAGE_REQ = 21, 1426 WNM_CHANNEL_USAGE_RESP = 22, 1427 WNM_DMS_REQ = 23, 1428 WNM_DMS_RESP = 24, 1429 WNM_TIMING_MEASUREMENT_REQ = 25, 1430 WNM_NOTIFICATION_REQ = 26, 1431 WNM_NOTIFICATION_RESP = 27 1432 }; 1433 1434 /* IEEE 802.11v - BSS Transition Management Request - Request Mode */ 1435 #define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0) 1436 #define WNM_BSS_TM_REQ_ABRIDGED BIT(1) 1437 #define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2) 1438 #define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3) 1439 #define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4) 1440 1441 /* IEEE Std 802.11-2012 - Table 8-253 */ 1442 enum bss_trans_mgmt_status_code { 1443 WNM_BSS_TM_ACCEPT = 0, 1444 WNM_BSS_TM_REJECT_UNSPECIFIED = 1, 1445 WNM_BSS_TM_REJECT_INSUFFICIENT_BEACON = 2, 1446 WNM_BSS_TM_REJECT_INSUFFICIENT_CAPABITY = 3, 1447 WNM_BSS_TM_REJECT_UNDESIRED = 4, 1448 WNM_BSS_TM_REJECT_DELAY_REQUEST = 5, 1449 WNM_BSS_TM_REJECT_STA_CANDIDATE_LIST_PROVIDED = 6, 1450 WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES = 7, 1451 WNM_BSS_TM_REJECT_LEAVING_ESS = 8 1452 }; 1453 1454 /* 1455 * IEEE P802.11-REVmc/D5.0 Table 9-150 - Optional subelement IDs for 1456 * neighbor report 1457 */ 1458 #define WNM_NEIGHBOR_TSF 1 1459 #define WNM_NEIGHBOR_CONDENSED_COUNTRY_STRING 2 1460 #define WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE 3 1461 #define WNM_NEIGHBOR_BSS_TERMINATION_DURATION 4 1462 #define WNM_NEIGHBOR_BEARING 5 1463 #define WNM_NEIGHBOR_WIDE_BW_CHAN 6 1464 #define WNM_NEIGHBOR_MEASUREMENT_REPORT 39 1465 #define WNM_NEIGHBOR_HT_CAPAB 45 1466 #define WNM_NEIGHBOR_HT_OPER 61 1467 #define WNM_NEIGHBOR_SEC_CHAN_OFFSET 62 1468 #define WNM_NEIGHBOR_MEASUREMENT_PILOT 66 1469 #define WNM_NEIGHBOR_RRM_ENABLED_CAPABILITIES 70 1470 #define WNM_NEIGHBOR_MULTIPLE_BSSID 71 1471 #define WNM_NEIGHBOR_VHT_CAPAB 191 1472 #define WNM_NEIGHBOR_VHT_OPER 192 1473 1474 /* QoS action */ 1475 enum qos_action { 1476 QOS_ADDTS_REQ = 0, 1477 QOS_ADDTS_RESP = 1, 1478 QOS_DELTS = 2, 1479 QOS_SCHEDULE = 3, 1480 QOS_QOS_MAP_CONFIG = 4, 1481 }; 1482 1483 /* IEEE Std 802.11-2012, 8.4.2.62 20/40 BSS Coexistence element */ 1484 #define WLAN_20_40_BSS_COEX_INFO_REQ BIT(0) 1485 #define WLAN_20_40_BSS_COEX_40MHZ_INTOL BIT(1) 1486 #define WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ BIT(2) 1487 #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ BIT(3) 1488 #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_GRNT BIT(4) 1489 1490 struct ieee80211_2040_bss_coex_ie { 1491 u8 element_id; 1492 u8 length; 1493 u8 coex_param; 1494 } STRUCT_PACKED; 1495 1496 struct ieee80211_2040_intol_chan_report { 1497 u8 element_id; 1498 u8 length; 1499 u8 op_class; 1500 u8 variable[0]; /* Channel List */ 1501 } STRUCT_PACKED; 1502 1503 /* IEEE 802.11v - WNM-Sleep Mode element */ 1504 struct wnm_sleep_element { 1505 u8 eid; /* WLAN_EID_WNMSLEEP */ 1506 u8 len; 1507 u8 action_type; /* WNM_SLEEP_ENTER/WNM_SLEEP_MODE_EXIT */ 1508 u8 status; 1509 le16 intval; 1510 } STRUCT_PACKED; 1511 1512 #define WNM_SLEEP_MODE_ENTER 0 1513 #define WNM_SLEEP_MODE_EXIT 1 1514 1515 enum wnm_sleep_mode_response_status { 1516 WNM_STATUS_SLEEP_ACCEPT = 0, 1517 WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE = 1, 1518 WNM_STATUS_DENIED_ACTION = 2, 1519 WNM_STATUS_DENIED_TMP = 3, 1520 WNM_STATUS_DENIED_KEY = 4, 1521 WNM_STATUS_DENIED_OTHER_WNM_SERVICE = 5 1522 }; 1523 1524 /* WNM-Sleep Mode subelement IDs */ 1525 enum wnm_sleep_mode_subelement_id { 1526 WNM_SLEEP_SUBELEM_GTK = 0, 1527 WNM_SLEEP_SUBELEM_IGTK = 1 1528 }; 1529 1530 /* Channel Switch modes (802.11h) */ 1531 #define CHAN_SWITCH_MODE_ALLOW_TX 0 1532 #define CHAN_SWITCH_MODE_BLOCK_TX 1 1533 1534 struct tpc_report { 1535 u8 eid; 1536 u8 len; 1537 u8 tx_power; 1538 u8 link_margin; 1539 } STRUCT_PACKED; 1540 1541 #define RRM_CAPABILITIES_IE_LEN 5 1542 1543 /* IEEE Std 802.11-2012, 8.5.7.4 - Link Measurement Request frame format */ 1544 struct rrm_link_measurement_request { 1545 u8 dialog_token; 1546 s8 tx_power; 1547 s8 max_tp; 1548 u8 variable[0]; 1549 } STRUCT_PACKED; 1550 1551 /* IEEE Std 802.11-2012, 8.5.7.5 - Link Measurement Report frame format */ 1552 struct rrm_link_measurement_report { 1553 u8 dialog_token; 1554 struct tpc_report tpc; 1555 u8 rx_ant_id; 1556 u8 tx_ant_id; 1557 u8 rcpi; 1558 u8 rsni; 1559 u8 variable[0]; 1560 } STRUCT_PACKED; 1561 1562 /* IEEE Std 802.11ad-2012 - Multi-band element */ 1563 struct multi_band_ie { 1564 u8 eid; /* WLAN_EID_MULTI_BAND */ 1565 u8 len; 1566 u8 mb_ctrl; 1567 u8 band_id; 1568 u8 op_class; 1569 u8 chan; 1570 u8 bssid[ETH_ALEN]; 1571 le16 beacon_int; 1572 u8 tsf_offs[8]; 1573 u8 mb_connection_capability; 1574 u8 fst_session_tmout; 1575 /* Optional: 1576 * STA MAC Address 1577 * Pairwise Cipher Suite Count 1578 * Pairwise Cipher Suite List 1579 */ 1580 u8 variable[0]; 1581 } STRUCT_PACKED; 1582 1583 enum mb_ctrl_sta_role { 1584 MB_STA_ROLE_AP = 0, 1585 MB_STA_ROLE_TDLS_STA = 1, 1586 MB_STA_ROLE_IBSS_STA = 2, 1587 MB_STA_ROLE_PCP = 3, 1588 MB_STA_ROLE_NON_PCP_NON_AP = 4 1589 }; 1590 1591 #define MB_CTRL_ROLE_MASK (BIT(0) | BIT(1) | BIT(2)) 1592 #define MB_CTRL_ROLE(ctrl) ((u8) ((ctrl) & MB_CTRL_ROLE_MASK)) 1593 #define MB_CTRL_STA_MAC_PRESENT ((u8) (BIT(3))) 1594 #define MB_CTRL_PAIRWISE_CIPHER_SUITE_PRESENT ((u8) (BIT(4))) 1595 1596 enum mb_band_id { 1597 MB_BAND_ID_WIFI_2_4GHZ = 2, /* 2.4 GHz */ 1598 MB_BAND_ID_WIFI_5GHZ = 4, /* 4.9 and 5 GHz */ 1599 MB_BAND_ID_WIFI_60GHZ = 5, /* 60 GHz */ 1600 }; 1601 1602 #define MB_CONNECTION_CAPABILITY_AP ((u8) (BIT(0))) 1603 #define MB_CONNECTION_CAPABILITY_PCP ((u8) (BIT(1))) 1604 #define MB_CONNECTION_CAPABILITY_DLS ((u8) (BIT(2))) 1605 #define MB_CONNECTION_CAPABILITY_TDLS ((u8) (BIT(3))) 1606 #define MB_CONNECTION_CAPABILITY_IBSS ((u8) (BIT(4))) 1607 1608 /* IEEE Std 802.11ad-2014 - FST Action field */ 1609 enum fst_action { 1610 FST_ACTION_SETUP_REQUEST = 0, 1611 FST_ACTION_SETUP_RESPONSE = 1, 1612 FST_ACTION_TEAR_DOWN = 2, 1613 FST_ACTION_ACK_REQUEST = 3, 1614 FST_ACTION_ACK_RESPONSE = 4, 1615 FST_ACTION_ON_CHANNEL_TUNNEL = 5, 1616 }; 1617 1618 /* IEEE Std 802.11ac-2013, Annex C - dot11PHYType */ 1619 enum phy_type { 1620 PHY_TYPE_UNSPECIFIED = 0, 1621 PHY_TYPE_FHSS = 1, 1622 PHY_TYPE_DSSS = 2, 1623 PHY_TYPE_IRBASEBAND = 3, 1624 PHY_TYPE_OFDM = 4, 1625 PHY_TYPE_HRDSSS = 5, 1626 PHY_TYPE_ERP = 6, 1627 PHY_TYPE_HT = 7, 1628 PHY_TYPE_DMG = 8, 1629 PHY_TYPE_VHT = 9, 1630 }; 1631 1632 /* IEEE P802.11-REVmc/D5.0, 9.4.2.37 - Neighbor Report element */ 1633 /* BSSID Information Field */ 1634 #define NEI_REP_BSSID_INFO_AP_NOT_REACH BIT(0) 1635 #define NEI_REP_BSSID_INFO_AP_UNKNOWN_REACH BIT(1) 1636 #define NEI_REP_BSSID_INFO_AP_REACHABLE (BIT(0) | BIT(1)) 1637 #define NEI_REP_BSSID_INFO_SECURITY BIT(2) 1638 #define NEI_REP_BSSID_INFO_KEY_SCOPE BIT(3) 1639 #define NEI_REP_BSSID_INFO_SPECTRUM_MGMT BIT(4) 1640 #define NEI_REP_BSSID_INFO_QOS BIT(5) 1641 #define NEI_REP_BSSID_INFO_APSD BIT(6) 1642 #define NEI_REP_BSSID_INFO_RM BIT(7) 1643 #define NEI_REP_BSSID_INFO_DELAYED_BA BIT(8) 1644 #define NEI_REP_BSSID_INFO_IMM_BA BIT(9) 1645 #define NEI_REP_BSSID_INFO_MOBILITY_DOMAIN BIT(10) 1646 #define NEI_REP_BSSID_INFO_HT BIT(11) 1647 #define NEI_REP_BSSID_INFO_VHT BIT(12) 1648 #define NEI_REP_BSSID_INFO_FTM BIT(13) 1649 1650 /* 1651 * IEEE P802.11-REVmc/D5.0 Table 9-152 - HT/VHT Operation Information 1652 * subfields. 1653 * Note: These definitions are not the same as other VHT_CHANWIDTH_*. 1654 */ 1655 enum nr_chan_width { 1656 NR_CHAN_WIDTH_20 = 0, 1657 NR_CHAN_WIDTH_40 = 1, 1658 NR_CHAN_WIDTH_80 = 2, 1659 NR_CHAN_WIDTH_160 = 3, 1660 NR_CHAN_WIDTH_80P80 = 4, 1661 }; 1662 1663 #endif /* IEEE802_11_DEFS_H */ 1664