Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 1 | /* |
Howard Harte | 3b7f77a | 2009-05-07 09:59:52 -0700 | [diff] [blame^] | 2 | * Copyright (C) 1999-2009, Broadcom Corporation |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 3 | * |
Howard Harte | f42f81d | 2009-03-30 17:09:32 -0700 | [diff] [blame] | 4 | * Unless you and Broadcom execute a separate written software license |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 5 | * agreement governing use of this software, this software is licensed to you |
Howard Harte | 3b7f77a | 2009-05-07 09:59:52 -0700 | [diff] [blame^] | 6 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
Howard Harte | f42f81d | 2009-03-30 17:09:32 -0700 | [diff] [blame] | 7 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 8 | * following added to such license: |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 9 | * |
Howard Harte | f42f81d | 2009-03-30 17:09:32 -0700 | [diff] [blame] | 10 | * As a special exception, the copyright holders of this software give you |
| 11 | * permission to link this software with independent modules, and to copy and |
| 12 | * distribute the resulting executable under terms of your choice, provided that |
| 13 | * you also meet, for each linked independent module, the terms and conditions of |
| 14 | * the license of that module. An independent module is a module which is not |
| 15 | * derived from this software. The special exception does not apply to any |
| 16 | * modifications of the software. |
| 17 | * |
| 18 | * Notwithstanding the above, under no circumstances may you combine this |
| 19 | * software in any way with any other Broadcom software provided under a license |
| 20 | * other than the GPL, without Broadcom's express prior written consent. |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 21 | * |
| 22 | * Fundamental types and constants relating to 802.11 |
| 23 | * |
Howard Harte | f42f81d | 2009-03-30 17:09:32 -0700 | [diff] [blame] | 24 | * $Id: 802.11.h,v 9.219.4.1.4.5.20.6 2009/03/05 21:13:45 Exp $ |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 25 | */ |
| 26 | |
| 27 | |
| 28 | #ifndef _802_11_H_ |
| 29 | #define _802_11_H_ |
| 30 | |
| 31 | #ifndef _TYPEDEFS_H_ |
| 32 | #include <typedefs.h> |
| 33 | #endif |
| 34 | |
| 35 | #ifndef _NET_ETHERNET_H_ |
| 36 | #include <proto/ethernet.h> |
| 37 | #endif |
| 38 | |
| 39 | #include <proto/wpa.h> |
| 40 | |
| 41 | |
| 42 | #include <packed_section_start.h> |
| 43 | |
| 44 | |
| 45 | #define DOT11_TU_TO_US 1024 |
| 46 | |
| 47 | |
| 48 | #define DOT11_A3_HDR_LEN 24 |
| 49 | #define DOT11_A4_HDR_LEN 30 |
| 50 | #define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN |
| 51 | #define DOT11_FCS_LEN 4 |
| 52 | #define DOT11_ICV_LEN 4 |
| 53 | #define DOT11_ICV_AES_LEN 8 |
| 54 | #define DOT11_QOS_LEN 2 |
| 55 | #define DOT11_HTC_LEN 4 |
| 56 | |
| 57 | #define DOT11_KEY_INDEX_SHIFT 6 |
| 58 | #define DOT11_IV_LEN 4 |
| 59 | #define DOT11_IV_TKIP_LEN 8 |
| 60 | #define DOT11_IV_AES_OCB_LEN 4 |
| 61 | #define DOT11_IV_AES_CCM_LEN 8 |
| 62 | #define DOT11_IV_MAX_LEN 8 |
| 63 | |
| 64 | |
| 65 | #define DOT11_MAX_MPDU_BODY_LEN 2304 |
| 66 | |
| 67 | #define DOT11_MAX_MPDU_LEN (DOT11_A4_HDR_LEN + \ |
| 68 | DOT11_QOS_LEN + \ |
| 69 | DOT11_IV_AES_CCM_LEN + \ |
| 70 | DOT11_MAX_MPDU_BODY_LEN + \ |
| 71 | DOT11_ICV_LEN + \ |
| 72 | DOT11_FCS_LEN) |
| 73 | |
| 74 | #define DOT11_MAX_SSID_LEN 32 |
| 75 | |
| 76 | |
| 77 | #define DOT11_DEFAULT_RTS_LEN 2347 |
| 78 | #define DOT11_MAX_RTS_LEN 2347 |
| 79 | |
| 80 | |
| 81 | #define DOT11_MIN_FRAG_LEN 256 |
| 82 | #define DOT11_MAX_FRAG_LEN 2346 |
| 83 | #define DOT11_DEFAULT_FRAG_LEN 2346 |
| 84 | |
| 85 | |
| 86 | #define DOT11_MIN_BEACON_PERIOD 1 |
| 87 | #define DOT11_MAX_BEACON_PERIOD 0xFFFF |
| 88 | |
| 89 | |
| 90 | #define DOT11_MIN_DTIM_PERIOD 1 |
| 91 | #define DOT11_MAX_DTIM_PERIOD 0xFF |
| 92 | |
| 93 | |
| 94 | #define DOT11_LLC_SNAP_HDR_LEN 8 |
| 95 | #define DOT11_OUI_LEN 3 |
| 96 | BWL_PRE_PACKED_STRUCT struct dot11_llc_snap_header { |
| 97 | uint8 dsap; |
| 98 | uint8 ssap; |
| 99 | uint8 ctl; |
| 100 | uint8 oui[DOT11_OUI_LEN]; |
| 101 | uint16 type; |
| 102 | } BWL_POST_PACKED_STRUCT; |
| 103 | |
| 104 | |
| 105 | #define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN) |
| 106 | |
| 107 | |
| 108 | |
| 109 | BWL_PRE_PACKED_STRUCT struct dot11_header { |
| 110 | uint16 fc; |
| 111 | uint16 durid; |
| 112 | struct ether_addr a1; |
| 113 | struct ether_addr a2; |
| 114 | struct ether_addr a3; |
| 115 | uint16 seq; |
| 116 | struct ether_addr a4; |
| 117 | } BWL_POST_PACKED_STRUCT; |
| 118 | |
| 119 | |
| 120 | |
| 121 | BWL_PRE_PACKED_STRUCT struct dot11_rts_frame { |
| 122 | uint16 fc; |
| 123 | uint16 durid; |
| 124 | struct ether_addr ra; |
| 125 | struct ether_addr ta; |
| 126 | } BWL_POST_PACKED_STRUCT; |
| 127 | #define DOT11_RTS_LEN 16 |
| 128 | |
| 129 | BWL_PRE_PACKED_STRUCT struct dot11_cts_frame { |
| 130 | uint16 fc; |
| 131 | uint16 durid; |
| 132 | struct ether_addr ra; |
| 133 | } BWL_POST_PACKED_STRUCT; |
| 134 | #define DOT11_CTS_LEN 10 |
| 135 | |
| 136 | BWL_PRE_PACKED_STRUCT struct dot11_ack_frame { |
| 137 | uint16 fc; |
| 138 | uint16 durid; |
| 139 | struct ether_addr ra; |
| 140 | } BWL_POST_PACKED_STRUCT; |
| 141 | #define DOT11_ACK_LEN 10 |
| 142 | |
| 143 | BWL_PRE_PACKED_STRUCT struct dot11_ps_poll_frame { |
| 144 | uint16 fc; |
| 145 | uint16 durid; |
| 146 | struct ether_addr bssid; |
| 147 | struct ether_addr ta; |
| 148 | } BWL_POST_PACKED_STRUCT; |
| 149 | #define DOT11_PS_POLL_LEN 16 |
| 150 | |
| 151 | BWL_PRE_PACKED_STRUCT struct dot11_cf_end_frame { |
| 152 | uint16 fc; |
| 153 | uint16 durid; |
| 154 | struct ether_addr ra; |
| 155 | struct ether_addr bssid; |
| 156 | } BWL_POST_PACKED_STRUCT; |
| 157 | #define DOT11_CS_END_LEN 16 |
| 158 | |
| 159 | BWL_PRE_PACKED_STRUCT struct dot11_action_wifi_vendor_specific { |
| 160 | uint8 category; |
| 161 | uint8 OUI[3]; |
| 162 | uint8 type; |
| 163 | uint8 subtype; |
| 164 | uint8 data[1040]; |
| 165 | struct dot11_action_wifi_vendor_specific* next_node; |
| 166 | } BWL_POST_PACKED_STRUCT; |
| 167 | |
| 168 | typedef struct dot11_action_wifi_vendor_specific dot11_action_wifi_vendor_specific_t; |
| 169 | |
| 170 | #define DOT11_BA_CTL_POLICY_NORMAL 0x0000 |
| 171 | #define DOT11_BA_CTL_POLICY_NOACK 0x0001 |
| 172 | #define DOT11_BA_CTL_POLICY_MASK 0x0001 |
| 173 | |
| 174 | #define DOT11_BA_CTL_MTID 0x0002 |
| 175 | #define DOT11_BA_CTL_COMPRESSED 0x0004 |
| 176 | |
| 177 | #define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0 |
| 178 | #define DOT11_BA_CTL_NUMMSDU_SHIFT 6 |
| 179 | |
| 180 | #define DOT11_BA_CTL_TID_MASK 0xF000 |
| 181 | #define DOT11_BA_CTL_TID_SHIFT 12 |
| 182 | |
| 183 | |
| 184 | BWL_PRE_PACKED_STRUCT struct dot11_ctl_header { |
| 185 | uint16 fc; |
| 186 | uint16 durid; |
| 187 | struct ether_addr ra; |
| 188 | struct ether_addr ta; |
| 189 | } BWL_POST_PACKED_STRUCT; |
| 190 | #define DOT11_CTL_HDR_LEN 16 |
| 191 | |
| 192 | |
| 193 | BWL_PRE_PACKED_STRUCT struct dot11_bar { |
| 194 | uint16 bar_control; |
| 195 | uint16 seqnum; |
| 196 | } BWL_POST_PACKED_STRUCT; |
| 197 | #define DOT11_BAR_LEN 4 |
| 198 | |
| 199 | #define DOT11_BA_BITMAP_LEN 128 |
| 200 | #define DOT11_BA_CMP_BITMAP_LEN 8 |
| 201 | |
| 202 | BWL_PRE_PACKED_STRUCT struct dot11_ba { |
| 203 | uint16 ba_control; |
| 204 | uint16 seqnum; |
| 205 | uint8 bitmap[DOT11_BA_BITMAP_LEN]; |
| 206 | } BWL_POST_PACKED_STRUCT; |
| 207 | #define DOT11_BA_LEN 4 |
| 208 | |
| 209 | |
| 210 | BWL_PRE_PACKED_STRUCT struct dot11_management_header { |
| 211 | uint16 fc; |
| 212 | uint16 durid; |
| 213 | struct ether_addr da; |
| 214 | struct ether_addr sa; |
| 215 | struct ether_addr bssid; |
| 216 | uint16 seq; |
| 217 | } BWL_POST_PACKED_STRUCT; |
| 218 | #define DOT11_MGMT_HDR_LEN 24 |
| 219 | |
| 220 | |
| 221 | |
| 222 | BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb { |
| 223 | uint32 timestamp[2]; |
| 224 | uint16 beacon_interval; |
| 225 | uint16 capability; |
| 226 | } BWL_POST_PACKED_STRUCT; |
| 227 | #define DOT11_BCN_PRB_LEN 12 |
| 228 | |
| 229 | BWL_PRE_PACKED_STRUCT struct dot11_auth { |
| 230 | uint16 alg; |
| 231 | uint16 seq; |
| 232 | uint16 status; |
| 233 | } BWL_POST_PACKED_STRUCT; |
| 234 | #define DOT11_AUTH_FIXED_LEN 6 |
| 235 | |
| 236 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_req { |
| 237 | uint16 capability; |
| 238 | uint16 listen; |
| 239 | } BWL_POST_PACKED_STRUCT; |
| 240 | #define DOT11_ASSOC_REQ_FIXED_LEN 4 |
| 241 | |
| 242 | BWL_PRE_PACKED_STRUCT struct dot11_reassoc_req { |
| 243 | uint16 capability; |
| 244 | uint16 listen; |
| 245 | struct ether_addr ap; |
| 246 | } BWL_POST_PACKED_STRUCT; |
| 247 | #define DOT11_REASSOC_REQ_FIXED_LEN 10 |
| 248 | |
| 249 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_resp { |
| 250 | uint16 capability; |
| 251 | uint16 status; |
| 252 | uint16 aid; |
| 253 | } BWL_POST_PACKED_STRUCT; |
| 254 | |
| 255 | BWL_PRE_PACKED_STRUCT struct dot11_action_measure { |
| 256 | uint8 category; |
| 257 | uint8 action; |
| 258 | uint8 token; |
| 259 | uint8 data[1]; |
| 260 | } BWL_POST_PACKED_STRUCT; |
| 261 | #define DOT11_ACTION_MEASURE_LEN 3 |
| 262 | |
| 263 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_ch_width { |
| 264 | uint8 category; |
| 265 | uint8 action; |
| 266 | uint8 ch_width; |
| 267 | } BWL_POST_PACKED_STRUCT; |
| 268 | |
| 269 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_mimops { |
| 270 | uint8 category; |
| 271 | uint8 action; |
| 272 | uint8 control; |
| 273 | } BWL_POST_PACKED_STRUCT; |
| 274 | |
| 275 | #define SM_PWRSAVE_ENABLE 1 |
| 276 | #define SM_PWRSAVE_MODE 2 |
| 277 | |
| 278 | |
| 279 | BWL_PRE_PACKED_STRUCT struct dot11_power_cnst { |
| 280 | uint8 id; |
| 281 | uint8 len; |
| 282 | uint8 power; |
| 283 | } BWL_POST_PACKED_STRUCT; |
| 284 | typedef struct dot11_power_cnst dot11_power_cnst_t; |
| 285 | |
| 286 | BWL_PRE_PACKED_STRUCT struct dot11_power_cap { |
| 287 | uint8 min; |
| 288 | uint8 max; |
| 289 | } BWL_POST_PACKED_STRUCT; |
| 290 | typedef struct dot11_power_cap dot11_power_cap_t; |
| 291 | |
| 292 | BWL_PRE_PACKED_STRUCT struct dot11_tpc_rep { |
| 293 | uint8 id; |
| 294 | uint8 len; |
| 295 | uint8 tx_pwr; |
| 296 | uint8 margin; |
| 297 | } BWL_POST_PACKED_STRUCT; |
| 298 | typedef struct dot11_tpc_rep dot11_tpc_rep_t; |
| 299 | #define DOT11_MNG_IE_TPC_REPORT_LEN 2 |
| 300 | |
| 301 | BWL_PRE_PACKED_STRUCT struct dot11_supp_channels { |
| 302 | uint8 id; |
| 303 | uint8 len; |
| 304 | uint8 first_channel; |
| 305 | uint8 num_channels; |
| 306 | } BWL_POST_PACKED_STRUCT; |
| 307 | typedef struct dot11_supp_channels dot11_supp_channels_t; |
| 308 | |
| 309 | |
| 310 | BWL_PRE_PACKED_STRUCT struct dot11_extch { |
| 311 | uint8 id; |
| 312 | uint8 len; |
| 313 | uint8 extch; |
| 314 | } BWL_POST_PACKED_STRUCT; |
| 315 | typedef struct dot11_extch dot11_extch_ie_t; |
| 316 | |
| 317 | BWL_PRE_PACKED_STRUCT struct dot11_brcm_extch { |
| 318 | uint8 id; |
| 319 | uint8 len; |
| 320 | uint8 oui[3]; |
| 321 | uint8 type; |
| 322 | uint8 extch; |
| 323 | } BWL_POST_PACKED_STRUCT; |
| 324 | typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t; |
| 325 | |
| 326 | #define BRCM_EXTCH_IE_LEN 5 |
| 327 | #define BRCM_EXTCH_IE_TYPE 53 |
| 328 | #define DOT11_EXTCH_IE_LEN 1 |
| 329 | #define DOT11_EXT_CH_MASK 0x03 |
| 330 | #define DOT11_EXT_CH_UPPER 0x01 |
| 331 | #define DOT11_EXT_CH_LOWER 0x03 |
| 332 | #define DOT11_EXT_CH_NONE 0x00 |
| 333 | |
| 334 | BWL_PRE_PACKED_STRUCT struct dot11_action_frmhdr { |
| 335 | uint8 category; |
| 336 | uint8 action; |
| 337 | uint8 data[1]; |
| 338 | } BWL_POST_PACKED_STRUCT; |
| 339 | #define DOT11_ACTION_FRMHDR_LEN 2 |
| 340 | |
| 341 | |
| 342 | BWL_PRE_PACKED_STRUCT struct dot11_channel_switch { |
| 343 | uint8 id; |
| 344 | uint8 len; |
| 345 | uint8 mode; |
| 346 | uint8 channel; |
| 347 | uint8 count; |
| 348 | } BWL_POST_PACKED_STRUCT; |
| 349 | typedef struct dot11_channel_switch dot11_chan_switch_ie_t; |
| 350 | |
| 351 | #define DOT11_SWITCH_IE_LEN 3 |
| 352 | |
| 353 | #define DOT11_CSA_MODE_ADVISORY 0 |
| 354 | #define DOT11_CSA_MODE_NO_TX 1 |
| 355 | |
| 356 | BWL_PRE_PACKED_STRUCT struct dot11_action_switch_channel { |
| 357 | uint8 category; |
| 358 | uint8 action; |
| 359 | dot11_chan_switch_ie_t chan_switch_ie; |
| 360 | dot11_brcm_extch_ie_t extch_ie; |
| 361 | } BWL_POST_PACKED_STRUCT; |
| 362 | |
| 363 | |
| 364 | BWL_PRE_PACKED_STRUCT struct dot11_ext_csa { |
| 365 | uint8 id; |
| 366 | uint8 len; |
| 367 | uint8 mode; |
| 368 | uint8 reg; |
| 369 | uint8 channel; |
| 370 | uint8 count; |
| 371 | } BWL_POST_PACKED_STRUCT; |
| 372 | typedef struct dot11_ext_csa dot11_ext_csa_ie_t; |
| 373 | #define DOT11_EXT_CSA_IE_LEN 4 |
| 374 | |
| 375 | BWL_PRE_PACKED_STRUCT struct dot11_action_ext_csa { |
| 376 | uint8 category; |
| 377 | uint8 action; |
| 378 | dot11_ext_csa_ie_t chan_switch_ie; |
| 379 | } BWL_POST_PACKED_STRUCT; |
| 380 | |
| 381 | BWL_PRE_PACKED_STRUCT struct dot11_obss_coex { |
| 382 | uint8 id; |
| 383 | uint8 len; |
| 384 | uint8 info; |
| 385 | } BWL_POST_PACKED_STRUCT; |
| 386 | typedef struct dot11_obss_coex dot11_obss_coex_t; |
| 387 | #define DOT11_OBSS_COEXINFO_LEN 1 |
| 388 | |
| 389 | #define DOT11_OBSS_COEX_INFO_REQ 0x01 |
| 390 | #define DOT11_OBSS_COEX_40MHZ_INTOLERANT 0x02 |
| 391 | #define DOT11_OBSS_COEX_20MHZ_WIDTH_REQ 0x04 |
| 392 | |
| 393 | BWL_PRE_PACKED_STRUCT struct dot11_obss_chanlist { |
| 394 | uint8 id; |
| 395 | uint8 len; |
| 396 | uint8 regclass; |
| 397 | uint8 chanlist[1]; |
| 398 | } BWL_POST_PACKED_STRUCT; |
| 399 | typedef struct dot11_obss_chanlist dot11_obss_chanlist_t; |
| 400 | #define DOT11_OBSS_CHANLIST_FIXED_LEN 1 |
| 401 | |
| 402 | BWL_PRE_PACKED_STRUCT struct dot11_extcap_ie { |
| 403 | uint8 id; |
| 404 | uint8 len; |
| 405 | uint8 cap; |
| 406 | } BWL_POST_PACKED_STRUCT; |
| 407 | typedef struct dot11_extcap_ie dot11_extcap_ie_t; |
| 408 | #define DOT11_EXTCAP_LEN 1 |
| 409 | |
| 410 | |
| 411 | |
| 412 | #define DOT11_MEASURE_TYPE_BASIC 0 |
| 413 | #define DOT11_MEASURE_TYPE_CCA 1 |
| 414 | #define DOT11_MEASURE_TYPE_RPI 2 |
| 415 | |
| 416 | |
| 417 | #define DOT11_MEASURE_MODE_ENABLE (1<<1) |
| 418 | #define DOT11_MEASURE_MODE_REQUEST (1<<2) |
| 419 | #define DOT11_MEASURE_MODE_REPORT (1<<3) |
| 420 | |
| 421 | #define DOT11_MEASURE_MODE_LATE (1<<0) |
| 422 | #define DOT11_MEASURE_MODE_INCAPABLE (1<<1) |
| 423 | #define DOT11_MEASURE_MODE_REFUSED (1<<2) |
| 424 | |
| 425 | #define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0)) |
| 426 | #define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1)) |
| 427 | #define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2)) |
| 428 | #define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3)) |
| 429 | #define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4)) |
| 430 | |
| 431 | BWL_PRE_PACKED_STRUCT struct dot11_meas_req { |
| 432 | uint8 id; |
| 433 | uint8 len; |
| 434 | uint8 token; |
| 435 | uint8 mode; |
| 436 | uint8 type; |
| 437 | uint8 channel; |
| 438 | uint8 start_time[8]; |
| 439 | uint16 duration; |
| 440 | } BWL_POST_PACKED_STRUCT; |
| 441 | typedef struct dot11_meas_req dot11_meas_req_t; |
| 442 | #define DOT11_MNG_IE_MREQ_LEN 14 |
| 443 | |
| 444 | #define DOT11_MNG_IE_MREQ_FIXED_LEN 3 |
| 445 | |
| 446 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep { |
| 447 | uint8 id; |
| 448 | uint8 len; |
| 449 | uint8 token; |
| 450 | uint8 mode; |
| 451 | uint8 type; |
| 452 | BWL_PRE_PACKED_STRUCT union |
| 453 | { |
| 454 | BWL_PRE_PACKED_STRUCT struct { |
| 455 | uint8 channel; |
| 456 | uint8 start_time[8]; |
| 457 | uint16 duration; |
| 458 | uint8 map; |
| 459 | } BWL_POST_PACKED_STRUCT basic; |
| 460 | uint8 data[1]; |
| 461 | } BWL_POST_PACKED_STRUCT rep; |
| 462 | } BWL_POST_PACKED_STRUCT; |
| 463 | typedef struct dot11_meas_rep dot11_meas_rep_t; |
| 464 | |
| 465 | |
| 466 | #define DOT11_MNG_IE_MREP_FIXED_LEN 3 |
| 467 | |
| 468 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep_basic { |
| 469 | uint8 channel; |
| 470 | uint8 start_time[8]; |
| 471 | uint16 duration; |
| 472 | uint8 map; |
| 473 | } BWL_POST_PACKED_STRUCT; |
| 474 | typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t; |
| 475 | #define DOT11_MEASURE_BASIC_REP_LEN 12 |
| 476 | |
| 477 | BWL_PRE_PACKED_STRUCT struct dot11_quiet { |
| 478 | uint8 id; |
| 479 | uint8 len; |
| 480 | uint8 count; |
| 481 | uint8 period; |
| 482 | uint16 duration; |
| 483 | uint16 offset; |
| 484 | } BWL_POST_PACKED_STRUCT; |
| 485 | typedef struct dot11_quiet dot11_quiet_t; |
| 486 | |
| 487 | BWL_PRE_PACKED_STRUCT struct chan_map_tuple { |
| 488 | uint8 channel; |
| 489 | uint8 map; |
| 490 | } BWL_POST_PACKED_STRUCT; |
| 491 | typedef struct chan_map_tuple chan_map_tuple_t; |
| 492 | |
| 493 | BWL_PRE_PACKED_STRUCT struct dot11_ibss_dfs { |
| 494 | uint8 id; |
| 495 | uint8 len; |
| 496 | uint8 eaddr[ETHER_ADDR_LEN]; |
| 497 | uint8 interval; |
| 498 | chan_map_tuple_t map[1]; |
| 499 | } BWL_POST_PACKED_STRUCT; |
| 500 | typedef struct dot11_ibss_dfs dot11_ibss_dfs_t; |
| 501 | |
| 502 | |
| 503 | #define WME_OUI "\x00\x50\xf2" |
| 504 | #define WME_VER 1 |
| 505 | #define WME_TYPE 2 |
| 506 | #define WME_SUBTYPE_IE 0 |
| 507 | #define WME_SUBTYPE_PARAM_IE 1 |
| 508 | #define WME_SUBTYPE_TSPEC 2 |
| 509 | |
| 510 | |
| 511 | #define AC_BE 0 |
| 512 | #define AC_BK 1 |
| 513 | #define AC_VI 2 |
| 514 | #define AC_VO 3 |
| 515 | #define AC_COUNT 4 |
| 516 | |
| 517 | typedef uint8 ac_bitmap_t; |
| 518 | |
| 519 | #define AC_BITMAP_NONE 0x0 |
| 520 | #define AC_BITMAP_ALL 0xf |
| 521 | #define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0) |
| 522 | #define AC_BITMAP_SET(ab, ac) (((ab) |= (1 << (ac)))) |
| 523 | #define AC_BITMAP_RESET(ab, ac) (((ab) &= ~(1 << (ac)))) |
| 524 | |
| 525 | |
| 526 | BWL_PRE_PACKED_STRUCT struct wme_ie { |
| 527 | uint8 oui[3]; |
| 528 | uint8 type; |
| 529 | uint8 subtype; |
| 530 | uint8 version; |
| 531 | uint8 qosinfo; |
| 532 | } BWL_POST_PACKED_STRUCT; |
| 533 | typedef struct wme_ie wme_ie_t; |
| 534 | #define WME_IE_LEN 7 |
| 535 | |
| 536 | BWL_PRE_PACKED_STRUCT struct edcf_acparam { |
| 537 | uint8 ACI; |
| 538 | uint8 ECW; |
| 539 | uint16 TXOP; |
| 540 | } BWL_POST_PACKED_STRUCT; |
| 541 | typedef struct edcf_acparam edcf_acparam_t; |
| 542 | |
| 543 | |
| 544 | BWL_PRE_PACKED_STRUCT struct wme_param_ie { |
| 545 | uint8 oui[3]; |
| 546 | uint8 type; |
| 547 | uint8 subtype; |
| 548 | uint8 version; |
| 549 | uint8 qosinfo; |
| 550 | uint8 rsvd; |
| 551 | edcf_acparam_t acparam[AC_COUNT]; |
| 552 | } BWL_POST_PACKED_STRUCT; |
| 553 | typedef struct wme_param_ie wme_param_ie_t; |
| 554 | #define WME_PARAM_IE_LEN 24 |
| 555 | |
| 556 | |
| 557 | #define WME_QI_AP_APSD_MASK 0x80 |
| 558 | #define WME_QI_AP_APSD_SHIFT 7 |
| 559 | #define WME_QI_AP_COUNT_MASK 0x0f |
| 560 | #define WME_QI_AP_COUNT_SHIFT 0 |
| 561 | |
| 562 | |
| 563 | #define WME_QI_STA_MAXSPLEN_MASK 0x60 |
| 564 | #define WME_QI_STA_MAXSPLEN_SHIFT 5 |
| 565 | #define WME_QI_STA_APSD_ALL_MASK 0xf |
| 566 | #define WME_QI_STA_APSD_ALL_SHIFT 0 |
| 567 | #define WME_QI_STA_APSD_BE_MASK 0x8 |
| 568 | #define WME_QI_STA_APSD_BE_SHIFT 3 |
| 569 | #define WME_QI_STA_APSD_BK_MASK 0x4 |
| 570 | #define WME_QI_STA_APSD_BK_SHIFT 2 |
| 571 | #define WME_QI_STA_APSD_VI_MASK 0x2 |
| 572 | #define WME_QI_STA_APSD_VI_SHIFT 1 |
| 573 | #define WME_QI_STA_APSD_VO_MASK 0x1 |
| 574 | #define WME_QI_STA_APSD_VO_SHIFT 0 |
| 575 | |
| 576 | |
| 577 | #define EDCF_AIFSN_MIN 1 |
| 578 | #define EDCF_AIFSN_MAX 15 |
| 579 | #define EDCF_AIFSN_MASK 0x0f |
| 580 | #define EDCF_ACM_MASK 0x10 |
| 581 | #define EDCF_ACI_MASK 0x60 |
| 582 | #define EDCF_ACI_SHIFT 5 |
| 583 | #define EDCF_AIFSN_SHIFT 12 |
| 584 | |
| 585 | |
| 586 | #define EDCF_ECW_MIN 0 |
| 587 | #define EDCF_ECW_MAX 15 |
| 588 | #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1) |
| 589 | #define EDCF_ECWMIN_MASK 0x0f |
| 590 | #define EDCF_ECWMAX_MASK 0xf0 |
| 591 | #define EDCF_ECWMAX_SHIFT 4 |
| 592 | |
| 593 | |
| 594 | #define EDCF_TXOP_MIN 0 |
| 595 | #define EDCF_TXOP_MAX 65535 |
| 596 | #define EDCF_TXOP2USEC(txop) ((txop) << 5) |
| 597 | |
| 598 | |
| 599 | #define EDCF_AC_BE_ACI_STA 0x03 |
| 600 | #define EDCF_AC_BE_ECW_STA 0xA4 |
| 601 | #define EDCF_AC_BE_TXOP_STA 0x0000 |
| 602 | #define EDCF_AC_BK_ACI_STA 0x27 |
| 603 | #define EDCF_AC_BK_ECW_STA 0xA4 |
| 604 | #define EDCF_AC_BK_TXOP_STA 0x0000 |
| 605 | #define EDCF_AC_VI_ACI_STA 0x42 |
| 606 | #define EDCF_AC_VI_ECW_STA 0x43 |
| 607 | #define EDCF_AC_VI_TXOP_STA 0x005e |
| 608 | #define EDCF_AC_VO_ACI_STA 0x62 |
| 609 | #define EDCF_AC_VO_ECW_STA 0x32 |
| 610 | #define EDCF_AC_VO_TXOP_STA 0x002f |
| 611 | |
| 612 | |
| 613 | #define EDCF_AC_BE_ACI_AP 0x03 |
| 614 | #define EDCF_AC_BE_ECW_AP 0x64 |
| 615 | #define EDCF_AC_BE_TXOP_AP 0x0000 |
| 616 | #define EDCF_AC_BK_ACI_AP 0x27 |
| 617 | #define EDCF_AC_BK_ECW_AP 0xA4 |
| 618 | #define EDCF_AC_BK_TXOP_AP 0x0000 |
| 619 | #define EDCF_AC_VI_ACI_AP 0x41 |
| 620 | #define EDCF_AC_VI_ECW_AP 0x43 |
| 621 | #define EDCF_AC_VI_TXOP_AP 0x005e |
| 622 | #define EDCF_AC_VO_ACI_AP 0x61 |
| 623 | #define EDCF_AC_VO_ECW_AP 0x32 |
| 624 | #define EDCF_AC_VO_TXOP_AP 0x002f |
| 625 | |
| 626 | |
| 627 | BWL_PRE_PACKED_STRUCT struct edca_param_ie { |
| 628 | uint8 qosinfo; |
| 629 | uint8 rsvd; |
| 630 | edcf_acparam_t acparam[AC_COUNT]; |
| 631 | } BWL_POST_PACKED_STRUCT; |
| 632 | typedef struct edca_param_ie edca_param_ie_t; |
| 633 | #define EDCA_PARAM_IE_LEN 18 |
| 634 | |
| 635 | |
| 636 | BWL_PRE_PACKED_STRUCT struct qos_cap_ie { |
| 637 | uint8 qosinfo; |
| 638 | } BWL_POST_PACKED_STRUCT; |
| 639 | typedef struct qos_cap_ie qos_cap_ie_t; |
| 640 | |
| 641 | BWL_PRE_PACKED_STRUCT struct dot11_qbss_load_ie { |
| 642 | uint8 id; |
| 643 | uint8 length; |
| 644 | uint16 station_count; |
| 645 | uint8 channel_utilization; |
| 646 | uint16 aac; |
| 647 | } BWL_POST_PACKED_STRUCT; |
| 648 | typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t; |
| 649 | |
| 650 | |
| 651 | #define FIXED_MSDU_SIZE 0x8000 |
| 652 | #define MSDU_SIZE_MASK 0x7fff |
| 653 | |
| 654 | |
| 655 | |
| 656 | #define INTEGER_SHIFT 13 |
| 657 | #define FRACTION_MASK 0x1FFF |
| 658 | |
| 659 | |
| 660 | BWL_PRE_PACKED_STRUCT struct dot11_management_notification { |
| 661 | uint8 category; |
| 662 | uint8 action; |
| 663 | uint8 token; |
| 664 | uint8 status; |
| 665 | uint8 data[1]; |
| 666 | } BWL_POST_PACKED_STRUCT; |
| 667 | #define DOT11_MGMT_NOTIFICATION_LEN 4 |
| 668 | |
| 669 | |
| 670 | #define WME_ADDTS_REQUEST 0 |
| 671 | #define WME_ADDTS_RESPONSE 1 |
| 672 | #define WME_DELTS_REQUEST 2 |
| 673 | |
| 674 | |
| 675 | #define WME_ADMISSION_ACCEPTED 0 |
| 676 | #define WME_INVALID_PARAMETERS 1 |
| 677 | #define WME_ADMISSION_REFUSED 3 |
| 678 | |
| 679 | |
| 680 | #define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN) |
| 681 | |
| 682 | |
| 683 | #define DOT11_OPEN_SYSTEM 0 |
| 684 | #define DOT11_SHARED_KEY 1 |
| 685 | |
| 686 | #define DOT11_OPEN_SHARED 2 |
| 687 | #define DOT11_CHALLENGE_LEN 128 |
| 688 | |
| 689 | |
| 690 | #define FC_PVER_MASK 0x3 |
| 691 | #define FC_PVER_SHIFT 0 |
| 692 | #define FC_TYPE_MASK 0xC |
| 693 | #define FC_TYPE_SHIFT 2 |
| 694 | #define FC_SUBTYPE_MASK 0xF0 |
| 695 | #define FC_SUBTYPE_SHIFT 4 |
| 696 | #define FC_TODS 0x100 |
| 697 | #define FC_TODS_SHIFT 8 |
| 698 | #define FC_FROMDS 0x200 |
| 699 | #define FC_FROMDS_SHIFT 9 |
| 700 | #define FC_MOREFRAG 0x400 |
| 701 | #define FC_MOREFRAG_SHIFT 10 |
| 702 | #define FC_RETRY 0x800 |
| 703 | #define FC_RETRY_SHIFT 11 |
| 704 | #define FC_PM 0x1000 |
| 705 | #define FC_PM_SHIFT 12 |
| 706 | #define FC_MOREDATA 0x2000 |
| 707 | #define FC_MOREDATA_SHIFT 13 |
| 708 | #define FC_WEP 0x4000 |
| 709 | #define FC_WEP_SHIFT 14 |
| 710 | #define FC_ORDER 0x8000 |
| 711 | #define FC_ORDER_SHIFT 15 |
| 712 | |
| 713 | |
| 714 | #define SEQNUM_SHIFT 4 |
| 715 | #define SEQNUM_MAX 0x1000 |
| 716 | #define FRAGNUM_MASK 0xF |
| 717 | |
| 718 | |
| 719 | |
| 720 | |
| 721 | #define FC_TYPE_MNG 0 |
| 722 | #define FC_TYPE_CTL 1 |
| 723 | #define FC_TYPE_DATA 2 |
| 724 | |
| 725 | |
| 726 | #define FC_SUBTYPE_ASSOC_REQ 0 |
| 727 | #define FC_SUBTYPE_ASSOC_RESP 1 |
| 728 | #define FC_SUBTYPE_REASSOC_REQ 2 |
| 729 | #define FC_SUBTYPE_REASSOC_RESP 3 |
| 730 | #define FC_SUBTYPE_PROBE_REQ 4 |
| 731 | #define FC_SUBTYPE_PROBE_RESP 5 |
| 732 | #define FC_SUBTYPE_BEACON 8 |
| 733 | #define FC_SUBTYPE_ATIM 9 |
| 734 | #define FC_SUBTYPE_DISASSOC 10 |
| 735 | #define FC_SUBTYPE_AUTH 11 |
| 736 | #define FC_SUBTYPE_DEAUTH 12 |
| 737 | #define FC_SUBTYPE_ACTION 13 |
| 738 | #define FC_SUBTYPE_ACTION_NOACK 14 |
| 739 | |
| 740 | |
| 741 | #define FC_SUBTYPE_CTL_WRAPPER 7 |
| 742 | #define FC_SUBTYPE_BLOCKACK_REQ 8 |
| 743 | #define FC_SUBTYPE_BLOCKACK 9 |
| 744 | #define FC_SUBTYPE_PS_POLL 10 |
| 745 | #define FC_SUBTYPE_RTS 11 |
| 746 | #define FC_SUBTYPE_CTS 12 |
| 747 | #define FC_SUBTYPE_ACK 13 |
| 748 | #define FC_SUBTYPE_CF_END 14 |
| 749 | #define FC_SUBTYPE_CF_END_ACK 15 |
| 750 | |
| 751 | |
| 752 | #define FC_SUBTYPE_DATA 0 |
| 753 | #define FC_SUBTYPE_DATA_CF_ACK 1 |
| 754 | #define FC_SUBTYPE_DATA_CF_POLL 2 |
| 755 | #define FC_SUBTYPE_DATA_CF_ACK_POLL 3 |
| 756 | #define FC_SUBTYPE_NULL 4 |
| 757 | #define FC_SUBTYPE_CF_ACK 5 |
| 758 | #define FC_SUBTYPE_CF_POLL 6 |
| 759 | #define FC_SUBTYPE_CF_ACK_POLL 7 |
| 760 | #define FC_SUBTYPE_QOS_DATA 8 |
| 761 | #define FC_SUBTYPE_QOS_DATA_CF_ACK 9 |
| 762 | #define FC_SUBTYPE_QOS_DATA_CF_POLL 10 |
| 763 | #define FC_SUBTYPE_QOS_DATA_CF_ACK_POLL 11 |
| 764 | #define FC_SUBTYPE_QOS_NULL 12 |
| 765 | #define FC_SUBTYPE_QOS_CF_POLL 14 |
| 766 | #define FC_SUBTYPE_QOS_CF_ACK_POLL 15 |
| 767 | |
| 768 | |
| 769 | #define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0) |
| 770 | #define FC_SUBTYPE_ANY_NULL(s) (((s) & 4) != 0) |
| 771 | #define FC_SUBTYPE_ANY_CF_POLL(s) (((s) & 2) != 0) |
| 772 | #define FC_SUBTYPE_ANY_CF_ACK(s) (((s) & 1) != 0) |
| 773 | |
| 774 | |
| 775 | #define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK) |
| 776 | |
| 777 | #define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT)) |
| 778 | |
| 779 | #define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT) |
| 780 | #define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT) |
| 781 | |
| 782 | #define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ) |
| 783 | #define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP) |
| 784 | #define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ) |
| 785 | #define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP) |
| 786 | #define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ) |
| 787 | #define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP) |
| 788 | #define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON) |
| 789 | #define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC) |
| 790 | #define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH) |
| 791 | #define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH) |
| 792 | #define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION) |
| 793 | #define FC_ACTION_NOACK FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION_NOACK) |
| 794 | |
| 795 | #define FC_CTL_WRAPPER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTL_WRAPPER) |
| 796 | #define FC_BLOCKACK_REQ FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK_REQ) |
| 797 | #define FC_BLOCKACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK) |
| 798 | #define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL) |
| 799 | #define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS) |
| 800 | #define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS) |
| 801 | #define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK) |
| 802 | #define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END) |
| 803 | #define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK) |
| 804 | |
| 805 | #define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA) |
| 806 | #define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL) |
| 807 | #define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK) |
| 808 | #define FC_QOS_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA) |
| 809 | #define FC_QOS_NULL FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL) |
| 810 | |
| 811 | |
| 812 | |
| 813 | |
| 814 | #define QOS_PRIO_SHIFT 0 |
| 815 | #define QOS_PRIO_MASK 0x0007 |
| 816 | #define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT) |
| 817 | |
| 818 | |
| 819 | #define QOS_TID_SHIFT 0 |
| 820 | #define QOS_TID_MASK 0x000f |
| 821 | #define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT) |
| 822 | |
| 823 | |
| 824 | #define QOS_EOSP_SHIFT 4 |
| 825 | #define QOS_EOSP_MASK 0x0010 |
| 826 | #define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT) |
| 827 | |
| 828 | |
| 829 | #define QOS_ACK_NORMAL_ACK 0 |
| 830 | #define QOS_ACK_NO_ACK 1 |
| 831 | #define QOS_ACK_NO_EXP_ACK 2 |
| 832 | #define QOS_ACK_BLOCK_ACK 3 |
| 833 | #define QOS_ACK_SHIFT 5 |
| 834 | #define QOS_ACK_MASK 0x0060 |
| 835 | #define QOS_ACK(qos) (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT) |
| 836 | |
| 837 | |
| 838 | #define QOS_AMSDU_SHIFT 7 |
| 839 | #define QOS_AMSDU_MASK 0x0080 |
| 840 | |
| 841 | |
| 842 | |
| 843 | |
| 844 | |
| 845 | |
| 846 | #define DOT11_MNG_AUTH_ALGO_LEN 2 |
| 847 | #define DOT11_MNG_AUTH_SEQ_LEN 2 |
| 848 | #define DOT11_MNG_BEACON_INT_LEN 2 |
| 849 | #define DOT11_MNG_CAP_LEN 2 |
| 850 | #define DOT11_MNG_AP_ADDR_LEN 6 |
| 851 | #define DOT11_MNG_LISTEN_INT_LEN 2 |
| 852 | #define DOT11_MNG_REASON_LEN 2 |
| 853 | #define DOT11_MNG_AID_LEN 2 |
| 854 | #define DOT11_MNG_STATUS_LEN 2 |
| 855 | #define DOT11_MNG_TIMESTAMP_LEN 8 |
| 856 | |
| 857 | |
| 858 | #define DOT11_AID_MASK 0x3fff |
| 859 | |
| 860 | |
| 861 | #define DOT11_RC_RESERVED 0 |
| 862 | #define DOT11_RC_UNSPECIFIED 1 |
| 863 | #define DOT11_RC_AUTH_INVAL 2 |
| 864 | #define DOT11_RC_DEAUTH_LEAVING 3 |
| 865 | #define DOT11_RC_INACTIVITY 4 |
| 866 | #define DOT11_RC_BUSY 5 |
| 867 | #define DOT11_RC_INVAL_CLASS_2 6 |
| 868 | #define DOT11_RC_INVAL_CLASS_3 7 |
| 869 | #define DOT11_RC_DISASSOC_LEAVING 8 |
| 870 | #define DOT11_RC_NOT_AUTH 9 |
| 871 | #define DOT11_RC_BAD_PC 10 |
| 872 | #define DOT11_RC_BAD_CHANNELS 11 |
| 873 | |
| 874 | |
| 875 | |
| 876 | #define DOT11_RC_UNSPECIFIED_QOS 32 |
| 877 | #define DOT11_RC_INSUFFCIENT_BW 33 |
| 878 | #define DOT11_RC_EXCESSIVE_FRAMES 34 |
| 879 | #define DOT11_RC_TX_OUTSIDE_TXOP 35 |
| 880 | #define DOT11_RC_LEAVING_QBSS 36 |
| 881 | #define DOT11_RC_BAD_MECHANISM 37 |
| 882 | #define DOT11_RC_SETUP_NEEDED 38 |
| 883 | #define DOT11_RC_TIMEOUT 39 |
| 884 | |
| 885 | #define DOT11_RC_MAX 23 |
| 886 | |
| 887 | |
| 888 | #define DOT11_SC_SUCCESS 0 |
| 889 | #define DOT11_SC_FAILURE 1 |
| 890 | #define DOT11_SC_CAP_MISMATCH 10 |
| 891 | #define DOT11_SC_REASSOC_FAIL 11 |
| 892 | #define DOT11_SC_ASSOC_FAIL 12 |
| 893 | #define DOT11_SC_AUTH_MISMATCH 13 |
| 894 | #define DOT11_SC_AUTH_SEQ 14 |
| 895 | #define DOT11_SC_AUTH_CHALLENGE_FAIL 15 |
| 896 | #define DOT11_SC_AUTH_TIMEOUT 16 |
| 897 | #define DOT11_SC_ASSOC_BUSY_FAIL 17 |
| 898 | #define DOT11_SC_ASSOC_RATE_MISMATCH 18 |
| 899 | #define DOT11_SC_ASSOC_SHORT_REQUIRED 19 |
| 900 | #define DOT11_SC_ASSOC_PBCC_REQUIRED 20 |
| 901 | #define DOT11_SC_ASSOC_AGILITY_REQUIRED 21 |
| 902 | #define DOT11_SC_ASSOC_SPECTRUM_REQUIRED 22 |
| 903 | #define DOT11_SC_ASSOC_BAD_POWER_CAP 23 |
| 904 | #define DOT11_SC_ASSOC_BAD_SUP_CHANNELS 24 |
| 905 | #define DOT11_SC_ASSOC_SHORTSLOT_REQUIRED 25 |
| 906 | #define DOT11_SC_ASSOC_ERPBCC_REQUIRED 26 |
| 907 | #define DOT11_SC_ASSOC_DSSOFDM_REQUIRED 27 |
| 908 | |
| 909 | #define DOT11_SC_DECLINED 37 |
| 910 | #define DOT11_SC_INVALID_PARAMS 38 |
| 911 | |
| 912 | |
| 913 | #define DOT11_MNG_DS_PARAM_LEN 1 |
| 914 | #define DOT11_MNG_IBSS_PARAM_LEN 2 |
| 915 | |
| 916 | |
| 917 | #define DOT11_MNG_TIM_FIXED_LEN 3 |
| 918 | #define DOT11_MNG_TIM_DTIM_COUNT 0 |
| 919 | #define DOT11_MNG_TIM_DTIM_PERIOD 1 |
| 920 | #define DOT11_MNG_TIM_BITMAP_CTL 2 |
| 921 | #define DOT11_MNG_TIM_PVB 3 |
| 922 | |
| 923 | |
| 924 | #define TLV_TAG_OFF 0 |
| 925 | #define TLV_LEN_OFF 1 |
| 926 | #define TLV_HDR_LEN 2 |
| 927 | #define TLV_BODY_OFF 2 |
| 928 | |
| 929 | |
| 930 | #define DOT11_MNG_SSID_ID 0 |
| 931 | #define DOT11_MNG_RATES_ID 1 |
| 932 | #define DOT11_MNG_FH_PARMS_ID 2 |
| 933 | #define DOT11_MNG_DS_PARMS_ID 3 |
| 934 | #define DOT11_MNG_CF_PARMS_ID 4 |
| 935 | #define DOT11_MNG_TIM_ID 5 |
| 936 | #define DOT11_MNG_IBSS_PARMS_ID 6 |
| 937 | #define DOT11_MNG_COUNTRY_ID 7 |
| 938 | #define DOT11_MNG_HOPPING_PARMS_ID 8 |
| 939 | #define DOT11_MNG_HOPPING_TABLE_ID 9 |
| 940 | #define DOT11_MNG_REQUEST_ID 10 |
| 941 | #define DOT11_MNG_QBSS_LOAD_ID 11 |
| 942 | #define DOT11_MNG_EDCA_PARAM_ID 12 |
| 943 | #define DOT11_MNG_CHALLENGE_ID 16 |
| 944 | #define DOT11_MNG_PWR_CONSTRAINT_ID 32 |
| 945 | #define DOT11_MNG_PWR_CAP_ID 33 |
| 946 | #define DOT11_MNG_TPC_REQUEST_ID 34 |
| 947 | #define DOT11_MNG_TPC_REPORT_ID 35 |
| 948 | #define DOT11_MNG_SUPP_CHANNELS_ID 36 |
| 949 | #define DOT11_MNG_CHANNEL_SWITCH_ID 37 |
| 950 | #define DOT11_MNG_MEASURE_REQUEST_ID 38 |
| 951 | #define DOT11_MNG_MEASURE_REPORT_ID 39 |
| 952 | #define DOT11_MNG_QUIET_ID 40 |
| 953 | #define DOT11_MNG_IBSS_DFS_ID 41 |
| 954 | #define DOT11_MNG_ERP_ID 42 |
| 955 | #define DOT11_MNG_TS_DELAY_ID 43 |
| 956 | #define DOT11_MNG_HT_CAP 45 |
| 957 | #define DOT11_MNG_QOS_CAP_ID 46 |
| 958 | #define DOT11_MNG_NONERP_ID 47 |
| 959 | #define DOT11_MNG_RSN_ID 48 |
| 960 | #define DOT11_MNG_EXT_RATES_ID 50 |
| 961 | #define DOT11_MNG_REGCLASS_ID 59 |
| 962 | #define DOT11_MNG_EXT_CSA_ID 60 |
| 963 | #define DOT11_MNG_HT_ADD 61 |
| 964 | #define DOT11_MNG_EXT_CHANNEL_OFFSET 62 |
| 965 | #define DOT11_MNG_HT_BSS_COEXINFO_ID 72 |
| 966 | #define DOT11_MNG_HT_BSS_CHANNEL_REPORT_ID 73 |
| 967 | #define DOT11_MNG_HT_OBSS_ID 74 |
| 968 | #define DOT11_MNG_EXT_CAP 127 |
| 969 | #define DOT11_MNG_WPA_ID 221 |
| 970 | #define DOT11_MNG_PROPR_ID 221 |
| 971 | |
| 972 | |
| 973 | #define DOT11_RATE_BASIC 0x80 |
| 974 | #define DOT11_RATE_MASK 0x7F |
| 975 | |
| 976 | |
| 977 | #define DOT11_MNG_ERP_LEN 1 |
| 978 | #define DOT11_MNG_NONERP_PRESENT 0x01 |
| 979 | #define DOT11_MNG_USE_PROTECTION 0x02 |
| 980 | #define DOT11_MNG_BARKER_PREAMBLE 0x04 |
| 981 | |
| 982 | #define DOT11_MGN_TS_DELAY_LEN 4 |
| 983 | #define TS_DELAY_FIELD_SIZE 4 |
| 984 | |
| 985 | |
| 986 | #define DOT11_CAP_ESS 0x0001 |
| 987 | #define DOT11_CAP_IBSS 0x0002 |
| 988 | #define DOT11_CAP_POLLABLE 0x0004 |
| 989 | #define DOT11_CAP_POLL_RQ 0x0008 |
| 990 | #define DOT11_CAP_PRIVACY 0x0010 |
| 991 | #define DOT11_CAP_SHORT 0x0020 |
| 992 | #define DOT11_CAP_PBCC 0x0040 |
| 993 | #define DOT11_CAP_AGILITY 0x0080 |
| 994 | #define DOT11_CAP_SPECTRUM 0x0100 |
| 995 | #define DOT11_CAP_SHORTSLOT 0x0400 |
| 996 | #define DOT11_CAP_CCK_OFDM 0x2000 |
| 997 | |
| 998 | |
| 999 | #define DOT11_OBSS_COEX_MNG_SUPPORT 0x01 |
| 1000 | |
| 1001 | |
| 1002 | #define DOT11_ACTION_HDR_LEN 2 |
| 1003 | #define DOT11_ACTION_CAT_ERR_MASK 0x80 |
| 1004 | #define DOT11_ACTION_CAT_MASK 0x7F |
| 1005 | #define DOT11_ACTION_CAT_SPECT_MNG 0 |
| 1006 | #define DOT11_ACTION_CAT_BLOCKACK 3 |
| 1007 | #define DOT11_ACTION_CAT_PUBLIC 4 |
| 1008 | #define DOT11_ACTION_CAT_HT 7 |
Howard Harte | f42f81d | 2009-03-30 17:09:32 -0700 | [diff] [blame] | 1009 | #define DOT11_ACTION_CAT_VS 127 |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 1010 | #define DOT11_ACTION_NOTIFICATION 0x11 |
| 1011 | |
| 1012 | #define DOT11_ACTION_ID_M_REQ 0 |
| 1013 | #define DOT11_ACTION_ID_M_REP 1 |
| 1014 | #define DOT11_ACTION_ID_TPC_REQ 2 |
| 1015 | #define DOT11_ACTION_ID_TPC_REP 3 |
| 1016 | #define DOT11_ACTION_ID_CHANNEL_SWITCH 4 |
| 1017 | #define DOT11_ACTION_ID_EXT_CSA 5 |
| 1018 | |
| 1019 | |
| 1020 | #define DOT11_ACTION_ID_HT_CH_WIDTH 0 |
| 1021 | #define DOT11_ACTION_ID_HT_MIMO_PS 1 |
| 1022 | |
| 1023 | |
| 1024 | #define DOT11_ACTION_ID_BSS_COEX_MNG 0 |
| 1025 | |
| 1026 | |
| 1027 | #define DOT11_BA_ACTION_ADDBA_REQ 0 |
| 1028 | #define DOT11_BA_ACTION_ADDBA_RESP 1 |
| 1029 | #define DOT11_BA_ACTION_DELBA 2 |
| 1030 | |
| 1031 | |
| 1032 | #define DOT11_ADDBA_PARAM_AMSDU_SUP 0x0001 |
| 1033 | #define DOT11_ADDBA_PARAM_POLICY_MASK 0x0002 |
| 1034 | #define DOT11_ADDBA_PARAM_POLICY_SHIFT 1 |
| 1035 | #define DOT11_ADDBA_PARAM_TID_MASK 0x003c |
| 1036 | #define DOT11_ADDBA_PARAM_TID_SHIFT 2 |
| 1037 | #define DOT11_ADDBA_PARAM_BSIZE_MASK 0xffc0 |
| 1038 | #define DOT11_ADDBA_PARAM_BSIZE_SHIFT 6 |
| 1039 | |
| 1040 | #define DOT11_ADDBA_POLICY_DELAYED 0 |
| 1041 | #define DOT11_ADDBA_POLICY_IMMEDIATE 1 |
| 1042 | |
| 1043 | BWL_PRE_PACKED_STRUCT struct dot11_addba_req { |
| 1044 | uint8 category; |
| 1045 | uint8 action; |
| 1046 | uint8 token; |
| 1047 | uint16 addba_param_set; |
| 1048 | uint16 timeout; |
| 1049 | uint16 start_seqnum; |
| 1050 | }BWL_POST_PACKED_STRUCT; |
| 1051 | typedef struct dot11_addba_req dot11_addba_req_t; |
| 1052 | #define DOT11_ADDBA_REQ_LEN 9 |
| 1053 | |
| 1054 | BWL_PRE_PACKED_STRUCT struct dot11_addba_resp { |
| 1055 | uint8 category; |
| 1056 | uint8 action; |
| 1057 | uint8 token; |
| 1058 | uint16 status; |
| 1059 | uint16 addba_param_set; |
| 1060 | uint16 timeout; |
| 1061 | }BWL_POST_PACKED_STRUCT; |
| 1062 | typedef struct dot11_addba_resp dot11_addba_resp_t; |
| 1063 | #define DOT11_ADDBA_RESP_LEN 9 |
| 1064 | |
| 1065 | |
| 1066 | #define DOT11_DELBA_PARAM_INIT_MASK 0x0800 |
| 1067 | #define DOT11_DELBA_PARAM_INIT_SHIFT 11 |
| 1068 | #define DOT11_DELBA_PARAM_TID_MASK 0xf000 |
| 1069 | #define DOT11_DELBA_PARAM_TID_SHIFT 12 |
| 1070 | |
| 1071 | BWL_PRE_PACKED_STRUCT struct dot11_delba { |
| 1072 | uint8 category; |
| 1073 | uint8 action; |
| 1074 | uint16 delba_param_set; |
| 1075 | uint16 reason; |
| 1076 | }BWL_POST_PACKED_STRUCT; |
| 1077 | typedef struct dot11_delba dot11_delba_t; |
| 1078 | #define DOT11_DELBA_LEN 6 |
| 1079 | |
| 1080 | |
| 1081 | #define DOT11_BSSTYPE_INFRASTRUCTURE 0 |
| 1082 | #define DOT11_BSSTYPE_INDEPENDENT 1 |
| 1083 | #define DOT11_BSSTYPE_ANY 2 |
| 1084 | #define DOT11_SCANTYPE_ACTIVE 0 |
| 1085 | #define DOT11_SCANTYPE_PASSIVE 1 |
| 1086 | |
| 1087 | |
| 1088 | #define PREN_PREAMBLE 24 |
| 1089 | #define PREN_MM_EXT 8 |
| 1090 | #define PREN_PREAMBLE_EXT 4 |
| 1091 | |
| 1092 | |
| 1093 | #define NPHY_RIFS_TIME 2 |
| 1094 | |
| 1095 | |
| 1096 | #define APHY_SLOT_TIME 9 |
| 1097 | #define APHY_SIFS_TIME 16 |
| 1098 | #define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME)) |
| 1099 | #define APHY_PREAMBLE_TIME 16 |
| 1100 | #define APHY_SIGNAL_TIME 4 |
| 1101 | #define APHY_SYMBOL_TIME 4 |
| 1102 | #define APHY_SERVICE_NBITS 16 |
| 1103 | #define APHY_TAIL_NBITS 6 |
| 1104 | #define APHY_CWMIN 15 |
| 1105 | |
| 1106 | |
| 1107 | #define BPHY_SLOT_TIME 20 |
| 1108 | #define BPHY_SIFS_TIME 10 |
| 1109 | #define BPHY_DIFS_TIME 50 |
| 1110 | #define BPHY_PLCP_TIME 192 |
| 1111 | #define BPHY_PLCP_SHORT_TIME 96 |
| 1112 | #define BPHY_CWMIN 31 |
| 1113 | |
| 1114 | |
| 1115 | #define DOT11_OFDM_SIGNAL_EXTENSION 6 |
| 1116 | |
| 1117 | #define PHY_CWMAX 1023 |
| 1118 | |
| 1119 | #define DOT11_MAXNUMFRAGS 16 |
| 1120 | |
| 1121 | |
| 1122 | typedef struct d11cnt { |
| 1123 | uint32 txfrag; |
| 1124 | uint32 txmulti; |
| 1125 | uint32 txfail; |
| 1126 | uint32 txretry; |
| 1127 | uint32 txretrie; |
| 1128 | uint32 rxdup; |
| 1129 | uint32 txrts; |
| 1130 | uint32 txnocts; |
| 1131 | uint32 txnoack; |
| 1132 | uint32 rxfrag; |
| 1133 | uint32 rxmulti; |
| 1134 | uint32 rxcrc; |
| 1135 | uint32 txfrmsnt; |
| 1136 | uint32 rxundec; |
| 1137 | } d11cnt_t; |
| 1138 | |
| 1139 | |
| 1140 | #define BRCM_PROP_OUI "\x00\x90\x4C" |
| 1141 | |
| 1142 | |
| 1143 | |
| 1144 | |
| 1145 | BWL_PRE_PACKED_STRUCT struct brcm_prop_ie_s { |
| 1146 | uint8 id; |
| 1147 | uint8 len; |
| 1148 | uint8 oui[3]; |
| 1149 | uint8 type; |
| 1150 | uint16 cap; |
| 1151 | } BWL_POST_PACKED_STRUCT; |
| 1152 | typedef struct brcm_prop_ie_s brcm_prop_ie_t; |
| 1153 | |
| 1154 | #define BRCM_PROP_IE_LEN 6 |
| 1155 | |
| 1156 | #define DPT_IE_TYPE 2 |
| 1157 | |
| 1158 | |
| 1159 | #define BRCM_OUI "\x00\x10\x18" |
| 1160 | |
| 1161 | |
| 1162 | BWL_PRE_PACKED_STRUCT struct brcm_ie { |
| 1163 | uint8 id; |
| 1164 | uint8 len; |
| 1165 | uint8 oui[3]; |
| 1166 | uint8 ver; |
| 1167 | uint8 assoc; |
| 1168 | uint8 flags; |
| 1169 | uint8 flags1; |
| 1170 | uint16 amsdu_mtu_pref; |
| 1171 | } BWL_POST_PACKED_STRUCT; |
| 1172 | typedef struct brcm_ie brcm_ie_t; |
| 1173 | #define BRCM_IE_LEN 11 |
| 1174 | #define BRCM_IE_VER 2 |
| 1175 | #define BRCM_IE_LEGACY_AES_VER 1 |
| 1176 | |
| 1177 | |
| 1178 | #ifdef WLAFTERBURNER |
| 1179 | #define BRF_ABCAP 0x1 |
| 1180 | #define BRF_ABRQRD 0x2 |
| 1181 | #define BRF_ABCOUNTER_MASK 0xf0 |
| 1182 | #define BRF_ABCOUNTER_SHIFT 4 |
| 1183 | #endif |
| 1184 | #define BRF_LZWDS 0x4 |
| 1185 | #define BRF_BLOCKACK 0x8 |
| 1186 | |
| 1187 | |
| 1188 | #define BRF1_AMSDU 0x1 |
| 1189 | #define BRF1_WMEPS 0x4 |
| 1190 | #define BRF1_PSOFIX 0x8 |
| 1191 | |
| 1192 | #ifdef WLAFTERBURNER |
| 1193 | #define AB_WDS_TIMEOUT_MAX 15 |
| 1194 | #define AB_WDS_TIMEOUT_MIN 1 |
| 1195 | #endif |
| 1196 | |
| 1197 | #define AB_GUARDCOUNT 10 |
| 1198 | |
| 1199 | #define MCSSET_LEN 16 |
| 1200 | #define MAX_MCS_NUM (128) |
| 1201 | |
| 1202 | BWL_PRE_PACKED_STRUCT struct ht_cap_ie { |
| 1203 | uint16 cap; |
| 1204 | uint8 params; |
| 1205 | uint8 supp_mcs[MCSSET_LEN]; |
| 1206 | uint16 ext_htcap; |
| 1207 | uint32 txbf_cap; |
| 1208 | uint8 as_cap; |
| 1209 | } BWL_POST_PACKED_STRUCT; |
| 1210 | typedef struct ht_cap_ie ht_cap_ie_t; |
| 1211 | |
| 1212 | |
| 1213 | |
| 1214 | BWL_PRE_PACKED_STRUCT struct ht_prop_cap_ie { |
| 1215 | uint8 id; |
| 1216 | uint8 len; |
| 1217 | uint8 oui[3]; |
| 1218 | uint8 type; |
| 1219 | ht_cap_ie_t cap_ie; |
| 1220 | } BWL_POST_PACKED_STRUCT; |
| 1221 | typedef struct ht_prop_cap_ie ht_prop_cap_ie_t; |
| 1222 | #define HT_PROP_IE_OVERHEAD 4 |
| 1223 | #define HT_CAP_IE_LEN 26 |
| 1224 | #define HT_CAP_IE_TYPE 51 |
| 1225 | |
| 1226 | #define HT_CAP_LDPC_CODING 0x0001 |
| 1227 | #define HT_CAP_40MHZ 0x0002 |
| 1228 | #define HT_CAP_MIMO_PS_MASK 0x000C |
| 1229 | #define HT_CAP_MIMO_PS_SHIFT 0x0002 |
| 1230 | #define HT_CAP_MIMO_PS_OFF 0x0003 |
| 1231 | #define HT_CAP_MIMO_PS_RTS 0x0001 |
| 1232 | #define HT_CAP_MIMO_PS_ON 0x0000 |
| 1233 | #define HT_CAP_GF 0x0010 |
| 1234 | #define HT_CAP_SHORT_GI_20 0x0020 |
| 1235 | #define HT_CAP_SHORT_GI_40 0x0040 |
| 1236 | #define HT_CAP_TX_STBC 0x0080 |
| 1237 | #define HT_CAP_RX_STBC_MASK 0x0300 |
| 1238 | #define HT_CAP_RX_STBC_SHIFT 8 |
| 1239 | #define HT_CAP_DELAYED_BA 0x0400 |
| 1240 | #define HT_CAP_MAX_AMSDU 0x0800 |
| 1241 | #define HT_CAP_DSSS_CCK 0x1000 |
| 1242 | #define HT_CAP_PSMP 0x2000 |
| 1243 | #define HT_CAP_40MHZ_INTOLERANT 0x4000 |
| 1244 | #define HT_CAP_LSIG_TXOP 0x8000 |
| 1245 | |
| 1246 | #define HT_CAP_RX_STBC_NO 0x0 |
| 1247 | #define HT_CAP_RX_STBC_ONE_STREAM 0x1 |
| 1248 | #define HT_CAP_RX_STBC_TWO_STREAM 0x2 |
| 1249 | #define HT_CAP_RX_STBC_THREE_STREAM 0x3 |
| 1250 | |
| 1251 | #define HT_MAX_AMSDU 7935 |
| 1252 | #define HT_MIN_AMSDU 3835 |
| 1253 | |
| 1254 | #define HT_PARAMS_RX_FACTOR_MASK 0x03 |
| 1255 | #define HT_PARAMS_DENSITY_MASK 0x1C |
| 1256 | #define HT_PARAMS_DENSITY_SHIFT 2 |
| 1257 | |
| 1258 | |
| 1259 | #define AMPDU_MAX_MPDU_DENSITY 7 |
| 1260 | #define AMPDU_RX_FACTOR_64K 3 |
| 1261 | #define AMPDU_RX_FACTOR_BASE 8*1024 |
| 1262 | #define AMPDU_DELIMITER_LEN 4 |
| 1263 | |
| 1264 | BWL_PRE_PACKED_STRUCT struct ht_add_ie { |
| 1265 | uint8 ctl_ch; |
| 1266 | uint8 byte1; |
| 1267 | uint16 opmode; |
| 1268 | uint16 misc_bits; |
| 1269 | uint8 basic_mcs[MCSSET_LEN]; |
| 1270 | } BWL_POST_PACKED_STRUCT; |
| 1271 | typedef struct ht_add_ie ht_add_ie_t; |
| 1272 | |
| 1273 | |
| 1274 | |
| 1275 | BWL_PRE_PACKED_STRUCT struct ht_prop_add_ie { |
| 1276 | uint8 id; |
| 1277 | uint8 len; |
| 1278 | uint8 oui[3]; |
| 1279 | uint8 type; |
| 1280 | ht_add_ie_t add_ie; |
| 1281 | } BWL_POST_PACKED_STRUCT; |
| 1282 | typedef struct ht_prop_add_ie ht_prop_add_ie_t; |
| 1283 | |
| 1284 | #define HT_ADD_IE_LEN 22 |
| 1285 | #define HT_ADD_IE_TYPE 52 |
| 1286 | |
| 1287 | |
| 1288 | #define HT_BW_ANY 0x04 |
| 1289 | #define HT_RIFS_PERMITTED 0x08 |
| 1290 | |
| 1291 | |
| 1292 | #define HT_OPMODE_MASK 0x0003 |
| 1293 | #define HT_OPMODE_SHIFT 0 |
| 1294 | #define HT_OPMODE_PURE 0x0000 |
| 1295 | #define HT_OPMODE_OPTIONAL 0x0001 |
| 1296 | #define HT_OPMODE_HT20IN40 0x0002 |
| 1297 | #define HT_OPMODE_MIXED 0x0003 |
| 1298 | #define HT_OPMODE_NONGF 0x0004 |
| 1299 | #define DOT11N_TXBURST 0x0008 |
| 1300 | #define DOT11N_OBSS_NONHT 0x0010 |
| 1301 | |
| 1302 | |
| 1303 | #define HT_BASIC_STBC_MCS 0x007f |
| 1304 | #define HT_DUAL_STBC_PROT 0x0080 |
| 1305 | #define HT_SECOND_BCN 0x0100 |
| 1306 | #define HT_LSIG_TXOP 0x0200 |
| 1307 | #define HT_PCO_ACTIVE 0x0400 |
| 1308 | #define HT_PCO_PHASE 0x0800 |
| 1309 | #define HT_DUALCTS_PROTECTION 0x0080 |
| 1310 | |
| 1311 | |
| 1312 | #define DOT11N_2G_TXBURST_LIMIT 6160 |
| 1313 | #define DOT11N_5G_TXBURST_LIMIT 3080 |
| 1314 | |
| 1315 | |
| 1316 | #define GET_HT_OPMODE(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ |
| 1317 | >> HT_OPMODE_SHIFT) |
| 1318 | #define HT_MIXEDMODE_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ |
| 1319 | == HT_OPMODE_MIXED) |
| 1320 | #define HT_HT20_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ |
| 1321 | == HT_OPMODE_HT20IN40) |
| 1322 | #define HT_OPTIONAL_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ |
| 1323 | == HT_OPMODE_OPTIONAL) |
| 1324 | #define HT_USE_PROTECTION(add_ie) (HT_HT20_PRESENT((add_ie)) || \ |
| 1325 | HT_MIXEDMODE_PRESENT((add_ie))) |
| 1326 | #define HT_NONGF_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_NONGF) \ |
| 1327 | == HT_OPMODE_NONGF) |
| 1328 | #define DOT11N_TXBURST_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) \ |
| 1329 | == DOT11N_TXBURST) |
| 1330 | #define DOT11N_OBSS_NONHT_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) \ |
| 1331 | == DOT11N_OBSS_NONHT) |
| 1332 | |
| 1333 | BWL_PRE_PACKED_STRUCT struct obss_params { |
| 1334 | uint16 passive_dwell; |
| 1335 | uint16 active_dwell; |
| 1336 | uint16 bss_widthscan_interval; |
| 1337 | uint16 passive_total; |
| 1338 | uint16 active_total; |
| 1339 | uint16 chanwidth_transition_dly; |
| 1340 | uint16 activity_threshold; |
| 1341 | } BWL_POST_PACKED_STRUCT; |
| 1342 | typedef struct obss_params obss_params_t; |
| 1343 | |
| 1344 | BWL_PRE_PACKED_STRUCT struct dot11_obss_ie { |
| 1345 | uint8 id; |
| 1346 | uint8 len; |
| 1347 | obss_params_t obss_params; |
| 1348 | } BWL_POST_PACKED_STRUCT; |
| 1349 | typedef struct dot11_obss_ie dot11_obss_ie_t; |
| 1350 | #define DOT11_OBSS_SCAN_IE_LEN sizeof(obss_params_t) |
| 1351 | |
| 1352 | |
| 1353 | BWL_PRE_PACKED_STRUCT struct vndr_ie { |
| 1354 | uchar id; |
| 1355 | uchar len; |
| 1356 | uchar oui [3]; |
| 1357 | uchar data [1]; |
| 1358 | } BWL_POST_PACKED_STRUCT; |
| 1359 | typedef struct vndr_ie vndr_ie_t; |
| 1360 | |
| 1361 | #define VNDR_IE_HDR_LEN 2 |
| 1362 | #define VNDR_IE_MIN_LEN 3 |
| 1363 | #define VNDR_IE_MAX_LEN 256 |
| 1364 | |
| 1365 | |
Howard Harte | f42f81d | 2009-03-30 17:09:32 -0700 | [diff] [blame] | 1366 | |
Howard M. Harte | 8aee8ec | 2009-01-21 14:38:51 -0800 | [diff] [blame] | 1367 | #define WPA_VERSION 1 |
| 1368 | #define WPA_OUI "\x00\x50\xF2" |
| 1369 | |
| 1370 | #define WPA2_VERSION 1 |
| 1371 | #define WPA2_VERSION_LEN 2 |
| 1372 | #define WPA2_OUI "\x00\x0F\xAC" |
| 1373 | |
| 1374 | #define WPA_OUI_LEN 3 |
| 1375 | |
| 1376 | |
| 1377 | #define RSN_AKM_NONE 0 |
| 1378 | #define RSN_AKM_UNSPECIFIED 1 |
| 1379 | #define RSN_AKM_PSK 2 |
| 1380 | |
| 1381 | |
| 1382 | #define DOT11_MAX_DEFAULT_KEYS 4 |
| 1383 | #define DOT11_MAX_KEY_SIZE 32 |
| 1384 | #define DOT11_MAX_IV_SIZE 16 |
| 1385 | #define DOT11_EXT_IV_FLAG (1<<5) |
| 1386 | #define DOT11_WPA_KEY_RSC_LEN 8 |
| 1387 | |
| 1388 | #define WEP1_KEY_SIZE 5 |
| 1389 | #define WEP1_KEY_HEX_SIZE 10 |
| 1390 | #define WEP128_KEY_SIZE 13 |
| 1391 | #define WEP128_KEY_HEX_SIZE 26 |
| 1392 | #define TKIP_MIC_SIZE 8 |
| 1393 | #define TKIP_EOM_SIZE 7 |
| 1394 | #define TKIP_EOM_FLAG 0x5a |
| 1395 | #define TKIP_KEY_SIZE 32 |
| 1396 | #define TKIP_MIC_AUTH_TX 16 |
| 1397 | #define TKIP_MIC_AUTH_RX 24 |
| 1398 | #define TKIP_MIC_SUP_RX TKIP_MIC_AUTH_TX |
| 1399 | #define TKIP_MIC_SUP_TX TKIP_MIC_AUTH_RX |
| 1400 | #define AES_KEY_SIZE 16 |
| 1401 | #define AES_MIC_SIZE 8 |
| 1402 | |
| 1403 | |
| 1404 | |
| 1405 | #include <packed_section_end.h> |
| 1406 | |
| 1407 | #endif |