1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2001 Atsushi Onoe 5 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 #ifndef _NET80211_IEEE80211_H_ 29 #define _NET80211_IEEE80211_H_ 30 31 /* 32 * 802.11 protocol definitions. 33 */ 34 35 #define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */ 36 /* is 802.11 address multicast/broadcast? */ 37 #define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01) 38 39 #ifdef _KERNEL 40 extern const uint8_t ieee80211broadcastaddr[]; 41 #endif 42 43 typedef uint16_t ieee80211_seq; 44 45 /* IEEE 802.11 PLCP header */ 46 struct ieee80211_plcp_hdr { 47 uint16_t i_sfd; 48 uint8_t i_signal; 49 uint8_t i_service; 50 uint16_t i_length; 51 uint16_t i_crc; 52 } __packed; 53 54 #define IEEE80211_PLCP_SFD 0xF3A0 55 #define IEEE80211_PLCP_SERVICE 0x00 56 #define IEEE80211_PLCP_SERVICE_LOCKED 0x04 57 #define IEEE80211_PLCL_SERVICE_PBCC 0x08 58 #define IEEE80211_PLCP_SERVICE_LENEXT5 0x20 59 #define IEEE80211_PLCP_SERVICE_LENEXT6 0x40 60 #define IEEE80211_PLCP_SERVICE_LENEXT7 0x80 61 62 /* 63 * generic definitions for IEEE 802.11 frames 64 */ 65 struct ieee80211_frame { 66 uint8_t i_fc[2]; 67 uint8_t i_dur[2]; 68 uint8_t i_addr1[IEEE80211_ADDR_LEN]; 69 uint8_t i_addr2[IEEE80211_ADDR_LEN]; 70 uint8_t i_addr3[IEEE80211_ADDR_LEN]; 71 uint8_t i_seq[2]; 72 /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ 73 /* see below */ 74 } __packed; 75 76 struct ieee80211_qosframe { 77 uint8_t i_fc[2]; 78 uint8_t i_dur[2]; 79 uint8_t i_addr1[IEEE80211_ADDR_LEN]; 80 uint8_t i_addr2[IEEE80211_ADDR_LEN]; 81 uint8_t i_addr3[IEEE80211_ADDR_LEN]; 82 uint8_t i_seq[2]; 83 uint8_t i_qos[2]; 84 /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ 85 /* see below */ 86 } __packed; 87 88 struct ieee80211_qoscntl { 89 uint8_t i_qos[2]; 90 }; 91 92 struct ieee80211_frame_addr4 { 93 uint8_t i_fc[2]; 94 uint8_t i_dur[2]; 95 uint8_t i_addr1[IEEE80211_ADDR_LEN]; 96 uint8_t i_addr2[IEEE80211_ADDR_LEN]; 97 uint8_t i_addr3[IEEE80211_ADDR_LEN]; 98 uint8_t i_seq[2]; 99 uint8_t i_addr4[IEEE80211_ADDR_LEN]; 100 } __packed; 101 102 struct ieee80211_qosframe_addr4 { 103 uint8_t i_fc[2]; 104 uint8_t i_dur[2]; 105 uint8_t i_addr1[IEEE80211_ADDR_LEN]; 106 uint8_t i_addr2[IEEE80211_ADDR_LEN]; 107 uint8_t i_addr3[IEEE80211_ADDR_LEN]; 108 uint8_t i_seq[2]; 109 uint8_t i_addr4[IEEE80211_ADDR_LEN]; 110 uint8_t i_qos[2]; 111 } __packed; 112 113 #define IEEE80211_FC0_VERSION_MASK 0x03 114 #define IEEE80211_FC0_VERSION_SHIFT 0 115 #define IEEE80211_FC0_VERSION_0 0x00 116 #define IEEE80211_FC0_TYPE_MASK 0x0c 117 #define IEEE80211_FC0_TYPE_SHIFT 2 118 #define IEEE80211_FC0_TYPE_MGT 0x00 /* Management */ 119 #define IEEE80211_FC0_TYPE_CTL 0x04 /* Control */ 120 #define IEEE80211_FC0_TYPE_DATA 0x08 /* Data */ 121 #define IEEE80211_FC0_TYPE_EXT 0x0c /* Extension */ 122 123 #define IEEE80211_FC0_SUBTYPE_MASK 0xf0 124 #define IEEE80211_FC0_SUBTYPE_SHIFT 4 125 /* 802.11-2020 Table 9-1-Valid type and subtype combinations */ 126 /* For type 00 Management (IEEE80211_FC0_TYPE_MGT) */ 127 #define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00 /* Association Request */ 128 #define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10 /* Association Response */ 129 #define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20 /* Reassociation Request */ 130 #define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30 /* Reassociation Response */ 131 #define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40 /* Probe Request */ 132 #define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50 /* Probe Response */ 133 #define IEEE80211_FC0_SUBTYPE_TIMING_ADV 0x60 /* Timing Advertisement */ 134 /* 0111 Reserved 0x70 */ 135 #define IEEE80211_FC0_SUBTYPE_BEACON 0x80 /* Beacon */ 136 #define IEEE80211_FC0_SUBTYPE_ATIM 0x90 /* ATIM */ 137 #define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0 /* Disassociation */ 138 #define IEEE80211_FC0_SUBTYPE_AUTH 0xb0 /* Authentication */ 139 #define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0 /* Deauthentication */ 140 #define IEEE80211_FC0_SUBTYPE_ACTION 0xd0 /* Action */ 141 #define IEEE80211_FC0_SUBTYPE_ACTION_NOACK 0xe0 /* Action No Ack */ 142 /* 1111 Reserved 0xf0 */ 143 /* For type 01 Control (IEEE80211_FC0_TYPE_CTL) */ 144 /* 0000-0001 Reserved 0x00-0x10 */ 145 #define IEEE80211_FC0_SUBTYPE_TRIGGER 0x20 /* Trigger, 80211ax-2021 */ 146 #define IEEE80211_FC0_SUBTYPE_TACK 0x30 /* TACK */ 147 #define IEEE80211_FC0_SUBTYPE_BF_REPORT_POLL 0x40 /* Beamforming Report Poll */ 148 #define IEEE80211_FC0_SUBTYPE_VHT_HE_NDP 0x50 /* VHT/HE NDP Announcement, 80211ac/ax-2013/2021 */ 149 #define IEEE80211_FC0_SUBTYPE_CTL_EXT 0x60 /* Control Frame Extension */ 150 #define IEEE80211_FC0_SUBTYPE_CONTROL_WRAP 0x70 /* Control Wrapper */ 151 #define IEEE80211_FC0_SUBTYPE_BAR 0x80 /* Block Ack Request (BlockAckReq) */ 152 #define IEEE80211_FC0_SUBTYPE_BA 0x90 /* Block Ack (BlockAck) */ 153 #define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0 /* PS-Poll */ 154 #define IEEE80211_FC0_SUBTYPE_RTS 0xb0 /* RTS */ 155 #define IEEE80211_FC0_SUBTYPE_CTS 0xc0 /* CTS */ 156 #define IEEE80211_FC0_SUBTYPE_ACK 0xd0 /* Ack */ 157 #define IEEE80211_FC0_SUBTYPE_CF_END 0xe0 /* CF-End */ 158 #define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0 /* 1111 Reserved - what was CF_END_ACK? */ 159 /* For type 10 Data (IEEE80211_FC0_TYPE_DATA) */ 160 #define IEEE80211_FC0_SUBTYPE_DATA 0x00 /* Data */ 161 /* 0001-0011 Reserved 0x10-0x30 */ /* Were: CF_ACK, CF_POLL, CF_ACPL */ 162 #define IEEE80211_FC0_SUBTYPE_NODATA 0x40 /* Null */ 163 /* 0101-0111 Reserved 0x50-0x70 */ /* Were: CFACK, CFPOLL, CF_ACK_CF_ACK */ 164 #define IEEE80211_FC0_SUBTYPE_QOS_MASK_ANY 0x80 /* QoS mask - matching any subtypes 8..15 */ 165 #define IEEE80211_FC0_SUBTYPE_QOS_DATA 0x80 /* QoS Data */ 166 #define IEEE80211_FC0_SUBTYPE_QOS_DATA_CFACK 0x90 /* QoS Data +CF-Ack */ 167 #define IEEE80211_FC0_SUBTYPE_QOS_DATA_CFPOLL 0xa0 /* QoS Data +CF-Poll */ 168 #define IEEE80211_FC0_SUBTYPE_QOS_DATA_CFACKPOLL 0xb0 /* QoS Data +CF-Ack +CF-Poll */ 169 #define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0 /* QoS Null */ 170 /* 1101 Reserved 0xd0 */ 171 #define IEEE80211_FC0_SUBTYPE_QOS_CFPOLL 0xe0 /* QoS CF-Poll */ 172 #define IEEE80211_FC0_SUBTYPE_QOS_CFACKPOLL 0xf0 /* QoS CF-Ack +CF-Poll */ 173 /* For type 11 Extension (IEEE80211_FC0_TYPE_EXT) */ 174 #define IEEE80211_FC0_SUBTYPE_DMG_BEACON 0x00 /* DMG Beacon */ 175 #define IEEE80211_FC0_SUBTYPE_S1G_BEACON 0x10 /* S1G Beacon */ 176 /* 0010-1111 Reserved 0x20-0xff */ 177 178 /* 802.11-2020 Table 9-2-Control Frame Extension */ 179 /* Reusing B11..B8, part of FC1 */ 180 #define IEEE80211_CTL_EXT_SECTOR_ACK 0x00 /* Sector Ack, 80211ay-2021 */ 181 #define IEEE80211_CTL_EXT_BA_SCHED 0x01 /* Block Ack Schedule, 80211ay-2021 */ 182 #define IEEE80211_CTL_EXT_POLL 0x02 /* Poll */ 183 #define IEEE80211_CTL_EXT_SPR 0x03 /* SPR */ 184 #define IEEE80211_CTL_EXT_GRANT 0x04 /* Grant */ 185 #define IEEE80211_CTL_EXT_DMG_CTS 0x05 /* DMG CTS */ 186 #define IEEE80211_CTL_EXT_DMG_DTS 0x06 /* DMG DTS */ 187 #define IEEE80211_CTL_EXT_GRANT_ACK 0x07 /* Grant Ack */ 188 #define IEEE80211_CTL_EXT_SSW 0x08 /* SSW */ 189 #define IEEE80211_CTL_EXT_SSW_FBACK 0x09 /* SSW-Feedback */ 190 #define IEEE80211_CTL_EXT_SSW_ACK 0x0a /* SSW-Ack */ 191 #define IEEE80211_CTL_EXT_TDD_BF 0x0b /* TDD Beamforming, 80211ay-2021 */ 192 /* 1100-1111 Reserved 0xc-0xf */ 193 194 /* Check the version field */ 195 #define IEEE80211_IS_FC0_CHECK_VER(wh, v) \ 196 (((wh)->i_fc[0] & IEEE80211_FC0_VERSION_MASK) == (v)) 197 198 /* Check the version and type field */ 199 #define IEEE80211_IS_FC0_CHECK_VER_TYPE(wh, v, t) \ 200 (((((wh)->i_fc[0] & IEEE80211_FC0_VERSION_MASK) == (v))) && \ 201 (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == (t))) 202 203 /* Check the version, type and subtype field */ 204 #define IEEE80211_IS_FC0_CHECK_VER_TYPE_SUBTYPE(wh, v, t, st) \ 205 (((((wh)->i_fc[0] & IEEE80211_FC0_VERSION_MASK) == (v))) && \ 206 (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == (t)) && \ 207 (((wh)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == (st))) 208 209 #define IEEE80211_IS_MGMT(wh) \ 210 (IEEE80211_IS_FC0_CHECK_VER_TYPE(wh, IEEE80211_FC0_VERSION_0, \ 211 IEEE80211_FC0_TYPE_MGT)) 212 #define IEEE80211_IS_CTL(wh) \ 213 (IEEE80211_IS_FC0_CHECK_VER_TYPE(wh, IEEE80211_FC0_VERSION_0, \ 214 IEEE80211_FC0_TYPE_CTL)) 215 #define IEEE80211_IS_DATA(wh) \ 216 (IEEE80211_IS_FC0_CHECK_VER_TYPE(wh, IEEE80211_FC0_VERSION_0, \ 217 IEEE80211_FC0_TYPE_DATA)) 218 #define IEEE80211_IS_EXT(wh) \ 219 (IEEE80211_IS_FC0_CHECK_VER_TYPE(wh, IEEE80211_FC0_VERSION_0, \ 220 IEEE80211_FC0_TYPE_EXT)) 221 222 #define IEEE80211_FC0_QOSDATA \ 223 (IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS_DATA|IEEE80211_FC0_VERSION_0) 224 225 /* 226 * Return true if the frame is any of the QOS frame types, not just 227 * data frames. Matching on the IEEE80211_FC0_SUBTYPE_QOS_ANY bit 228 * being set also matches on subtypes 8..15. 229 */ 230 #define IEEE80211_IS_QOS_ANY(wh) \ 231 ((IEEE80211_IS_FC0_CHECK_VER_TYPE(wh, IEEE80211_FC0_VERSION_0, \ 232 IEEE80211_FC0_TYPE_DATA)) && \ 233 ((wh)->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS_MASK_ANY)) 234 235 /* 236 * Return true if this frame is QOS data, and only QOS data. 237 */ 238 #define IEEE80211_IS_QOSDATA(wh) \ 239 (IEEE80211_IS_FC0_CHECK_VER_TYPE_SUBTYPE(wh, \ 240 IEEE80211_FC0_VERSION_0, \ 241 IEEE80211_FC0_TYPE_DATA, \ 242 IEEE80211_FC0_SUBTYPE_QOS_DATA)) 243 244 #define IEEE80211_FC1_DIR_MASK 0x03 245 #define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ 246 #define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */ 247 #define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */ 248 #define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */ 249 250 #define IEEE80211_IS_DSTODS(wh) \ 251 (((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) 252 253 #define IEEE80211_FC1_MORE_FRAG 0x04 254 #define IEEE80211_FC1_RETRY 0x08 255 #define IEEE80211_FC1_PWR_MGT 0x10 256 #define IEEE80211_FC1_MORE_DATA 0x20 257 #define IEEE80211_FC1_PROTECTED 0x40 258 #define IEEE80211_FC1_ORDER 0x80 259 260 #define IEEE80211_IS_PROTECTED(wh) \ 261 ((wh)->i_fc[1] & IEEE80211_FC1_PROTECTED) 262 263 #define IEEE80211_HAS_SEQ(type, subtype) \ 264 ((type) != IEEE80211_FC0_TYPE_CTL && \ 265 !((type) == IEEE80211_FC0_TYPE_DATA && \ 266 ((subtype) & IEEE80211_FC0_SUBTYPE_QOS_NULL) == \ 267 IEEE80211_FC0_SUBTYPE_QOS_NULL)) 268 #define IEEE80211_SEQ_FRAG_MASK 0x000f 269 #define IEEE80211_SEQ_FRAG_SHIFT 0 270 #define IEEE80211_SEQ_SEQ_MASK 0xfff0 271 #define IEEE80211_SEQ_SEQ_SHIFT 4 272 #define IEEE80211_SEQ_RANGE 4096 273 274 #define IEEE80211_SEQ_ADD(seq, incr) \ 275 (((seq) + (incr)) & (IEEE80211_SEQ_RANGE-1)) 276 #define IEEE80211_SEQ_INC(seq) IEEE80211_SEQ_ADD(seq,1) 277 #define IEEE80211_SEQ_SUB(a, b) \ 278 (((a) + IEEE80211_SEQ_RANGE - (b)) & (IEEE80211_SEQ_RANGE-1)) 279 280 #define IEEE80211_SEQ_BA_RANGE 2048 /* 2^11 */ 281 #define IEEE80211_SEQ_BA_BEFORE(a, b) \ 282 (IEEE80211_SEQ_SUB(b, a+1) < IEEE80211_SEQ_BA_RANGE-1) 283 284 #define IEEE80211_NWID_LEN 32 285 #define IEEE80211_MESHID_LEN 32 286 287 #define IEEE80211_QOS_CTL_LEN 2 288 289 #define IEEE80211_QOS_TXOP 0x00ff 290 /* bit 8 is reserved */ 291 #define IEEE80211_QOS_AMSDU 0x80 292 #define IEEE80211_QOS_AMSDU_S 7 293 #define IEEE80211_QOS_ACKPOLICY 0x60 294 #define IEEE80211_QOS_ACKPOLICY_S 5 295 #define IEEE80211_QOS_ACKPOLICY_NOACK 0x20 /* No ACK required */ 296 #define IEEE80211_QOS_ACKPOLICY_BA 0x60 /* Block ACK */ 297 #define IEEE80211_QOS_EOSP 0x10 /* EndOfService Period*/ 298 #define IEEE80211_QOS_EOSP_S 4 299 #define IEEE80211_QOS_TID 0x0f 300 /* qos[1] byte used for all frames sent by mesh STAs in a mesh BSS */ 301 #define IEEE80211_QOS_MC 0x01 /* Mesh control */ 302 /* Mesh power save level*/ 303 #define IEEE80211_QOS_MESH_PSL 0x02 304 /* Mesh Receiver Service Period Initiated */ 305 #define IEEE80211_QOS_RSPI 0x04 306 /* bits 11 to 15 reserved */ 307 308 /* does frame have QoS sequence control data */ 309 #define IEEE80211_QOS_HAS_SEQ(wh) \ 310 (((wh)->i_fc[0] & \ 311 (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS_DATA)) == \ 312 (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS_DATA)) 313 314 /* 315 * WME/802.11e information element. 316 */ 317 struct ieee80211_wme_info { 318 uint8_t wme_id; /* IEEE80211_ELEMID_VENDOR */ 319 uint8_t wme_len; /* length in bytes */ 320 uint8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */ 321 uint8_t wme_type; /* OUI type */ 322 uint8_t wme_subtype; /* OUI subtype */ 323 uint8_t wme_version; /* spec revision */ 324 uint8_t wme_info; /* QoS info */ 325 } __packed; 326 327 /* 328 * WME/802.11e Tspec Element 329 */ 330 struct ieee80211_wme_tspec { 331 uint8_t ts_id; 332 uint8_t ts_len; 333 uint8_t ts_oui[3]; 334 uint8_t ts_oui_type; 335 uint8_t ts_oui_subtype; 336 uint8_t ts_version; 337 uint8_t ts_tsinfo[3]; 338 uint8_t ts_nom_msdu[2]; 339 uint8_t ts_max_msdu[2]; 340 uint8_t ts_min_svc[4]; 341 uint8_t ts_max_svc[4]; 342 uint8_t ts_inactv_intv[4]; 343 uint8_t ts_susp_intv[4]; 344 uint8_t ts_start_svc[4]; 345 uint8_t ts_min_rate[4]; 346 uint8_t ts_mean_rate[4]; 347 uint8_t ts_max_burst[4]; 348 uint8_t ts_min_phy[4]; 349 uint8_t ts_peak_rate[4]; 350 uint8_t ts_delay[4]; 351 uint8_t ts_surplus[2]; 352 uint8_t ts_medium_time[2]; 353 } __packed; 354 355 /* 356 * WME AC parameter field 357 */ 358 struct ieee80211_wme_acparams { 359 uint8_t acp_aci_aifsn; 360 uint8_t acp_logcwminmax; 361 uint16_t acp_txop; 362 } __packed; 363 364 #define WME_NUM_AC 4 /* 4 AC categories */ 365 #define WME_NUM_TID 16 /* 16 tids */ 366 367 #define WME_PARAM_ACI 0x60 /* Mask for ACI field */ 368 #define WME_PARAM_ACI_S 5 /* Shift for ACI field */ 369 #define WME_PARAM_ACM 0x10 /* Mask for ACM bit */ 370 #define WME_PARAM_ACM_S 4 /* Shift for ACM bit */ 371 #define WME_PARAM_AIFSN 0x0f /* Mask for aifsn field */ 372 #define WME_PARAM_AIFSN_S 0 /* Shift for aifsn field */ 373 #define WME_PARAM_LOGCWMIN 0x0f /* Mask for CwMin field (in log) */ 374 #define WME_PARAM_LOGCWMIN_S 0 /* Shift for CwMin field */ 375 #define WME_PARAM_LOGCWMAX 0xf0 /* Mask for CwMax field (in log) */ 376 #define WME_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */ 377 378 #define WME_AC_TO_TID(_ac) ( \ 379 ((_ac) == WME_AC_VO) ? 6 : \ 380 ((_ac) == WME_AC_VI) ? 5 : \ 381 ((_ac) == WME_AC_BK) ? 1 : \ 382 0) 383 384 #define TID_TO_WME_AC(_tid) ( \ 385 ((_tid) == 0 || (_tid) == 3) ? WME_AC_BE : \ 386 ((_tid) < 3) ? WME_AC_BK : \ 387 ((_tid) < 6) ? WME_AC_VI : \ 388 WME_AC_VO) 389 390 /* 391 * WME Parameter Element 392 */ 393 struct ieee80211_wme_param { 394 uint8_t param_id; 395 uint8_t param_len; 396 uint8_t param_oui[3]; 397 uint8_t param_oui_type; 398 uint8_t param_oui_subtype; 399 uint8_t param_version; 400 uint8_t param_qosInfo; 401 #define WME_QOSINFO_COUNT 0x0f /* Mask for param count field */ 402 uint8_t param_reserved; 403 struct ieee80211_wme_acparams params_acParams[WME_NUM_AC]; 404 } __packed; 405 406 /* 407 * WME U-APSD qos info field defines 408 */ 409 #define WME_CAPINFO_UAPSD_EN 0x00000080 410 #define WME_CAPINFO_UAPSD_VO 0x00000001 411 #define WME_CAPINFO_UAPSD_VI 0x00000002 412 #define WME_CAPINFO_UAPSD_BK 0x00000004 413 #define WME_CAPINFO_UAPSD_BE 0x00000008 414 #define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT 0 415 #define WME_CAPINFO_UAPSD_ACFLAGS_MASK 0xF 416 #define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5 417 #define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3 418 #define WME_CAPINFO_IE_OFFSET 8 419 #define WME_UAPSD_MAXSP(_qosinfo) \ 420 (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & \ 421 WME_CAPINFO_UAPSD_MAXSP_MASK) 422 #define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) \ 423 ((1 << (3 - (_ac))) & ( \ 424 ((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & \ 425 WME_CAPINFO_UAPSD_ACFLAGS_MASK)) 426 427 /* 428 * Management Notification Frame 429 */ 430 struct ieee80211_mnf { 431 uint8_t mnf_category; 432 uint8_t mnf_action; 433 uint8_t mnf_dialog; 434 uint8_t mnf_status; 435 } __packed; 436 #define MNF_SETUP_REQ 0 437 #define MNF_SETUP_RESP 1 438 #define MNF_TEARDOWN 2 439 440 /* 441 * 802.11n Management Action Frames 442 */ 443 /* generic frame format */ 444 struct ieee80211_action { 445 uint8_t ia_category; 446 uint8_t ia_action; 447 } __packed; 448 449 /* 80211-2020 Table 9-51-Category values */ 450 #define IEEE80211_ACTION_CAT_SM 0 /* 9.6.2 Spectrum Management */ 451 #define IEEE80211_ACTION_CAT_QOS 1 /* 9.6.3 QoS */ 452 /* Reserved 2 was IEEE80211_ACTION_CAT_DLS */ 453 #define IEEE80211_ACTION_CAT_BA 3 /* 9.6.4 Block Ack */ 454 #define IEEE80211_ACTION_CAT_PUBLIC 4 /* 9.6.7 Public */ 455 #define IEEE80211_ACTION_CAT_RADIO_MEASUREMENT 5 /* 9.6.6 Radio Measurement */ 456 #define IEEE80211_ACTION_CAT_FAST_BSS_TRANSITION 6 /* 9.6.8 Fast BSS Transition */ 457 #define IEEE80211_ACTION_CAT_HT 7 /* 9.6.11 HT */ 458 #define IEEE80211_ACTION_CAT_SA_QUERY 8 /* 9.6.9 SA Query */ 459 #define IEEE80211_ACTION_CAT_PROTECTED_DUAL_OF_PUBLIC_ACTION 9 /* 9.6.10 Protected Dual of Public Action */ 460 #define IEEE80211_ACTION_CAT_WNM 10 /* 9.6.13 WNM */ 461 #define IEEE80211_ACTION_CAT_UNPROTECTED_WNM 11 /* 9.6.14 Unprotected WNM */ 462 #define IEEE80211_ACTION_CAT_TDLS 12 /* 9.6.12 TDLS */ 463 #define IEEE80211_ACTION_CAT_MESH 13 /* 9.6.16 Mesh */ 464 #define IEEE80211_ACTION_CAT_MULTIHOP 14 /* 9.6.17 Multihop */ 465 #define IEEE80211_ACTION_CAT_SELF_PROT 15 /* 9.6.15 Self-protected */ 466 #define IEEE80211_ACTION_CAT_DMG 16 /* 9.6.19 DMG */ 467 /* Reserved 17 (R)Wi-Fi Alliance */ 468 #define IEEE80211_ACTION_CAT_FAST_SESSION_TRANSFER 18 /* 9.6.20 Fast Session Transfer */ 469 #define IEEE80211_ACTION_CAT_ROBUST_AV_STREAMING 19 /* 9.6.18 Robust AV Streaming */ 470 #define IEEE80211_ACTION_CAT_UNPROTECTED_DMG 20 /* 9.6.21 Unprotected DMG */ 471 #define IEEE80211_ACTION_CAT_VHT 21 /* 9.6.22 VHT */ 472 #define IEEE80211_ACTION_CAT_UNPROTECTED_S1G 22 /* 9.6.24 Unprotected S1G */ 473 #define IEEE80211_ACTION_CAT_S1G 23 /* 9.6.25 S1G */ 474 #define IEEE80211_ACTION_CAT_FLOW_CONTROL 24 /* 9.6.26 Flow Control */ 475 #define IEEE80211_ACTION_CAT_CTL_RESP_MCS_NEG 25 /* 9.6.27 Control Response MCS Negotiation */ 476 #define IEEE80211_ACTION_CAT_FILS 26 /* 9.6.23 FILS */ 477 #define IEEE80211_ACTION_CAT_CDMG 27 /* 9.6.28 CDMG */ 478 #define IEEE80211_ACTION_CAT_CMMG 28 /* 9.6.29 CMMG */ 479 #define IEEE80211_ACTION_CAT_GLK 29 /* 9.6.30 GLK */ 480 #define IEEE80211_ACTION_CAT_HE 30 /* 9.6.31 HE, 80211ax-2021 */ 481 #define IEEE80211_ACTION_CAT_PROTECTED_HE 31 /* 9.6.32 Protected HE, 80211ax-2021 */ 482 /* Reserved 32-125 */ 483 #define IEEE80211_ACTION_CAT_VENDOR_SPECIFIC_PROTECTED 126 /* 9.6.5 Vendor-specific Protected */ 484 #define IEEE80211_ACTION_CAT_VENDOR 127 /* 9.6.5 Vendor-specific */ 485 /* Error 128-255 */ 486 487 488 /* 80211-2020 Table 9-346-Spectrum Management Action field values */ 489 enum ieee80211_action_sm { 490 IEEE80211_ACTION_SM_SMREQ = 0, /* Spectrum Measurement Request */ 491 IEEE80211_ACTION_SM_SMREP = 1, /* Spectrum Measurement Report */ 492 IEEE80211_ACTION_SM_TPCREQ = 2, /* TPC Request */ 493 IEEE80211_ACTION_SM_TPCREP = 3, /* TPC Report */ 494 IEEE80211_ACTION_SM_CSA = 4, /* Channel Switch Announcement */ 495 /* Reserved = 5-255 */ 496 }; 497 498 /* 80211-2020 Table 9-363-Radio Measurement Action field values */ 499 enum ieee80211_action_radio_measurement { 500 IEEE80211_ACTION_RADIO_MEASUREMENT_RMREQ = 0, /* Radio Measurement Request */ 501 IEEE80211_ACTION_RADIO_MEASUREMENT_RMREP = 1, /* Radio Measurement Report */ 502 IEEE80211_ACTION_RADIO_MEASUREMENT_LMREQ = 2, /* Link Measurement Request */ 503 IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP = 3, /* Link Measurement Report */ 504 IEEE80211_ACTION_RADIO_MEASUREMENT_NRREQ = 4, /* Neighbor Report Request */ 505 IEEE80211_ACTION_RADIO_MEASUREMENT_NRRESP = 5, /* Neighbor Report Response */ 506 /* Reserved = 6-255 */ 507 }; 508 509 #define IEEE80211_ACTION_HT_TXCHWIDTH 0 /* recommended xmit chan width*/ 510 #define IEEE80211_ACTION_HT_MIMOPWRSAVE 1 /* MIMO power save */ 511 512 /* HT - recommended transmission channel width */ 513 struct ieee80211_action_ht_txchwidth { 514 struct ieee80211_action at_header; 515 uint8_t at_chwidth; 516 } __packed; 517 518 #define IEEE80211_A_HT_TXCHWIDTH_20 0 519 #define IEEE80211_A_HT_TXCHWIDTH_2040 1 520 521 /* HT - MIMO Power Save (NB: D2.04) */ 522 struct ieee80211_action_ht_mimopowersave { 523 struct ieee80211_action am_header; 524 uint8_t am_control; 525 } __packed; 526 527 #define IEEE80211_A_HT_MIMOPWRSAVE_ENA 0x01 /* PS enabled */ 528 #define IEEE80211_A_HT_MIMOPWRSAVE_MODE 0x02 529 #define IEEE80211_A_HT_MIMOPWRSAVE_MODE_S 1 530 #define IEEE80211_A_HT_MIMOPWRSAVE_DYNAMIC 0x02 /* Dynamic Mode */ 531 #define IEEE80211_A_HT_MIMOPWRSAVE_STATIC 0x00 /* no SM packets */ 532 /* bits 2-7 reserved */ 533 534 /* Block Ack actions */ 535 #define IEEE80211_ACTION_BA_ADDBA_REQUEST 0 /* ADDBA request */ 536 #define IEEE80211_ACTION_BA_ADDBA_RESPONSE 1 /* ADDBA response */ 537 #define IEEE80211_ACTION_BA_DELBA 2 /* DELBA */ 538 539 /* Block Ack Parameter Set */ 540 #define IEEE80211_BAPS_BUFSIZ 0xffc0 /* buffer size */ 541 #define IEEE80211_BAPS_BUFSIZ_S 6 542 #define IEEE80211_BAPS_TID 0x003c /* TID */ 543 #define IEEE80211_BAPS_TID_S 2 544 #define IEEE80211_BAPS_POLICY 0x0002 /* block ack policy */ 545 #define IEEE80211_BAPS_POLICY_S 1 546 #define IEEE80211_BAPS_AMSDU 0x0001 /* A-MSDU permitted */ 547 #define IEEE80211_BAPS_AMSDU_S 0 548 549 #define IEEE80211_BAPS_POLICY_DELAYED (0<<IEEE80211_BAPS_POLICY_S) 550 #define IEEE80211_BAPS_POLICY_IMMEDIATE (1<<IEEE80211_BAPS_POLICY_S) 551 552 /* Block Ack Sequence Control */ 553 #define IEEE80211_BASEQ_START 0xfff0 /* starting seqnum */ 554 #define IEEE80211_BASEQ_START_S 4 555 #define IEEE80211_BASEQ_FRAG 0x000f /* fragment number */ 556 #define IEEE80211_BASEQ_FRAG_S 0 557 558 /* Delayed Block Ack Parameter Set */ 559 #define IEEE80211_DELBAPS_TID 0xf000 /* TID */ 560 #define IEEE80211_DELBAPS_TID_S 12 561 #define IEEE80211_DELBAPS_INIT 0x0800 /* initiator */ 562 #define IEEE80211_DELBAPS_INIT_S 11 563 564 /* BA - ADDBA request */ 565 struct ieee80211_action_ba_addbarequest { 566 struct ieee80211_action rq_header; 567 uint8_t rq_dialogtoken; 568 uint16_t rq_baparamset; 569 uint16_t rq_batimeout; /* in TUs */ 570 uint16_t rq_baseqctl; 571 } __packed; 572 573 /* BA - ADDBA response */ 574 struct ieee80211_action_ba_addbaresponse { 575 struct ieee80211_action rs_header; 576 uint8_t rs_dialogtoken; 577 uint16_t rs_statuscode; 578 uint16_t rs_baparamset; 579 uint16_t rs_batimeout; /* in TUs */ 580 } __packed; 581 582 /* BA - DELBA */ 583 struct ieee80211_action_ba_delba { 584 struct ieee80211_action dl_header; 585 uint16_t dl_baparamset; 586 uint16_t dl_reasoncode; 587 } __packed; 588 589 /* BAR Control */ 590 #define IEEE80211_BAR_TID 0xf000 /* TID */ 591 #define IEEE80211_BAR_TID_S 12 592 #define IEEE80211_BAR_COMP 0x0004 /* Compressed Bitmap */ 593 #define IEEE80211_BAR_MTID 0x0002 /* Multi-TID */ 594 #define IEEE80211_BAR_NOACK 0x0001 /* No-Ack policy */ 595 596 /* BAR Starting Sequence Control */ 597 #define IEEE80211_BAR_SEQ_START 0xfff0 /* starting seqnum */ 598 #define IEEE80211_BAR_SEQ_START_S 4 599 600 struct ieee80211_ba_request { 601 uint16_t rq_barctl; 602 uint16_t rq_barseqctl; 603 } __packed; 604 605 /* 606 * Control frames. 607 */ 608 struct ieee80211_frame_min { 609 uint8_t i_fc[2]; 610 uint8_t i_dur[2]; 611 uint8_t i_addr1[IEEE80211_ADDR_LEN]; 612 uint8_t i_addr2[IEEE80211_ADDR_LEN]; 613 /* FCS */ 614 } __packed; 615 616 struct ieee80211_frame_rts { 617 uint8_t i_fc[2]; 618 uint8_t i_dur[2]; 619 uint8_t i_ra[IEEE80211_ADDR_LEN]; 620 uint8_t i_ta[IEEE80211_ADDR_LEN]; 621 /* FCS */ 622 } __packed; 623 624 struct ieee80211_frame_cts { 625 uint8_t i_fc[2]; 626 uint8_t i_dur[2]; 627 uint8_t i_ra[IEEE80211_ADDR_LEN]; 628 /* FCS */ 629 } __packed; 630 631 struct ieee80211_frame_ack { 632 uint8_t i_fc[2]; 633 uint8_t i_dur[2]; 634 uint8_t i_ra[IEEE80211_ADDR_LEN]; 635 /* FCS */ 636 } __packed; 637 638 struct ieee80211_frame_pspoll { 639 uint8_t i_fc[2]; 640 uint8_t i_aid[2]; 641 uint8_t i_bssid[IEEE80211_ADDR_LEN]; 642 uint8_t i_ta[IEEE80211_ADDR_LEN]; 643 /* FCS */ 644 } __packed; 645 646 struct ieee80211_frame_cfend { /* NB: also CF-End+CF-Ack */ 647 uint8_t i_fc[2]; 648 uint8_t i_dur[2]; /* should be zero */ 649 uint8_t i_ra[IEEE80211_ADDR_LEN]; 650 uint8_t i_bssid[IEEE80211_ADDR_LEN]; 651 /* FCS */ 652 } __packed; 653 654 struct ieee80211_frame_bar { 655 uint8_t i_fc[2]; 656 uint8_t i_dur[2]; 657 uint8_t i_ra[IEEE80211_ADDR_LEN]; 658 uint8_t i_ta[IEEE80211_ADDR_LEN]; 659 uint16_t i_ctl; 660 uint16_t i_seq; 661 /* FCS */ 662 } __packed; 663 664 /* 665 * BEACON management packets 666 * 667 * octet timestamp[8] 668 * octet beacon interval[2] 669 * octet capability information[2] 670 * information element 671 * octet elemid 672 * octet length 673 * octet information[length] 674 */ 675 676 #define IEEE80211_BEACON_INTERVAL(beacon) \ 677 ((beacon)[8] | ((beacon)[9] << 8)) 678 #define IEEE80211_BEACON_CAPABILITY(beacon) \ 679 ((beacon)[10] | ((beacon)[11] << 8)) 680 681 #define IEEE80211_CAPINFO_ESS 0x0001 682 #define IEEE80211_CAPINFO_IBSS 0x0002 683 #define IEEE80211_CAPINFO_CF_POLLABLE 0x0004 684 #define IEEE80211_CAPINFO_CF_POLLREQ 0x0008 685 #define IEEE80211_CAPINFO_PRIVACY 0x0010 686 #define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020 687 #define IEEE80211_CAPINFO_PBCC 0x0040 688 #define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080 689 #define IEEE80211_CAPINFO_SPECTRUM_MGMT 0x0100 690 /* bit 9 is reserved */ 691 #define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400 692 #define IEEE80211_CAPINFO_RSN 0x0800 693 /* bit 12 is reserved */ 694 #define IEEE80211_CAPINFO_DSSSOFDM 0x2000 695 /* bits 14-15 are reserved */ 696 697 #define IEEE80211_CAPINFO_BITS \ 698 "\20\1ESS\2IBSS\3CF_POLLABLE\4CF_POLLREQ\5PRIVACY\6SHORT_PREAMBLE" \ 699 "\7PBCC\10CHNL_AGILITY\11SPECTRUM_MGMT\13SHORT_SLOTTIME\14RSN" \ 700 "\16DSSOFDM" 701 702 /* 703 * 802.11i/WPA information element (maximally sized). 704 */ 705 struct ieee80211_ie_wpa { 706 uint8_t wpa_id; /* IEEE80211_ELEMID_VENDOR */ 707 uint8_t wpa_len; /* length in bytes */ 708 uint8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */ 709 uint8_t wpa_type; /* OUI type */ 710 uint16_t wpa_version; /* spec revision */ 711 uint32_t wpa_mcipher[1]; /* multicast/group key cipher */ 712 uint16_t wpa_uciphercnt; /* # pairwise key ciphers */ 713 uint32_t wpa_uciphers[8];/* ciphers */ 714 uint16_t wpa_authselcnt; /* authentication selector cnt*/ 715 uint32_t wpa_authsels[8];/* selectors */ 716 uint16_t wpa_caps; /* 802.11i capabilities */ 717 uint16_t wpa_pmkidcnt; /* 802.11i pmkid count */ 718 uint16_t wpa_pmkids[8]; /* 802.11i pmkids */ 719 } __packed; 720 721 /* 722 * 802.11n HT Capability IE 723 * NB: these reflect D1.10 724 */ 725 struct ieee80211_ie_htcap { 726 uint8_t hc_id; /* element ID */ 727 uint8_t hc_len; /* length in bytes */ 728 uint16_t hc_cap; /* HT caps (see below) */ 729 uint8_t hc_param; /* HT params (see below) */ 730 uint8_t hc_mcsset[16]; /* supported MCS set */ 731 uint16_t hc_extcap; /* extended HT capabilities */ 732 uint32_t hc_txbf; /* txbf capabilities */ 733 uint8_t hc_antenna; /* antenna capabilities */ 734 } __packed; 735 736 /* HT capability flags (ht_cap) */ 737 #define IEEE80211_HTCAP_LDPC 0x0001 /* LDPC rx supported */ 738 #define IEEE80211_HTCAP_CHWIDTH40 0x0002 /* 20/40 supported */ 739 #define IEEE80211_HTCAP_SMPS 0x000c /* SM Power Save mode */ 740 #define IEEE80211_HTCAP_SMPS_OFF 0x000c /* disabled */ 741 #define IEEE80211_HTCAP_SMPS_DYNAMIC 0x0004 /* send RTS first */ 742 /* NB: SMPS value 2 is reserved */ 743 #define IEEE80211_HTCAP_SMPS_ENA 0x0000 /* enabled (static mode) */ 744 #define IEEE80211_HTCAP_GREENFIELD 0x0010 /* Greenfield supported */ 745 #define IEEE80211_HTCAP_SHORTGI20 0x0020 /* Short GI in 20MHz */ 746 #define IEEE80211_HTCAP_SHORTGI40 0x0040 /* Short GI in 40MHz */ 747 #define IEEE80211_HTCAP_TXSTBC 0x0080 /* STBC tx ok */ 748 #define IEEE80211_HTCAP_RXSTBC 0x0300 /* STBC rx support */ 749 #define IEEE80211_HTCAP_RXSTBC_S 8 750 #define IEEE80211_HTCAP_RXSTBC_1STREAM 0x0100 /* 1 spatial stream */ 751 #define IEEE80211_HTCAP_RXSTBC_2STREAM 0x0200 /* 1-2 spatial streams*/ 752 #define IEEE80211_HTCAP_RXSTBC_3STREAM 0x0300 /* 1-3 spatial streams*/ 753 #define IEEE80211_HTCAP_DELBA 0x0400 /* HT DELBA supported */ 754 #define IEEE80211_HTCAP_MAXAMSDU 0x0800 /* max A-MSDU length */ 755 #define IEEE80211_HTCAP_MAXAMSDU_7935 0x0800 /* 7935 octets */ 756 #define IEEE80211_HTCAP_MAXAMSDU_3839 0x0000 /* 3839 octets */ 757 #define IEEE80211_HTCAP_DSSSCCK40 0x1000 /* DSSS/CCK in 40MHz */ 758 #define IEEE80211_HTCAP_PSMP 0x2000 /* PSMP supported */ 759 #define IEEE80211_HTCAP_40INTOLERANT 0x4000 /* 40MHz intolerant */ 760 #define IEEE80211_HTCAP_LSIGTXOPPROT 0x8000 /* L-SIG TXOP prot */ 761 762 #define IEEE80211_HTCAP_BITS \ 763 "\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \ 764 "\13DELBA\14AMSDU(7935)\15DSSSCCK40\16PSMP\1740INTOLERANT" \ 765 "\20LSIGTXOPPROT" 766 767 /* HT parameters (hc_param) */ 768 #define IEEE80211_HTCAP_MAXRXAMPDU 0x03 /* max rx A-MPDU factor */ 769 #define IEEE80211_HTCAP_MAXRXAMPDU_S 0 770 #define IEEE80211_HTCAP_MAXRXAMPDU_8K 0 771 #define IEEE80211_HTCAP_MAXRXAMPDU_16K 1 772 #define IEEE80211_HTCAP_MAXRXAMPDU_32K 2 773 #define IEEE80211_HTCAP_MAXRXAMPDU_64K 3 774 #define IEEE80211_HTCAP_MPDUDENSITY 0x1c /* min MPDU start spacing */ 775 #define IEEE80211_HTCAP_MPDUDENSITY_S 2 776 #define IEEE80211_HTCAP_MPDUDENSITY_NA 0 /* no time restriction */ 777 #define IEEE80211_HTCAP_MPDUDENSITY_025 1 /* 1/4 us */ 778 #define IEEE80211_HTCAP_MPDUDENSITY_05 2 /* 1/2 us */ 779 #define IEEE80211_HTCAP_MPDUDENSITY_1 3 /* 1 us */ 780 #define IEEE80211_HTCAP_MPDUDENSITY_2 4 /* 2 us */ 781 #define IEEE80211_HTCAP_MPDUDENSITY_4 5 /* 4 us */ 782 #define IEEE80211_HTCAP_MPDUDENSITY_8 6 /* 8 us */ 783 #define IEEE80211_HTCAP_MPDUDENSITY_16 7 /* 16 us */ 784 785 /* HT extended capabilities (hc_extcap) */ 786 #define IEEE80211_HTCAP_PCO 0x0001 /* PCO capable */ 787 #define IEEE80211_HTCAP_PCOTRANS 0x0006 /* PCO transition time */ 788 #define IEEE80211_HTCAP_PCOTRANS_S 1 789 #define IEEE80211_HTCAP_PCOTRANS_04 0x0002 /* 400 us */ 790 #define IEEE80211_HTCAP_PCOTRANS_15 0x0004 /* 1.5 ms */ 791 #define IEEE80211_HTCAP_PCOTRANS_5 0x0006 /* 5 ms */ 792 /* bits 3-7 reserved */ 793 #define IEEE80211_HTCAP_MCSFBACK 0x0300 /* MCS feedback */ 794 #define IEEE80211_HTCAP_MCSFBACK_S 8 795 #define IEEE80211_HTCAP_MCSFBACK_NONE 0x0000 /* nothing provided */ 796 #define IEEE80211_HTCAP_MCSFBACK_UNSOL 0x0200 /* unsolicited feedback */ 797 #define IEEE80211_HTCAP_MCSFBACK_MRQ 0x0300 /* " "+respond to MRQ */ 798 #define IEEE80211_HTCAP_HTC 0x0400 /* +HTC support */ 799 #define IEEE80211_HTCAP_RDR 0x0800 /* reverse direction responder*/ 800 /* bits 12-15 reserved */ 801 802 /* 803 * 802.11n HT Information IE 804 */ 805 struct ieee80211_ie_htinfo { 806 uint8_t hi_id; /* element ID */ 807 uint8_t hi_len; /* length in bytes */ 808 uint8_t hi_ctrlchannel; /* primary channel */ 809 uint8_t hi_byte1; /* ht ie byte 1 */ 810 uint8_t hi_byte2; /* ht ie byte 2 */ 811 uint8_t hi_byte3; /* ht ie byte 3 */ 812 uint16_t hi_byte45; /* ht ie bytes 4+5 */ 813 uint8_t hi_basicmcsset[16]; /* basic MCS set */ 814 } __packed; 815 816 /* byte1 */ 817 #define IEEE80211_HTINFO_2NDCHAN 0x03 /* secondary/ext chan offset */ 818 #define IEEE80211_HTINFO_2NDCHAN_S 0 819 #define IEEE80211_HTINFO_2NDCHAN_NONE 0x00 /* no secondary/ext channel */ 820 #define IEEE80211_HTINFO_2NDCHAN_ABOVE 0x01 /* above private channel */ 821 /* NB: 2 is reserved */ 822 #define IEEE80211_HTINFO_2NDCHAN_BELOW 0x03 /* below primary channel */ 823 #define IEEE80211_HTINFO_TXWIDTH 0x04 /* tx channel width */ 824 #define IEEE80211_HTINFO_TXWIDTH_20 0x00 /* 20MHz width */ 825 #define IEEE80211_HTINFO_TXWIDTH_2040 0x04 /* any supported width */ 826 #define IEEE80211_HTINFO_RIFSMODE 0x08 /* Reduced IFS (RIFS) use */ 827 #define IEEE80211_HTINFO_RIFSMODE_PROH 0x00 /* RIFS use prohibited */ 828 #define IEEE80211_HTINFO_RIFSMODE_PERM 0x08 /* RIFS use permitted */ 829 #define IEEE80211_HTINFO_PMSPONLY 0x10 /* PSMP required to associate */ 830 #define IEEE80211_HTINFO_SIGRAN 0xe0 /* shortest Service Interval */ 831 #define IEEE80211_HTINFO_SIGRAN_S 5 832 #define IEEE80211_HTINFO_SIGRAN_5 0x00 /* 5 ms */ 833 /* XXX add rest */ 834 835 /* bytes 2+3 */ 836 #define IEEE80211_HTINFO_OPMODE 0x03 /* operating mode */ 837 #define IEEE80211_HTINFO_OPMODE_S 0 838 #define IEEE80211_HTINFO_OPMODE_PURE 0x00 /* no protection */ 839 #define IEEE80211_HTINFO_OPMODE_PROTOPT 0x01 /* protection optional */ 840 #define IEEE80211_HTINFO_OPMODE_HT20PR 0x02 /* protection for HT20 sta's */ 841 #define IEEE80211_HTINFO_OPMODE_MIXED 0x03 /* protection for legacy sta's*/ 842 #define IEEE80211_HTINFO_NONGF_PRESENT 0x04 /* non-GF sta's present */ 843 #define IEEE80211_HTINFO_TXBL 0x08 /* transmit burst limit */ 844 #define IEEE80211_HTINFO_NONHT_PRESENT 0x10 /* non-HT sta's present */ 845 /* bits 5-15 reserved */ 846 847 /* bytes 4+5 */ 848 #define IEEE80211_HTINFO_2NDARYBEACON 0x01 849 #define IEEE80211_HTINFO_LSIGTXOPPROT 0x02 850 #define IEEE80211_HTINFO_PCO_ACTIVE 0x04 851 #define IEEE80211_HTINFO_40MHZPHASE 0x08 852 853 /* byte5 */ 854 #define IEEE80211_HTINFO_BASIC_STBCMCS 0x7f 855 #define IEEE80211_HTINFO_BASIC_STBCMCS_S 0 856 #define IEEE80211_HTINFO_DUALPROTECTED 0x80 857 858 /* 859 * 802.11ac definitions - 802.11ac-2013 . 860 */ 861 862 /* 863 * Maximum length of A-MPDU that the STA can RX in VHT. 864 * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets) 865 */ 866 #define IEEE80211_VHTCAP_MAX_AMPDU_8K 0 867 #define IEEE80211_VHTCAP_MAX_AMPDU_16K 1 868 #define IEEE80211_VHTCAP_MAX_AMPDU_32K 2 869 #define IEEE80211_VHTCAP_MAX_AMPDU_64K 3 870 #define IEEE80211_VHTCAP_MAX_AMPDU_128K 4 871 #define IEEE80211_VHTCAP_MAX_AMPDU_256K 5 872 #define IEEE80211_VHTCAP_MAX_AMPDU_512K 6 873 #define IEEE80211_VHTCAP_MAX_AMPDU_1024K 7 874 875 /* 876 * VHT MCS information. 877 * + rx_highest/tx_highest: optional; maximum long GI VHT PPDU 878 * data rate. 1Mbit/sec units. 879 * + rx_mcs_map/tx_mcs_map: bitmap of per-stream supported MCS; 880 * 2 bits each. 881 */ 882 883 /* 802.11ac-2013, 8.4.2.160.3 Supported VHT-MCS and NSS Set field */ 884 enum ieee80211_vht_mcs_support { 885 IEEE80211_VHT_MCS_SUPPORT_0_7 = 0, /* MCS0-7 */ 886 IEEE80211_VHT_MCS_SUPPORT_0_8 = 1, /* MCS0-8 */ 887 IEEE80211_VHT_MCS_SUPPORT_0_9 = 2, /* MCS0-9 */ 888 IEEE80211_VHT_MCS_NOT_SUPPORTED = 3 /* not supported */ 889 }; 890 891 struct ieee80211_vht_mcs_info { 892 uint16_t rx_mcs_map; 893 uint16_t rx_highest; 894 uint16_t tx_mcs_map; 895 uint16_t tx_highest; 896 } __packed; 897 898 /* 802.11ac-2013, 8.4.2.160.1 VHT Capabilities element structure */ 899 struct ieee80211_vht_cap { 900 uint32_t vht_cap_info; 901 struct ieee80211_vht_mcs_info supp_mcs; 902 } __packed; 903 904 /* 802.11ac-2013, Table 8-183x-VHT Operation Information subfields */ 905 enum ieee80211_vht_chanwidth { 906 IEEE80211_VHT_CHANWIDTH_USE_HT = 0, /* 20 MHz or 40 MHz */ 907 IEEE80211_VHT_CHANWIDTH_80MHZ = 1, /* 80MHz */ 908 IEEE80211_VHT_CHANWIDTH_160MHZ = 2, /* 160MHz */ 909 IEEE80211_VHT_CHANWIDTH_80P80MHZ = 3, /* 80+80MHz */ 910 /* 4..255 reserved. */ 911 }; 912 913 /* The name conflicts with the same structure in wpa. Only ifconfig needs this. */ 914 #if defined(_KERNEL) || defined(WANT_NET80211) 915 /* 802.11ac-2013 8.4.2.161 VHT Operation element */ 916 struct ieee80211_vht_operation { 917 uint8_t chan_width; /* enum ieee80211_vht_chanwidth */ 918 uint8_t center_freq_seq0_idx; /* 20/40/80/160 - VHT chan1 */ 919 uint8_t center_freq_seq1_idx; /* 80+80 - VHT chan2 */ 920 uint16_t basic_mcs_set; /* Basic VHT-MCS and NSS Set */ 921 } __packed; 922 #endif 923 924 /* 802.11ac VHT Capabilities */ 925 #define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 0x00000000 926 #define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 0x00000001 927 #define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 0x00000002 928 #define IEEE80211_VHTCAP_MAX_MPDU_MASK 0x00000003 929 #define IEEE80211_VHTCAP_MAX_MPDU_MASK_S 0 930 931 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK 0x0000000C 932 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S 2 933 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_NONE 0 934 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 1 935 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ 2 936 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_RESERVED 3 937 938 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ(_vhtcaps) \ 939 (_IEEE80211_MASKSHIFT(_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= \ 940 IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ) 941 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ(_vhtcaps) \ 942 (_IEEE80211_MASKSHIFT(_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == \ 943 IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ) 944 945 #define IEEE80211_VHTCAP_RXLDPC 0x00000010 946 #define IEEE80211_VHTCAP_RXLDPC_S 4 947 948 #define IEEE80211_VHTCAP_SHORT_GI_80 0x00000020 949 #define IEEE80211_VHTCAP_SHORT_GI_80_S 5 950 951 #define IEEE80211_VHTCAP_SHORT_GI_160 0x00000040 952 #define IEEE80211_VHTCAP_SHORT_GI_160_S 6 953 954 #define IEEE80211_VHTCAP_TXSTBC 0x00000080 955 #define IEEE80211_VHTCAP_TXSTBC_S 7 956 957 #define IEEE80211_VHTCAP_RXSTBC_1 0x00000100 958 #define IEEE80211_VHTCAP_RXSTBC_2 0x00000200 959 #define IEEE80211_VHTCAP_RXSTBC_3 0x00000300 960 #define IEEE80211_VHTCAP_RXSTBC_4 0x00000400 961 #define IEEE80211_VHTCAP_RXSTBC_MASK 0x00000700 962 #define IEEE80211_VHTCAP_RXSTBC_MASK_S 8 963 964 #define IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE 0x00000800 965 #define IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE_S 11 966 967 #define IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE 0x00001000 968 #define IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE_S 12 969 970 #define IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT 13 971 #define IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK \ 972 (7 << IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT) 973 #define IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK_S 13 974 975 #define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT 16 976 #define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK \ 977 (7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT) 978 #define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK_S 16 979 980 #define IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE 0x00080000 981 #define IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE_S 19 982 #define IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE 0x00100000 983 #define IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE_S 20 984 #define IEEE80211_VHTCAP_VHT_TXOP_PS 0x00200000 985 #define IEEE80211_VHTCAP_VHT_TXOP_PS_S 21 986 #define IEEE80211_VHTCAP_HTC_VHT 0x00400000 987 #define IEEE80211_VHTCAP_HTC_VHT_S 22 988 989 #define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 990 #define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ 991 (7 << IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) 992 #define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK_S 23 993 994 #define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK 0x0c000000 995 #define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 996 #define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 997 #define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK_S 26 998 999 #define IEEE80211_VHTCAP_RX_ANTENNA_PATTERN 0x10000000 1000 #define IEEE80211_VHTCAP_RX_ANTENNA_PATTERN_S 28 1001 #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x20000000 1002 #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN_S 29 1003 1004 /* 1005 * XXX TODO: add the rest of the bits 1006 */ 1007 #define IEEE80211_VHTCAP_BITS \ 1008 "\20\1MPDU7991\2MPDU11454\3CHAN160\4CHAN8080\5RXLDPC\6SHORTGI80" \ 1009 "\7SHORTGI160\10RXSTBC1\11RXSTBC2\12RXSTBC3\13RXSTBC4\14BFERCAP" \ 1010 "\15BFEECAP\27VHT\37RXANTPTN\40TXANTPTN" 1011 1012 /* 1013 * VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164 1014 * 1015 * This defines the maximum transmit power for various bandwidths. 1016 */ 1017 /* 1018 * Count is how many elements follow and what they're for: 1019 * 1020 * 0 - 20 MHz 1021 * 1 - 20+40 MHz 1022 * 2 - 20+40+80 MHz 1023 * 3 - 20+40+80+(160, 80+80) MHz 1024 */ 1025 #define IEEE80211_VHT_TXPWRENV_INFO_COUNT_SHIFT 0 1026 #define IEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK 0x07 1027 1028 /* 1029 * Unit is the tx power representation. It should be EIRP for now; 1030 * other values are reserved. 1031 */ 1032 #define IEEE80211_VHT_TXPWRENV_UNIT_MASK 0x38 1033 #define IEEE80211_VHT_TXPWRENV_UNIT_SHIFT 3 1034 1035 /* This value is within the unit mask/shift above */ 1036 #define IEEE80211_VHT_TXPWRENV_UNIT_EIRP 0 1037 1038 struct ieee80211_ie_vht_txpwrenv { 1039 uint8_t ie; 1040 uint8_t len; 1041 uint8_t tx_info; 1042 int8_t tx_elem[0]; /* TX power elements, 1/2 dB, signed */ 1043 }; 1044 1045 /* VHT action codes */ 1046 #define WLAN_ACTION_VHT_COMPRESSED_BF 0 1047 #define WLAN_ACTION_VHT_GROUPID_MGMT 1 1048 #define WLAN_ACTION_VHT_OPMODE_NOTIF 2 1049 1050 /* 1051 * Management information element payloads. 1052 * 1053 * 802.11-2016 Table 9-77 (Element IDs). 1054 */ 1055 1056 enum { 1057 IEEE80211_ELEMID_SSID = 0, 1058 IEEE80211_ELEMID_RATES = 1, 1059 IEEE80211_ELEMID_FHPARMS = 2, 1060 IEEE80211_ELEMID_DSPARMS = 3, 1061 IEEE80211_ELEMID_CFPARMS = 4, 1062 IEEE80211_ELEMID_TIM = 5, 1063 IEEE80211_ELEMID_IBSSPARMS = 6, 1064 IEEE80211_ELEMID_COUNTRY = 7, 1065 IEEE80211_ELEMID_BSSLOAD = 11, 1066 IEEE80211_ELEMID_TSPEC = 13, 1067 IEEE80211_ELEMID_TCLAS = 14, 1068 IEEE80211_ELEMID_CHALLENGE = 16, 1069 /* 17-31 reserved for challenge text extension */ 1070 IEEE80211_ELEMID_PWRCNSTR = 32, 1071 IEEE80211_ELEMID_PWRCAP = 33, 1072 IEEE80211_ELEMID_TPCREQ = 34, 1073 IEEE80211_ELEMID_TPCREP = 35, 1074 IEEE80211_ELEMID_SUPPCHAN = 36, 1075 IEEE80211_ELEMID_CSA = 37, 1076 IEEE80211_ELEMID_MEASREQ = 38, 1077 IEEE80211_ELEMID_MEASREP = 39, 1078 IEEE80211_ELEMID_QUIET = 40, 1079 IEEE80211_ELEMID_IBSSDFS = 41, 1080 IEEE80211_ELEMID_ERP = 42, 1081 IEEE80211_ELEMID_HTCAP = 45, 1082 IEEE80211_ELEMID_QOS = 46, 1083 IEEE80211_ELEMID_RESERVED_47 = 47, 1084 IEEE80211_ELEMID_RSN = 48, 1085 IEEE80211_ELEMID_XRATES = 50, 1086 IEEE80211_ELEMID_APCHANREP = 51, 1087 IEEE80211_ELEMID_MOBILITY_DOMAIN = 54, 1088 IEEE80211_ELEMID_HTINFO = 61, 1089 IEEE80211_ELEMID_SECCHAN_OFFSET = 62, 1090 IEEE80211_ELEMID_RRM_ENACAPS = 70, 1091 IEEE80211_ELEMID_MULTIBSSID = 71, 1092 IEEE80211_ELEMID_COEX_2040 = 72, 1093 IEEE80211_ELEMID_INTOL_CHN_REPORT = 73, 1094 IEEE80211_ELEMID_OVERLAP_BSS_SCAN_PARAM = 74, 1095 IEEE80211_ELEMID_MMIC = 76, 1096 IEEE80211_ELEMID_TSF_REQ = 91, 1097 IEEE80211_ELEMID_TSF_RESP = 92, 1098 IEEE80211_ELEMID_WNM_SLEEP_MODE = 93, 1099 IEEE80211_ELEMID_TIM_BCAST_REQ = 94, 1100 IEEE80211_ELEMID_TIM_BCAST_RESP = 95, 1101 IEEE80211_ELEMID_TPC = 150, 1102 IEEE80211_ELEMID_CCKM = 156, 1103 IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ 1104 1105 /* 1106 * 802.11s IEs 1107 * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55, 1108 * but they defined a new with id 117 called PEER_MGMT. 1109 * NB: complies with open80211 1110 */ 1111 IEEE80211_ELEMID_MESHCONF = 113, 1112 IEEE80211_ELEMID_MESHID = 114, 1113 IEEE80211_ELEMID_MESHLINK = 115, 1114 IEEE80211_ELEMID_MESHCNGST = 116, 1115 IEEE80211_ELEMID_MESHPEER = 117, 1116 IEEE80211_ELEMID_MESHCSA = 118, 1117 IEEE80211_ELEMID_MESHTIM = 39, /* XXX: remove */ 1118 IEEE80211_ELEMID_MESHAWAKEW = 119, 1119 IEEE80211_ELEMID_MESHBEACONT = 120, 1120 /* 121-124 MMCAOP not implemented yet */ 1121 IEEE80211_ELEMID_MESHGANN = 125, 1122 IEEE80211_ELEMID_MESHRANN = 126, 1123 /* 127 Extended Capabilities */ 1124 IEEE80211_ELEMID_EXTCAP = 127, 1125 /* 128-129 reserved */ 1126 IEEE80211_ELEMID_MESHPREQ = 130, 1127 IEEE80211_ELEMID_MESHPREP = 131, 1128 IEEE80211_ELEMID_MESHPERR = 132, 1129 /* 133-136 reserved */ 1130 IEEE80211_ELEMID_MESHPXU = 137, 1131 IEEE80211_ELEMID_MESHPXUC = 138, 1132 IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ 1133 1134 /* 802.11ac-2013, Table 8-54-Element IDs */ 1135 IEEE80211_ELEMID_VHT_CAP = 191, 1136 IEEE80211_ELEMID_VHT_OPMODE = 192, 1137 IEEE80211_ELEMID_EXTENDED_BSS_LOAD = 193, 1138 IEEE80211_ELEMID_WIDE_BW_CHANNEL_SWITCH = 194, 1139 IEEE80211_ELEMID_VHT_PWR_ENV = 195, 1140 IEEE80211_ELEMID_CHANNEL_SWITCH_WRAPPER = 196, 1141 IEEE80211_ELEMID_AID = 197, 1142 IEEE80211_ELEMID_QUIET_CHANNEL = 198, 1143 IEEE80211_ELEMID_OPMODE_NOTIF = 199, 1144 }; 1145 1146 struct ieee80211_tim_ie { 1147 uint8_t tim_ie; /* IEEE80211_ELEMID_TIM */ 1148 uint8_t tim_len; 1149 uint8_t tim_count; /* DTIM count */ 1150 uint8_t tim_period; /* DTIM period */ 1151 uint8_t tim_bitctl; /* bitmap control */ 1152 uint8_t tim_bitmap[1]; /* variable-length bitmap */ 1153 } __packed; 1154 1155 struct ieee80211_country_ie { 1156 uint8_t ie; /* IEEE80211_ELEMID_COUNTRY */ 1157 uint8_t len; 1158 uint8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */ 1159 struct { 1160 uint8_t schan; /* starting channel */ 1161 uint8_t nchan; /* number channels */ 1162 uint8_t maxtxpwr; /* tx power cap */ 1163 } __packed band[1]; /* sub bands (NB: var size) */ 1164 } __packed; 1165 1166 #define IEEE80211_COUNTRY_MAX_BANDS 84 /* max possible bands */ 1167 #define IEEE80211_COUNTRY_MAX_SIZE \ 1168 (sizeof(struct ieee80211_country_ie) + 3*(IEEE80211_COUNTRY_MAX_BANDS-1)) 1169 1170 struct ieee80211_bss_load_ie { 1171 uint8_t ie; 1172 uint8_t len; 1173 uint16_t sta_count; /* station count */ 1174 uint8_t chan_load; /* channel utilization */ 1175 uint8_t aac; /* available admission capacity */ 1176 } __packed; 1177 1178 struct ieee80211_ap_chan_report_ie { 1179 uint8_t ie; 1180 uint8_t len; 1181 uint8_t i_class; /* operating class */ 1182 /* Annex E, E.1 Country information and operating classes */ 1183 uint8_t chan_list[0]; 1184 } __packed; 1185 1186 #define IEEE80211_EXTCAP_CMS (1ULL << 0) /* 20/40 BSS coexistence management support */ 1187 #define IEEE80211_EXTCAP_RSVD_1 (1ULL << 1) 1188 #define IEEE80211_EXTCAP_ECS (1ULL << 2) /* extended channel switching */ 1189 #define IEEE80211_EXTCAP_RSVD_3 (1ULL << 3) 1190 #define IEEE80211_EXTCAP_PSMP_CAP (1ULL << 4) /* PSMP capability */ 1191 #define IEEE80211_EXTCAP_RSVD_5 (1ULL << 5) 1192 #define IEEE80211_EXTCAP_S_PSMP_SUPP (1ULL << 6) 1193 #define IEEE80211_EXTCAP_EVENT (1ULL << 7) 1194 #define IEEE80211_EXTCAP_DIAGNOSTICS (1ULL << 8) 1195 #define IEEE80211_EXTCAP_MCAST_DIAG (1ULL << 9) 1196 #define IEEE80211_EXTCAP_LOC_TRACKING (1ULL << 10) 1197 #define IEEE80211_EXTCAP_FMS (1ULL << 11) 1198 #define IEEE80211_EXTCAP_PROXY_ARP (1ULL << 12) 1199 #define IEEE80211_EXTCAP_CIR (1ULL << 13) /* collocated interference reporting */ 1200 #define IEEE80211_EXTCAP_CIVIC_LOC (1ULL << 14) 1201 #define IEEE80211_EXTCAP_GEOSPATIAL_LOC (1ULL << 15) 1202 #define IEEE80211_EXTCAP_TFS (1ULL << 16) 1203 #define IEEE80211_EXTCAP_WNM_SLEEPMODE (1ULL << 17) 1204 #define IEEE80211_EXTCAP_TIM_BROADCAST (1ULL << 18) 1205 #define IEEE80211_EXTCAP_BSS_TRANSITION (1ULL << 19) 1206 #define IEEE80211_EXTCAP_QOS_TRAF_CAP (1ULL << 20) 1207 #define IEEE80211_EXTCAP_AC_STA_COUNT (1ULL << 21) 1208 #define IEEE80211_EXTCAP_M_BSSID (1ULL << 22) /* multiple BSSID field */ 1209 #define IEEE80211_EXTCAP_TIMING_MEAS (1ULL << 23) 1210 #define IEEE80211_EXTCAP_CHAN_USAGE (1ULL << 24) 1211 #define IEEE80211_EXTCAP_SSID_LIST (1ULL << 25) 1212 #define IEEE80211_EXTCAP_DMS (1ULL << 26) 1213 #define IEEE80211_EXTCAP_UTC_TSF_OFFSET (1ULL << 27) 1214 #define IEEE80211_EXTCAP_TLDS_BUF_STA_SUPP (1ULL << 28) /* TDLS peer U-APSP buffer STA support */ 1215 #define IEEE80211_EXTCAP_TLDS_PPSM_SUPP (1ULL << 29) /* TDLS peer PSM support */ 1216 #define IEEE80211_EXTCAP_TLDS_CH_SW (1ULL << 30) /* TDLS channel switching */ 1217 #define IEEE80211_EXTCAP_INTERWORKING (1ULL << 31) 1218 #define IEEE80211_EXTCAP_QOSMAP (1ULL << 32) 1219 #define IEEE80211_EXTCAP_EBR (1ULL << 33) 1220 #define IEEE80211_EXTCAP_SSPN_IF (1ULL << 34) 1221 #define IEEE80211_EXTCAP_RSVD_35 (1ULL << 35) 1222 #define IEEE80211_EXTCAP_MSGCF_CAP (1ULL << 36) 1223 #define IEEE80211_EXTCAP_TLDS_SUPP (1ULL << 37) 1224 #define IEEE80211_EXTCAP_TLDS_PROHIB (1ULL << 38) 1225 #define IEEE80211_EXTCAP_TLDS_CH_SW_PROHIB (1ULL << 39) /* TDLS channel switching prohibited */ 1226 #define IEEE80211_EXTCAP_RUF (1ULL << 40) /* reject unadmitted frame */ 1227 /* service interval granularity */ 1228 #define IEEE80211_EXTCAP_SIG \ 1229 ((1ULL << 41) | (1ULL << 42) | (1ULL << 43)) 1230 #define IEEE80211_EXTCAP_ID_LOC (1ULL << 44) 1231 #define IEEE80211_EXTCAP_U_APSD_COEX (1ULL << 45) 1232 #define IEEE80211_EXTCAP_WNM_NOTIFICATION (1ULL << 46) 1233 #define IEEE80211_EXTCAP_RSVD_47 (1ULL << 47) 1234 #define IEEE80211_EXTCAP_SSID (1ULL << 48) /* UTF-8 SSID */ 1235 /* bits 49-n are reserved */ 1236 1237 struct ieee80211_extcap_ie { 1238 uint8_t ie; 1239 uint8_t len; 1240 } __packed; 1241 1242 /* 1243 * 802.11h Quiet Time Element. 1244 */ 1245 struct ieee80211_quiet_ie { 1246 uint8_t quiet_ie; /* IEEE80211_ELEMID_QUIET */ 1247 uint8_t len; 1248 uint8_t tbttcount; /* quiet start */ 1249 uint8_t period; /* beacon intervals between quiets */ 1250 uint16_t duration; /* TUs of each quiet*/ 1251 uint16_t offset; /* TUs of from TBTT of quiet start */ 1252 } __packed; 1253 1254 /* 1255 * 802.11h Channel Switch Announcement (CSA). 1256 */ 1257 struct ieee80211_csa_ie { 1258 uint8_t csa_ie; /* IEEE80211_ELEMID_CHANSWITCHANN */ 1259 uint8_t csa_len; 1260 uint8_t csa_mode; /* Channel Switch Mode */ 1261 uint8_t csa_newchan; /* New Channel Number */ 1262 uint8_t csa_count; /* Channel Switch Count */ 1263 } __packed; 1264 1265 /* 1266 * Note the min acceptable CSA count is used to guard against 1267 * malicious CSA injection in station mode. Defining this value 1268 * as other than 0 violates the 11h spec. 1269 */ 1270 #define IEEE80211_CSA_COUNT_MIN 2 1271 #define IEEE80211_CSA_COUNT_MAX 255 1272 1273 /* rate set entries are in .5 Mb/s units, and potentially marked as basic */ 1274 #define IEEE80211_RATE_BASIC 0x80 1275 #define IEEE80211_RATE_VAL 0x7f 1276 #define IEEE80211_RV(v) ((v) & IEEE80211_RATE_VAL) 1277 1278 /* ERP information element flags */ 1279 #define IEEE80211_ERP_NON_ERP_PRESENT 0x01 1280 #define IEEE80211_ERP_USE_PROTECTION 0x02 1281 #define IEEE80211_ERP_LONG_PREAMBLE 0x04 1282 1283 #define IEEE80211_ERP_BITS \ 1284 "\20\1NON_ERP_PRESENT\2USE_PROTECTION\3LONG_PREAMBLE" 1285 1286 #define ATH_OUI 0x7f0300 /* Atheros OUI */ 1287 #define ATH_OUI_TYPE 0x01 /* Atheros protocol ie */ 1288 1289 /* NB: Atheros allocated the OUI for this purpose ~2005 but beware ... */ 1290 #define TDMA_OUI ATH_OUI 1291 #define TDMA_OUI_TYPE 0x02 /* TDMA protocol ie */ 1292 1293 #define BCM_OUI 0x4c9000 /* Broadcom OUI */ 1294 #define BCM_OUI_HTCAP 51 /* pre-draft HTCAP ie */ 1295 #define BCM_OUI_HTINFO 52 /* pre-draft HTINFO ie */ 1296 1297 #define WPA_OUI 0xf25000 1298 #define WPA_OUI_TYPE 0x01 1299 #define WPA_VERSION 1 /* current supported version */ 1300 1301 #define WPA_CSE_NULL 0x00 1302 #define WPA_CSE_WEP40 0x01 1303 #define WPA_CSE_TKIP 0x02 1304 #define WPA_CSE_CCMP 0x04 /* CCMP 128-bit */ 1305 #define WPA_CSE_WEP104 0x05 1306 1307 #define WPA_ASE_NONE 0x00 1308 #define WPA_ASE_8021X_UNSPEC 0x01 1309 #define WPA_ASE_8021X_PSK 0x02 1310 1311 #define WPS_OUI_TYPE 0x04 1312 1313 /* 802.11-2016 Table 9-131 - Cipher Suite Selectors */ 1314 #define RSN_OUI 0xac0f00 1315 #define RSN_VERSION 1 /* current supported version */ 1316 1317 /* RSN cipher suite element */ 1318 #define RSN_CSE_NULL 0 1319 #define RSN_CSE_WEP40 1 1320 #define RSN_CSE_TKIP 2 1321 #define RSN_CSE_WRAP 3 /* Reserved in the 802.11-2016 */ 1322 #define RSN_CSE_CCMP 4 /* CCMP 128 bit */ 1323 #define RSN_CSE_WEP104 5 1324 #define RSN_CSE_BIP_CMAC_128 6 1325 /* 7 - "Group addressed traffic not allowed" */ 1326 #define RSN_CSE_GCMP_128 8 1327 #define RSN_CSE_GCMP_256 9 1328 #define RSN_CSE_CCMP_256 10 1329 #define RSN_CSE_BIP_GMAC_128 11 1330 #define RSN_CSE_BIP_GMAC_256 12 1331 #define RSN_CSE_BIP_CMAC_256 13 1332 1333 /* 802.11-2016 Table 9-133 - AKM suite selectors */ 1334 /* RSN AKM suite element */ 1335 #define RSN_ASE_NONE 0 1336 #define RSN_ASE_8021X_UNSPEC 1 1337 #define RSN_ASE_8021X_PSK 2 1338 #define RSN_ASE_FT_8021X 3 /* SHA-256 */ 1339 #define RSN_ASE_FT_PSK 4 /* SHA-256 */ 1340 #define RSN_ASE_8021X_UNSPEC_SHA256 5 1341 #define RSN_ASE_8021X_PSK_SHA256 6 1342 #define RSN_ASE_8021X_TDLS 7 /* SHA-256 */ 1343 #define RSN_ASE_SAE_UNSPEC 8 /* SHA-256 */ 1344 #define RSN_ASE_FT_SAE 9 /* SHA-256 */ 1345 #define RSN_ASE_AP_PEERKEY 10 /* SHA-256 */ 1346 #define RSN_ASE_8021X_SUITE_B_SHA256 11 1347 #define RSN_ASE_8021X_SUITE_B_SHA384 12 1348 #define RSN_ASE_FT_8021X_SHA384 13 1349 1350 /* 802.11-2016 Figure 9-257 - RSN Capabilities (2 byte field) */ 1351 #define RSN_CAP_PREAUTH 0x0001 1352 #define RSN_CAP_NO_PAIRWISE 0x0002 1353 #define RSN_CAP_PTKSA_REPLAY_COUNTER 0x000c /* 2 bit field */ 1354 #define RSN_CAP_GTKSA_REPLAY_COUNTER 0x0030 /* 2 bit field */ 1355 #define RSN_CAP_MFP_REQUIRED 0x0040 1356 #define RSN_CAP_MFP_CAPABLE 0x0080 1357 #define RSN_CAP_JOINT_MULTIBAND_RSNA 0x0100 1358 #define RSN_CAP_PEERKEY_ENABLED 0x0200 1359 #define RSN_CAP_SPP_AMSDU_CAPABLE 0x0400 1360 #define RSN_CAP_SPP_AMSDU_REQUIRED 0x0800 1361 #define RSN_CAP_PBAC_CAPABLE 0x1000 1362 #define RSN_CAP_EXT_KEYID_CAPABLE 0x0200 1363 1364 /* 802.11-2016 Table 9-134 PTKSA/GTKSA/STKSA replay counters usage */ 1365 #define RSN_CAP_REPLAY_COUNTER_1_PER 0 1366 #define RSN_CAP_REPLAY_COUNTER_2_PER 1 1367 #define RSN_CAP_REPLAY_COUNTER_4_PER 2 1368 #define RSN_CAP_REPLAY_COUNTER_16_PER 3 1369 1370 #define WME_OUI 0xf25000 1371 #define WME_OUI_TYPE 0x02 1372 #define WME_INFO_OUI_SUBTYPE 0x00 1373 #define WME_PARAM_OUI_SUBTYPE 0x01 1374 #define WME_VERSION 1 1375 1376 /* WME stream classes */ 1377 #define WME_AC_BE 0 /* best effort */ 1378 #define WME_AC_BK 1 /* background */ 1379 #define WME_AC_VI 2 /* video */ 1380 #define WME_AC_VO 3 /* voice */ 1381 1382 /* 1383 * AUTH management packets 1384 * 1385 * octet algo[2] 1386 * octet seq[2] 1387 * octet status[2] 1388 * octet chal.id 1389 * octet chal.length 1390 * octet chal.text[253] NB: 1-253 bytes 1391 */ 1392 1393 /* challenge length for shared key auth */ 1394 #define IEEE80211_CHALLENGE_LEN 128 1395 1396 #define IEEE80211_AUTH_ALG_OPEN 0x0000 1397 #define IEEE80211_AUTH_ALG_SHARED 0x0001 1398 #define IEEE80211_AUTH_ALG_LEAP 0x0080 1399 1400 enum { 1401 IEEE80211_AUTH_OPEN_REQUEST = 1, 1402 IEEE80211_AUTH_OPEN_RESPONSE = 2, 1403 }; 1404 1405 enum { 1406 IEEE80211_AUTH_SHARED_REQUEST = 1, 1407 IEEE80211_AUTH_SHARED_CHALLENGE = 2, 1408 IEEE80211_AUTH_SHARED_RESPONSE = 3, 1409 IEEE80211_AUTH_SHARED_PASS = 4, 1410 }; 1411 1412 /* 1413 * Reason and status codes. 1414 * 1415 * Reason codes are used in management frames to indicate why an 1416 * action took place (e.g. on disassociation). Status codes are 1417 * used in management frames to indicate the result of an operation. 1418 * 1419 * Unlisted codes are reserved 1420 */ 1421 1422 enum { 1423 IEEE80211_REASON_UNSPECIFIED = 1, 1424 IEEE80211_REASON_AUTH_EXPIRE = 2, 1425 IEEE80211_REASON_AUTH_LEAVE = 3, 1426 IEEE80211_REASON_ASSOC_EXPIRE = 4, 1427 IEEE80211_REASON_ASSOC_TOOMANY = 5, 1428 IEEE80211_REASON_NOT_AUTHED = 6, 1429 IEEE80211_REASON_NOT_ASSOCED = 7, 1430 IEEE80211_REASON_ASSOC_LEAVE = 8, 1431 IEEE80211_REASON_ASSOC_NOT_AUTHED = 9, 1432 IEEE80211_REASON_DISASSOC_PWRCAP_BAD = 10, /* 11h */ 1433 IEEE80211_REASON_DISASSOC_SUPCHAN_BAD = 11, /* 11h */ 1434 IEEE80211_REASON_IE_INVALID = 13, /* 11i */ 1435 IEEE80211_REASON_MIC_FAILURE = 14, /* 11i */ 1436 IEEE80211_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, /* 11i */ 1437 IEEE80211_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, /* 11i */ 1438 IEEE80211_REASON_IE_IN_4WAY_DIFFERS = 17, /* 11i */ 1439 IEEE80211_REASON_GROUP_CIPHER_INVALID = 18, /* 11i */ 1440 IEEE80211_REASON_PAIRWISE_CIPHER_INVALID= 19, /* 11i */ 1441 IEEE80211_REASON_AKMP_INVALID = 20, /* 11i */ 1442 IEEE80211_REASON_UNSUPP_RSN_IE_VERSION = 21, /* 11i */ 1443 IEEE80211_REASON_INVALID_RSN_IE_CAP = 22, /* 11i */ 1444 IEEE80211_REASON_802_1X_AUTH_FAILED = 23, /* 11i */ 1445 IEEE80211_REASON_CIPHER_SUITE_REJECTED = 24, /* 11i */ 1446 IEEE80211_REASON_UNSPECIFIED_QOS = 32, /* 11e */ 1447 IEEE80211_REASON_INSUFFICIENT_BW = 33, /* 11e */ 1448 IEEE80211_REASON_TOOMANY_FRAMES = 34, /* 11e */ 1449 IEEE80211_REASON_OUTSIDE_TXOP = 35, /* 11e */ 1450 IEEE80211_REASON_LEAVING_QBSS = 36, /* 11e */ 1451 IEEE80211_REASON_BAD_MECHANISM = 37, /* 11e */ 1452 IEEE80211_REASON_SETUP_NEEDED = 38, /* 11e */ 1453 IEEE80211_REASON_TIMEOUT = 39, /* 11e */ 1454 1455 IEEE80211_REASON_PEER_LINK_CANCELED = 52, /* 11s */ 1456 IEEE80211_REASON_MESH_MAX_PEERS = 53, /* 11s */ 1457 IEEE80211_REASON_MESH_CPVIOLATION = 54, /* 11s */ 1458 IEEE80211_REASON_MESH_CLOSE_RCVD = 55, /* 11s */ 1459 IEEE80211_REASON_MESH_MAX_RETRIES = 56, /* 11s */ 1460 IEEE80211_REASON_MESH_CONFIRM_TIMEOUT = 57, /* 11s */ 1461 IEEE80211_REASON_MESH_INVALID_GTK = 58, /* 11s */ 1462 IEEE80211_REASON_MESH_INCONS_PARAMS = 59, /* 11s */ 1463 IEEE80211_REASON_MESH_INVALID_SECURITY = 60, /* 11s */ 1464 IEEE80211_REASON_MESH_PERR_NO_PROXY = 61, /* 11s */ 1465 IEEE80211_REASON_MESH_PERR_NO_FI = 62, /* 11s */ 1466 IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 63, /* 11s */ 1467 IEEE80211_REASON_MESH_MAC_ALRDY_EXISTS_MBSS = 64, /* 11s */ 1468 IEEE80211_REASON_MESH_CHAN_SWITCH_REG = 65, /* 11s */ 1469 IEEE80211_REASON_MESH_CHAN_SWITCH_UNSPEC = 66, /* 11s */ 1470 1471 IEEE80211_STATUS_SUCCESS = 0, 1472 IEEE80211_STATUS_UNSPECIFIED = 1, 1473 IEEE80211_STATUS_CAPINFO = 10, 1474 IEEE80211_STATUS_NOT_ASSOCED = 11, 1475 IEEE80211_STATUS_OTHER = 12, 1476 IEEE80211_STATUS_ALG = 13, 1477 IEEE80211_STATUS_SEQUENCE = 14, 1478 IEEE80211_STATUS_CHALLENGE = 15, 1479 IEEE80211_STATUS_TIMEOUT = 16, 1480 IEEE80211_STATUS_TOOMANY = 17, 1481 IEEE80211_STATUS_BASIC_RATE = 18, 1482 IEEE80211_STATUS_SP_REQUIRED = 19, /* 11b */ 1483 IEEE80211_STATUS_PBCC_REQUIRED = 20, /* 11b */ 1484 IEEE80211_STATUS_CA_REQUIRED = 21, /* 11b */ 1485 IEEE80211_STATUS_SPECMGMT_REQUIRED = 22, /* 11h */ 1486 IEEE80211_STATUS_PWRCAP_REQUIRED = 23, /* 11h */ 1487 IEEE80211_STATUS_SUPCHAN_REQUIRED = 24, /* 11h */ 1488 IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25, /* 11g */ 1489 IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26, /* 11g */ 1490 IEEE80211_STATUS_MISSING_HT_CAPS = 27, /* 11n D3.0 */ 1491 IEEE80211_STATUS_INVALID_IE = 40, /* 11i */ 1492 IEEE80211_STATUS_GROUP_CIPHER_INVALID = 41, /* 11i */ 1493 IEEE80211_STATUS_PAIRWISE_CIPHER_INVALID = 42, /* 11i */ 1494 IEEE80211_STATUS_AKMP_INVALID = 43, /* 11i */ 1495 IEEE80211_STATUS_UNSUPP_RSN_IE_VERSION = 44, /* 11i */ 1496 IEEE80211_STATUS_INVALID_RSN_IE_CAP = 45, /* 11i */ 1497 IEEE80211_STATUS_CIPHER_SUITE_REJECTED = 46, /* 11i */ 1498 }; 1499 1500 #define IEEE80211_WEP_KEYLEN 5 /* 40bit */ 1501 #define IEEE80211_WEP_IVLEN 3 /* 24bit */ 1502 #define IEEE80211_WEP_KIDLEN 1 /* 1 octet */ 1503 #define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */ 1504 #define IEEE80211_WEP_TOTLEN (IEEE80211_WEP_IVLEN + \ 1505 IEEE80211_WEP_KIDLEN + \ 1506 IEEE80211_WEP_CRCLEN) 1507 #define IEEE80211_WEP_NKID 4 /* number of key ids */ 1508 1509 /* 1510 * 802.11i defines an extended IV for use with non-WEP ciphers. 1511 * When the EXTIV bit is set in the key id byte an additional 1512 * 4 bytes immediately follow the IV for TKIP. For CCMP the 1513 * EXTIV bit is likewise set but the 8 bytes represent the 1514 * CCMP header rather than IV+extended-IV. 1515 */ 1516 #define IEEE80211_WEP_EXTIV 0x20 1517 #define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */ 1518 #define IEEE80211_WEP_MICLEN 8 /* trailing MIC */ 1519 1520 #define IEEE80211_CRC_LEN 4 1521 1522 /* 1523 * Maximum acceptable MTU is: 1524 * IEEE80211_MAX_LEN - WEP overhead - CRC - 1525 * QoS overhead - RSN/WPA overhead 1526 * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default 1527 * mtu is Ethernet-compatible; it's set by ether_ifattach. 1528 */ 1529 #define IEEE80211_MTU_MAX 2290 1530 #define IEEE80211_MTU_MIN 32 1531 1532 #define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \ 1533 (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN)) 1534 #define IEEE80211_ACK_LEN \ 1535 (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN) 1536 #define IEEE80211_MIN_LEN \ 1537 (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN) 1538 1539 /* 1540 * The 802.11 spec says at most 2007 stations may be 1541 * associated at once. For most AP's this is way more 1542 * than is feasible so we use a default of IEEE80211_AID_DEF. 1543 * This number may be overridden by the driver and/or by 1544 * user configuration but may not be less than IEEE80211_AID_MIN 1545 * (see _ieee80211.h for implementation-specific settings). 1546 */ 1547 #define IEEE80211_AID_MAX 2007 1548 1549 #define IEEE80211_AID(b) ((b) &~ 0xc000) 1550 1551 /* 1552 * RTS frame length parameters. The default is specified in 1553 * the 802.11 spec as 512; we treat it as implementation-dependent 1554 * so it's defined in ieee80211_var.h. The max may be wrong 1555 * for jumbo frames. 1556 */ 1557 #define IEEE80211_RTS_MIN 1 1558 #define IEEE80211_RTS_MAX 2346 1559 1560 /* 1561 * TX fragmentation parameters. As above for RTS, we treat 1562 * default as implementation-dependent so define it elsewhere. 1563 */ 1564 #define IEEE80211_FRAG_MIN 256 1565 #define IEEE80211_FRAG_MAX 2346 1566 1567 /* 1568 * Beacon interval (TU's). Min+max come from WiFi requirements. 1569 * As above, we treat default as implementation-dependent so 1570 * define it elsewhere. 1571 */ 1572 #define IEEE80211_BINTVAL_MAX 1000 /* max beacon interval (TU's) */ 1573 #define IEEE80211_BINTVAL_MIN 25 /* min beacon interval (TU's) */ 1574 1575 /* 1576 * DTIM period (beacons). Min+max are not really defined 1577 * by the protocol but we want them publicly visible so 1578 * define them here. 1579 */ 1580 #define IEEE80211_DTIM_MAX 15 /* max DTIM period */ 1581 #define IEEE80211_DTIM_MIN 1 /* min DTIM period */ 1582 1583 /* 1584 * Beacon miss threshold (beacons). As for DTIM, we define 1585 * them here to be publicly visible. Note the max may be 1586 * clamped depending on device capabilities. 1587 */ 1588 #define IEEE80211_HWBMISS_MIN 1 1589 #define IEEE80211_HWBMISS_MAX 255 1590 1591 /* 1592 * 802.11 frame duration definitions. 1593 */ 1594 1595 struct ieee80211_duration { 1596 uint16_t d_rts_dur; 1597 uint16_t d_data_dur; 1598 uint16_t d_plcp_len; 1599 uint8_t d_residue; /* unused octets in time slot */ 1600 }; 1601 1602 /* One Time Unit (TU) is 1Kus = 1024 microseconds. */ 1603 #define IEEE80211_DUR_TU 1024 1604 1605 /* IEEE 802.11b durations for DSSS PHY in microseconds */ 1606 #define IEEE80211_DUR_DS_LONG_PREAMBLE 144 1607 #define IEEE80211_DUR_DS_SHORT_PREAMBLE 72 1608 1609 #define IEEE80211_DUR_DS_SLOW_PLCPHDR 48 1610 #define IEEE80211_DUR_DS_FAST_PLCPHDR 24 1611 #define IEEE80211_DUR_DS_SLOW_ACK 112 1612 #define IEEE80211_DUR_DS_FAST_ACK 56 1613 #define IEEE80211_DUR_DS_SLOW_CTS 112 1614 #define IEEE80211_DUR_DS_FAST_CTS 56 1615 1616 #define IEEE80211_DUR_DS_SLOT 20 1617 #define IEEE80211_DUR_DS_SIFS 10 1618 #define IEEE80211_DUR_DS_PIFS (IEEE80211_DUR_DS_SIFS + IEEE80211_DUR_DS_SLOT) 1619 #define IEEE80211_DUR_DS_DIFS (IEEE80211_DUR_DS_SIFS + \ 1620 2 * IEEE80211_DUR_DS_SLOT) 1621 #define IEEE80211_DUR_DS_EIFS (IEEE80211_DUR_DS_SIFS + \ 1622 IEEE80211_DUR_DS_SLOW_ACK + \ 1623 IEEE80211_DUR_DS_LONG_PREAMBLE + \ 1624 IEEE80211_DUR_DS_SLOW_PLCPHDR + \ 1625 IEEE80211_DUR_DIFS) 1626 1627 #endif /* _NET80211_IEEE80211_H_ */ 1628