1 /* 2 * IEEE 802.11 Frame type definitions 3 * Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi> 4 * Copyright (c) 2007-2008 Intel Corporation 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. 9 * 10 * Alternatively, this software may be distributed under the terms of BSD 11 * license. 12 * 13 * See README and COPYING for more details. 14 */ 15 16 #ifndef IEEE802_11_DEFS_H 17 #define IEEE802_11_DEFS_H 18 19 /* IEEE 802.11 defines */ 20 21 #define WLAN_FC_PVER 0x0003 22 #define WLAN_FC_TODS 0x0100 23 #define WLAN_FC_FROMDS 0x0200 24 #define WLAN_FC_MOREFRAG 0x0400 25 #define WLAN_FC_RETRY 0x0800 26 #define WLAN_FC_PWRMGT 0x1000 27 #define WLAN_FC_MOREDATA 0x2000 28 #define WLAN_FC_ISWEP 0x4000 29 #define WLAN_FC_ORDER 0x8000 30 31 #define WLAN_FC_GET_TYPE(fc) (((fc) & 0x000c) >> 2) 32 #define WLAN_FC_GET_STYPE(fc) (((fc) & 0x00f0) >> 4) 33 34 #define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0))) 35 #define WLAN_GET_SEQ_SEQ(seq) \ 36 (((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4) 37 38 #define WLAN_FC_TYPE_MGMT 0 39 #define WLAN_FC_TYPE_CTRL 1 40 #define WLAN_FC_TYPE_DATA 2 41 42 /* management */ 43 #define WLAN_FC_STYPE_ASSOC_REQ 0 44 #define WLAN_FC_STYPE_ASSOC_RESP 1 45 #define WLAN_FC_STYPE_REASSOC_REQ 2 46 #define WLAN_FC_STYPE_REASSOC_RESP 3 47 #define WLAN_FC_STYPE_PROBE_REQ 4 48 #define WLAN_FC_STYPE_PROBE_RESP 5 49 #define WLAN_FC_STYPE_BEACON 8 50 #define WLAN_FC_STYPE_ATIM 9 51 #define WLAN_FC_STYPE_DISASSOC 10 52 #define WLAN_FC_STYPE_AUTH 11 53 #define WLAN_FC_STYPE_DEAUTH 12 54 #define WLAN_FC_STYPE_ACTION 13 55 56 /* control */ 57 #define WLAN_FC_STYPE_PSPOLL 10 58 #define WLAN_FC_STYPE_RTS 11 59 #define WLAN_FC_STYPE_CTS 12 60 #define WLAN_FC_STYPE_ACK 13 61 #define WLAN_FC_STYPE_CFEND 14 62 #define WLAN_FC_STYPE_CFENDACK 15 63 64 /* data */ 65 #define WLAN_FC_STYPE_DATA 0 66 #define WLAN_FC_STYPE_DATA_CFACK 1 67 #define WLAN_FC_STYPE_DATA_CFPOLL 2 68 #define WLAN_FC_STYPE_DATA_CFACKPOLL 3 69 #define WLAN_FC_STYPE_NULLFUNC 4 70 #define WLAN_FC_STYPE_CFACK 5 71 #define WLAN_FC_STYPE_CFPOLL 6 72 #define WLAN_FC_STYPE_CFACKPOLL 7 73 #define WLAN_FC_STYPE_QOS_DATA 8 74 75 /* Authentication algorithms */ 76 #define WLAN_AUTH_OPEN 0 77 #define WLAN_AUTH_SHARED_KEY 1 78 #define WLAN_AUTH_FT 2 79 #define WLAN_AUTH_LEAP 128 80 81 #define WLAN_AUTH_CHALLENGE_LEN 128 82 83 #define WLAN_CAPABILITY_ESS BIT(0) 84 #define WLAN_CAPABILITY_IBSS BIT(1) 85 #define WLAN_CAPABILITY_CF_POLLABLE BIT(2) 86 #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3) 87 #define WLAN_CAPABILITY_PRIVACY BIT(4) 88 #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5) 89 #define WLAN_CAPABILITY_PBCC BIT(6) 90 #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7) 91 #define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8) 92 #define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10) 93 #define WLAN_CAPABILITY_DSSS_OFDM BIT(13) 94 95 /* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */ 96 #define WLAN_STATUS_SUCCESS 0 97 #define WLAN_STATUS_UNSPECIFIED_FAILURE 1 98 #define WLAN_STATUS_CAPS_UNSUPPORTED 10 99 #define WLAN_STATUS_REASSOC_NO_ASSOC 11 100 #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12 101 #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13 102 #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14 103 #define WLAN_STATUS_CHALLENGE_FAIL 15 104 #define WLAN_STATUS_AUTH_TIMEOUT 16 105 #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17 106 #define WLAN_STATUS_ASSOC_DENIED_RATES 18 107 /* IEEE 802.11b */ 108 #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19 109 #define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20 110 #define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21 111 /* IEEE 802.11h */ 112 #define WLAN_STATUS_SPEC_MGMT_REQUIRED 22 113 #define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23 114 #define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24 115 /* IEEE 802.11g */ 116 #define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25 117 #define WLAN_STATUS_ASSOC_DENIED_NO_ER_PBCC 26 118 #define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 27 119 /* IEEE 802.11w */ 120 #define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30 121 #define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31 122 /* IEEE 802.11i */ 123 #define WLAN_STATUS_INVALID_IE 40 124 #define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41 125 #define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42 126 #define WLAN_STATUS_AKMP_NOT_VALID 43 127 #define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44 128 #define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45 129 #define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46 130 #define WLAN_STATUS_TS_NOT_CREATED 47 131 #define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48 132 #define WLAN_STATUS_DEST_STA_NOT_PRESENT 49 133 #define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50 134 #define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51 135 /* IEEE 802.11r */ 136 #define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52 137 #define WLAN_STATUS_INVALID_PMKID 53 138 #define WLAN_STATUS_INVALID_MDIE 54 139 #define WLAN_STATUS_INVALID_FTIE 55 140 141 /* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */ 142 #define WLAN_REASON_UNSPECIFIED 1 143 #define WLAN_REASON_PREV_AUTH_NOT_VALID 2 144 #define WLAN_REASON_DEAUTH_LEAVING 3 145 #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4 146 #define WLAN_REASON_DISASSOC_AP_BUSY 5 147 #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 148 #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7 149 #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8 150 #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 151 /* IEEE 802.11h */ 152 #define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10 153 #define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11 154 /* IEEE 802.11i */ 155 #define WLAN_REASON_INVALID_IE 13 156 #define WLAN_REASON_MICHAEL_MIC_FAILURE 14 157 #define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15 158 #define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16 159 #define WLAN_REASON_IE_IN_4WAY_DIFFERS 17 160 #define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18 161 #define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19 162 #define WLAN_REASON_AKMP_NOT_VALID 20 163 #define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21 164 #define WLAN_REASON_INVALID_RSN_IE_CAPAB 22 165 #define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23 166 #define WLAN_REASON_CIPHER_SUITE_REJECTED 24 167 168 169 /* Information Element IDs */ 170 #define WLAN_EID_SSID 0 171 #define WLAN_EID_SUPP_RATES 1 172 #define WLAN_EID_FH_PARAMS 2 173 #define WLAN_EID_DS_PARAMS 3 174 #define WLAN_EID_CF_PARAMS 4 175 #define WLAN_EID_TIM 5 176 #define WLAN_EID_IBSS_PARAMS 6 177 #define WLAN_EID_COUNTRY 7 178 #define WLAN_EID_CHALLENGE 16 179 /* EIDs defined by IEEE 802.11h - START */ 180 #define WLAN_EID_PWR_CONSTRAINT 32 181 #define WLAN_EID_PWR_CAPABILITY 33 182 #define WLAN_EID_TPC_REQUEST 34 183 #define WLAN_EID_TPC_REPORT 35 184 #define WLAN_EID_SUPPORTED_CHANNELS 36 185 #define WLAN_EID_CHANNEL_SWITCH 37 186 #define WLAN_EID_MEASURE_REQUEST 38 187 #define WLAN_EID_MEASURE_REPORT 39 188 #define WLAN_EID_QUITE 40 189 #define WLAN_EID_IBSS_DFS 41 190 /* EIDs defined by IEEE 802.11h - END */ 191 #define WLAN_EID_ERP_INFO 42 192 #define WLAN_EID_HT_CAP 45 193 #define WLAN_EID_RSN 48 194 #define WLAN_EID_EXT_SUPP_RATES 50 195 #define WLAN_EID_MOBILITY_DOMAIN 54 196 #define WLAN_EID_FAST_BSS_TRANSITION 55 197 #define WLAN_EID_TIMEOUT_INTERVAL 56 198 #define WLAN_EID_RIC_DATA 57 199 #define WLAN_EID_HT_OPERATION 61 200 #define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62 201 #define WLAN_EID_20_40_BSS_COEXISTENCE 72 202 #define WLAN_EID_20_40_BSS_INTOLERANT 73 203 #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74 204 #define WLAN_EID_MMIE 76 205 #define WLAN_EID_VENDOR_SPECIFIC 221 206 207 208 /* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */ 209 #define WLAN_ACTION_SPECTRUM_MGMT 0 210 #define WLAN_ACTION_QOS 1 211 #define WLAN_ACTION_DLS 2 212 #define WLAN_ACTION_BLOCK_ACK 3 213 #define WLAN_ACTION_PUBLIC 4 214 #define WLAN_ACTION_RADIO_MEASUREMENT 5 215 #define WLAN_ACTION_FT 6 216 #define WLAN_ACTION_HT 7 217 #define WLAN_ACTION_SA_QUERY 8 218 #define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */ 219 220 /* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */ 221 #define WLAN_SA_QUERY_REQUEST 0 222 #define WLAN_SA_QUERY_RESPONSE 1 223 224 #define WLAN_SA_QUERY_TR_ID_LEN 2 225 226 /* Timeout Interval Type */ 227 #define WLAN_TIMEOUT_REASSOC_DEADLINE 1 228 #define WLAN_TIMEOUT_KEY_LIFETIME 2 229 #define WLAN_TIMEOUT_ASSOC_COMEBACK 3 230 231 232 #ifdef _MSC_VER 233 #pragma pack(push, 1) 234 #endif /* _MSC_VER */ 235 236 struct ieee80211_mgmt { 237 le16 frame_control; 238 le16 duration; 239 u8 da[6]; 240 u8 sa[6]; 241 u8 bssid[6]; 242 le16 seq_ctrl; 243 union { 244 struct { 245 le16 auth_alg; 246 le16 auth_transaction; 247 le16 status_code; 248 /* possibly followed by Challenge text */ 249 u8 variable[0]; 250 } STRUCT_PACKED auth; 251 struct { 252 le16 reason_code; 253 } STRUCT_PACKED deauth; 254 struct { 255 le16 capab_info; 256 le16 listen_interval; 257 /* followed by SSID and Supported rates */ 258 u8 variable[0]; 259 } STRUCT_PACKED assoc_req; 260 struct { 261 le16 capab_info; 262 le16 status_code; 263 le16 aid; 264 /* followed by Supported rates */ 265 u8 variable[0]; 266 } STRUCT_PACKED assoc_resp, reassoc_resp; 267 struct { 268 le16 capab_info; 269 le16 listen_interval; 270 u8 current_ap[6]; 271 /* followed by SSID and Supported rates */ 272 u8 variable[0]; 273 } STRUCT_PACKED reassoc_req; 274 struct { 275 le16 reason_code; 276 } STRUCT_PACKED disassoc; 277 struct { 278 u8 timestamp[8]; 279 le16 beacon_int; 280 le16 capab_info; 281 /* followed by some of SSID, Supported rates, 282 * FH Params, DS Params, CF Params, IBSS Params, TIM */ 283 u8 variable[0]; 284 } STRUCT_PACKED beacon; 285 struct { 286 /* only variable items: SSID, Supported rates */ 287 u8 variable[0]; 288 } STRUCT_PACKED probe_req; 289 struct { 290 u8 timestamp[8]; 291 le16 beacon_int; 292 le16 capab_info; 293 /* followed by some of SSID, Supported rates, 294 * FH Params, DS Params, CF Params, IBSS Params */ 295 u8 variable[0]; 296 } STRUCT_PACKED probe_resp; 297 struct { 298 u8 category; 299 union { 300 struct { 301 u8 action_code; 302 u8 dialog_token; 303 u8 status_code; 304 u8 variable[0]; 305 } STRUCT_PACKED wmm_action; 306 struct{ 307 u8 action_code; 308 u8 element_id; 309 u8 length; 310 u8 switch_mode; 311 u8 new_chan; 312 u8 switch_count; 313 } STRUCT_PACKED chan_switch; 314 struct { 315 u8 action; 316 u8 sta_addr[ETH_ALEN]; 317 u8 target_ap_addr[ETH_ALEN]; 318 u8 variable[0]; /* FT Request */ 319 } STRUCT_PACKED ft_action_req; 320 struct { 321 u8 action; 322 u8 sta_addr[ETH_ALEN]; 323 u8 target_ap_addr[ETH_ALEN]; 324 le16 status_code; 325 u8 variable[0]; /* FT Request */ 326 } STRUCT_PACKED ft_action_resp; 327 struct { 328 u8 action; 329 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 330 } STRUCT_PACKED sa_query_req; 331 struct { 332 u8 action; /* */ 333 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 334 } STRUCT_PACKED sa_query_resp; 335 } u; 336 } STRUCT_PACKED action; 337 } u; 338 } STRUCT_PACKED; 339 340 #ifdef _MSC_VER 341 #pragma pack(pop) 342 #endif /* _MSC_VER */ 343 344 #define ERP_INFO_NON_ERP_PRESENT BIT(0) 345 #define ERP_INFO_USE_PROTECTION BIT(1) 346 #define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2) 347 348 349 /* HT Capability element */ 350 351 enum { 352 MAX_RX_AMPDU_FACTOR_8KB = 0, 353 MAX_RX_AMPDU_FACTOR_16KB, 354 MAX_RX_AMPDU_FACTOR_32KB, 355 MAX_RX_AMPDU_FACTOR_64KB 356 }; 357 358 enum { 359 CALIBRATION_NOT_SUPPORTED = 0, 360 CALIBRATION_CANNOT_INIT, 361 CALIBRATION_CAN_INIT, 362 CALIBRATION_FULL_SUPPORT 363 }; 364 365 enum { 366 MCS_FEEDBACK_NOT_PROVIDED = 0, 367 MCS_FEEDBACK_UNSOLICITED, 368 MCS_FEEDBACK_MRQ_RESPONSE 369 }; 370 371 372 struct ieee80211_ht_capability { 373 le16 capabilities_info; 374 u8 mac_ht_params_info; 375 u8 supported_mcs_set[16]; 376 le16 extended_ht_capability_info; 377 le32 tx_BF_capability_info; 378 u8 antenna_selection_info; 379 } STRUCT_PACKED; 380 381 382 struct ieee80211_ht_operation { 383 u8 control_chan; 384 u8 ht_param; 385 le16 operation_mode; 386 le16 stbc_param; 387 u8 basic_set[16]; 388 } STRUCT_PACKED; 389 390 /* auxiliary bit manipulation macros FIXME: move it to common later... */ 391 #define SET_2BIT_U8(_ptr_, _shift_, _val_) \ 392 ((*(_ptr_) &= ~(3 << (_shift_))), \ 393 (*(_ptr_) |= (*(_ptr_) & (((u8)3) << (_shift_))) | \ 394 (((u8)(_val_) & 3) << _shift_))) 395 396 #define GET_2BIT_U8(_var_, _shift_) \ 397 (((_var_) & (((u8)3) << (_shift_))) >> (_shift_)) 398 399 #define SET_2BIT_LE16(_u16ptr_, _shift_, _val_) \ 400 ((*(_u16ptr_) &= ~(3 << (_shift_))), \ 401 (*(_u16ptr_) |= \ 402 (((*(_u16ptr_)) & (((u16)3) << ((u16)_shift_))) | \ 403 (((u16)(_val_) & (u16)3) << (u16)(_shift_))))) 404 405 #define GET_2BIT_LE16(_var_, _shift_) \ 406 (((_var_) & (((u16)3) << (_shift_))) >> (_shift_)) 407 408 #define SET_2BIT_LE32(_u32ptr_, _shift_, _val_) \ 409 ((*(_u32ptr_) &= ~(3 << (_shift_))), \ 410 (*(_u32ptr_) |= (((*(_u32ptr_)) & (((u32)3) << (_shift_))) | \ 411 (((u32)(_val_) & 3) << _shift_)))) 412 413 #define GET_2BIT_LE32(_var_, _shift_) \ 414 (((_var_) & (((u32)3) << (_shift_))) >> (_shift_)) 415 416 #define SET_3BIT_LE16(_u16ptr_, _shift_, _val_) \ 417 ((*(_u16ptr_) &= ~(7 << (_shift_))), \ 418 (*(_u16ptr_) |= (((*(_u16ptr_)) & (((u16)7) << (_shift_))) | \ 419 (((u16)(_val_) & 7) << _shift_)))) 420 421 #define GET_3BIT_LE16(_var_, _shift_) \ 422 (((_var_) & (((u16)7) << (_shift_))) >> (_shift_)) 423 424 #define SET_3BIT_LE32(_u32ptr_, _shift_, _val_) \ 425 ((*(_u32ptr_) &= ~(7 << (_shift_))), \ 426 (*(_u32ptr_) |= (((*(_u32ptr_)) & (((u32)7) << (_shift_))) | \ 427 (((u32)(_val_) & 7) << _shift_)))) 428 429 #define GET_3BIT_LE32(_var_, _shift_) \ 430 (((_var_) & (((u32)7) << (_shift_))) >> (_shift_)) 431 432 433 #define HT_CAP_INFO_LDPC_CODING_CAP ((u16) BIT(0)) 434 #define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET ((u16) BIT(1)) 435 #define HT_CAP_INFO_SMPS_MASK ((u16) (BIT(2) | BIT(3))) 436 #define HT_CAP_INFO_SMPS_STATIC ((u16) 0) 437 #define HT_CAP_INFO_SMPS_DYNAMIC ((u16) BIT(2)) 438 #define HT_CAP_INFO_SMPS_DISABLED ((u16) (BIT(2) | BIT(3))) 439 #define HT_CAP_INFO_GREEN_FIELD ((u16) BIT(4)) 440 #define HT_CAP_INFO_SHORT_GI20MHZ ((u16) BIT(5)) 441 #define HT_CAP_INFO_SHORT_GI40MHZ ((u16) BIT(6)) 442 #define HT_CAP_INFO_TX_STBC ((u16) BIT(7)) 443 #define HT_CAP_INFO_RX_STBC_MASK ((u16) (BIT(8) | BIT(9))) 444 #define HT_CAP_INFO_RX_STBC_1 ((u16) BIT(8)) 445 #define HT_CAP_INFO_RX_STBC_12 ((u16) BIT(9)) 446 #define HT_CAP_INFO_RX_STBC_123 ((u16) (BIT(8) | BIT(9))) 447 #define HT_CAP_INFO_DELAYED_BA ((u16) BIT(10)) 448 #define HT_CAP_INFO_MAX_AMSDU_SIZE ((u16) BIT(11)) 449 #define HT_CAP_INFO_DSSS_CCK40MHZ ((u16) BIT(12)) 450 #define HT_CAP_INFO_PSMP_SUPP ((u16) BIT(13)) 451 #define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14)) 452 #define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15)) 453 454 455 #define MAC_HT_PARAM_INFO_MAX_RX_AMPDU_FACTOR_OFFSET 0 456 #define MAC_HT_PARAM_INFO_MAX_MPDU_DENSITY_OFFSET 2 457 458 #define EXT_HT_CAP_INFO_PCO ((u16) BIT(0)) 459 #define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET 1 460 #define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET 8 461 #define EXT_HT_CAP_INFO_HTC_SUPPORTED ((u16) BIT(10)) 462 #define EXT_HT_CAP_INFO_RD_RESPONDER ((u16) BIT(11)) 463 464 465 #define TX_BEAMFORM_CAP_TXBF_CAP ((u32) BIT(0)) 466 #define TX_BEAMFORM_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1)) 467 #define TX_BEAMFORM_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2)) 468 #define TX_BEAMFORM_CAP_RX_ZLF_CAP ((u32) BIT(3)) 469 #define TX_BEAMFORM_CAP_TX_ZLF_CAP ((u32) BIT(4)) 470 #define TX_BEAMFORM_CAP_IMPLICIT_ZLF_CAP ((u32) BIT(5)) 471 #define TX_BEAMFORM_CAP_CALIB_OFFSET 6 472 #define TX_BEAMFORM_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8)) 473 #define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_CAP ((u32) BIT(9)) 474 #define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_CAP ((u32) BIT(10)) 475 #define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11 476 #define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13 477 #define TX_BEAMFORM_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15 478 #define TX_BEAMFORM_CAP_MINIMAL_GROUPING_OFFSET 17 479 #define TX_BEAMFORM_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19 480 #define TX_BEAMFORM_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21 481 #define TX_BEAMFORM_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23 482 #define TX_BEAMFORM_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25 483 484 485 #define ASEL_CAPABILITY_ASEL_CAPABLE ((u8) BIT(0)) 486 #define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1)) 487 #define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2)) 488 #define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3)) 489 #define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4)) 490 #define ASEL_CAPABILITY_RX_AS_CAP ((u8) BIT(5)) 491 #define ASEL_CAPABILITY_TX_SOUND_PPDUS_CAP ((u8) BIT(6)) 492 493 494 struct ht_cap_ie { 495 u8 id; 496 u8 length; 497 struct ieee80211_ht_capability data; 498 } STRUCT_PACKED; 499 500 501 #define REC_TRANS_CHNL_WIDTH_20 0 502 #define REC_TRANS_CHNL_WIDTH_ANY 1 503 504 #define OP_MODE_PURE 0 505 #define OP_MODE_MAY_BE_LEGACY_STAS 1 506 #define OP_MODE_20MHZ_HT_STA_ASSOCED 2 507 #define OP_MODE_MIXED 3 508 509 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1)) 510 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0)) 511 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1)) 512 #define HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH ((u8) BIT(2)) 513 #define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3)) 514 #define HT_INFO_HT_PARAM_CTRL_ACCESS_ONLY ((u8) BIT(4)) 515 #define HT_INFO_HT_PARAM_SRV_INTERVAL_GRANULARITY ((u8) BIT(5)) 516 517 #define HT_INFO_OPERATION_MODE_OP_MODE_MASK \ 518 ((le16) (0x0001 | 0x0002)) 519 #define HT_INFO_OPERATION_MODE_OP_MODE_OFFSET 0 520 #define HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT ((u8) BIT(2)) 521 #define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT ((u8) BIT(3)) 522 #define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT ((u8) BIT(4)) 523 524 #define HT_INFO_STBC_PARAM_DUAL_BEACON ((u16) BIT(6)) 525 #define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT ((u16) BIT(7)) 526 #define HT_INFO_STBC_PARAM_SECONDARY_BCN ((u16) BIT(8)) 527 #define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED ((u16) BIT(9)) 528 #define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10)) 529 #define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11)) 530 531 532 /* Secondary channel offset element */ 533 #define SECONDARY_CHANNEL_OFFSET_NONE 0 534 #define SECONDARY_CHANNEL_OFFSET_ABOVE 1 535 #define SECONDARY_CHANNEL_OFFSET_BELOW 3 536 struct secondary_channel_offset_ie { 537 u8 id; 538 u8 length; 539 u8 secondary_offset_offset; 540 } STRUCT_PACKED; 541 542 543 /* body of Recommended Transmit Channel Width action frame */ 544 #define CHANNEL_WIDTH_20 0 545 #define CHANNEL_WIDTH_ANY 1 546 struct recommended_tx_channel_width_action { 547 u8 category; 548 u8 action; 549 u8 channel_width; 550 } STRUCT_PACKED; 551 552 /* body of MIMO Power Save action frame */ 553 #define PWR_SAVE_MODE_STATIC 0 554 #define PWR_SAVE_MODE_DYNAMIC 1 555 struct mimo_pwr_save_action { 556 u8 category; 557 u8 action; 558 u8 enable; 559 u8 mode; 560 } STRUCT_PACKED; 561 562 563 #define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs) 564 * 00:50:F2 */ 565 566 #define WMM_OUI_TYPE 2 567 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0 568 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1 569 #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2 570 #define WMM_VERSION 1 571 572 #define WMM_ACTION_CODE_ADDTS_REQ 0 573 #define WMM_ACTION_CODE_ADDTS_RESP 1 574 #define WMM_ACTION_CODE_DELTS 2 575 576 #define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0 577 #define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1 578 /* 2 - Reserved */ 579 #define WMM_ADDTS_STATUS_REFUSED 3 580 /* 4-255 - Reserved */ 581 582 /* WMM TSPEC Direction Field Values */ 583 #define WMM_TSPEC_DIRECTION_UPLINK 0 584 #define WMM_TSPEC_DIRECTION_DOWNLINK 1 585 /* 2 - Reserved */ 586 #define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3 587 588 589 #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */ 590 591 #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */ 592 593 #endif /* IEEE802_11_DEFS_H */ 594