2 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 * Fundamental types and constants relating to 802.11
18 * $Id: 802.11.h 397770 2013-04-20 00:13:40Z $
28 #ifndef _NET_ETHERNET_H_
29 #include <proto/ethernet.h>
32 #include <proto/wpa.h>
34 /* This marks the start of a packed structure section. */
35 #include <packed_section_start.h>
38 #define DOT11_TU_TO_US 1024 /* 802.11 Time Unit is 1024 microseconds */
40 /* Generic 802.11 frame constants */
41 #define DOT11_A3_HDR_LEN 24 /* d11 header length with A3 */
42 #define DOT11_A4_HDR_LEN 30 /* d11 header length with A4 */
43 #define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN /* MAC header length */
44 #define DOT11_FCS_LEN 4 /* d11 FCS length */
45 #define DOT11_ICV_LEN 4 /* d11 ICV length */
46 #define DOT11_ICV_AES_LEN 8 /* d11 ICV/AES length */
47 #define DOT11_QOS_LEN 2 /* d11 QoS length */
48 #define DOT11_HTC_LEN 4 /* d11 HT Control field length */
50 #define DOT11_KEY_INDEX_SHIFT 6 /* d11 key index shift */
51 #define DOT11_IV_LEN 4 /* d11 IV length */
52 #define DOT11_IV_TKIP_LEN 8 /* d11 IV TKIP length */
53 #define DOT11_IV_AES_OCB_LEN 4 /* d11 IV/AES/OCB length */
54 #define DOT11_IV_AES_CCM_LEN 8 /* d11 IV/AES/CCM length */
55 #define DOT11_IV_MAX_LEN 8 /* maximum iv len for any encryption */
58 #define DOT11_MAX_MPDU_BODY_LEN 2304 /* max MPDU body length */
59 /* A4 header + QoS + CCMP + PDU + ICV + FCS = 2352 */
60 #define DOT11_MAX_MPDU_LEN (DOT11_A4_HDR_LEN + \
62 DOT11_IV_AES_CCM_LEN + \
63 DOT11_MAX_MPDU_BODY_LEN + \
65 DOT11_FCS_LEN) /* d11 max MPDU length */
67 #define DOT11_MAX_SSID_LEN 32 /* d11 max ssid length */
69 /* dot11RTSThreshold */
70 #define DOT11_DEFAULT_RTS_LEN 2347 /* d11 default RTS length */
71 #define DOT11_MAX_RTS_LEN 2347 /* d11 max RTS length */
73 /* dot11FragmentationThreshold */
74 #define DOT11_MIN_FRAG_LEN 256 /* d11 min fragmentation length */
75 #define DOT11_MAX_FRAG_LEN 2346 /* Max frag is also limited by aMPDUMaxLength
78 #define DOT11_DEFAULT_FRAG_LEN 2346 /* d11 default fragmentation length */
80 /* dot11BeaconPeriod */
81 #define DOT11_MIN_BEACON_PERIOD 1 /* d11 min beacon period */
82 #define DOT11_MAX_BEACON_PERIOD 0xFFFF /* d11 max beacon period */
85 #define DOT11_MIN_DTIM_PERIOD 1 /* d11 min DTIM period */
86 #define DOT11_MAX_DTIM_PERIOD 0xFF /* d11 max DTIM period */
88 /* 802.2 LLC/SNAP header used by 802.11 per 802.1H */
89 #define DOT11_LLC_SNAP_HDR_LEN 8 /* d11 LLC/SNAP header length */
90 #define DOT11_OUI_LEN 3 /* d11 OUI length */
91 BWL_PRE_PACKED_STRUCT
struct dot11_llc_snap_header
{
92 uint8 dsap
; /* always 0xAA */
93 uint8 ssap
; /* always 0xAA */
94 uint8 ctl
; /* always 0x03 */
95 uint8 oui
[DOT11_OUI_LEN
]; /* RFC1042: 0x00 0x00 0x00
96 * Bridge-Tunnel: 0x00 0x00 0xF8
98 uint16 type
; /* ethertype */
99 } BWL_POST_PACKED_STRUCT
;
101 /* RFC1042 header used by 802.11 per 802.1H */
102 #define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN) /* RCF1042 header length */
104 /* Generic 802.11 MAC header */
106 * N.B.: This struct reflects the full 4 address 802.11 MAC header.
107 * The fields are defined such that the shorter 1, 2, and 3
108 * address headers just use the first k fields.
110 BWL_PRE_PACKED_STRUCT
struct dot11_header
{
111 uint16 fc
; /* frame control */
112 uint16 durid
; /* duration/ID */
113 struct ether_addr a1
; /* address 1 */
114 struct ether_addr a2
; /* address 2 */
115 struct ether_addr a3
; /* address 3 */
116 uint16 seq
; /* sequence control */
117 struct ether_addr a4
; /* address 4 */
118 } BWL_POST_PACKED_STRUCT
;
122 BWL_PRE_PACKED_STRUCT
struct dot11_rts_frame
{
123 uint16 fc
; /* frame control */
124 uint16 durid
; /* duration/ID */
125 struct ether_addr ra
; /* receiver address */
126 struct ether_addr ta
; /* transmitter address */
127 } BWL_POST_PACKED_STRUCT
;
128 #define DOT11_RTS_LEN 16 /* d11 RTS frame length */
130 BWL_PRE_PACKED_STRUCT
struct dot11_cts_frame
{
131 uint16 fc
; /* frame control */
132 uint16 durid
; /* duration/ID */
133 struct ether_addr ra
; /* receiver address */
134 } BWL_POST_PACKED_STRUCT
;
135 #define DOT11_CTS_LEN 10 /* d11 CTS frame length */
137 BWL_PRE_PACKED_STRUCT
struct dot11_ack_frame
{
138 uint16 fc
; /* frame control */
139 uint16 durid
; /* duration/ID */
140 struct ether_addr ra
; /* receiver address */
141 } BWL_POST_PACKED_STRUCT
;
142 #define DOT11_ACK_LEN 10 /* d11 ACK frame length */
144 BWL_PRE_PACKED_STRUCT
struct dot11_ps_poll_frame
{
145 uint16 fc
; /* frame control */
146 uint16 durid
; /* AID */
147 struct ether_addr bssid
; /* receiver address, STA in AP */
148 struct ether_addr ta
; /* transmitter address */
149 } BWL_POST_PACKED_STRUCT
;
150 #define DOT11_PS_POLL_LEN 16 /* d11 PS poll frame length */
152 BWL_PRE_PACKED_STRUCT
struct dot11_cf_end_frame
{
153 uint16 fc
; /* frame control */
154 uint16 durid
; /* duration/ID */
155 struct ether_addr ra
; /* receiver address */
156 struct ether_addr bssid
; /* transmitter address, STA in AP */
157 } BWL_POST_PACKED_STRUCT
;
158 #define DOT11_CS_END_LEN 16 /* d11 CF-END frame length */
160 /* RWL wifi protocol: The Vendor Specific Action frame is defined for vendor-specific signaling
161 * category+OUI+vendor specific content ( this can be variable)
163 BWL_PRE_PACKED_STRUCT
struct dot11_action_wifi_vendor_specific
{
169 } BWL_POST_PACKED_STRUCT
;
170 typedef struct dot11_action_wifi_vendor_specific dot11_action_wifi_vendor_specific_t
;
172 /* generic vender specific action frame with variable length */
173 BWL_PRE_PACKED_STRUCT
struct dot11_action_vs_frmhdr
{
179 } BWL_POST_PACKED_STRUCT
;
180 typedef struct dot11_action_vs_frmhdr dot11_action_vs_frmhdr_t
;
181 #define DOT11_ACTION_VS_HDR_LEN 6
183 #define BCM_ACTION_OUI_BYTE0 0x00
184 #define BCM_ACTION_OUI_BYTE1 0x90
185 #define BCM_ACTION_OUI_BYTE2 0x4c
187 /* BA/BAR Control parameters */
188 #define DOT11_BA_CTL_POLICY_NORMAL 0x0000 /* normal ack */
189 #define DOT11_BA_CTL_POLICY_NOACK 0x0001 /* no ack */
190 #define DOT11_BA_CTL_POLICY_MASK 0x0001 /* ack policy mask */
192 #define DOT11_BA_CTL_MTID 0x0002 /* multi tid BA */
193 #define DOT11_BA_CTL_COMPRESSED 0x0004 /* compressed bitmap */
195 #define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0 /* num msdu in bitmap mask */
196 #define DOT11_BA_CTL_NUMMSDU_SHIFT 6 /* num msdu in bitmap shift */
198 #define DOT11_BA_CTL_TID_MASK 0xF000 /* tid mask */
199 #define DOT11_BA_CTL_TID_SHIFT 12 /* tid shift */
201 /* control frame header (BA/BAR) */
202 BWL_PRE_PACKED_STRUCT
struct dot11_ctl_header
{
203 uint16 fc
; /* frame control */
204 uint16 durid
; /* duration/ID */
205 struct ether_addr ra
; /* receiver address */
206 struct ether_addr ta
; /* transmitter address */
207 } BWL_POST_PACKED_STRUCT
;
208 #define DOT11_CTL_HDR_LEN 16 /* control frame hdr len */
210 /* BAR frame payload */
211 BWL_PRE_PACKED_STRUCT
struct dot11_bar
{
212 uint16 bar_control
; /* BAR Control */
213 uint16 seqnum
; /* Starting Sequence control */
214 } BWL_POST_PACKED_STRUCT
;
215 #define DOT11_BAR_LEN 4 /* BAR frame payload length */
217 #define DOT11_BA_BITMAP_LEN 128 /* bitmap length */
218 #define DOT11_BA_CMP_BITMAP_LEN 8 /* compressed bitmap length */
219 /* BA frame payload */
220 BWL_PRE_PACKED_STRUCT
struct dot11_ba
{
221 uint16 ba_control
; /* BA Control */
222 uint16 seqnum
; /* Starting Sequence control */
223 uint8 bitmap
[DOT11_BA_BITMAP_LEN
]; /* Block Ack Bitmap */
224 } BWL_POST_PACKED_STRUCT
;
225 #define DOT11_BA_LEN 4 /* BA frame payload len (wo bitmap) */
227 /* Management frame header */
228 BWL_PRE_PACKED_STRUCT
struct dot11_management_header
{
229 uint16 fc
; /* frame control */
230 uint16 durid
; /* duration/ID */
231 struct ether_addr da
; /* receiver address */
232 struct ether_addr sa
; /* transmitter address */
233 struct ether_addr bssid
; /* BSS ID */
234 uint16 seq
; /* sequence control */
235 } BWL_POST_PACKED_STRUCT
;
236 #define DOT11_MGMT_HDR_LEN 24 /* d11 management header length */
238 /* Management frame payloads */
240 BWL_PRE_PACKED_STRUCT
struct dot11_bcn_prb
{
242 uint16 beacon_interval
;
244 } BWL_POST_PACKED_STRUCT
;
245 #define DOT11_BCN_PRB_LEN 12 /* 802.11 beacon/probe frame fixed length */
246 #define DOT11_BCN_PRB_FIXED_LEN 12 /* 802.11 beacon/probe frame fixed length */
248 BWL_PRE_PACKED_STRUCT
struct dot11_auth
{
249 uint16 alg
; /* algorithm */
250 uint16 seq
; /* sequence control */
251 uint16 status
; /* status code */
252 } BWL_POST_PACKED_STRUCT
;
253 #define DOT11_AUTH_FIXED_LEN 6 /* length of auth frame without challenge IE */
255 BWL_PRE_PACKED_STRUCT
struct dot11_assoc_req
{
256 uint16 capability
; /* capability information */
257 uint16 listen
; /* listen interval */
258 } BWL_POST_PACKED_STRUCT
;
259 #define DOT11_ASSOC_REQ_FIXED_LEN 4 /* length of assoc frame without info elts */
261 BWL_PRE_PACKED_STRUCT
struct dot11_reassoc_req
{
262 uint16 capability
; /* capability information */
263 uint16 listen
; /* listen interval */
264 struct ether_addr ap
; /* Current AP address */
265 } BWL_POST_PACKED_STRUCT
;
266 #define DOT11_REASSOC_REQ_FIXED_LEN 10 /* length of assoc frame without info elts */
268 BWL_PRE_PACKED_STRUCT
struct dot11_assoc_resp
{
269 uint16 capability
; /* capability information */
270 uint16 status
; /* status code */
271 uint16 aid
; /* association ID */
272 } BWL_POST_PACKED_STRUCT
;
273 #define DOT11_ASSOC_RESP_FIXED_LEN 6 /* length of assoc resp frame without info elts */
275 BWL_PRE_PACKED_STRUCT
struct dot11_action_measure
{
280 } BWL_POST_PACKED_STRUCT
;
281 #define DOT11_ACTION_MEASURE_LEN 3 /* d11 action measurement header length */
283 BWL_PRE_PACKED_STRUCT
struct dot11_action_ht_ch_width
{
287 } BWL_POST_PACKED_STRUCT
;
289 BWL_PRE_PACKED_STRUCT
struct dot11_action_ht_mimops
{
293 } BWL_POST_PACKED_STRUCT
;
295 BWL_PRE_PACKED_STRUCT
struct dot11_action_sa_query
{
299 } BWL_POST_PACKED_STRUCT
;
301 BWL_PRE_PACKED_STRUCT
struct dot11_action_vht_oper_mode
{
305 } BWL_POST_PACKED_STRUCT
;
307 #define SM_PWRSAVE_ENABLE 1
308 #define SM_PWRSAVE_MODE 2
310 /* ************* 802.11h related definitions. ************* */
311 BWL_PRE_PACKED_STRUCT
struct dot11_power_cnst
{
315 } BWL_POST_PACKED_STRUCT
;
316 typedef struct dot11_power_cnst dot11_power_cnst_t
;
318 BWL_PRE_PACKED_STRUCT
struct dot11_power_cap
{
321 } BWL_POST_PACKED_STRUCT
;
322 typedef struct dot11_power_cap dot11_power_cap_t
;
324 BWL_PRE_PACKED_STRUCT
struct dot11_tpc_rep
{
329 } BWL_POST_PACKED_STRUCT
;
330 typedef struct dot11_tpc_rep dot11_tpc_rep_t
;
331 #define DOT11_MNG_IE_TPC_REPORT_LEN 2 /* length of IE data, not including 2 byte header */
333 BWL_PRE_PACKED_STRUCT
struct dot11_supp_channels
{
338 } BWL_POST_PACKED_STRUCT
;
339 typedef struct dot11_supp_channels dot11_supp_channels_t
;
341 /* Extension Channel Offset IE: 802.11n-D1.0 spec. added sideband
342 * offset for 40MHz operation. The possible 3 values are:
343 * 1 = above control channel
344 * 3 = below control channel
345 * 0 = no extension channel
347 BWL_PRE_PACKED_STRUCT
struct dot11_extch
{
348 uint8 id
; /* IE ID, 62, DOT11_MNG_EXT_CHANNEL_OFFSET */
349 uint8 len
; /* IE length */
351 } BWL_POST_PACKED_STRUCT
;
352 typedef struct dot11_extch dot11_extch_ie_t
;
354 BWL_PRE_PACKED_STRUCT
struct dot11_brcm_extch
{
355 uint8 id
; /* IE ID, 221, DOT11_MNG_PROPR_ID */
356 uint8 len
; /* IE length */
357 uint8 oui
[3]; /* Proprietary OUI, BRCM_PROP_OUI */
358 uint8 type
; /* type inidicates what follows */
360 } BWL_POST_PACKED_STRUCT
;
361 typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t
;
363 #define BRCM_EXTCH_IE_LEN 5
364 #define BRCM_EXTCH_IE_TYPE 53 /* 802.11n ID not yet assigned */
365 #define DOT11_EXTCH_IE_LEN 1
366 #define DOT11_EXT_CH_MASK 0x03 /* extension channel mask */
367 #define DOT11_EXT_CH_UPPER 0x01 /* ext. ch. on upper sb */
368 #define DOT11_EXT_CH_LOWER 0x03 /* ext. ch. on lower sb */
369 #define DOT11_EXT_CH_NONE 0x00 /* no extension ch. */
371 BWL_PRE_PACKED_STRUCT
struct dot11_action_frmhdr
{
375 } BWL_POST_PACKED_STRUCT
;
376 #define DOT11_ACTION_FRMHDR_LEN 2
378 /* CSA IE data structure */
379 BWL_PRE_PACKED_STRUCT
struct dot11_channel_switch
{
380 uint8 id
; /* id DOT11_MNG_CHANNEL_SWITCH_ID */
381 uint8 len
; /* length of IE */
382 uint8 mode
; /* mode 0 or 1 */
383 uint8 channel
; /* channel switch to */
384 uint8 count
; /* number of beacons before switching */
385 } BWL_POST_PACKED_STRUCT
;
386 typedef struct dot11_channel_switch dot11_chan_switch_ie_t
;
388 #define DOT11_SWITCH_IE_LEN 3 /* length of IE data, not including 2 byte header */
389 /* CSA mode - 802.11h-2003 $7.3.2.20 */
390 #define DOT11_CSA_MODE_ADVISORY 0 /* no DOT11_CSA_MODE_NO_TX restriction imposed */
391 #define DOT11_CSA_MODE_NO_TX 1 /* no transmission upon receiving CSA frame. */
393 BWL_PRE_PACKED_STRUCT
struct dot11_action_switch_channel
{
396 dot11_chan_switch_ie_t chan_switch_ie
; /* for switch IE */
397 dot11_brcm_extch_ie_t extch_ie
; /* extension channel offset */
398 } BWL_POST_PACKED_STRUCT
;
400 BWL_PRE_PACKED_STRUCT
struct dot11_csa_body
{
401 uint8 mode
; /* mode 0 or 1 */
402 uint8 reg
; /* regulatory class */
403 uint8 channel
; /* channel switch to */
404 uint8 count
; /* number of beacons before switching */
405 } BWL_POST_PACKED_STRUCT
;
407 /* 11n Extended Channel Switch IE data structure */
408 BWL_PRE_PACKED_STRUCT
struct dot11_ext_csa
{
409 uint8 id
; /* id DOT11_MNG_EXT_CHANNEL_SWITCH_ID */
410 uint8 len
; /* length of IE */
411 struct dot11_csa_body b
; /* body of the ie */
412 } BWL_POST_PACKED_STRUCT
;
413 typedef struct dot11_ext_csa dot11_ext_csa_ie_t
;
414 #define DOT11_EXT_CSA_IE_LEN 4 /* length of extended channel switch IE body */
416 BWL_PRE_PACKED_STRUCT
struct dot11_action_ext_csa
{
419 dot11_ext_csa_ie_t chan_switch_ie
; /* for switch IE */
420 } BWL_POST_PACKED_STRUCT
;
422 BWL_PRE_PACKED_STRUCT
struct dot11y_action_ext_csa
{
425 struct dot11_csa_body b
; /* body of the ie */
426 } BWL_POST_PACKED_STRUCT
;
428 /* Wide Bandwidth Channel Switch IE data structure */
429 BWL_PRE_PACKED_STRUCT
struct dot11_wide_bw_channel_switch
{
430 uint8 id
; /* id DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID */
431 uint8 len
; /* length of IE */
432 uint8 channel_width
; /* new channel width */
433 uint8 center_frequency_segment_0
; /* center frequency segment 0 */
434 uint8 center_frequency_segment_1
; /* center frequency segment 1 */
435 } BWL_POST_PACKED_STRUCT
;
436 typedef struct dot11_wide_bw_channel_switch dot11_wide_bw_chan_switch_ie_t
;
438 #define DOT11_WIDE_BW_SWITCH_IE_LEN 3 /* length of IE data, not including 2 byte header */
440 /* Channel Switch Wrapper IE data structure */
441 BWL_PRE_PACKED_STRUCT
struct dot11_channel_switch_wrapper
{
442 uint8 id
; /* id DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID */
443 uint8 len
; /* length of IE */
444 dot11_wide_bw_chan_switch_ie_t wb_chan_switch_ie
;
445 } BWL_POST_PACKED_STRUCT
;
446 typedef struct dot11_channel_switch_wrapper dot11_chan_switch_wrapper_ie_t
;
448 /* VHT Transmit Power Envelope IE data structure */
449 BWL_PRE_PACKED_STRUCT
struct dot11_vht_transmit_power_envelope
{
450 uint8 id
; /* id DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID */
451 uint8 len
; /* length of IE */
452 uint8 transmit_power_info
;
453 uint8 local_max_transmit_power_20
;
454 } BWL_POST_PACKED_STRUCT
;
455 typedef struct dot11_vht_transmit_power_envelope dot11_vht_transmit_power_envelope_ie_t
;
457 /* vht transmit power envelope IE length depends on channel width */
458 #define DOT11_VHT_TRANSMIT_PWR_ENVELOPE_IE_LEN_40MHZ 1
459 #define DOT11_VHT_TRANSMIT_PWR_ENVELOPE_IE_LEN_80MHZ 2
460 #define DOT11_VHT_TRANSMIT_PWR_ENVELOPE_IE_LEN_160MHZ 3
462 BWL_PRE_PACKED_STRUCT
struct dot11_obss_coex
{
466 } BWL_POST_PACKED_STRUCT
;
467 typedef struct dot11_obss_coex dot11_obss_coex_t
;
468 #define DOT11_OBSS_COEXINFO_LEN 1 /* length of OBSS Coexistence INFO IE */
470 #define DOT11_OBSS_COEX_INFO_REQ 0x01
471 #define DOT11_OBSS_COEX_40MHZ_INTOLERANT 0x02
472 #define DOT11_OBSS_COEX_20MHZ_WIDTH_REQ 0x04
474 BWL_PRE_PACKED_STRUCT
struct dot11_obss_chanlist
{
479 } BWL_POST_PACKED_STRUCT
;
480 typedef struct dot11_obss_chanlist dot11_obss_chanlist_t
;
481 #define DOT11_OBSS_CHANLIST_FIXED_LEN 1 /* fixed length of regclass */
483 BWL_PRE_PACKED_STRUCT
struct dot11_extcap_ie
{
487 } BWL_POST_PACKED_STRUCT
;
488 typedef struct dot11_extcap_ie dot11_extcap_ie_t
;
490 #define DOT11_EXTCAP_LEN_MAX 8
491 #define DOT11_EXTCAP_LEN_COEX 1
492 #define DOT11_EXTCAP_LEN_BT 3
493 #define DOT11_EXTCAP_LEN_IW 4
494 #define DOT11_EXTCAP_LEN_SI 6
496 #define DOT11_EXTCAP_LEN_TDLS 5
498 #define DOT11_EXTCAP_LEN_FMS 2
499 #define DOT11_EXTCAP_LEN_PROXY_ARP 2
500 #define DOT11_EXTCAP_LEN_TFS 3
501 #define DOT11_EXTCAP_LEN_WNM_SLEEP 3
502 #define DOT11_EXTCAP_LEN_TIM_BCAST 3
503 #define DOT11_EXTCAP_LEN_BSS_TRANSITION 3
504 #define DOT11_EXTCAP_LEN_DMS 4
505 #define DOT11_EXTCAP_LEN_WNM_NOTIFICATION 6
507 BWL_PRE_PACKED_STRUCT
struct dot11_extcap
{
508 uint8 extcap
[DOT11_EXTCAP_LEN_MAX
];
509 } BWL_POST_PACKED_STRUCT
;
510 typedef struct dot11_extcap dot11_extcap_t
;
512 /* TDLS Capabilities */
513 #define TDLS_CAP_TDLS 37 /* TDLS support */
514 #define TDLS_CAP_PU_BUFFER_STA 28 /* TDLS Peer U-APSD buffer STA support */
515 #define TDLS_CAP_PEER_PSM 20 /* TDLS Peer PSM support */
516 #define TDLS_CAP_CH_SW 30 /* TDLS Channel switch */
517 #define TDLS_CAP_PROH 38 /* TDLS prohibited */
518 #define TDLS_CAP_CH_SW_PROH 39 /* TDLS Channel switch prohibited */
520 #define TDLS_CAP_MAX_BIT 39 /* TDLS max bit defined in ext cap */
522 /* 802.11h/802.11k Measurement Request/Report IEs */
523 /* Measurement Type field */
524 #define DOT11_MEASURE_TYPE_BASIC 0 /* d11 measurement basic type */
525 #define DOT11_MEASURE_TYPE_CCA 1 /* d11 measurement CCA type */
526 #define DOT11_MEASURE_TYPE_RPI 2 /* d11 measurement RPI type */
527 #define DOT11_MEASURE_TYPE_CHLOAD 3 /* d11 measurement Channel Load type */
528 #define DOT11_MEASURE_TYPE_NOISE 4 /* d11 measurement Noise Histogram type */
529 #define DOT11_MEASURE_TYPE_BEACON 5 /* d11 measurement Beacon type */
530 #define DOT11_MEASURE_TYPE_FRAME 6 /* d11 measurement Frame type */
531 #define DOT11_MEASURE_TYPE_STAT 7 /* d11 measurement STA Statistics type */
532 #define DOT11_MEASURE_TYPE_LCI 8 /* d11 measurement LCI type */
533 #define DOT11_MEASURE_TYPE_TXSTREAM 9 /* d11 measurement TX Stream type */
534 #define DOT11_MEASURE_TYPE_PAUSE 255 /* d11 measurement pause type */
536 /* Measurement Request Modes */
537 #define DOT11_MEASURE_MODE_PARALLEL (1<<0) /* d11 measurement parallel */
538 #define DOT11_MEASURE_MODE_ENABLE (1<<1) /* d11 measurement enable */
539 #define DOT11_MEASURE_MODE_REQUEST (1<<2) /* d11 measurement request */
540 #define DOT11_MEASURE_MODE_REPORT (1<<3) /* d11 measurement report */
541 #define DOT11_MEASURE_MODE_DUR (1<<4) /* d11 measurement dur mandatory */
542 /* Measurement Report Modes */
543 #define DOT11_MEASURE_MODE_LATE (1<<0) /* d11 measurement late */
544 #define DOT11_MEASURE_MODE_INCAPABLE (1<<1) /* d11 measurement incapable */
545 #define DOT11_MEASURE_MODE_REFUSED (1<<2) /* d11 measurement refuse */
546 /* Basic Measurement Map bits */
547 #define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0)) /* d11 measurement basic map BSS */
548 #define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1)) /* d11 measurement map OFDM */
549 #define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2)) /* d11 measurement map unknown */
550 #define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3)) /* d11 measurement map radar */
551 #define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4)) /* d11 measurement map unmeasuremnt */
553 BWL_PRE_PACKED_STRUCT
struct dot11_meas_req
{
562 } BWL_POST_PACKED_STRUCT
;
563 typedef struct dot11_meas_req dot11_meas_req_t
;
564 #define DOT11_MNG_IE_MREQ_LEN 14 /* d11 measurement request IE length */
565 /* length of Measure Request IE data not including variable len */
566 #define DOT11_MNG_IE_MREQ_FIXED_LEN 3 /* d11 measurement request IE fixed length */
568 BWL_PRE_PACKED_STRUCT
struct dot11_meas_rep
{
574 BWL_PRE_PACKED_STRUCT
union
576 BWL_PRE_PACKED_STRUCT
struct {
581 } BWL_POST_PACKED_STRUCT basic
;
583 } BWL_POST_PACKED_STRUCT rep
;
584 } BWL_POST_PACKED_STRUCT
;
585 typedef struct dot11_meas_rep dot11_meas_rep_t
;
587 /* length of Measure Report IE data not including variable len */
588 #define DOT11_MNG_IE_MREP_FIXED_LEN 3 /* d11 measurement response IE fixed length */
590 BWL_PRE_PACKED_STRUCT
struct dot11_meas_rep_basic
{
595 } BWL_POST_PACKED_STRUCT
;
596 typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t
;
597 #define DOT11_MEASURE_BASIC_REP_LEN 12 /* d11 measurement basic report length */
599 BWL_PRE_PACKED_STRUCT
struct dot11_quiet
{
602 uint8 count
; /* TBTTs until beacon interval in quiet starts */
603 uint8 period
; /* Beacon intervals between periodic quiet periods ? */
604 uint16 duration
; /* Length of quiet period, in TU's */
605 uint16 offset
; /* TU's offset from TBTT in Count field */
606 } BWL_POST_PACKED_STRUCT
;
607 typedef struct dot11_quiet dot11_quiet_t
;
609 BWL_PRE_PACKED_STRUCT
struct chan_map_tuple
{
612 } BWL_POST_PACKED_STRUCT
;
613 typedef struct chan_map_tuple chan_map_tuple_t
;
615 BWL_PRE_PACKED_STRUCT
struct dot11_ibss_dfs
{
618 uint8 eaddr
[ETHER_ADDR_LEN
];
620 chan_map_tuple_t map
[1];
621 } BWL_POST_PACKED_STRUCT
;
622 typedef struct dot11_ibss_dfs dot11_ibss_dfs_t
;
625 #define WME_OUI "\x00\x50\xf2" /* WME OUI */
626 #define WME_OUI_LEN 3
627 #define WME_OUI_TYPE 2 /* WME type */
628 #define WME_TYPE 2 /* WME type, deprecated */
629 #define WME_SUBTYPE_IE 0 /* Information Element */
630 #define WME_SUBTYPE_PARAM_IE 1 /* Parameter Element */
631 #define WME_SUBTYPE_TSPEC 2 /* Traffic Specification */
632 #define WME_VER 1 /* WME version */
634 /* WME Access Category Indices (ACIs) */
635 #define AC_BE 0 /* Best Effort */
636 #define AC_BK 1 /* Background */
637 #define AC_VI 2 /* Video */
638 #define AC_VO 3 /* Voice */
639 #define AC_COUNT 4 /* number of ACs */
641 typedef uint8 ac_bitmap_t
; /* AC bitmap of (1 << AC_xx) */
643 #define AC_BITMAP_NONE 0x0 /* No ACs */
644 #define AC_BITMAP_ALL 0xf /* All ACs */
645 #define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0)
646 #define AC_BITMAP_SET(ab, ac) (((ab) |= (1 << (ac))))
647 #define AC_BITMAP_RESET(ab, ac) (((ab) &= ~(1 << (ac))))
649 /* WME Information Element (IE) */
650 BWL_PRE_PACKED_STRUCT
struct wme_ie
{
656 } BWL_POST_PACKED_STRUCT
;
657 typedef struct wme_ie wme_ie_t
;
658 #define WME_IE_LEN 7 /* WME IE length */
660 BWL_PRE_PACKED_STRUCT
struct edcf_acparam
{
663 uint16 TXOP
; /* stored in network order (ls octet first) */
664 } BWL_POST_PACKED_STRUCT
;
665 typedef struct edcf_acparam edcf_acparam_t
;
667 /* WME Parameter Element (PE) */
668 BWL_PRE_PACKED_STRUCT
struct wme_param_ie
{
675 edcf_acparam_t acparam
[AC_COUNT
];
676 } BWL_POST_PACKED_STRUCT
;
677 typedef struct wme_param_ie wme_param_ie_t
;
678 #define WME_PARAM_IE_LEN 24 /* WME Parameter IE length */
680 /* QoS Info field for IE as sent from AP */
681 #define WME_QI_AP_APSD_MASK 0x80 /* U-APSD Supported mask */
682 #define WME_QI_AP_APSD_SHIFT 7 /* U-APSD Supported shift */
683 #define WME_QI_AP_COUNT_MASK 0x0f /* Parameter set count mask */
684 #define WME_QI_AP_COUNT_SHIFT 0 /* Parameter set count shift */
686 /* QoS Info field for IE as sent from STA */
687 #define WME_QI_STA_MAXSPLEN_MASK 0x60 /* Max Service Period Length mask */
688 #define WME_QI_STA_MAXSPLEN_SHIFT 5 /* Max Service Period Length shift */
689 #define WME_QI_STA_APSD_ALL_MASK 0xf /* APSD all AC bits mask */
690 #define WME_QI_STA_APSD_ALL_SHIFT 0 /* APSD all AC bits shift */
691 #define WME_QI_STA_APSD_BE_MASK 0x8 /* APSD AC_BE mask */
692 #define WME_QI_STA_APSD_BE_SHIFT 3 /* APSD AC_BE shift */
693 #define WME_QI_STA_APSD_BK_MASK 0x4 /* APSD AC_BK mask */
694 #define WME_QI_STA_APSD_BK_SHIFT 2 /* APSD AC_BK shift */
695 #define WME_QI_STA_APSD_VI_MASK 0x2 /* APSD AC_VI mask */
696 #define WME_QI_STA_APSD_VI_SHIFT 1 /* APSD AC_VI shift */
697 #define WME_QI_STA_APSD_VO_MASK 0x1 /* APSD AC_VO mask */
698 #define WME_QI_STA_APSD_VO_SHIFT 0 /* APSD AC_VO shift */
701 #define EDCF_AIFSN_MIN 1 /* AIFSN minimum value */
702 #define EDCF_AIFSN_MAX 15 /* AIFSN maximum value */
703 #define EDCF_AIFSN_MASK 0x0f /* AIFSN mask */
704 #define EDCF_ACM_MASK 0x10 /* ACM mask */
705 #define EDCF_ACI_MASK 0x60 /* ACI mask */
706 #define EDCF_ACI_SHIFT 5 /* ACI shift */
707 #define EDCF_AIFSN_SHIFT 12 /* 4 MSB(0xFFF) in ifs_ctl for AC idx */
710 #define EDCF_ECW_MIN 0 /* cwmin/cwmax exponent minimum value */
711 #define EDCF_ECW_MAX 15 /* cwmin/cwmax exponent maximum value */
712 #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1)
713 #define EDCF_ECWMIN_MASK 0x0f /* cwmin exponent form mask */
714 #define EDCF_ECWMAX_MASK 0xf0 /* cwmax exponent form mask */
715 #define EDCF_ECWMAX_SHIFT 4 /* cwmax exponent form shift */
718 #define EDCF_TXOP_MIN 0 /* TXOP minimum value */
719 #define EDCF_TXOP_MAX 65535 /* TXOP maximum value */
720 #define EDCF_TXOP2USEC(txop) ((txop) << 5)
722 /* Default BE ACI value for non-WME connection STA */
723 #define NON_EDCF_AC_BE_ACI_STA 0x02
725 /* Default EDCF parameters that AP advertises for STA to use; WMM draft Table 12 */
726 #define EDCF_AC_BE_ACI_STA 0x03 /* STA ACI value for best effort AC */
727 #define EDCF_AC_BE_ECW_STA 0xA4 /* STA ECW value for best effort AC */
728 #define EDCF_AC_BE_TXOP_STA 0x0000 /* STA TXOP value for best effort AC */
729 #define EDCF_AC_BK_ACI_STA 0x27 /* STA ACI value for background AC */
730 #define EDCF_AC_BK_ECW_STA 0xA4 /* STA ECW value for background AC */
731 #define EDCF_AC_BK_TXOP_STA 0x0000 /* STA TXOP value for background AC */
732 #define EDCF_AC_VI_ACI_STA 0x42 /* STA ACI value for video AC */
733 #define EDCF_AC_VI_ECW_STA 0x43 /* STA ECW value for video AC */
734 #define EDCF_AC_VI_TXOP_STA 0x005e /* STA TXOP value for video AC */
735 #define EDCF_AC_VO_ACI_STA 0x62 /* STA ACI value for audio AC */
736 #define EDCF_AC_VO_ECW_STA 0x32 /* STA ECW value for audio AC */
737 #define EDCF_AC_VO_TXOP_STA 0x002f /* STA TXOP value for audio AC */
739 /* Default EDCF parameters that AP uses; WMM draft Table 14 */
740 #define EDCF_AC_BE_ACI_AP 0x03 /* AP ACI value for best effort AC */
741 #define EDCF_AC_BE_ECW_AP 0x64 /* AP ECW value for best effort AC */
742 #define EDCF_AC_BE_TXOP_AP 0x0000 /* AP TXOP value for best effort AC */
743 #define EDCF_AC_BK_ACI_AP 0x27 /* AP ACI value for background AC */
744 #define EDCF_AC_BK_ECW_AP 0xA4 /* AP ECW value for background AC */
745 #define EDCF_AC_BK_TXOP_AP 0x0000 /* AP TXOP value for background AC */
746 #define EDCF_AC_VI_ACI_AP 0x41 /* AP ACI value for video AC */
747 #define EDCF_AC_VI_ECW_AP 0x43 /* AP ECW value for video AC */
748 #define EDCF_AC_VI_TXOP_AP 0x005e /* AP TXOP value for video AC */
749 #define EDCF_AC_VO_ACI_AP 0x61 /* AP ACI value for audio AC */
750 #define EDCF_AC_VO_ECW_AP 0x32 /* AP ECW value for audio AC */
751 #define EDCF_AC_VO_TXOP_AP 0x002f /* AP TXOP value for audio AC */
753 /* EDCA Parameter IE */
754 BWL_PRE_PACKED_STRUCT
struct edca_param_ie
{
757 edcf_acparam_t acparam
[AC_COUNT
];
758 } BWL_POST_PACKED_STRUCT
;
759 typedef struct edca_param_ie edca_param_ie_t
;
760 #define EDCA_PARAM_IE_LEN 18 /* EDCA Parameter IE length */
762 /* QoS Capability IE */
763 BWL_PRE_PACKED_STRUCT
struct qos_cap_ie
{
765 } BWL_POST_PACKED_STRUCT
;
766 typedef struct qos_cap_ie qos_cap_ie_t
;
768 BWL_PRE_PACKED_STRUCT
struct dot11_qbss_load_ie
{
769 uint8 id
; /* 11, DOT11_MNG_QBSS_LOAD_ID */
771 uint16 station_count
; /* total number of STAs associated */
772 uint8 channel_utilization
; /* % of time, normalized to 255, QAP sensed medium busy */
773 uint16 aac
; /* available admission capacity */
774 } BWL_POST_PACKED_STRUCT
;
775 typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t
;
776 #define BSS_LOAD_IE_SIZE 7 /* BSS load IE size */
779 #define FIXED_MSDU_SIZE 0x8000 /* MSDU size is fixed */
780 #define MSDU_SIZE_MASK 0x7fff /* (Nominal or fixed) MSDU size */
782 /* surplus_bandwidth */
783 /* Represented as 3 bits of integer, binary point, 13 bits fraction */
784 #define INTEGER_SHIFT 13 /* integer shift */
785 #define FRACTION_MASK 0x1FFF /* fraction mask */
787 /* Management Notification Frame */
788 BWL_PRE_PACKED_STRUCT
struct dot11_management_notification
{
789 uint8 category
; /* DOT11_ACTION_NOTIFICATION */
793 uint8 data
[1]; /* Elements */
794 } BWL_POST_PACKED_STRUCT
;
795 #define DOT11_MGMT_NOTIFICATION_LEN 4 /* Fixed length */
797 /* Timeout Interval IE */
798 BWL_PRE_PACKED_STRUCT
struct ti_ie
{
801 } BWL_POST_PACKED_STRUCT
;
802 typedef struct ti_ie ti_ie_t
;
803 #define TI_TYPE_REASSOC_DEADLINE 1
804 #define TI_TYPE_KEY_LIFETIME 2
806 /* WME Action Codes */
807 #define WME_ADDTS_REQUEST 0 /* WME ADDTS request */
808 #define WME_ADDTS_RESPONSE 1 /* WME ADDTS response */
809 #define WME_DELTS_REQUEST 2 /* WME DELTS request */
811 /* WME Setup Response Status Codes */
812 #define WME_ADMISSION_ACCEPTED 0 /* WME admission accepted */
813 #define WME_INVALID_PARAMETERS 1 /* WME invalide parameters */
814 #define WME_ADMISSION_REFUSED 3 /* WME admission refused */
816 /* Macro to take a pointer to a beacon or probe response
817 * body and return the char* pointer to the SSID info element
819 #define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN)
821 /* Authentication frame payload constants */
822 #define DOT11_OPEN_SYSTEM 0 /* d11 open authentication */
823 #define DOT11_SHARED_KEY 1 /* d11 shared authentication */
824 #define DOT11_FAST_BSS 2 /* d11 fast bss authentication */
825 #define DOT11_CHALLENGE_LEN 128 /* d11 challenge text length */
827 /* Frame control macros */
828 #define FC_PVER_MASK 0x3 /* PVER mask */
829 #define FC_PVER_SHIFT 0 /* PVER shift */
830 #define FC_TYPE_MASK 0xC /* type mask */
831 #define FC_TYPE_SHIFT 2 /* type shift */
832 #define FC_SUBTYPE_MASK 0xF0 /* subtype mask */
833 #define FC_SUBTYPE_SHIFT 4 /* subtype shift */
834 #define FC_TODS 0x100 /* to DS */
835 #define FC_TODS_SHIFT 8 /* to DS shift */
836 #define FC_FROMDS 0x200 /* from DS */
837 #define FC_FROMDS_SHIFT 9 /* from DS shift */
838 #define FC_MOREFRAG 0x400 /* more frag. */
839 #define FC_MOREFRAG_SHIFT 10 /* more frag. shift */
840 #define FC_RETRY 0x800 /* retry */
841 #define FC_RETRY_SHIFT 11 /* retry shift */
842 #define FC_PM 0x1000 /* PM */
843 #define FC_PM_SHIFT 12 /* PM shift */
844 #define FC_MOREDATA 0x2000 /* more data */
845 #define FC_MOREDATA_SHIFT 13 /* more data shift */
846 #define FC_WEP 0x4000 /* WEP */
847 #define FC_WEP_SHIFT 14 /* WEP shift */
848 #define FC_ORDER 0x8000 /* order */
849 #define FC_ORDER_SHIFT 15 /* order shift */
851 /* sequence control macros */
852 #define SEQNUM_SHIFT 4 /* seq. number shift */
853 #define SEQNUM_MAX 0x1000 /* max seqnum + 1 */
854 #define FRAGNUM_MASK 0xF /* frag. number mask */
856 /* Frame Control type/subtype defs */
859 #define FC_TYPE_MNG 0 /* management type */
860 #define FC_TYPE_CTL 1 /* control type */
861 #define FC_TYPE_DATA 2 /* data type */
863 /* Management Subtypes */
864 #define FC_SUBTYPE_ASSOC_REQ 0 /* assoc. request */
865 #define FC_SUBTYPE_ASSOC_RESP 1 /* assoc. response */
866 #define FC_SUBTYPE_REASSOC_REQ 2 /* reassoc. request */
867 #define FC_SUBTYPE_REASSOC_RESP 3 /* reassoc. response */
868 #define FC_SUBTYPE_PROBE_REQ 4 /* probe request */
869 #define FC_SUBTYPE_PROBE_RESP 5 /* probe response */
870 #define FC_SUBTYPE_BEACON 8 /* beacon */
871 #define FC_SUBTYPE_ATIM 9 /* ATIM */
872 #define FC_SUBTYPE_DISASSOC 10 /* disassoc. */
873 #define FC_SUBTYPE_AUTH 11 /* authentication */
874 #define FC_SUBTYPE_DEAUTH 12 /* de-authentication */
875 #define FC_SUBTYPE_ACTION 13 /* action */
876 #define FC_SUBTYPE_ACTION_NOACK 14 /* action no-ack */
878 /* Control Subtypes */
879 #define FC_SUBTYPE_CTL_WRAPPER 7 /* Control Wrapper */
880 #define FC_SUBTYPE_BLOCKACK_REQ 8 /* Block Ack Req */
881 #define FC_SUBTYPE_BLOCKACK 9 /* Block Ack */
882 #define FC_SUBTYPE_PS_POLL 10 /* PS poll */
883 #define FC_SUBTYPE_RTS 11 /* RTS */
884 #define FC_SUBTYPE_CTS 12 /* CTS */
885 #define FC_SUBTYPE_ACK 13 /* ACK */
886 #define FC_SUBTYPE_CF_END 14 /* CF-END */
887 #define FC_SUBTYPE_CF_END_ACK 15 /* CF-END ACK */
890 #define FC_SUBTYPE_DATA 0 /* Data */
891 #define FC_SUBTYPE_DATA_CF_ACK 1 /* Data + CF-ACK */
892 #define FC_SUBTYPE_DATA_CF_POLL 2 /* Data + CF-Poll */
893 #define FC_SUBTYPE_DATA_CF_ACK_POLL 3 /* Data + CF-Ack + CF-Poll */
894 #define FC_SUBTYPE_NULL 4 /* Null */
895 #define FC_SUBTYPE_CF_ACK 5 /* CF-Ack */
896 #define FC_SUBTYPE_CF_POLL 6 /* CF-Poll */
897 #define FC_SUBTYPE_CF_ACK_POLL 7 /* CF-Ack + CF-Poll */
898 #define FC_SUBTYPE_QOS_DATA 8 /* QoS Data */
899 #define FC_SUBTYPE_QOS_DATA_CF_ACK 9 /* QoS Data + CF-Ack */
900 #define FC_SUBTYPE_QOS_DATA_CF_POLL 10 /* QoS Data + CF-Poll */
901 #define FC_SUBTYPE_QOS_DATA_CF_ACK_POLL 11 /* QoS Data + CF-Ack + CF-Poll */
902 #define FC_SUBTYPE_QOS_NULL 12 /* QoS Null */
903 #define FC_SUBTYPE_QOS_CF_POLL 14 /* QoS CF-Poll */
904 #define FC_SUBTYPE_QOS_CF_ACK_POLL 15 /* QoS CF-Ack + CF-Poll */
906 /* Data Subtype Groups */
907 #define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0)
908 #define FC_SUBTYPE_ANY_NULL(s) (((s) & 4) != 0)
909 #define FC_SUBTYPE_ANY_CF_POLL(s) (((s) & 2) != 0)
910 #define FC_SUBTYPE_ANY_CF_ACK(s) (((s) & 1) != 0)
912 /* Type/Subtype Combos */
913 #define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK) /* FC kind mask */
915 #define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT)) /* FC kind */
917 #define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT) /* Subtype from FC */
918 #define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT) /* Type from FC */
920 #define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ) /* assoc. request */
921 #define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP) /* assoc. response */
922 #define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ) /* reassoc. request */
923 #define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP) /* reassoc. response */
924 #define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ) /* probe request */
925 #define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP) /* probe response */
926 #define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON) /* beacon */
927 #define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC) /* disassoc */
928 #define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH) /* authentication */
929 #define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH) /* deauthentication */
930 #define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION) /* action */
931 #define FC_ACTION_NOACK FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION_NOACK) /* action no-ack */
933 #define FC_CTL_WRAPPER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTL_WRAPPER) /* Control Wrapper */
934 #define FC_BLOCKACK_REQ FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK_REQ) /* Block Ack Req */
935 #define FC_BLOCKACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK) /* Block Ack */
936 #define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL) /* PS poll */
937 #define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS) /* RTS */
938 #define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS) /* CTS */
939 #define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK) /* ACK */
940 #define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END) /* CF-END */
941 #define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK) /* CF-END ACK */
943 #define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA) /* data */
944 #define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL) /* null data */
945 #define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK) /* data CF ACK */
946 #define FC_QOS_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA) /* QoS data */
947 #define FC_QOS_NULL FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL) /* QoS null */
949 /* QoS Control Field */
951 /* 802.1D Priority */
952 #define QOS_PRIO_SHIFT 0 /* QoS priority shift */
953 #define QOS_PRIO_MASK 0x0007 /* QoS priority mask */
954 #define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT) /* QoS priority */
956 /* Traffic Identifier */
957 #define QOS_TID_SHIFT 0 /* QoS TID shift */
958 #define QOS_TID_MASK 0x000f /* QoS TID mask */
959 #define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT) /* QoS TID */
961 /* End of Service Period (U-APSD) */
962 #define QOS_EOSP_SHIFT 4 /* QoS End of Service Period shift */
963 #define QOS_EOSP_MASK 0x0010 /* QoS End of Service Period mask */
964 #define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT) /* Qos EOSP */
967 #define QOS_ACK_NORMAL_ACK 0 /* Normal Ack */
968 #define QOS_ACK_NO_ACK 1 /* No Ack (eg mcast) */
969 #define QOS_ACK_NO_EXP_ACK 2 /* No Explicit Ack */
970 #define QOS_ACK_BLOCK_ACK 3 /* Block Ack */
971 #define QOS_ACK_SHIFT 5 /* QoS ACK shift */
972 #define QOS_ACK_MASK 0x0060 /* QoS ACK mask */
973 #define QOS_ACK(qos) (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT) /* QoS ACK */
976 #define QOS_AMSDU_SHIFT 7 /* AMSDU shift */
977 #define QOS_AMSDU_MASK 0x0080 /* AMSDU mask */
979 /* Management Frames */
981 /* Management Frame Constants */
984 #define DOT11_MNG_AUTH_ALGO_LEN 2 /* d11 management auth. algo. length */
985 #define DOT11_MNG_AUTH_SEQ_LEN 2 /* d11 management auth. seq. length */
986 #define DOT11_MNG_BEACON_INT_LEN 2 /* d11 management beacon interval length */
987 #define DOT11_MNG_CAP_LEN 2 /* d11 management cap. length */
988 #define DOT11_MNG_AP_ADDR_LEN 6 /* d11 management AP address length */
989 #define DOT11_MNG_LISTEN_INT_LEN 2 /* d11 management listen interval length */
990 #define DOT11_MNG_REASON_LEN 2 /* d11 management reason length */
991 #define DOT11_MNG_AID_LEN 2 /* d11 management AID length */
992 #define DOT11_MNG_STATUS_LEN 2 /* d11 management status length */
993 #define DOT11_MNG_TIMESTAMP_LEN 8 /* d11 management timestamp length */
995 /* DUR/ID field in assoc resp is 0xc000 | AID */
996 #define DOT11_AID_MASK 0x3fff /* d11 AID mask */
999 #define DOT11_RC_RESERVED 0 /* d11 RC reserved */
1000 #define DOT11_RC_UNSPECIFIED 1 /* Unspecified reason */
1001 #define DOT11_RC_AUTH_INVAL 2 /* Previous authentication no longer valid */
1002 #define DOT11_RC_DEAUTH_LEAVING 3 /* Deauthenticated because sending station
1003 * is leaving (or has left) IBSS or ESS
1005 #define DOT11_RC_INACTIVITY 4 /* Disassociated due to inactivity */
1006 #define DOT11_RC_BUSY 5 /* Disassociated because AP is unable to handle
1007 * all currently associated stations
1009 #define DOT11_RC_INVAL_CLASS_2 6 /* Class 2 frame received from
1010 * nonauthenticated station
1012 #define DOT11_RC_INVAL_CLASS_3 7 /* Class 3 frame received from
1013 * nonassociated station
1015 #define DOT11_RC_DISASSOC_LEAVING 8 /* Disassociated because sending station is
1016 * leaving (or has left) BSS
1018 #define DOT11_RC_NOT_AUTH 9 /* Station requesting (re)association is not
1019 * authenticated with responding station
1021 #define DOT11_RC_BAD_PC 10 /* Unacceptable power capability element */
1022 #define DOT11_RC_BAD_CHANNELS 11 /* Unacceptable supported channels element */
1025 /* 32-39 are QSTA specific reasons added in 11e */
1026 #define DOT11_RC_UNSPECIFIED_QOS 32 /* unspecified QoS-related reason */
1027 #define DOT11_RC_INSUFFCIENT_BW 33 /* QAP lacks sufficient bandwidth */
1028 #define DOT11_RC_EXCESSIVE_FRAMES 34 /* excessive number of frames need ack */
1029 #define DOT11_RC_TX_OUTSIDE_TXOP 35 /* transmitting outside the limits of txop */
1030 #define DOT11_RC_LEAVING_QBSS 36 /* QSTA is leaving the QBSS (or restting) */
1031 #define DOT11_RC_BAD_MECHANISM 37 /* does not want to use the mechanism */
1032 #define DOT11_RC_SETUP_NEEDED 38 /* mechanism needs a setup */
1033 #define DOT11_RC_TIMEOUT 39 /* timeout */
1035 #define DOT11_RC_MAX 23 /* Reason codes > 23 are reserved */
1037 #define DOT11_RC_TDLS_PEER_UNREACH 25
1038 #define DOT11_RC_TDLS_DOWN_UNSPECIFIED 26
1041 #define DOT11_SC_SUCCESS 0 /* Successful */
1042 #define DOT11_SC_FAILURE 1 /* Unspecified failure */
1043 #define DOT11_SC_TDLS_WAKEUP_SCH_ALT 2 /* TDLS wakeup schedule rejected but alternative */
1044 /* schedule provided */
1045 #define DOT11_SC_TDLS_WAKEUP_SCH_REJ 3 /* TDLS wakeup schedule rejected */
1046 #define DOT11_SC_TDLS_SEC_DISABLED 5 /* TDLS Security disabled */
1047 #define DOT11_SC_LIFETIME_REJ 6 /* Unacceptable lifetime */
1048 #define DOT11_SC_NOT_SAME_BSS 7 /* Not in same BSS */
1049 #define DOT11_SC_CAP_MISMATCH 10 /* Cannot support all requested
1050 * capabilities in the Capability
1053 #define DOT11_SC_REASSOC_FAIL 11 /* Reassociation denied due to inability
1054 * to confirm that association exists
1056 #define DOT11_SC_ASSOC_FAIL 12 /* Association denied due to reason
1057 * outside the scope of this standard
1059 #define DOT11_SC_AUTH_MISMATCH 13 /* Responding station does not support
1060 * the specified authentication
1063 #define DOT11_SC_AUTH_SEQ 14 /* Received an Authentication frame
1064 * with authentication transaction
1065 * sequence number out of expected
1068 #define DOT11_SC_AUTH_CHALLENGE_FAIL 15 /* Authentication rejected because of
1071 #define DOT11_SC_AUTH_TIMEOUT 16 /* Authentication rejected due to timeout
1072 * waiting for next frame in sequence
1074 #define DOT11_SC_ASSOC_BUSY_FAIL 17 /* Association denied because AP is
1075 * unable to handle additional
1076 * associated stations
1078 #define DOT11_SC_ASSOC_RATE_MISMATCH 18 /* Association denied due to requesting
1079 * station not supporting all of the
1080 * data rates in the BSSBasicRateSet
1083 #define DOT11_SC_ASSOC_SHORT_REQUIRED 19 /* Association denied due to requesting
1084 * station not supporting the Short
1087 #define DOT11_SC_ASSOC_PBCC_REQUIRED 20 /* Association denied due to requesting
1088 * station not supporting the PBCC
1091 #define DOT11_SC_ASSOC_AGILITY_REQUIRED 21 /* Association denied due to requesting
1092 * station not supporting the Channel
1095 #define DOT11_SC_ASSOC_SPECTRUM_REQUIRED 22 /* Association denied because Spectrum
1096 * Management capability is required.
1098 #define DOT11_SC_ASSOC_BAD_POWER_CAP 23 /* Association denied because the info
1099 * in the Power Cap element is
1102 #define DOT11_SC_ASSOC_BAD_SUP_CHANNELS 24 /* Association denied because the info
1103 * in the Supported Channel element is
1106 #define DOT11_SC_ASSOC_SHORTSLOT_REQUIRED 25 /* Association denied due to requesting
1107 * station not supporting the Short Slot
1110 #define DOT11_SC_ASSOC_ERPBCC_REQUIRED 26 /* Association denied due to requesting
1111 * station not supporting the ER-PBCC
1114 #define DOT11_SC_ASSOC_DSSOFDM_REQUIRED 27 /* Association denied due to requesting
1115 * station not supporting the DSS-OFDM
1118 #define DOT11_SC_ASSOC_R0KH_UNREACHABLE 28 /* Association denied due to AP
1119 * being unable to reach the R0 Key Holder
1121 #define DOT11_SC_ASSOC_TRY_LATER 30 /* Association denied temporarily, try again later
1123 #define DOT11_SC_ASSOC_MFP_VIOLATION 31 /* Association denied due to Robust Management
1124 * frame policy violation
1127 #define DOT11_SC_DECLINED 37 /* request declined */
1128 #define DOT11_SC_INVALID_PARAMS 38 /* One or more params have invalid values */
1129 #define DOT11_SC_INVALID_PAIRWISE_CIPHER 42 /* invalid pairwise cipher */
1130 #define DOT11_SC_INVALID_AKMP 43 /* Association denied due to invalid AKMP */
1131 #define DOT11_SC_INVALID_RSNIE_CAP 45 /* invalid RSN IE capabilities */
1132 #define DOT11_SC_DLS_NOT_ALLOWED 48 /* DLS is not allowed in the BSS by policy */
1133 #define DOT11_SC_INVALID_PMKID 53 /* Association denied due to invalid PMKID */
1134 #define DOT11_SC_INVALID_MDID 54 /* Association denied due to invalid MDID */
1135 #define DOT11_SC_INVALID_FTIE 55 /* Association denied due to invalid FTIE */
1137 #define DOT11_SC_ADV_PROTO_NOT_SUPPORTED 59 /* ad proto not supported */
1138 #define DOT11_SC_NO_OUTSTAND_REQ 60 /* no outstanding req */
1139 #define DOT11_SC_RSP_NOT_RX_FROM_SERVER 61 /* no response from server */
1140 #define DOT11_SC_TIMEOUT 62 /* timeout */
1141 #define DOT11_SC_QUERY_RSP_TOO_LARGE 63 /* query rsp too large */
1142 #define DOT11_SC_SERVER_UNREACHABLE 65 /* server unreachable */
1144 #define DOT11_SC_UNEXP_MSG 70 /* Unexpected message */
1145 #define DOT11_SC_INVALID_SNONCE 71 /* Invalid SNonce */
1146 #define DOT11_SC_INVALID_RSNIE 72 /* Invalid contents of RSNIE */
1148 #define DOT11_SC_TRANSMIT_FAILURE 79 /* transmission failure */
1150 /* Info Elts, length of INFORMATION portion of Info Elts */
1151 #define DOT11_MNG_DS_PARAM_LEN 1 /* d11 management DS parameter length */
1152 #define DOT11_MNG_IBSS_PARAM_LEN 2 /* d11 management IBSS parameter length */
1154 /* TIM Info element has 3 bytes fixed info in INFORMATION field,
1155 * followed by 1 to 251 bytes of Partial Virtual Bitmap
1157 #define DOT11_MNG_TIM_FIXED_LEN 3 /* d11 management TIM fixed length */
1158 #define DOT11_MNG_TIM_DTIM_COUNT 0 /* d11 management DTIM count */
1159 #define DOT11_MNG_TIM_DTIM_PERIOD 1 /* d11 management DTIM period */
1160 #define DOT11_MNG_TIM_BITMAP_CTL 2 /* d11 management TIM BITMAP control */
1161 #define DOT11_MNG_TIM_PVB 3 /* d11 management TIM PVB */
1164 #define TLV_TAG_OFF 0 /* tag offset */
1165 #define TLV_LEN_OFF 1 /* length offset */
1166 #define TLV_HDR_LEN 2 /* header length */
1167 #define TLV_BODY_OFF 2 /* body offset */
1169 /* Management Frame Information Element IDs */
1170 #define DOT11_MNG_SSID_ID 0 /* d11 management SSID id */
1171 #define DOT11_MNG_RATES_ID 1 /* d11 management rates id */
1172 #define DOT11_MNG_FH_PARMS_ID 2 /* d11 management FH parameter id */
1173 #define DOT11_MNG_DS_PARMS_ID 3 /* d11 management DS parameter id */
1174 #define DOT11_MNG_CF_PARMS_ID 4 /* d11 management CF parameter id */
1175 #define DOT11_MNG_TIM_ID 5 /* d11 management TIM id */
1176 #define DOT11_MNG_IBSS_PARMS_ID 6 /* d11 management IBSS parameter id */
1177 #define DOT11_MNG_COUNTRY_ID 7 /* d11 management country id */
1178 #define DOT11_MNG_HOPPING_PARMS_ID 8 /* d11 management hopping parameter id */
1179 #define DOT11_MNG_HOPPING_TABLE_ID 9 /* d11 management hopping table id */
1180 #define DOT11_MNG_REQUEST_ID 10 /* d11 management request id */
1181 #define DOT11_MNG_QBSS_LOAD_ID 11 /* d11 management QBSS Load id */
1182 #define DOT11_MNG_EDCA_PARAM_ID 12 /* 11E EDCA Parameter id */
1183 #define DOT11_MNG_TSPEC_ID 13 /* d11 management TSPEC id */
1184 #define DOT11_MNG_TCLAS_ID 14 /* d11 management TCLAS id */
1185 #define DOT11_MNG_CHALLENGE_ID 16 /* d11 management chanllenge id */
1186 #define DOT11_MNG_PWR_CONSTRAINT_ID 32 /* 11H PowerConstraint */
1187 #define DOT11_MNG_PWR_CAP_ID 33 /* 11H PowerCapability */
1188 #define DOT11_MNG_TPC_REQUEST_ID 34 /* 11H TPC Request */
1189 #define DOT11_MNG_TPC_REPORT_ID 35 /* 11H TPC Report */
1190 #define DOT11_MNG_SUPP_CHANNELS_ID 36 /* 11H Supported Channels */
1191 #define DOT11_MNG_CHANNEL_SWITCH_ID 37 /* 11H ChannelSwitch Announcement */
1192 #define DOT11_MNG_MEASURE_REQUEST_ID 38 /* 11H MeasurementRequest */
1193 #define DOT11_MNG_MEASURE_REPORT_ID 39 /* 11H MeasurementReport */
1194 #define DOT11_MNG_QUIET_ID 40 /* 11H Quiet */
1195 #define DOT11_MNG_IBSS_DFS_ID 41 /* 11H IBSS_DFS */
1196 #define DOT11_MNG_ERP_ID 42 /* d11 management ERP id */
1197 #define DOT11_MNG_TS_DELAY_ID 43 /* d11 management TS Delay id */
1198 #define DOT11_MNG_TCLAS_PROC_ID 44 /* d11 management TCLAS processing id */
1199 #define DOT11_MNG_HT_CAP 45 /* d11 mgmt HT cap id */
1200 #define DOT11_MNG_QOS_CAP_ID 46 /* 11E QoS Capability id */
1201 #define DOT11_MNG_NONERP_ID 47 /* d11 management NON-ERP id */
1202 #define DOT11_MNG_RSN_ID 48 /* d11 management RSN id */
1203 #define DOT11_MNG_EXT_RATES_ID 50 /* d11 management ext. rates id */
1204 #define DOT11_MNG_AP_CHREP_ID 51 /* 11k AP Channel report id */
1205 #define DOT11_MNG_NBR_REP_ID 52 /* 11k Neighbor report id */
1206 #define DOT11_MNG_RCPI_ID 53 /* 11k RCPI */
1207 #define DOT11_MNG_MDIE_ID 54 /* 11r Mobility domain id */
1208 #define DOT11_MNG_FTIE_ID 55 /* 11r Fast Bss Transition id */
1209 #define DOT11_MNG_FT_TI_ID 56 /* 11r Timeout Interval id */
1210 #define DOT11_MNG_RDE_ID 57 /* 11r RIC Data Element id */
1211 #define DOT11_MNG_REGCLASS_ID 59 /* d11 management regulatory class id */
1212 #define DOT11_MNG_EXT_CSA_ID 60 /* d11 Extended CSA */
1213 #define DOT11_MNG_HT_ADD 61 /* d11 mgmt additional HT info */
1214 #define DOT11_MNG_EXT_CHANNEL_OFFSET 62 /* d11 mgmt ext channel offset */
1215 #define DOT11_MNG_BSS_AVR_ACCESS_DELAY_ID 63 /* 11k bss average access delay */
1216 #define DOT11_MNG_ANTENNA_ID 64 /* 11k antenna id */
1217 #define DOT11_MNG_RSNI_ID 65 /* 11k RSNI id */
1218 #define DOT11_MNG_MEASUREMENT_PILOT_TX_ID 66 /* 11k measurement pilot tx info id */
1219 #define DOT11_MNG_BSS_AVAL_ADMISSION_CAP_ID 67 /* 11k bss aval admission cap id */
1220 #define DOT11_MNG_BSS_AC_ACCESS_DELAY_ID 68 /* 11k bss AC access delay id */
1221 #define DOT11_MNG_WAPI_ID 68 /* d11 management WAPI id */
1222 #define DOT11_MNG_TIME_ADVERTISE_ID 69 /* 11p time advertisement */
1223 #define DOT11_MNG_RRM_CAP_ID 70 /* 11k radio measurement capability */
1224 #define DOT11_MNG_MULTIPLE_BSSID_ID 71 /* 11k multiple BSSID id */
1225 #define DOT11_MNG_HT_BSS_COEXINFO_ID 72 /* d11 mgmt OBSS Coexistence INFO */
1226 #define DOT11_MNG_HT_BSS_CHANNEL_REPORT_ID 73 /* d11 mgmt OBSS Intolerant Channel list */
1227 #define DOT11_MNG_HT_OBSS_ID 74 /* d11 mgmt OBSS HT info */
1228 #define DOT11_MNG_MMIE_ID 76 /* d11 mgmt MIC IE */
1229 #define DOT11_MNG_BSS_MAX_IDLE_PERIOD_ID 90 /* 11v bss max idle id */
1230 #define DOT11_MNG_TFS_REQUEST_ID 91 /* 11v tfs request id */
1231 #define DOT11_MNG_TFS_RESPONSE_ID 92 /* 11v tfs response id */
1232 #define DOT11_MNG_WNM_SLEEP_MODE_ID 93 /* 11v wnm-sleep mode id */
1233 #define DOT11_MNG_TIM_BCAST_REQ_ID 94 /* 11v TIM broadcast request id */
1234 #define DOT11_MNG_TIM_BCAST_RESP_ID 95 /* 11v TIM broadcast response id */
1235 #define DOT11_MNG_CHANNEL_USAGE 97 /* 11v channel usage */
1236 #define DOT11_MNG_TIME_ZONE_ID 98 /* 11v time zone */
1237 #define DOT11_MNG_DMS_REQUEST_ID 99 /* 11v dms request id */
1238 #define DOT11_MNG_DMS_RESPONSE_ID 100 /* 11v dms response id */
1239 #define DOT11_MNG_LINK_IDENTIFIER_ID 101 /* 11z TDLS Link Identifier IE */
1240 #define DOT11_MNG_WAKEUP_SCHEDULE_ID 102 /* 11z TDLS Wakeup Schedule IE */
1241 #define DOT11_MNG_CHANNEL_SWITCH_TIMING_ID 104 /* 11z TDLS Channel Switch Timing IE */
1242 #define DOT11_MNG_PTI_CONTROL_ID 105 /* 11z TDLS PTI Control IE */
1243 #define DOT11_MNG_PU_BUFFER_STATUS_ID 106 /* 11z TDLS PU Buffer Status IE */
1244 #define DOT11_MNG_INTERWORKING_ID 107 /* 11u interworking */
1245 #define DOT11_MNG_ADVERTISEMENT_ID 108 /* 11u advertisement protocol */
1246 #define DOT11_MNG_EXP_BW_REQ_ID 109 /* 11u expedited bandwith request */
1247 #define DOT11_MNG_QOS_MAP_ID 110 /* 11u QoS map set */
1248 #define DOT11_MNG_ROAM_CONSORT_ID 111 /* 11u roaming consortium */
1249 #define DOT11_MNG_EMERGCY_ALERT_ID 112 /* 11u emergency alert identifier */
1250 #define DOT11_MNG_EXT_CAP_ID 127 /* d11 mgmt ext capability */
1251 #define DOT11_MNG_VHT_CAP_ID 191 /* d11 mgmt VHT cap id */
1252 #define DOT11_MNG_VHT_OPERATION_ID 192 /* d11 mgmt VHT op id */
1253 #define DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID 194 /* Wide BW Channel Switch IE */
1254 #define DOT11_MNG_VHT_TRANSMIT_POWER_ENVELOPE_ID 195 /* VHT transmit Power Envelope IE */
1255 #define DOT11_MNG_CHANNEL_SWITCH_WRAPPER_ID 196 /* Channel Switch Wrapper IE */
1256 #define DOT11_MNG_OPER_MODE_NOTIF_ID 199 /* d11 mgmt VHT oper mode notif */
1259 #define DOT11_MNG_WPA_ID 221 /* d11 management WPA id */
1260 #define DOT11_MNG_PROPR_ID 221 /* d11 management proprietary id */
1261 /* should start using this one instead of above two */
1262 #define DOT11_MNG_VS_ID 221 /* d11 management Vendor Specific IE */
1264 /* Rate element Basic flag and rate mask */
1265 #define DOT11_RATE_BASIC 0x80 /* flag for a Basic Rate */
1266 #define DOT11_RATE_MASK 0x7F /* mask for numeric part of rate */
1268 /* ERP info element bit values */
1269 #define DOT11_MNG_ERP_LEN 1 /* ERP is currently 1 byte long */
1270 #define DOT11_MNG_NONERP_PRESENT 0x01 /* NonERP (802.11b) STAs are present
1273 #define DOT11_MNG_USE_PROTECTION 0x02 /* Use protection mechanisms for
1276 #define DOT11_MNG_BARKER_PREAMBLE 0x04 /* Short Preambles: 0 == allowed,
1279 /* TS Delay element offset & size */
1280 #define DOT11_MGN_TS_DELAY_LEN 4 /* length of TS DELAY IE */
1281 #define TS_DELAY_FIELD_SIZE 4 /* TS DELAY field size */
1283 /* Capability Information Field */
1284 #define DOT11_CAP_ESS 0x0001 /* d11 cap. ESS */
1285 #define DOT11_CAP_IBSS 0x0002 /* d11 cap. IBSS */
1286 #define DOT11_CAP_POLLABLE 0x0004 /* d11 cap. pollable */
1287 #define DOT11_CAP_POLL_RQ 0x0008 /* d11 cap. poll request */
1288 #define DOT11_CAP_PRIVACY 0x0010 /* d11 cap. privacy */
1289 #define DOT11_CAP_SHORT 0x0020 /* d11 cap. short */
1290 #define DOT11_CAP_PBCC 0x0040 /* d11 cap. PBCC */
1291 #define DOT11_CAP_AGILITY 0x0080 /* d11 cap. agility */
1292 #define DOT11_CAP_SPECTRUM 0x0100 /* d11 cap. spectrum */
1293 #define DOT11_CAP_SHORTSLOT 0x0400 /* d11 cap. shortslot */
1294 #define DOT11_CAP_RRM 0x1000 /* d11 cap. 11k radio measurement */
1295 #define DOT11_CAP_CCK_OFDM 0x2000 /* d11 cap. CCK/OFDM */
1297 /* Extended capabilities IE bitfields */
1298 /* 20/40 BSS Coexistence Management support bit position */
1299 #define DOT11_EXT_CAP_OBSS_COEX_MGMT 0
1300 /* Extended Channel Switching support bit position */
1301 #define DOT11_EXT_CAP_EXT_CHAN_SWITCHING 2
1302 /* scheduled PSMP support bit position */
1303 #define DOT11_EXT_CAP_SPSMP 6
1304 /* Flexible Multicast Service */
1305 #define DOT11_EXT_CAP_FMS 11
1306 /* proxy ARP service support bit position */
1307 #define DOT11_EXT_CAP_PROXY_ARP 12
1308 /* Traffic Filter Service */
1309 #define DOT11_EXT_CAP_TFS 16
1310 /* WNM-Sleep Mode */
1311 #define DOT11_EXT_CAP_WNM_SLEEP 17
1312 /* TIM Broadcast service */
1313 #define DOT11_EXT_CAP_TIM_BCAST 18
1314 /* BSS Transition Management support bit position */
1315 #define DOT11_EXT_CAP_BSS_TRANSITION_MGMT 19
1316 /* Direct Multicast Service */
1317 #define DOT11_EXT_CAP_DMS 26
1318 /* Interworking support bit position */
1319 #define DOT11_EXT_CAP_IW 31
1320 /* service Interval granularity bit position and mask */
1321 #define DOT11_EXT_CAP_SI 41
1322 #define DOT11_EXT_CAP_SI_MASK 0x0E
1323 /* WNM notification */
1324 #define DOT11_EXT_CAP_WNM_NOTIF 46
1325 /* Operating mode notification - VHT (11ac D3.0 - 8.4.2.29) */
1326 #define DOT11_EXT_CAP_OPER_MODE_NOTIF 62
1328 /* VHT Operating mode bit fields - (11ac D3.0 - 8.4.1.50) */
1329 #define DOT11_OPER_MODE_CHANNEL_WIDTH_SHIFT 0
1330 #define DOT11_OPER_MODE_CHANNEL_WIDTH_MASK 0x3
1331 #define DOT11_OPER_MODE_RXNSS_SHIFT 4
1332 #define DOT11_OPER_MODE_RXNSS_MASK 0x70
1333 #define DOT11_OPER_MODE_RXNSS_TYPE_SHIFT 7
1334 #define DOT11_OPER_MODE_RXNSS_TYPE_MASK 0x80
1336 #define DOT11_OPER_MODE(type, nss, chanw) (\
1337 ((type) << DOT11_OPER_MODE_RXNSS_TYPE_SHIFT &\
1338 DOT11_OPER_MODE_RXNSS_TYPE_MASK) |\
1339 (((nss) - 1) << DOT11_OPER_MODE_RXNSS_SHIFT & DOT11_OPER_MODE_RXNSS_MASK) |\
1340 ((chanw) << DOT11_OPER_MODE_CHANNEL_WIDTH_SHIFT &\
1341 DOT11_OPER_MODE_CHANNEL_WIDTH_MASK))
1343 #define DOT11_OPER_MODE_CHANNEL_WIDTH(mode) \
1344 (((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK)\
1345 >> DOT11_OPER_MODE_CHANNEL_WIDTH_SHIFT)
1346 #define DOT11_OPER_MODE_RXNSS(mode) \
1347 ((((mode) & DOT11_OPER_MODE_RXNSS_MASK) \
1348 >> DOT11_OPER_MODE_RXNSS_SHIFT) + 1)
1349 #define DOT11_OPER_MODE_RXNSS_TYPE(mode) \
1350 (((mode) & DOT11_OPER_MODE_RXNSS_TYPE_MASK)\
1351 >> DOT11_OPER_MODE_RXNSS_TYPE_SHIFT)
1353 #define DOT11_OPER_MODE_20MHZ 0
1354 #define DOT11_OPER_MODE_40MHZ 1
1355 #define DOT11_OPER_MODE_80MHZ 2
1356 #define DOT11_OPER_MODE_160MHZ 3
1357 #define DOT11_OPER_MODE_8080MHZ 3
1359 #define DOT11_OPER_MODE_CHANNEL_WIDTH_20MHZ(mode) (\
1360 ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_20MHZ)
1361 #define DOT11_OPER_MODE_CHANNEL_WIDTH_40MHZ(mode) (\
1362 ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_40MHZ)
1363 #define DOT11_OPER_MODE_CHANNEL_WIDTH_80MHZ(mode) (\
1364 ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_80MHZ)
1365 #define DOT11_OPER_MODE_CHANNEL_WIDTH_160MHZ(mode) (\
1366 ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_160MHZ)
1367 #define DOT11_OPER_MODE_CHANNEL_WIDTH_8080MHZ(mode) (\
1368 ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_8080MHZ)
1370 /* Operating mode information element 802.11ac D3.0 - 8.4.2.168 */
1371 BWL_PRE_PACKED_STRUCT
struct dot11_oper_mode_notif_ie
{
1373 } BWL_POST_PACKED_STRUCT
;
1374 typedef struct dot11_oper_mode_notif_ie dot11_oper_mode_notif_ie_t
;
1376 #define DOT11_OPER_MODE_NOTIF_IE_LEN 1
1379 * Action Frame Constants
1381 #define DOT11_ACTION_HDR_LEN 2 /* action frame category + action field */
1382 #define DOT11_ACTION_CAT_OFF 0 /* category offset */
1383 #define DOT11_ACTION_ACT_OFF 1 /* action offset */
1385 /* Action Category field (sec 8.4.1.11) */
1386 #define DOT11_ACTION_CAT_ERR_MASK 0x80 /* category error mask */
1387 #define DOT11_ACTION_CAT_MASK 0x7F /* category mask */
1388 #define DOT11_ACTION_CAT_SPECT_MNG 0 /* category spectrum management */
1389 #define DOT11_ACTION_CAT_QOS 1 /* category QoS */
1390 #define DOT11_ACTION_CAT_DLS 2 /* category DLS */
1391 #define DOT11_ACTION_CAT_BLOCKACK 3 /* category block ack */
1392 #define DOT11_ACTION_CAT_PUBLIC 4 /* category public */
1393 #define DOT11_ACTION_CAT_RRM 5 /* category radio measurements */
1394 #define DOT11_ACTION_CAT_FBT 6 /* category fast bss transition */
1395 #define DOT11_ACTION_CAT_HT 7 /* category for HT */
1396 #define DOT11_ACTION_CAT_SA_QUERY 8 /* security association query */
1397 #define DOT11_ACTION_CAT_PDPA 9 /* protected dual of public action */
1398 #define DOT11_ACTION_CAT_WNM 10 /* category for WNM */
1399 #define DOT11_ACTION_CAT_UWNM 11 /* category for Unprotected WNM */
1400 #define DOT11_ACTION_NOTIFICATION 17
1401 #define DOT11_ACTION_CAT_VHT 21 /* VHT action */
1402 #define DOT11_ACTION_CAT_VSP 126 /* protected vendor specific */
1403 #define DOT11_ACTION_CAT_VS 127 /* category Vendor Specific */
1405 /* Spectrum Management Action IDs (sec 7.4.1) */
1406 #define DOT11_SM_ACTION_M_REQ 0 /* d11 action measurement request */
1407 #define DOT11_SM_ACTION_M_REP 1 /* d11 action measurement response */
1408 #define DOT11_SM_ACTION_TPC_REQ 2 /* d11 action TPC request */
1409 #define DOT11_SM_ACTION_TPC_REP 3 /* d11 action TPC response */
1410 #define DOT11_SM_ACTION_CHANNEL_SWITCH 4 /* d11 action channel switch */
1413 #define DOT11_ACTION_ID_HT_CH_WIDTH 0 /* notify channel width action id */
1414 #define DOT11_ACTION_ID_HT_MIMO_PS 1 /* mimo ps action id */
1416 /* Public action ids */
1417 #define DOT11_PUB_ACTION_BSS_COEX_MNG 0 /* 20/40 Coexistence Management action id */
1418 #define DOT11_PUB_ACTION_CHANNEL_SWITCH 4 /* d11 action channel switch */
1420 /* Block Ack action types */
1421 #define DOT11_BA_ACTION_ADDBA_REQ 0 /* ADDBA Req action frame type */
1422 #define DOT11_BA_ACTION_ADDBA_RESP 1 /* ADDBA Resp action frame type */
1423 #define DOT11_BA_ACTION_DELBA 2 /* DELBA action frame type */
1425 /* ADDBA action parameters */
1426 #define DOT11_ADDBA_PARAM_AMSDU_SUP 0x0001 /* AMSDU supported under BA */
1427 #define DOT11_ADDBA_PARAM_POLICY_MASK 0x0002 /* policy mask(ack vs delayed) */
1428 #define DOT11_ADDBA_PARAM_POLICY_SHIFT 1 /* policy shift */
1429 #define DOT11_ADDBA_PARAM_TID_MASK 0x003c /* tid mask */
1430 #define DOT11_ADDBA_PARAM_TID_SHIFT 2 /* tid shift */
1431 #define DOT11_ADDBA_PARAM_BSIZE_MASK 0xffc0 /* buffer size mask */
1432 #define DOT11_ADDBA_PARAM_BSIZE_SHIFT 6 /* buffer size shift */
1434 #define DOT11_ADDBA_POLICY_DELAYED 0 /* delayed BA policy */
1435 #define DOT11_ADDBA_POLICY_IMMEDIATE 1 /* immediate BA policy */
1437 /* Fast Transition action types */
1438 #define DOT11_FT_ACTION_FT_RESERVED 0
1439 #define DOT11_FT_ACTION_FT_REQ 1 /* FBT request - for over-the-DS FBT */
1440 #define DOT11_FT_ACTION_FT_RES 2 /* FBT response - for over-the-DS FBT */
1441 #define DOT11_FT_ACTION_FT_CON 3 /* FBT confirm - for OTDS with RRP */
1442 #define DOT11_FT_ACTION_FT_ACK 4 /* FBT ack */
1444 /* DLS action types */
1445 #define DOT11_DLS_ACTION_REQ 0 /* DLS Request */
1446 #define DOT11_DLS_ACTION_RESP 1 /* DLS Response */
1447 #define DOT11_DLS_ACTION_TD 2 /* DLS Teardown */
1449 /* Wireless Network Management (WNM) action types */
1450 #define DOT11_WNM_ACTION_EVENT_REQ 0
1451 #define DOT11_WNM_ACTION_EVENT_REP 1
1452 #define DOT11_WNM_ACTION_DIAG_REQ 2
1453 #define DOT11_WNM_ACTION_DIAG_REP 3
1454 #define DOT11_WNM_ACTION_LOC_CFG_REQ 4
1455 #define DOT11_WNM_ACTION_LOC_RFG_RESP 5
1456 #define DOT11_WNM_ACTION_BSS_TRANS_QURY 6
1457 #define DOT11_WNM_ACTION_BSS_TRANS_REQ 7
1458 #define DOT11_WNM_ACTION_BSS_TRANS_RESP 8
1459 #define DOT11_WNM_ACTION_FMS_REQ 9
1460 #define DOT11_WNM_ACTION_FMS_RESP 10
1461 #define DOT11_WNM_ACTION_COL_INTRFRNCE_REQ 11
1462 #define DOT11_WNM_ACTION_COL_INTRFRNCE_REP 12
1463 #define DOT11_WNM_ACTION_TFS_REQ 13
1464 #define DOT11_WNM_ACTION_TFS_RESP 14
1465 #define DOT11_WNM_ACTION_TFS_NOTIFY 15
1466 #define DOT11_WNM_ACTION_WNM_SLEEP_REQ 16
1467 #define DOT11_WNM_ACTION_WNM_SLEEP_RESP 17
1468 #define DOT11_WNM_ACTION_TIM_BCAST_REQ 18
1469 #define DOT11_WNM_ACTION_TIM_BCAST_RESP 19
1470 #define DOT11_WNM_ACTION_QOS_TRFC_CAP_UPD 20
1471 #define DOT11_WNM_ACTION_CHAN_USAGE_REQ 21
1472 #define DOT11_WNM_ACTION_CHAN_USAGE_RESP 22
1473 #define DOT11_WNM_ACTION_DMS_REQ 23
1474 #define DOT11_WNM_ACTION_DMS_RESP 24
1475 #define DOT11_WNM_ACTION_TMNG_MEASUR_REQ 25
1476 #define DOT11_WNM_ACTION_NOTFCTN_REQ 26
1477 #define DOT11_WNM_ACTION_NOTFCTN_RES 27
1479 /* Unprotected Wireless Network Management (WNM) action types */
1480 #define DOT11_UWNM_ACTION_TIM 0
1481 #define DOT11_UWNM_ACTION_TIMING_MEASUREMENT 1
1483 #define DOT11_MNG_COUNTRY_ID_LEN 3
1485 /* VHT category action types - 802.11ac D3.0 - 8.5.23.1 */
1486 #define DOT11_VHT_ACTION_CBF 0 /* Compressed Beamforming */
1487 #define DOT11_VHT_ACTION_GID_MGMT 1 /* Group ID Management */
1488 #define DOT11_VHT_ACTION_OPER_MODE_NOTIF 2 /* Operating mode notif'n */
1490 /* DLS Request frame header */
1491 BWL_PRE_PACKED_STRUCT
struct dot11_dls_req
{
1492 uint8 category
; /* category of action frame (2) */
1493 uint8 action
; /* DLS action: req (0) */
1494 struct ether_addr da
; /* destination address */
1495 struct ether_addr sa
; /* source address */
1496 uint16 cap
; /* capability */
1497 uint16 timeout
; /* timeout value */
1498 uint8 data
[1]; /* IE:support rate, extend support rate, HT cap */
1499 } BWL_POST_PACKED_STRUCT
;
1500 typedef struct dot11_dls_req dot11_dls_req_t
;
1501 #define DOT11_DLS_REQ_LEN 18 /* Fixed length */
1503 /* DLS response frame header */
1504 BWL_PRE_PACKED_STRUCT
struct dot11_dls_resp
{
1505 uint8 category
; /* category of action frame (2) */
1506 uint8 action
; /* DLS action: req (0) */
1507 uint16 status
; /* status code field */
1508 struct ether_addr da
; /* destination address */
1509 struct ether_addr sa
; /* source address */
1510 uint8 data
[1]; /* optional: capability, rate ... */
1511 } BWL_POST_PACKED_STRUCT
;
1512 typedef struct dot11_dls_resp dot11_dls_resp_t
;
1513 #define DOT11_DLS_RESP_LEN 16 /* Fixed length */
1516 /* ************* 802.11v related definitions. ************* */
1518 /* BSS Management Transition Query frame header */
1519 BWL_PRE_PACKED_STRUCT
struct dot11_bss_trans_query
{
1520 uint8 category
; /* category of action frame (10) */
1521 uint8 action
; /* WNM action: trans_query (6) */
1522 uint8 token
; /* dialog token */
1523 uint8 reason
; /* transition query reason */
1524 uint8 data
[1]; /* Elements */
1525 } BWL_POST_PACKED_STRUCT
;
1526 typedef struct dot11_bss_trans_query dot11_bss_trans_query_t
;
1527 #define DOT11_BSS_TRANS_QUERY_LEN 4 /* Fixed length */
1529 /* BSS Management Transition Request frame header */
1530 BWL_PRE_PACKED_STRUCT
struct dot11_bss_trans_req
{
1531 uint8 category
; /* category of action frame (10) */
1532 uint8 action
; /* WNM action: trans_req (7) */
1533 uint8 token
; /* dialog token */
1534 uint8 reqmode
; /* transition request mode */
1535 uint16 disassoc_tmr
; /* disassociation timer */
1536 uint8 validity_intrvl
; /* validity interval */
1537 uint8 data
[1]; /* optional: BSS term duration, ... */
1538 /* ...session info URL, list */
1539 } BWL_POST_PACKED_STRUCT
;
1540 typedef struct dot11_bss_trans_req dot11_bss_trans_req_t
;
1541 #define DOT11_BSS_TRANS_REQ_LEN 7 /* Fixed length */
1543 #define DOT11_BSS_TERM_DUR_LEN 12 /* Fixed length if present */
1546 /* BSS Mgmt Transition Request Mode Field - 802.11v */
1547 #define DOT11_BSS_TRNS_REQMODE_PREF_LIST_INCL 0x01
1548 #define DOT11_BSS_TRNS_REQMODE_ABRIDGED 0x02
1549 #define DOT11_BSS_TRNS_REQMODE_DISASSOC_IMMINENT 0x04
1550 #define DOT11_BSS_TRNS_REQMODE_BSS_TERM_INCL 0x08
1551 #define DOT11_BSS_TRNS_REQMODE_ESS_DISASSOC_IMNT 0x10
1554 /* BSS Management transition response frame header */
1555 BWL_PRE_PACKED_STRUCT
struct dot11_bss_trans_res
{
1556 uint8 category
; /* category of action frame (10) */
1557 uint8 action
; /* WNM action: trans_res (8) */
1558 uint8 token
; /* dialog token */
1559 uint8 status
; /* transition status */
1560 uint8 term_delay
; /* validity interval */
1561 uint8 data
[1]; /* optional: BSS term duration, ... */
1562 /* ...session info URL, list */
1563 } BWL_POST_PACKED_STRUCT
;
1564 typedef struct dot11_bss_trans_res dot11_bss_trans_res_t
;
1565 #define DOT11_BSS_TRANS_RES_LEN 5 /* Fixed length */
1567 /* BSS Mgmt Transition Response Status Field */
1568 #define DOT11_BSS_TRNS_RES_STATUS_ACCEPT 0
1569 #define DOT11_BSS_TRNS_RES_STATUS_REJECT 1
1570 #define DOT11_BSS_TRNS_RES_STATUS_REJ_INSUFF_BCN 2
1571 #define DOT11_BSS_TRNS_RES_STATUS_REJ_INSUFF_CAP 3
1572 #define DOT11_BSS_TRNS_RES_STATUS_REJ_TERM_UNDESIRED 4
1573 #define DOT11_BSS_TRNS_RES_STATUS_REJ_TERM_DELAY_REQ 5
1574 #define DOT11_BSS_TRNS_RES_STATUS_REJ_BSS_LIST_PROVIDED 6
1575 #define DOT11_BSS_TRNS_RES_STATUS_REJ_NO_SUITABLE_BSS 7
1576 #define DOT11_BSS_TRNS_RES_STATUS_REJ_LEAVING_ESS 8
1579 /* Neighbor Report BSSID Information Field */
1580 #define DOT11_NBR_RPRT_BSSID_INFO_REACHABILTY 0x0003
1581 #define DOT11_NBR_RPRT_BSSID_INFO_SEC 0x0004
1582 #define DOT11_NBR_RPRT_BSSID_INFO_KEY_SCOPE 0x0008
1583 #define DOT11_NBR_RPRT_BSSID_INFO_CAP 0x03f0
1585 #define DOT11_NBR_RPRT_BSSID_INFO_CAP_SPEC_MGMT 0x0010
1586 #define DOT11_NBR_RPRT_BSSID_INFO_CAP_QOS 0x0020
1587 #define DOT11_NBR_RPRT_BSSID_INFO_CAP_APSD 0x0040
1588 #define DOT11_NBR_RPRT_BSSID_INFO_CAP_RDIO_MSMT 0x0080
1589 #define DOT11_NBR_RPRT_BSSID_INFO_CAP_DEL_BA 0x0100
1590 #define DOT11_NBR_RPRT_BSSID_INFO_CAP_IMM_BA 0x0200
1592 /* Neighbor Report Subelements */
1593 #define DOT11_NBR_RPRT_SUBELEM_BSS_CANDDT_PREF_ID 3
1595 /* BSS Max Idle Period information element */
1596 BWL_PRE_PACKED_STRUCT
struct dot11_bss_max_idle_period_ie
{
1597 uint8 id
; /* 90, DOT11_MNG_BSS_MAX_IDLE_PERIOD_ID */
1599 uint16 max_idle_period
; /* in unit of 1000 TUs */
1601 } BWL_POST_PACKED_STRUCT
;
1602 typedef struct dot11_bss_max_idle_period_ie dot11_bss_max_idle_period_ie_t
;
1603 #define DOT11_BSS_MAX_IDLE_PERIOD_IE_LEN 3 /* bss max idle period IE size */
1604 #define DOT11_BSS_MAX_IDLE_PERIOD_OPT_PROTECTED 1 /* BSS max idle option */
1606 /* TIM Broadcast request information element */
1607 BWL_PRE_PACKED_STRUCT
struct dot11_tim_bcast_req_ie
{
1608 uint8 id
; /* 94, DOT11_MNG_TIM_BROADCAST_REQ_ID */
1610 uint8 tim_bcast_interval
; /* in unit of beacon interval */
1611 } BWL_POST_PACKED_STRUCT
;
1612 typedef struct dot11_tim_bcast_req_ie dot11_tim_bcast_req_ie_t
;
1613 #define DOT11_TIM_BCAST_REQ_IE_LEN 1 /* Fixed length */
1615 /* TIM Broadcast request frame header */
1616 BWL_PRE_PACKED_STRUCT
struct dot11_tim_bcast_req
{
1617 uint8 category
; /* category of action frame (10) */
1618 uint8 action
; /* WNM action: DOT11_WNM_ACTION_TIM_BCAST_REQ(18) */
1619 uint8 token
; /* dialog token */
1620 uint8 data
[1]; /* TIM broadcast request element */
1621 } BWL_POST_PACKED_STRUCT
;
1622 typedef struct dot11_tim_bcast_req dot11_tim_bcast_req_t
;
1623 #define DOT11_TIM_BCAST_REQ_LEN 3 /* Fixed length */
1625 /* TIM Broadcast response information element */
1626 BWL_PRE_PACKED_STRUCT
struct dot11_tim_bcast_resp_ie
{
1627 uint8 id
; /* 95, DOT11_MNG_TIM_BROADCAST_RESP_ID */
1629 uint8 status
; /* status of add request */
1630 uint8 tim_bcast_interval
; /* in unit of beacon interval */
1631 int32 tim_bcast_offset
; /* in unit of ms */
1632 uint16 high_rate
; /* in unit of 0.5 Mb/s */
1633 uint16 low_rate
; /* in unit of 0.5 Mb/s */
1634 } BWL_POST_PACKED_STRUCT
;
1635 typedef struct dot11_tim_bcast_resp_ie dot11_tim_bcast_resp_ie_t
;
1636 #define DOT11_TIM_BCAST_DENY_RESP_IE_LEN 1 /* Deny. Fixed length */
1637 #define DOT11_TIM_BCAST_ACCEPT_RESP_IE_LEN 10 /* Accept. Fixed length */
1639 #define DOT11_TIM_BCAST_STATUS_ACCEPT 0
1640 #define DOT11_TIM_BCAST_STATUS_ACCEPT_TSTAMP 1
1641 #define DOT11_TIM_BCAST_STATUS_DENY 2
1642 #define DOT11_TIM_BCAST_STATUS_OVERRIDEN 3
1644 /* TIM Broadcast request frame header */
1645 BWL_PRE_PACKED_STRUCT
struct dot11_tim_bcast_resp
{
1646 uint8 category
; /* category of action frame (10) */
1647 uint8 action
; /* action: DOT11_WNM_ACTION_TIM_BCAST_RESP(19) */
1648 uint8 token
; /* dialog token */
1649 uint8 data
[1]; /* TIM broadcast response element */
1650 } BWL_POST_PACKED_STRUCT
;
1651 typedef struct dot11_tim_bcast_resp dot11_tim_bcast_resp_t
;
1652 #define DOT11_TIM_BCAST_RESP_LEN 3 /* Fixed length */
1655 BWL_PRE_PACKED_STRUCT
struct dot11_tim_ie
{
1656 uint8 id
; /* 5, DOT11_MNG_TIM_ID */
1657 uint8 len
; /* 4 - 255 */
1658 uint8 dtim_count
; /* DTIM decrementing counter */
1659 uint8 dtim_period
; /* DTIM period */
1660 uint8 bitmap_control
; /* AID 0 + bitmap offset */
1661 uint8 pvb
[1]; /* Partial Virtual Bitmap, variable length */
1662 } BWL_POST_PACKED_STRUCT
;
1663 typedef struct dot11_tim_ie dot11_tim_ie_t
;
1664 #define DOT11_TIM_IE_FIXED_LEN 3 /* Fixed length, without id and len */
1665 #define DOT11_TIM_IE_FIXED_TOTAL_LEN 5 /* Fixed length, with id and len */
1667 /* TIM Broadcast frame header */
1668 BWL_PRE_PACKED_STRUCT
struct dot11_tim_bcast
{
1669 uint8 category
; /* category of action frame (11) */
1670 uint8 action
; /* action: TIM (0) */
1671 uint8 check_beacon
; /* need to check-beacon */
1672 uint8 tsf
[8]; /* Time Synchronization Function */
1673 uint8 data
[1]; /* TIM element */
1674 } BWL_POST_PACKED_STRUCT
;
1675 typedef struct dot11_tim_bcast dot11_tim_bcast_t
;
1676 #define DOT11_TIM_BCAST_LEN 11 /* Fixed length */
1678 /* TCLAS information element */
1679 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_ie
{
1680 uint8 id
; /* 14, DOT11_MNG_TCLAS_ID */
1682 uint8 user_priority
;
1683 uint8 data
[1]; /* Elements */
1684 } BWL_POST_PACKED_STRUCT
;
1685 typedef struct dot11_tclas_ie dot11_tclas_ie_t
;
1686 #define DOT11_TCLAS_IE_LEN 3 /* Fixed length */
1688 /* TCLAS processing information element */
1689 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_proc_ie
{
1690 uint8 id
; /* 44, DOT11_MNG_TCLAS_PROC_ID */
1693 } BWL_POST_PACKED_STRUCT
;
1694 typedef struct dot11_tclas_proc_ie dot11_tclas_proc_ie_t
;
1695 #define DOT11_TCLAS_PROC_IE_LEN 3 /* Fixed length */
1697 #define DOT11_TCLAS_PROC_MATCHALL 0 /* All high level element need to match */
1698 #define DOT11_TCLAS_PROC_MATCHONE 1 /* One high level element need to match */
1699 #define DOT11_TCLAS_PROC_NONMATCH 2 /* Non match to any high level element */
1702 /* TCLAS frame classifier type */
1703 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc_hdr
{
1707 } BWL_POST_PACKED_STRUCT
;
1708 typedef struct dot11_tclas_fc_hdr dot11_tclas_fc_hdr_t
;
1709 #define DOT11_TCLAS_FC_LEN 2 /* Fixed length */
1711 #define DOT11_TCLAS_MASK_0 0x1
1712 #define DOT11_TCLAS_MASK_1 0x2
1713 #define DOT11_TCLAS_MASK_2 0x4
1714 #define DOT11_TCLAS_MASK_3 0x8
1715 #define DOT11_TCLAS_MASK_4 0x10
1716 #define DOT11_TCLAS_MASK_5 0x20
1717 #define DOT11_TCLAS_MASK_6 0x40
1718 #define DOT11_TCLAS_MASK_7 0x80
1720 #define DOT11_TCLAS_FC_TYPE_0_ETH 0
1721 #define DOT11_TCLAS_FC_TYPE_1_IP 1
1722 #define DOT11_TCLAS_FC_TYPE_2_8021Q 2
1723 #define DOT11_TCLAS_FC_TYPE_3_OFFSET 3
1724 #define DOT11_TCLAS_FC_TYPE_4_IP_HIGHER 4
1725 #define DOT11_TCLAS_FC_TYPE_5_8021D 5
1727 /* TCLAS frame classifier type 0 parameters for Ethernet */
1728 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc_0_eth
{
1731 uint8 sa
[ETHER_ADDR_LEN
];
1732 uint8 da
[ETHER_ADDR_LEN
];
1734 } BWL_POST_PACKED_STRUCT
;
1735 typedef struct dot11_tclas_fc_0_eth dot11_tclas_fc_0_eth_t
;
1736 #define DOT11_TCLAS_FC_TYPE_0_ETH_LEN 16
1738 /* TCLAS frame classifier type 1 parameters for IPV4 */
1739 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc_1_ipv4
{
1750 } BWL_POST_PACKED_STRUCT
;
1751 typedef struct dot11_tclas_fc_1_ipv4 dot11_tclas_fc_1_ipv4_t
;
1752 #define DOT11_TCLAS_FC_TYPE_1_IPV4_LEN 18
1754 /* TCLAS frame classifier type 2 parameters for 802.1Q */
1755 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc_2_8021q
{
1759 } BWL_POST_PACKED_STRUCT
;
1760 typedef struct dot11_tclas_fc_2_8021q dot11_tclas_fc_2_8021q_t
;
1761 #define DOT11_TCLAS_FC_TYPE_2_8021Q_LEN 4
1763 /* TCLAS frame classifier type 3 parameters for filter offset */
1764 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc_3_filter
{
1769 } BWL_POST_PACKED_STRUCT
;
1770 typedef struct dot11_tclas_fc_3_filter dot11_tclas_fc_3_filter_t
;
1771 #define DOT11_TCLAS_FC_TYPE_3_FILTER_LEN 4
1773 /* TCLAS frame classifier type 4 parameters for IPV4 is the same as TCLAS type 1 */
1774 typedef struct dot11_tclas_fc_1_ipv4 dot11_tclas_fc_4_ipv4_t
;
1775 #define DOT11_TCLAS_FC_TYPE_4_IPV4_LEN DOT11_TCLAS_FC_TYPE_1_IPV4_LEN
1777 /* TCLAS frame classifier type 4 parameters for IPV6 */
1778 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc_4_ipv6
{
1789 } BWL_POST_PACKED_STRUCT
;
1790 typedef struct dot11_tclas_fc_4_ipv6 dot11_tclas_fc_4_ipv6_t
;
1791 #define DOT11_TCLAS_FC_TYPE_4_IPV6_LEN 44
1793 /* TCLAS frame classifier type 5 parameters for 802.1D */
1794 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc_5_8021d
{
1800 } BWL_POST_PACKED_STRUCT
;
1801 typedef struct dot11_tclas_fc_5_8021d dot11_tclas_fc_5_8021d_t
;
1803 #define DOT11_TCLAS_FC_5_8021D_LEN 6
1805 /* TCLAS frame classifier type parameters */
1806 #define DOT11_TCLAS_FC_MAX_LEN 252
1807 BWL_PRE_PACKED_STRUCT
struct dot11_tclas_fc
{
1808 #define fchdr u._fchdr
1809 #define fc0_eth u._fc0_eth
1810 #define fc1_ipv4 u._fc1_ipv4
1811 #define fc2_8021q u._fc2_8021q
1812 #define fc3_filter u._fc3_filter
1813 #define fc4_ipv4 u._fc4_ipv4
1814 #define fc4_ipv6 u._fc4_ipv6
1815 #define fc5_8021d u._fc5_8021d
1816 #define fc_data u._data
1817 BWL_PRE_PACKED_STRUCT
union {
1818 dot11_tclas_fc_hdr_t _fchdr
;
1819 dot11_tclas_fc_0_eth_t _fc0_eth
;
1820 dot11_tclas_fc_1_ipv4_t _fc1_ipv4
;
1821 dot11_tclas_fc_2_8021q_t _fc2_8021q
;
1822 dot11_tclas_fc_3_filter_t _fc3_filter
;
1823 dot11_tclas_fc_4_ipv4_t _fc4_ipv4
;
1824 dot11_tclas_fc_4_ipv6_t _fc4_ipv6
;
1825 dot11_tclas_fc_5_8021d_t _fc5_8021d
;
1826 uint8 _data
[DOT11_TCLAS_FC_MAX_LEN
];
1827 } BWL_POST_PACKED_STRUCT u
;
1828 } BWL_POST_PACKED_STRUCT
;
1829 typedef struct dot11_tclas_fc dot11_tclas_fc_t
;
1831 /* TSPEC element defined in 802.11 std section 8.4.2.32 */
1832 #define DOT11_TSPEC_IE_LEN 57 /* Fixed length */
1834 /* TFS request information element */
1835 BWL_PRE_PACKED_STRUCT
struct dot11_tfs_req_ie
{
1836 uint8 id
; /* 91, DOT11_MNG_TFS_REQUEST_ID */
1841 } BWL_POST_PACKED_STRUCT
;
1842 typedef struct dot11_tfs_req_ie dot11_tfs_req_ie_t
;
1843 #define DOT11_TFS_REQ_IE_LEN 4 /* Fixed length */
1845 #define DOT11_TFS_ACTCODE_DELETE 1
1846 #define DOT11_TFS_ACTCODE_MODIFY 2
1848 /* TFS request subelement */
1849 BWL_PRE_PACKED_STRUCT
struct dot11_tfs_req_se
{
1853 } BWL_POST_PACKED_STRUCT
;
1854 typedef struct dot11_tfs_req_se dot11_tfs_req_se_t
;
1856 #define DOT11_TFS_REQ_SUBELEM_LEN 2 /* Fixed length */
1858 #define DOT11_TFS_SUBELEM_ID_TFS 1
1859 #define DOT11_TFS_SUBELEM_ID_VENDOR 221
1861 /* TFS response information element */
1862 BWL_PRE_PACKED_STRUCT
struct dot11_tfs_resp_ie
{
1863 uint8 id
; /* 92, DOT11_MNG_TFS_RESPONSE_ID */
1866 } BWL_POST_PACKED_STRUCT
;
1867 typedef struct dot11_tfs_resp_ie dot11_tfs_resp_ie_t
;
1868 #define DOT11_TFS_RESP_IE_LEN 2 /* Fixed length */
1870 /* TFS status subelement */
1871 BWL_PRE_PACKED_STRUCT
struct dot11_tfs_status_se
{
1872 uint8 id
; /* 92, DOT11_MNG_TFS_RESPONSE_ID */
1876 } BWL_POST_PACKED_STRUCT
;
1877 typedef struct dot11_tfs_status_se dot11_tfs_status_se_t
;
1879 #define DOT11_TFS_STATUS_SE_LEN 4 /* Fixed length */
1881 #define DOT11_TFS_STATUS_SE_ID_TFS_ST 1
1882 #define DOT11_TFS_STATUS_SE_ID_TFS 2
1883 #define DOT11_TFS_STATUS_SE_ID_VENDOR 221
1885 #define DOT11_TFS_RESP_ST_ACCEPT 0
1887 /* TFS Management Request frame header */
1888 BWL_PRE_PACKED_STRUCT
struct dot11_tfs_req
{
1889 uint8 category
; /* category of action frame (10) */
1890 uint8 action
; /* WNM action: tfs request (13) */
1891 uint8 token
; /* dialog token */
1892 uint8 data
[1]; /* Elements */
1893 } BWL_POST_PACKED_STRUCT
;
1894 typedef struct dot11_tfs_req dot11_tfs_req_t
;
1895 #define DOT11_TFS_REQ_LEN 3 /* Fixed length */
1897 /* TFS Management Response frame header */
1898 BWL_PRE_PACKED_STRUCT
struct dot11_tfs_resp
{
1899 uint8 category
; /* category of action frame (10) */
1900 uint8 action
; /* WNM action: tfs request (14) */
1901 uint8 token
; /* dialog token */
1902 uint8 data
[1]; /* Elements */
1903 } BWL_POST_PACKED_STRUCT
;
1904 typedef struct dot11_tfs_resp dot11_tfs_resp_t
;
1905 #define DOT11_TFS_RESP_LEN 3 /* Fixed length */
1907 /* TFS Management Notify frame header */
1908 BWL_PRE_PACKED_STRUCT
struct dot11_tfs_notify
{
1909 uint8 category
; /* category of action frame (10) */
1910 uint8 action
; /* WNM action: tfs request (15) */
1911 uint8 num_tfs_id
; /* number of TFS IDs */
1912 uint8 data
[1]; /* Elements */
1913 } BWL_POST_PACKED_STRUCT
;
1914 typedef struct dot11_tfs_notify dot11_tfs_notify_t
;
1915 #define DOT11_TFS_NOTIFY_LEN 3 /* Fixed length */
1916 #define DOT11_TFS_NOTIFY_ACT_DEL 1
1917 #define DOT11_TFS_NOTIFY_ACT_NOTIFY 2
1919 /* DMS Management Request frame header */
1920 BWL_PRE_PACKED_STRUCT
struct dot11_dms_req
{
1921 uint8 category
; /* category of action frame (10) */
1922 uint8 action
; /* WNM action: dms request (23) */
1923 uint8 token
; /* dialog token */
1924 uint8 data
[1]; /* Elements */
1925 } BWL_POST_PACKED_STRUCT
;
1926 typedef struct dot11_dms_req dot11_dms_req_t
;
1927 #define DOT11_DMS_REQ_LEN 3 /* Fixed length */
1929 /* DMS Management Response frame header */
1930 BWL_PRE_PACKED_STRUCT
struct dot11_dms_resp_frm
{
1931 uint8 category
; /* category of action frame (10) */
1932 uint8 action
; /* WNM action: dms request (24) */
1933 uint8 token
; /* dialog token */
1934 uint8 data
[1]; /* Elements */
1935 } BWL_POST_PACKED_STRUCT
;
1936 typedef struct dot11_dms_resp_frm dot11_dms_resp_frm_t
;
1937 #define DOT11_DMS_RESP_FRM_LEN 3 /* Fixed length */
1939 /* DMS request information element */
1940 BWL_PRE_PACKED_STRUCT
struct dot11_dms_req_ie
{
1941 uint8 id
; /* 99, DOT11_MNG_DMS_REQUEST_ID */
1944 } BWL_POST_PACKED_STRUCT
;
1945 typedef struct dot11_dms_req_ie dot11_dms_req_ie_t
;
1946 #define DOT11_DMS_REQ_IE_LEN 2 /* Fixed length */
1948 /* DMS response information element */
1949 BWL_PRE_PACKED_STRUCT
struct dot11_dms_resp_ie
{
1950 uint8 id
; /* 100, DOT11_MNG_DMS_RESPONSE_ID */
1953 } BWL_POST_PACKED_STRUCT
;
1954 typedef struct dot11_dms_resp_ie dot11_dms_resp_ie_t
;
1955 #define DOT11_DMS_RESP_IE_LEN 2 /* Fixed length */
1957 /* DMS request descriptor */
1958 BWL_PRE_PACKED_STRUCT
struct dot11_dms_req_desc
{
1963 } BWL_POST_PACKED_STRUCT
;
1964 typedef struct dot11_dms_req_desc dot11_dms_req_desc_t
;
1965 #define DOT11_DMS_REQ_DESC_LEN 3 /* Fixed length */
1967 #define DOT11_DMS_REQ_TYPE_ADD 0
1968 #define DOT11_DMS_REQ_TYPE_REMOVE 1
1969 #define DOT11_DMS_REQ_TYPE_CHANGE 2
1971 /* DMS request descriptor subelement */
1972 BWL_PRE_PACKED_STRUCT
struct dot11_dms_req_desc_subelem
{
1976 } BWL_POST_PACKED_STRUCT
;
1977 typedef struct dot11_dms_req_desc_subelem dot11_dms_req_desc_subelem_t
;
1978 #define DOT11_DMS_REQ_DESC_SUBELEM_LEN 2 /* Fixed length */
1980 /* DMS response status */
1981 BWL_PRE_PACKED_STRUCT
struct dot11_dms_resp_st
{
1987 } BWL_POST_PACKED_STRUCT
;
1988 typedef struct dot11_dms_resp_st dot11_dms_resp_st_t
;
1989 #define DOT11_DMS_RESP_STATUS_LEN 5 /* Fixed length */
1991 #define DOT11_DMS_RESP_TYPE_ACCEPT 0
1992 #define DOT11_DMS_RESP_TYPE_DENY 1
1993 #define DOT11_DMS_RESP_TYPE_TERM 2
1995 #define DOT11_DMS_RESP_LSC_UNSUPPORTED -1
1997 BWL_PRE_PACKED_STRUCT
struct dot11_addba_req
{
1998 uint8 category
; /* category of action frame (3) */
1999 uint8 action
; /* action: addba req */
2000 uint8 token
; /* identifier */
2001 uint16 addba_param_set
; /* parameter set */
2002 uint16 timeout
; /* timeout in seconds */
2003 uint16 start_seqnum
; /* starting sequence number */
2004 } BWL_POST_PACKED_STRUCT
;
2005 typedef struct dot11_addba_req dot11_addba_req_t
;
2006 #define DOT11_ADDBA_REQ_LEN 9 /* length of addba req frame */
2008 BWL_PRE_PACKED_STRUCT
struct dot11_addba_resp
{
2009 uint8 category
; /* category of action frame (3) */
2010 uint8 action
; /* action: addba resp */
2011 uint8 token
; /* identifier */
2012 uint16 status
; /* status of add request */
2013 uint16 addba_param_set
; /* negotiated parameter set */
2014 uint16 timeout
; /* negotiated timeout in seconds */
2015 } BWL_POST_PACKED_STRUCT
;
2016 typedef struct dot11_addba_resp dot11_addba_resp_t
;
2017 #define DOT11_ADDBA_RESP_LEN 9 /* length of addba resp frame */
2019 /* DELBA action parameters */
2020 #define DOT11_DELBA_PARAM_INIT_MASK 0x0800 /* initiator mask */
2021 #define DOT11_DELBA_PARAM_INIT_SHIFT 11 /* initiator shift */
2022 #define DOT11_DELBA_PARAM_TID_MASK 0xf000 /* tid mask */
2023 #define DOT11_DELBA_PARAM_TID_SHIFT 12 /* tid shift */
2025 BWL_PRE_PACKED_STRUCT
struct dot11_delba
{
2026 uint8 category
; /* category of action frame (3) */
2027 uint8 action
; /* action: addba req */
2028 uint16 delba_param_set
; /* paarmeter set */
2029 uint16 reason
; /* reason for dellba */
2030 } BWL_POST_PACKED_STRUCT
;
2031 typedef struct dot11_delba dot11_delba_t
;
2032 #define DOT11_DELBA_LEN 6 /* length of delba frame */
2034 /* SA Query action field value */
2035 #define SA_QUERY_REQUEST 0
2036 #define SA_QUERY_RESPONSE 1
2038 /* ************* 802.11r related definitions. ************* */
2040 /* Over-the-DS Fast Transition Request frame header */
2041 BWL_PRE_PACKED_STRUCT
struct dot11_ft_req
{
2042 uint8 category
; /* category of action frame (6) */
2043 uint8 action
; /* action: ft req */
2044 uint8 sta_addr
[ETHER_ADDR_LEN
];
2045 uint8 tgt_ap_addr
[ETHER_ADDR_LEN
];
2046 uint8 data
[1]; /* Elements */
2047 } BWL_POST_PACKED_STRUCT
;
2048 typedef struct dot11_ft_req dot11_ft_req_t
;
2049 #define DOT11_FT_REQ_FIXED_LEN 14
2051 /* Over-the-DS Fast Transition Response frame header */
2052 BWL_PRE_PACKED_STRUCT
struct dot11_ft_res
{
2053 uint8 category
; /* category of action frame (6) */
2054 uint8 action
; /* action: ft resp */
2055 uint8 sta_addr
[ETHER_ADDR_LEN
];
2056 uint8 tgt_ap_addr
[ETHER_ADDR_LEN
];
2057 uint16 status
; /* status code */
2058 uint8 data
[1]; /* Elements */
2059 } BWL_POST_PACKED_STRUCT
;
2060 typedef struct dot11_ft_res dot11_ft_res_t
;
2061 #define DOT11_FT_RES_FIXED_LEN 16
2063 /* RDE RIC Data Element. */
2064 BWL_PRE_PACKED_STRUCT
struct dot11_rde_ie
{
2065 uint8 id
; /* 11r, DOT11_MNG_RDE_ID */
2067 uint8 rde_id
; /* RDE identifier. */
2068 uint8 rd_count
; /* Resource Descriptor Count. */
2069 uint16 status
; /* Status Code. */
2070 } BWL_POST_PACKED_STRUCT
;
2071 typedef struct dot11_rde_ie dot11_rde_ie_t
;
2073 /* 11r - Size of the RDE (RIC Data Element) IE, including TLV header. */
2074 #define DOT11_MNG_RDE_IE_LEN sizeof(dot11_rde_ie_t)
2077 /* ************* 802.11k related definitions. ************* */
2079 /* Radio measurements enabled capability ie */
2081 #define DOT11_RRM_CAP_LEN 5 /* length of rrm cap bitmap */
2082 #define RCPI_IE_LEN 1
2083 #define RSNI_IE_LEN 1
2084 BWL_PRE_PACKED_STRUCT
struct dot11_rrm_cap_ie
{
2085 uint8 cap
[DOT11_RRM_CAP_LEN
];
2086 } BWL_POST_PACKED_STRUCT
;
2087 typedef struct dot11_rrm_cap_ie dot11_rrm_cap_ie_t
;
2089 /* Bitmap definitions for cap ie */
2090 #define DOT11_RRM_CAP_LINK 0
2091 #define DOT11_RRM_CAP_NEIGHBOR_REPORT 1
2092 #define DOT11_RRM_CAP_PARALLEL 2
2093 #define DOT11_RRM_CAP_REPEATED 3
2094 #define DOT11_RRM_CAP_BCN_PASSIVE 4
2095 #define DOT11_RRM_CAP_BCN_ACTIVE 5
2096 #define DOT11_RRM_CAP_BCN_TABLE 6
2097 #define DOT11_RRM_CAP_BCN_REP_COND 7
2098 #define DOT11_RRM_CAP_AP_CHANREP 16
2101 /* Operating Class (formerly "Regulatory Class") definitions */
2102 #define DOT11_OP_CLASS_NONE 255
2104 BWL_PRE_PACKED_STRUCT
struct do11_ap_chrep
{
2109 } BWL_POST_PACKED_STRUCT
;
2110 typedef struct do11_ap_chrep dot11_ap_chrep_t
;
2112 /* Radio Measurements action ids */
2113 #define DOT11_RM_ACTION_RM_REQ 0 /* Radio measurement request */
2114 #define DOT11_RM_ACTION_RM_REP 1 /* Radio measurement report */
2115 #define DOT11_RM_ACTION_LM_REQ 2 /* Link measurement request */
2116 #define DOT11_RM_ACTION_LM_REP 3 /* Link measurement report */
2117 #define DOT11_RM_ACTION_NR_REQ 4 /* Neighbor report request */
2118 #define DOT11_RM_ACTION_NR_REP 5 /* Neighbor report response */
2120 /* Generic radio measurement action frame header */
2121 BWL_PRE_PACKED_STRUCT
struct dot11_rm_action
{
2122 uint8 category
; /* category of action frame (5) */
2123 uint8 action
; /* radio measurement action */
2124 uint8 token
; /* dialog token */
2126 } BWL_POST_PACKED_STRUCT
;
2127 typedef struct dot11_rm_action dot11_rm_action_t
;
2128 #define DOT11_RM_ACTION_LEN 3
2130 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq
{
2131 uint8 category
; /* category of action frame (5) */
2132 uint8 action
; /* radio measurement action */
2133 uint8 token
; /* dialog token */
2134 uint16 reps
; /* no. of repetitions */
2136 } BWL_POST_PACKED_STRUCT
;
2137 typedef struct dot11_rmreq dot11_rmreq_t
;
2138 #define DOT11_RMREQ_LEN 5
2140 BWL_PRE_PACKED_STRUCT
struct dot11_rm_ie
{
2146 } BWL_POST_PACKED_STRUCT
;
2147 typedef struct dot11_rm_ie dot11_rm_ie_t
;
2148 #define DOT11_RM_IE_LEN 5
2150 /* Definitions for "mode" bits in rm req */
2151 #define DOT11_RMREQ_MODE_PARALLEL 1
2152 #define DOT11_RMREQ_MODE_ENABLE 2
2153 #define DOT11_RMREQ_MODE_REQUEST 4
2154 #define DOT11_RMREQ_MODE_REPORT 8
2155 #define DOT11_RMREQ_MODE_DURMAND 0x10 /* Duration Mandatory */
2157 /* Definitions for "mode" bits in rm rep */
2158 #define DOT11_RMREP_MODE_LATE 1
2159 #define DOT11_RMREP_MODE_INCAPABLE 2
2160 #define DOT11_RMREP_MODE_REFUSED 4
2162 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_bcn
{
2173 struct ether_addr bssid
;
2174 } BWL_POST_PACKED_STRUCT
;
2175 typedef struct dot11_rmreq_bcn dot11_rmreq_bcn_t
;
2176 #define DOT11_RMREQ_BCN_LEN 18
2178 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_bcn
{
2181 uint32 starttime
[2];
2186 struct ether_addr bssid
;
2189 } BWL_POST_PACKED_STRUCT
;
2190 typedef struct dot11_rmrep_bcn dot11_rmrep_bcn_t
;
2191 #define DOT11_RMREP_BCN_LEN 26
2193 /* Beacon request measurement mode */
2194 #define DOT11_RMREQ_BCN_PASSIVE 0
2195 #define DOT11_RMREQ_BCN_ACTIVE 1
2196 #define DOT11_RMREQ_BCN_TABLE 2
2198 /* Sub-element IDs for Beacon Request */
2199 #define DOT11_RMREQ_BCN_SSID_ID 0
2200 #define DOT11_RMREQ_BCN_REPINFO_ID 1
2201 #define DOT11_RMREQ_BCN_REPDET_ID 2
2202 #define DOT11_RMREQ_BCN_REQUEST_ID 10
2203 #define DOT11_RMREQ_BCN_APCHREP_ID DOT11_MNG_AP_CHREP_ID
2205 /* Reporting Detail element definition */
2206 #define DOT11_RMREQ_BCN_REPDET_FIXED 0 /* Fixed length fields only */
2207 #define DOT11_RMREQ_BCN_REPDET_REQUEST 1 /* + requested information elems */
2208 #define DOT11_RMREQ_BCN_REPDET_ALL 2 /* All fields */
2210 /* Sub-element IDs for Beacon Report */
2211 #define DOT11_RMREP_BCN_FRM_BODY 1
2213 /* Sub-element IDs for Frame Report */
2214 #define DOT11_RMREP_FRAME_COUNT_REPORT 1
2216 /* Channel load request */
2217 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_chanload
{
2227 } BWL_POST_PACKED_STRUCT
;
2228 typedef struct dot11_rmreq_chanload dot11_rmreq_chanload_t
;
2229 #define DOT11_RMREQ_CHANLOAD_LEN 11
2231 /* Channel load report */
2232 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_chanload
{
2235 uint32 starttime
[2];
2238 } BWL_POST_PACKED_STRUCT
;
2239 typedef struct dot11_rmrep_chanload dot11_rmrep_chanload_t
;
2240 #define DOT11_RMREP_CHANLOAD_LEN 13
2242 /* Noise histogram request */
2243 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_noise
{
2253 } BWL_POST_PACKED_STRUCT
;
2254 typedef struct dot11_rmreq_noise dot11_rmreq_noise_t
;
2255 #define DOT11_RMREQ_NOISE_LEN 11
2257 /* Noise histogram report */
2258 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_noise
{
2261 uint32 starttime
[2];
2276 } BWL_POST_PACKED_STRUCT
;
2277 typedef struct dot11_rmrep_noise dot11_rmrep_noise_t
;
2278 #define DOT11_RMREP_NOISE_LEN 25
2281 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_frame
{
2292 struct ether_addr ta
;
2293 } BWL_POST_PACKED_STRUCT
;
2294 typedef struct dot11_rmreq_frame dot11_rmreq_frame_t
;
2295 #define DOT11_RMREQ_FRAME_LEN 18
2298 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_frame
{
2301 uint32 starttime
[2];
2303 } BWL_POST_PACKED_STRUCT
;
2304 typedef struct dot11_rmrep_frame dot11_rmrep_frame_t
;
2305 #define DOT11_RMREP_FRAME_LEN 12
2307 /* Frame report entry */
2308 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_frmentry
{
2309 struct ether_addr ta
;
2310 struct ether_addr bssid
;
2317 } BWL_POST_PACKED_STRUCT
;
2318 typedef struct dot11_rmrep_frmentry dot11_rmrep_frmentry_t
;
2319 #define DOT11_RMREP_FRMENTRY_LEN 19
2321 /* STA statistics request */
2322 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_stat
{
2328 struct ether_addr peer
;
2332 } BWL_POST_PACKED_STRUCT
;
2333 typedef struct dot11_rmreq_stat dot11_rmreq_stat_t
;
2334 #define DOT11_RMREQ_STAT_LEN 16
2336 /* STA statistics report */
2337 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_stat
{
2340 } BWL_POST_PACKED_STRUCT
;
2341 typedef struct dot11_rmrep_stat dot11_rmrep_stat_t
;
2343 /* Transmit stream/category measurement request */
2344 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_tx_stream
{
2352 struct ether_addr peer
;
2355 } BWL_POST_PACKED_STRUCT
;
2356 typedef struct dot11_rmreq_tx_stream dot11_rmreq_tx_stream_t
;
2358 /* Transmit stream/category measurement report */
2359 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_tx_stream
{
2360 uint32 starttime
[2];
2362 struct ether_addr peer
;
2366 uint32 msdu_discarded_cnt
;
2367 uint32 msdufailed_cnt
;
2368 uint32 msduretry_cnt
;
2369 uint32 cfpolls_lost_cnt
;
2370 uint32 avrqueue_delay
;
2379 } BWL_POST_PACKED_STRUCT
;
2380 typedef struct dot11_rmrep_tx_stream dot11_rmrep_tx_stream_t
;
2382 /* Measurement pause request */
2383 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_pause_time
{
2390 } BWL_POST_PACKED_STRUCT
;
2391 typedef struct dot11_rmreq_pause_time dot11_rmreq_pause_time_t
;
2393 /* Neighbor measurement report */
2394 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_nbr
{
2395 struct ether_addr bssid
;
2400 uchar sub_elements
[1]; /* Variable size data */
2401 } BWL_POST_PACKED_STRUCT
;
2402 typedef struct dot11_rmrep_nbr dot11_rmrep_nbr_t
;
2403 #define DOT11_RMREP_NBR_LEN 13
2405 /* 11k neighbor measurement report */
2406 BWL_PRE_PACKED_STRUCT
struct dot11_rrmrep_nbr
{
2409 dot11_rmrep_nbr_t nbr_rrmrep
;
2410 } BWL_POST_PACKED_STRUCT
;
2411 typedef struct dot11_rrmrep_nbr dot11_rrmrep_nbr_t
;
2412 #define DOT11_RRMREP_NBR_LEN 15
2414 /* MLME Enumerations */
2415 #define DOT11_BSSTYPE_INFRASTRUCTURE 0 /* d11 infrastructure */
2416 #define DOT11_BSSTYPE_INDEPENDENT 1 /* d11 independent */
2417 #define DOT11_BSSTYPE_ANY 2 /* d11 any BSS type */
2418 #define DOT11_SCANTYPE_ACTIVE 0 /* d11 scan active */
2419 #define DOT11_SCANTYPE_PASSIVE 1 /* d11 scan passive */
2421 /* Link Measurement */
2422 BWL_PRE_PACKED_STRUCT
struct dot11_lmreq
{
2423 uint8 category
; /* category of action frame (5) */
2424 uint8 action
; /* radio measurement action */
2425 uint8 token
; /* dialog token */
2426 uint8 txpwr
; /* Transmit Power Used */
2427 uint8 maxtxpwr
; /* Max Transmit Power */
2428 } BWL_POST_PACKED_STRUCT
;
2429 typedef struct dot11_lmreq dot11_lmreq_t
;
2430 #define DOT11_LMREQ_LEN 5
2432 BWL_PRE_PACKED_STRUCT
struct dot11_lmrep
{
2433 uint8 category
; /* category of action frame (5) */
2434 uint8 action
; /* radio measurement action */
2435 uint8 token
; /* dialog token */
2436 dot11_tpc_rep_t tpc
; /* TPC element */
2437 uint8 rxant
; /* Receive Antenna ID */
2438 uint8 txant
; /* Transmit Antenna ID */
2439 uint8 rcpi
; /* RCPI */
2440 uint8 rsni
; /* RSNI */
2441 } BWL_POST_PACKED_STRUCT
;
2442 typedef struct dot11_lmrep dot11_lmrep_t
;
2443 #define DOT11_LMREP_LEN 11
2445 /* 802.11 BRCM "Compromise" Pre N constants */
2446 #define PREN_PREAMBLE 24 /* green field preamble time */
2447 #define PREN_MM_EXT 12 /* extra mixed mode preamble time */
2448 #define PREN_PREAMBLE_EXT 4 /* extra preamble (multiply by unique_streams-1) */
2450 /* 802.11N PHY constants */
2451 #define RIFS_11N_TIME 2 /* NPHY RIFS time */
2453 /* 802.11 HT PLCP format 802.11n-2009, sec 20.3.9.4.3
2454 * HT-SIG is composed of two 24 bit parts, HT-SIG1 and HT-SIG2
2457 #define HT_SIG1_MCS_MASK 0x00007F
2458 #define HT_SIG1_CBW 0x000080
2459 #define HT_SIG1_HT_LENGTH 0xFFFF00
2462 #define HT_SIG2_SMOOTHING 0x000001
2463 #define HT_SIG2_NOT_SOUNDING 0x000002
2464 #define HT_SIG2_RESERVED 0x000004
2465 #define HT_SIG2_AGGREGATION 0x000008
2466 #define HT_SIG2_STBC_MASK 0x000030
2467 #define HT_SIG2_STBC_SHIFT 4
2468 #define HT_SIG2_FEC_CODING 0x000040
2469 #define HT_SIG2_SHORT_GI 0x000080
2470 #define HT_SIG2_ESS_MASK 0x000300
2471 #define HT_SIG2_ESS_SHIFT 8
2472 #define HT_SIG2_CRC 0x03FC00
2473 #define HT_SIG2_TAIL 0x1C0000
2475 /* 802.11 A PHY constants */
2476 #define APHY_SLOT_TIME 9 /* APHY slot time */
2477 #define APHY_SIFS_TIME 16 /* APHY SIFS time */
2478 #define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME)) /* APHY DIFS time */
2479 #define APHY_PREAMBLE_TIME 16 /* APHY preamble time */
2480 #define APHY_SIGNAL_TIME 4 /* APHY signal time */
2481 #define APHY_SYMBOL_TIME 4 /* APHY symbol time */
2482 #define APHY_SERVICE_NBITS 16 /* APHY service nbits */
2483 #define APHY_TAIL_NBITS 6 /* APHY tail nbits */
2484 #define APHY_CWMIN 15 /* APHY cwmin */
2486 /* 802.11 B PHY constants */
2487 #define BPHY_SLOT_TIME 20 /* BPHY slot time */
2488 #define BPHY_SIFS_TIME 10 /* BPHY SIFS time */
2489 #define BPHY_DIFS_TIME 50 /* BPHY DIFS time */
2490 #define BPHY_PLCP_TIME 192 /* BPHY PLCP time */
2491 #define BPHY_PLCP_SHORT_TIME 96 /* BPHY PLCP short time */
2492 #define BPHY_CWMIN 31 /* BPHY cwmin */
2494 /* 802.11 G constants */
2495 #define DOT11_OFDM_SIGNAL_EXTENSION 6 /* d11 OFDM signal extension */
2497 #define PHY_CWMAX 1023 /* PHY cwmax */
2499 #define DOT11_MAXNUMFRAGS 16 /* max # fragments per MSDU */
2501 /* 802.11 AC (VHT) constants */
2503 typedef int vht_group_id_t
;
2506 /* SIG-A1 reserved bits */
2507 #define VHT_SIGA1_CONST_MASK 0x800004
2509 #define VHT_SIGA1_20MHZ_VAL 0x000000
2510 #define VHT_SIGA1_40MHZ_VAL 0x000001
2511 #define VHT_SIGA1_80MHZ_VAL 0x000002
2512 #define VHT_SIGA1_160MHZ_VAL 0x000003
2513 #define VHT_SIGA1_BW_MASK 0x000003
2515 #define VHT_SIGA1_STBC 0x000008
2517 #define VHT_SIGA1_GID_MAX_GID 0x3f
2518 #define VHT_SIGA1_GID_MASK 0x0003f0
2519 #define VHT_SIGA1_GID_SHIFT 4
2520 #define VHT_SIGA1_GID_TO_AP 0x00
2521 #define VHT_SIGA1_GID_NOT_TO_AP 0x3f
2523 #define VHT_SIGA1_NSTS_SHIFT 10
2524 #define VHT_SIGA1_NSTS_SHIFT_MASK_USER0 0x001C00
2526 #define VHT_SIGA1_PARTIAL_AID_MASK 0x3fe000
2527 #define VHT_SIGA1_PARTIAL_AID_SHIFT 13
2529 #define VHT_SIGA1_TXOP_PS_NOT_ALLOWED 0x400000
2532 #define VHT_SIGA2_GI_NONE 0x000000
2533 #define VHT_SIGA2_GI_SHORT 0x000001
2534 #define VHT_SIGA2_GI_W_MOD10 0x000002
2535 #define VHT_SIGA2_CODING_LDPC 0x000004
2536 #define VHT_SIGA2_LDPC_EXTRA_OFDM_SYM 0x000008
2537 #define VHT_SIGA2_BEAMFORM_ENABLE 0x000100
2538 #define VHT_SIGA2_MCS_SHIFT 4
2540 #define VHT_SIGA2_B9_RESERVED 0x000200
2541 #define VHT_SIGA2_TAIL_MASK 0xfc0000
2542 #define VHT_SIGA2_TAIL_VALUE 0x000000
2544 #define VHT_SIGA2_SVC_BITS 16
2545 #define VHT_SIGA2_TAIL_BITS 6
2548 /* dot11Counters Table - 802.11 spec., Annex D */
2549 typedef struct d11cnt
{
2550 uint32 txfrag
; /* dot11TransmittedFragmentCount */
2551 uint32 txmulti
; /* dot11MulticastTransmittedFrameCount */
2552 uint32 txfail
; /* dot11FailedCount */
2553 uint32 txretry
; /* dot11RetryCount */
2554 uint32 txretrie
; /* dot11MultipleRetryCount */
2555 uint32 rxdup
; /* dot11FrameduplicateCount */
2556 uint32 txrts
; /* dot11RTSSuccessCount */
2557 uint32 txnocts
; /* dot11RTSFailureCount */
2558 uint32 txnoack
; /* dot11ACKFailureCount */
2559 uint32 rxfrag
; /* dot11ReceivedFragmentCount */
2560 uint32 rxmulti
; /* dot11MulticastReceivedFrameCount */
2561 uint32 rxcrc
; /* dot11FCSErrorCount */
2562 uint32 txfrmsnt
; /* dot11TransmittedFrameCount */
2563 uint32 rxundec
; /* dot11WEPUndecryptableCount */
2566 /* OUI for BRCM proprietary IE */
2567 #define BRCM_PROP_OUI "\x00\x90\x4C" /* Broadcom proprietary OUI */
2569 #ifndef LINUX_POSTMOGRIFY_REMOVAL
2570 /* The following BRCM_PROP_OUI types are currently in use (defined in
2571 * relevant subsections). Each of them will be in a separate proprietary(221) IE
2572 * #define SES_VNDR_IE_TYPE 1 (defined in src/ses/shared/ses.h)
2573 * #define DPT_IE_TYPE 2
2574 * #define HT_CAP_IE_TYPE 51
2575 * #define HT_ADD_IE_TYPE 52
2576 * #define BRCM_EXTCH_IE_TYPE 53
2577 * #define MEMBER_OF_BRCM_PROP_IE_TYPE 54
2578 * #define BRCM_RELMACST_IE_TYPE 55
2581 /* Following is the generic structure for brcm_prop_ie (uses BRCM_PROP_OUI).
2582 * DPT uses this format with type set to DPT_IE_TYPE
2584 BWL_PRE_PACKED_STRUCT
struct brcm_prop_ie_s
{
2585 uint8 id
; /* IE ID, 221, DOT11_MNG_PROPR_ID */
2586 uint8 len
; /* IE length */
2587 uint8 oui
[3]; /* Proprietary OUI, BRCM_PROP_OUI */
2588 uint8 type
; /* type of this IE */
2589 uint16 cap
; /* DPT capabilities */
2590 } BWL_POST_PACKED_STRUCT
;
2591 typedef struct brcm_prop_ie_s brcm_prop_ie_t
;
2593 #define BRCM_PROP_IE_LEN 6 /* len of fixed part of brcm_prop ie */
2595 #define DPT_IE_TYPE 2
2596 #define BRCM_SYSCAP_IE_TYPE 3
2597 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
2599 /* brcm syscap_ie cap */
2600 #define BRCM_SYSCAP_WET_TUNNEL 0x0100 /* Device with WET_TUNNEL support */
2602 /* BRCM OUI: Used in the proprietary(221) IE in all broadcom devices */
2603 #define BRCM_OUI "\x00\x10\x18" /* Broadcom OUI */
2605 /* BRCM info element */
2606 BWL_PRE_PACKED_STRUCT
struct brcm_ie
{
2607 uint8 id
; /* IE ID, 221, DOT11_MNG_PROPR_ID */
2608 uint8 len
; /* IE length */
2609 uint8 oui
[3]; /* Proprietary OUI, BRCM_OUI */
2610 uint8 ver
; /* type/ver of this IE */
2611 uint8 assoc
; /* # of assoc STAs */
2612 uint8 flags
; /* misc flags */
2613 uint8 flags1
; /* misc flags */
2614 uint16 amsdu_mtu_pref
; /* preferred A-MSDU MTU */
2615 } BWL_POST_PACKED_STRUCT
;
2616 typedef struct brcm_ie brcm_ie_t
;
2617 #define BRCM_IE_LEN 11 /* BRCM IE length */
2618 #define BRCM_IE_VER 2 /* BRCM IE version */
2619 #define BRCM_IE_LEGACY_AES_VER 1 /* BRCM IE legacy AES version */
2622 #define BRF_LZWDS 0x4 /* lazy wds enabled */
2623 #define BRF_BLOCKACK 0x8 /* BlockACK capable */
2625 /* brcm_ie flags1 */
2626 #define BRF1_AMSDU 0x1 /* A-MSDU capable */
2627 #define BRF1_WMEPS 0x4 /* AP is capable of handling WME + PS w/o APSD */
2628 #define BRF1_PSOFIX 0x8 /* AP has fixed PS mode out-of-order packets */
2629 #define BRF1_RX_LARGE_AGG 0x10 /* device can rx large aggregates */
2630 #define BRF1_RFAWARE_DCS 0x20 /* RFAWARE dynamic channel selection (DCS) */
2631 #define BRF1_SOFTAP 0x40 /* Configure as Broadcom SOFTAP */
2632 #define BRF1_DWDS 0x80 /* DWDS capable */
2634 /* Vendor IE structure */
2635 BWL_PRE_PACKED_STRUCT
struct vndr_ie
{
2639 uchar data
[1]; /* Variable size data */
2640 } BWL_POST_PACKED_STRUCT
;
2641 typedef struct vndr_ie vndr_ie_t
;
2643 #define VNDR_IE_HDR_LEN 2 /* id + len field */
2644 #define VNDR_IE_MIN_LEN 3 /* size of the oui field */
2645 #define VNDR_IE_MAX_LEN 256 /* verdor IE max length */
2647 /* BRCM PROP DEVICE PRIMARY MAC ADDRESS IE */
2648 BWL_PRE_PACKED_STRUCT
struct member_of_brcm_prop_ie
{
2652 uint8 type
; /* type inidicates what follows */
2653 struct ether_addr ea
; /* Device Primary MAC Adrress */
2654 } BWL_POST_PACKED_STRUCT
;
2655 typedef struct member_of_brcm_prop_ie member_of_brcm_prop_ie_t
;
2657 #define MEMBER_OF_BRCM_PROP_IE_LEN 10 /* IE max length */
2658 #define MEMBER_OF_BRCM_PROP_IE_TYPE 54
2660 /* BRCM Reliable Multicast IE */
2661 BWL_PRE_PACKED_STRUCT
struct relmcast_brcm_prop_ie
{
2665 uint8 type
; /* type inidicates what follows */
2666 struct ether_addr ea
; /* The ack sender's MAC Adrress */
2667 struct ether_addr mcast_ea
; /* The multicast MAC address */
2668 uint8 updtmo
; /* time interval(second) for client to send null packet to report its rssi */
2669 } BWL_POST_PACKED_STRUCT
;
2670 typedef struct relmcast_brcm_prop_ie relmcast_brcm_prop_ie_t
;
2672 #define RELMCAST_BRCM_PROP_IE_LEN (sizeof(relmcast_brcm_prop_ie_t)-2) /* IE length */
2673 #define RELMCAST_BRCM_PROP_IE_TYPE 55
2675 /* ************* HT definitions. ************* */
2676 #define MCSSET_LEN 16 /* 16-bits per 8-bit set to give 128-bits bitmap of MCS Index */
2677 #define MAX_MCS_NUM (128) /* max mcs number = 128 */
2679 BWL_PRE_PACKED_STRUCT
struct ht_cap_ie
{
2682 uint8 supp_mcs
[MCSSET_LEN
];
2686 } BWL_POST_PACKED_STRUCT
;
2687 typedef struct ht_cap_ie ht_cap_ie_t
;
2689 /* CAP IE: HT 1.0 spec. simply stole a 802.11 IE, we use our prop. IE until this is resolved */
2690 /* the capability IE is primarily used to convey this nodes abilities */
2691 BWL_PRE_PACKED_STRUCT
struct ht_prop_cap_ie
{
2692 uint8 id
; /* IE ID, 221, DOT11_MNG_PROPR_ID */
2693 uint8 len
; /* IE length */
2694 uint8 oui
[3]; /* Proprietary OUI, BRCM_PROP_OUI */
2695 uint8 type
; /* type inidicates what follows */
2697 } BWL_POST_PACKED_STRUCT
;
2698 typedef struct ht_prop_cap_ie ht_prop_cap_ie_t
;
2700 #define HT_PROP_IE_OVERHEAD 4 /* overhead bytes for prop oui ie */
2701 #define HT_CAP_IE_LEN 26 /* HT capability len (based on .11n d2.0) */
2702 #define HT_CAP_IE_TYPE 51
2704 #define HT_CAP_LDPC_CODING 0x0001 /* Support for rx of LDPC coded pkts */
2705 #define HT_CAP_40MHZ 0x0002 /* FALSE:20Mhz, TRUE:20/40MHZ supported */
2706 #define HT_CAP_MIMO_PS_MASK 0x000C /* Mimo PS mask */
2707 #define HT_CAP_MIMO_PS_SHIFT 0x0002 /* Mimo PS shift */
2708 #define HT_CAP_MIMO_PS_OFF 0x0003 /* Mimo PS, no restriction */
2709 #define HT_CAP_MIMO_PS_RTS 0x0001 /* Mimo PS, send RTS/CTS around MIMO frames */
2710 #define HT_CAP_MIMO_PS_ON 0x0000 /* Mimo PS, MIMO disallowed */
2711 #define HT_CAP_GF 0x0010 /* Greenfield preamble support */
2712 #define HT_CAP_SHORT_GI_20 0x0020 /* 20MHZ short guard interval support */
2713 #define HT_CAP_SHORT_GI_40 0x0040 /* 40Mhz short guard interval support */
2714 #define HT_CAP_TX_STBC 0x0080 /* Tx STBC support */
2715 #define HT_CAP_RX_STBC_MASK 0x0300 /* Rx STBC mask */
2716 #define HT_CAP_RX_STBC_SHIFT 8 /* Rx STBC shift */
2717 #define HT_CAP_DELAYED_BA 0x0400 /* delayed BA support */
2718 #define HT_CAP_MAX_AMSDU 0x0800 /* Max AMSDU size in bytes , 0=3839, 1=7935 */
2720 #define HT_CAP_DSSS_CCK 0x1000 /* DSSS/CCK supported by the BSS */
2721 #define HT_CAP_PSMP 0x2000 /* Power Save Multi Poll support */
2722 #define HT_CAP_40MHZ_INTOLERANT 0x4000 /* 40MHz Intolerant */
2723 #define HT_CAP_LSIG_TXOP 0x8000 /* L-SIG TXOP protection support */
2725 #define HT_CAP_RX_STBC_NO 0x0 /* no rx STBC support */
2726 #define HT_CAP_RX_STBC_ONE_STREAM 0x1 /* rx STBC support of 1 spatial stream */
2727 #define HT_CAP_RX_STBC_TWO_STREAM 0x2 /* rx STBC support of 1-2 spatial streams */
2728 #define HT_CAP_RX_STBC_THREE_STREAM 0x3 /* rx STBC support of 1-3 spatial streams */
2730 #define HT_CAP_TX_BF_CAP_EXPLICIT_CSI_FB_MASK 0x400
2731 #define HT_CAP_TX_BF_CAP_EXPLICIT_CSI_FB_SHIFT 10
2732 #define HT_CAP_TX_BF_CAP_EXPLICIT_COMPRESSED_FB_MASK 0x18000
2733 #define HT_CAP_TX_BF_CAP_EXPLICIT_COMPRESSED_FB_SHIFT 15
2735 #define VHT_MAX_MPDU 11454 /* max mpdu size for now (bytes) */
2736 #define VHT_MPDU_MSDU_DELTA 56 /* Difference in spec - vht mpdu, amsdu len */
2737 /* Max AMSDU len - per spec */
2738 #define VHT_MAX_AMSDU (VHT_MAX_MPDU - VHT_MPDU_MSDU_DELTA)
2740 #define HT_MAX_AMSDU 7935 /* max amsdu size (bytes) per the HT spec */
2741 #define HT_MIN_AMSDU 3835 /* min amsdu size (bytes) per the HT spec */
2743 #define HT_PARAMS_RX_FACTOR_MASK 0x03 /* ampdu rcv factor mask */
2744 #define HT_PARAMS_DENSITY_MASK 0x1C /* ampdu density mask */
2745 #define HT_PARAMS_DENSITY_SHIFT 2 /* ampdu density shift */
2747 /* HT/AMPDU specific define */
2748 #define AMPDU_MAX_MPDU_DENSITY 7 /* max mpdu density; in 1/4 usec units */
2749 #define AMPDU_DENSITY_NONE 0 /* No density requirement */
2750 #define AMPDU_DENSITY_1over4_US 1 /* 1/4 us density */
2751 #define AMPDU_DENSITY_1over2_US 2 /* 1/2 us density */
2752 #define AMPDU_DENSITY_1_US 3 /* 1 us density */
2753 #define AMPDU_DENSITY_2_US 4 /* 2 us density */
2754 #define AMPDU_DENSITY_4_US 5 /* 4 us density */
2755 #define AMPDU_DENSITY_8_US 6 /* 8 us density */
2756 #define AMPDU_DENSITY_16_US 7 /* 16 us density */
2757 #define AMPDU_RX_FACTOR_8K 0 /* max rcv ampdu len (8kb) */
2758 #define AMPDU_RX_FACTOR_16K 1 /* max rcv ampdu len (16kb) */
2759 #define AMPDU_RX_FACTOR_32K 2 /* max rcv ampdu len (32kb) */
2760 #define AMPDU_RX_FACTOR_64K 3 /* max rcv ampdu len (64kb) */
2761 #define AMPDU_RX_FACTOR_BASE 8*1024 /* ampdu factor base for rx len */
2763 #define AMPDU_DELIMITER_LEN 4 /* length of ampdu delimiter */
2764 #define AMPDU_DELIMITER_LEN_MAX 63 /* max length of ampdu delimiter(enforced in HW) */
2766 #define HT_CAP_EXT_PCO 0x0001
2767 #define HT_CAP_EXT_PCO_TTIME_MASK 0x0006
2768 #define HT_CAP_EXT_PCO_TTIME_SHIFT 1
2769 #define HT_CAP_EXT_MCS_FEEDBACK_MASK 0x0300
2770 #define HT_CAP_EXT_MCS_FEEDBACK_SHIFT 8
2771 #define HT_CAP_EXT_HTC 0x0400
2772 #define HT_CAP_EXT_RD_RESP 0x0800
2774 BWL_PRE_PACKED_STRUCT
struct ht_add_ie
{
2775 uint8 ctl_ch
; /* control channel number */
2776 uint8 byte1
; /* ext ch,rec. ch. width, RIFS support */
2777 uint16 opmode
; /* operation mode */
2778 uint16 misc_bits
; /* misc bits */
2779 uint8 basic_mcs
[MCSSET_LEN
]; /* required MCS set */
2780 } BWL_POST_PACKED_STRUCT
;
2781 typedef struct ht_add_ie ht_add_ie_t
;
2783 /* ADD IE: HT 1.0 spec. simply stole a 802.11 IE, we use our prop. IE until this is resolved */
2784 /* the additional IE is primarily used to convey the current BSS configuration */
2785 BWL_PRE_PACKED_STRUCT
struct ht_prop_add_ie
{
2786 uint8 id
; /* IE ID, 221, DOT11_MNG_PROPR_ID */
2787 uint8 len
; /* IE length */
2788 uint8 oui
[3]; /* Proprietary OUI, BRCM_PROP_OUI */
2789 uint8 type
; /* indicates what follows */
2791 } BWL_POST_PACKED_STRUCT
;
2792 typedef struct ht_prop_add_ie ht_prop_add_ie_t
;
2794 #define HT_ADD_IE_LEN 22
2795 #define HT_ADD_IE_TYPE 52
2798 #define HT_BW_ANY 0x04 /* set, STA can use 20 or 40MHz */
2799 #define HT_RIFS_PERMITTED 0x08 /* RIFS allowed */
2802 #define HT_OPMODE_MASK 0x0003 /* protection mode mask */
2803 #define HT_OPMODE_SHIFT 0 /* protection mode shift */
2804 #define HT_OPMODE_PURE 0x0000 /* protection mode PURE */
2805 #define HT_OPMODE_OPTIONAL 0x0001 /* protection mode optional */
2806 #define HT_OPMODE_HT20IN40 0x0002 /* protection mode 20MHz HT in 40MHz BSS */
2807 #define HT_OPMODE_MIXED 0x0003 /* protection mode Mixed Mode */
2808 #define HT_OPMODE_NONGF 0x0004 /* protection mode non-GF */
2809 #define DOT11N_TXBURST 0x0008 /* Tx burst limit */
2810 #define DOT11N_OBSS_NONHT 0x0010 /* OBSS Non-HT STA present */
2812 /* misc_bites defn's */
2813 #define HT_BASIC_STBC_MCS 0x007f /* basic STBC MCS */
2814 #define HT_DUAL_STBC_PROT 0x0080 /* Dual STBC Protection */
2815 #define HT_SECOND_BCN 0x0100 /* Secondary beacon support */
2816 #define HT_LSIG_TXOP 0x0200 /* L-SIG TXOP Protection full support */
2817 #define HT_PCO_ACTIVE 0x0400 /* PCO active */
2818 #define HT_PCO_PHASE 0x0800 /* PCO phase */
2819 #define HT_DUALCTS_PROTECTION 0x0080 /* DUAL CTS protection needed */
2821 /* Tx Burst Limits */
2822 #define DOT11N_2G_TXBURST_LIMIT 6160 /* 2G band Tx burst limit per 802.11n Draft 1.10 (usec) */
2823 #define DOT11N_5G_TXBURST_LIMIT 3080 /* 5G band Tx burst limit per 802.11n Draft 1.10 (usec) */
2825 /* Macros for opmode */
2826 #define GET_HT_OPMODE(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
2828 #define HT_MIXEDMODE_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
2829 == HT_OPMODE_MIXED) /* mixed mode present */
2830 #define HT_HT20_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
2831 == HT_OPMODE_HT20IN40) /* 20MHz HT present */
2832 #define HT_OPTIONAL_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
2833 == HT_OPMODE_OPTIONAL) /* Optional protection present */
2834 #define HT_USE_PROTECTION(add_ie) (HT_HT20_PRESENT((add_ie)) || \
2835 HT_MIXEDMODE_PRESENT((add_ie))) /* use protection */
2836 #define HT_NONGF_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_NONGF) \
2837 == HT_OPMODE_NONGF) /* non-GF present */
2838 #define DOT11N_TXBURST_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) \
2839 == DOT11N_TXBURST) /* Tx Burst present */
2840 #define DOT11N_OBSS_NONHT_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) \
2841 == DOT11N_OBSS_NONHT) /* OBSS Non-HT present */
2843 BWL_PRE_PACKED_STRUCT
struct obss_params
{
2844 uint16 passive_dwell
;
2845 uint16 active_dwell
;
2846 uint16 bss_widthscan_interval
;
2847 uint16 passive_total
;
2848 uint16 active_total
;
2849 uint16 chanwidth_transition_dly
;
2850 uint16 activity_threshold
;
2851 } BWL_POST_PACKED_STRUCT
;
2852 typedef struct obss_params obss_params_t
;
2854 BWL_PRE_PACKED_STRUCT
struct dot11_obss_ie
{
2857 obss_params_t obss_params
;
2858 } BWL_POST_PACKED_STRUCT
;
2859 typedef struct dot11_obss_ie dot11_obss_ie_t
;
2860 #define DOT11_OBSS_SCAN_IE_LEN sizeof(obss_params_t) /* HT OBSS len (based on 802.11n d3.0) */
2862 /* HT control field */
2863 #define HT_CTRL_LA_TRQ 0x00000002 /* sounding request */
2864 #define HT_CTRL_LA_MAI 0x0000003C /* MCS request or antenna selection indication */
2865 #define HT_CTRL_LA_MAI_SHIFT 2
2866 #define HT_CTRL_LA_MAI_MRQ 0x00000004 /* MCS request */
2867 #define HT_CTRL_LA_MAI_MSI 0x00000038 /* MCS request sequence identifier */
2868 #define HT_CTRL_LA_MFSI 0x000001C0 /* MFB sequence identifier */
2869 #define HT_CTRL_LA_MFSI_SHIFT 6
2870 #define HT_CTRL_LA_MFB_ASELC 0x0000FE00 /* MCS feedback, antenna selection command/data */
2871 #define HT_CTRL_LA_MFB_ASELC_SH 9
2872 #define HT_CTRL_LA_ASELC_CMD 0x00000C00 /* ASEL command */
2873 #define HT_CTRL_LA_ASELC_DATA 0x0000F000 /* ASEL data */
2874 #define HT_CTRL_CAL_POS 0x00030000 /* Calibration position */
2875 #define HT_CTRL_CAL_SEQ 0x000C0000 /* Calibration sequence */
2876 #define HT_CTRL_CSI_STEERING 0x00C00000 /* CSI/Steering */
2877 #define HT_CTRL_CSI_STEER_SHIFT 22
2878 #define HT_CTRL_CSI_STEER_NFB 0 /* no fedback required */
2879 #define HT_CTRL_CSI_STEER_CSI 1 /* CSI, H matrix */
2880 #define HT_CTRL_CSI_STEER_NCOM 2 /* non-compressed beamforming */
2881 #define HT_CTRL_CSI_STEER_COM 3 /* compressed beamforming */
2882 #define HT_CTRL_NDP_ANNOUNCE 0x01000000 /* NDP announcement */
2883 #define HT_CTRL_AC_CONSTRAINT 0x40000000 /* AC Constraint */
2884 #define HT_CTRL_RDG_MOREPPDU 0x80000000 /* RDG/More PPDU */
2886 #define HT_OPMODE_OPTIONAL 0x0001 /* protection mode optional */
2887 #define HT_OPMODE_HT20IN40 0x0002 /* protection mode 20MHz HT in 40MHz BSS */
2888 #define HT_OPMODE_MIXED 0x0003 /* protection mode Mixed Mode */
2889 #define HT_OPMODE_NONGF 0x0004 /* protection mode non-GF */
2890 #define DOT11N_TXBURST 0x0008 /* Tx burst limit */
2891 #define DOT11N_OBSS_NONHT 0x0010 /* OBSS Non-HT STA present */
2893 /* ************* VHT definitions. ************* */
2896 * VHT Capabilites IE (sec 8.4.2.160)
2899 BWL_PRE_PACKED_STRUCT
struct vht_cap_ie
{
2900 uint32 vht_cap_info
;
2901 /* supported MCS set - 64 bit field */
2906 } BWL_POST_PACKED_STRUCT
;
2907 typedef struct vht_cap_ie vht_cap_ie_t
;
2909 /* 4B cap_info + 8B supp_mcs */
2910 #define VHT_CAP_IE_LEN 12
2912 /* VHT Capabilities Info field - 32bit - in VHT Cap IE */
2913 #define VHT_CAP_INFO_MAX_MPDU_LEN_MASK 0x00000003
2914 #define VHT_CAP_INFO_SUPP_CHAN_WIDTH_MASK 0x0000000c
2915 #define VHT_CAP_INFO_LDPC 0x00000010
2916 #define VHT_CAP_INFO_SGI_80MHZ 0x00000020
2917 #define VHT_CAP_INFO_SGI_160MHZ 0x00000040
2918 #define VHT_CAP_INFO_TX_STBC 0x00000080
2919 #define VHT_CAP_INFO_RX_STBC_MASK 0x00000700
2920 #define VHT_CAP_INFO_RX_STBC_SHIFT 8
2921 #define VHT_CAP_INFO_SU_BEAMFMR 0x00000800
2922 #define VHT_CAP_INFO_SU_BEAMFMEE 0x00001000
2923 #define VHT_CAP_INFO_NUM_BMFMR_ANT_MASK 0x0000e000
2924 #define VHT_CAP_INFO_NUM_BMFMR_ANT_SHIFT 13
2925 #define VHT_CAP_INFO_NUM_SOUNDING_DIM_MASK 0x00070000
2926 #define VHT_CAP_INFO_NUM_SOUNDING_DIM_SHIFT 16
2927 #define VHT_CAP_INFO_MU_BEAMFMR 0x00080000
2928 #define VHT_CAP_INFO_MU_BEAMFMEE 0x00100000
2929 #define VHT_CAP_INFO_TXOPPS 0x00200000
2930 #define VHT_CAP_INFO_HTCVHT 0x00400000
2931 #define VHT_CAP_INFO_AMPDU_MAXLEN_EXP_MASK 0x03800000
2932 #define VHT_CAP_INFO_AMPDU_MAXLEN_EXP_SHIFT 23
2933 #define VHT_CAP_INFO_LINK_ADAPT_CAP_MASK 0x0c000000
2934 #define VHT_CAP_INFO_LINK_ADAPT_CAP_SHIFT 26
2936 /* VHT Supported MCS Set - 64-bit - in VHT Cap IE */
2937 #define VHT_CAP_SUPP_MCS_RX_HIGHEST_RATE_MASK 0x1fff
2938 #define VHT_CAP_SUPP_MCS_RX_HIGHEST_RATE_SHIFT 0
2940 #define VHT_CAP_SUPP_MCS_TX_HIGHEST_RATE_MASK 0x1fff
2941 #define VHT_CAP_SUPP_MCS_TX_HIGHEST_RATE_SHIFT 0
2943 #define VHT_CAP_MCS_MAP_0_7 0
2944 #define VHT_CAP_MCS_MAP_0_8 1
2945 #define VHT_CAP_MCS_MAP_0_9 2
2946 #define VHT_CAP_MCS_MAP_NONE 3
2947 #define VHT_CAP_MCS_MAP_S 2 /* num bits for 1-stream */
2948 #define VHT_CAP_MCS_MAP_M 0x3 /* mask for 1-stream */
2949 /* assumes VHT_CAP_MCS_MAP_NONE is 3 and 2 bits are used for encoding */
2950 #define VHT_CAP_MCS_MAP_NONE_ALL 0xffff
2951 /* mcsmap with MCS0-9 for Nss = 3 */
2952 #define VHT_CAP_MCS_MAP_0_9_NSS3 \
2953 ((VHT_CAP_MCS_MAP_0_9 << VHT_MCS_MAP_GET_SS_IDX(1)) | \
2954 (VHT_CAP_MCS_MAP_0_9 << VHT_MCS_MAP_GET_SS_IDX(2)) | \
2955 (VHT_CAP_MCS_MAP_0_9 << VHT_MCS_MAP_GET_SS_IDX(3)))
2957 #define VHT_CAP_MCS_MAP_NSS_MAX 8
2959 /* get mcsmap with given mcs for given nss streams */
2960 #define VHT_CAP_MCS_MAP_CREATE(mcsmap, nss, mcs) \
2963 for (i = 1; i <= nss; i++) { \
2964 VHT_MCS_MAP_SET_MCS_PER_SS(i, mcs, mcsmap); \
2968 /* Map the mcs code to mcs bit map */
2969 #define VHT_MCS_CODE_TO_MCS_MAP(mcs_code) \
2970 ((mcs_code == VHT_CAP_MCS_MAP_0_7) ? 0xff : \
2971 (mcs_code == VHT_CAP_MCS_MAP_0_8) ? 0x1ff : \
2972 (mcs_code == VHT_CAP_MCS_MAP_0_9) ? 0x3ff : 0)
2974 /* Map the mcs bit map to mcs code */
2975 #define VHT_MCS_MAP_TO_MCS_CODE(mcs_map) \
2976 ((mcs_map == 0xff) ? VHT_CAP_MCS_MAP_0_7 : \
2977 (mcs_map == 0x1ff) ? VHT_CAP_MCS_MAP_0_8 : \
2978 (mcs_map == 0x3ff) ? VHT_CAP_MCS_MAP_0_9 : VHT_CAP_MCS_MAP_NONE)
2980 /* VHT Capabilities Supported Channel Width */
2981 typedef enum vht_cap_chan_width
{
2982 VHT_CAP_CHAN_WIDTH_SUPPORT_MANDATORY
= 0x00,
2983 VHT_CAP_CHAN_WIDTH_SUPPORT_160
= 0x04,
2984 VHT_CAP_CHAN_WIDTH_SUPPORT_160_8080
= 0x08
2985 } vht_cap_chan_width_t
;
2987 /* VHT Capabilities Supported max MPDU LEN (sec 8.4.2.160.2) */
2988 typedef enum vht_cap_max_mpdu_len
{
2989 VHT_CAP_MPDU_MAX_4K
= 0x00,
2990 VHT_CAP_MPDU_MAX_8K
= 0x01,
2991 VHT_CAP_MPDU_MAX_11K
= 0x02
2992 } vht_cap_max_mpdu_len_t
;
2994 /* Maximum MPDU Length byte counts for the VHT Capabilities advertised limits */
2995 #define VHT_MPDU_LIMIT_4K 3895
2996 #define VHT_MPDU_LIMIT_8K 7991
2997 #define VHT_MPDU_LIMIT_11K 11454
3001 * VHT Operation IE (sec 8.4.2.161)
3004 BWL_PRE_PACKED_STRUCT
struct vht_op_ie
{
3008 uint16 supp_mcs
; /* same def as above in vht cap */
3009 } BWL_POST_PACKED_STRUCT
;
3010 typedef struct vht_op_ie vht_op_ie_t
;
3012 /* 3B VHT Op info + 2B Basic MCS */
3013 #define VHT_OP_IE_LEN 5
3015 typedef enum vht_op_chan_width
{
3016 VHT_OP_CHAN_WIDTH_20_40
= 0,
3017 VHT_OP_CHAN_WIDTH_80
= 1,
3018 VHT_OP_CHAN_WIDTH_160
= 2,
3019 VHT_OP_CHAN_WIDTH_80_80
= 3
3020 } vht_op_chan_width_t
;
3023 * BRCM vht features IE header
3024 * The header if the fixed part of the IE
3025 * On the 5GHz band this is the entire IE,
3026 * on 2.4GHz the VHT IEs as defined in the 802.11ac
3027 * specification follows
3030 * VHT features rates bitmap.
3031 * Bit0: 5G MCS 0-9 BW 160MHz
3032 * Bit1: 5G MCS 0-9 support BW 80MHz
3033 * Bit2: 5G MCS 0-9 support BW 20MHz
3034 * Bit3: 2.4G MCS 0-9 support BW 20MHz
3035 * Bits:4-7 Reserved for future use
3038 #define VHT_FEATURES_IE_TYPE 0x4
3039 BWL_PRE_PACKED_STRUCT
struct vht_features_ie_hdr
{
3040 uint8 oui
[3]; /* Proprietary OUI, BRCM_PROP_OUI */
3041 uint8 type
; /* type of this IE = 4 */
3042 uint8 rate_mask
; /* VHT rate mask */
3043 } BWL_POST_PACKED_STRUCT
;
3044 typedef struct vht_features_ie_hdr vht_features_ie_hdr_t
;
3046 /* Def for rx & tx basic mcs maps - ea ss num has 2 bits of info */
3047 #define VHT_MCS_MAP_GET_SS_IDX(nss) (((nss)-1) * VHT_CAP_MCS_MAP_S)
3048 #define VHT_MCS_MAP_GET_MCS_PER_SS(nss, mcsMap) \
3049 (((mcsMap) >> VHT_MCS_MAP_GET_SS_IDX(nss)) & VHT_CAP_MCS_MAP_M)
3050 #define VHT_MCS_MAP_SET_MCS_PER_SS(nss, numMcs, mcsMap) \
3052 (mcsMap) &= (~(VHT_CAP_MCS_MAP_M << VHT_MCS_MAP_GET_SS_IDX(nss))); \
3053 (mcsMap) |= (((numMcs) & VHT_CAP_MCS_MAP_M) << VHT_MCS_MAP_GET_SS_IDX(nss)); \
3055 #define VHT_MCS_SS_SUPPORTED(nss, mcsMap) \
3056 (VHT_MCS_MAP_GET_MCS_PER_SS((nss), (mcsMap)) != VHT_CAP_MCS_MAP_NONE)
3059 /* ************* WPA definitions. ************* */
3060 #define WPA_OUI "\x00\x50\xF2" /* WPA OUI */
3061 #define WPA_OUI_LEN 3 /* WPA OUI length */
3062 #define WPA_OUI_TYPE 1
3063 #define WPA_VERSION 1 /* WPA version */
3064 #define WPA2_OUI "\x00\x0F\xAC" /* WPA2 OUI */
3065 #define WPA2_OUI_LEN 3 /* WPA2 OUI length */
3066 #define WPA2_VERSION 1 /* WPA2 version */
3067 #define WPA2_VERSION_LEN 2 /* WAP2 version length */
3069 /* ************* WPS definitions. ************* */
3070 #define WPS_OUI "\x00\x50\xF2" /* WPS OUI */
3071 #define WPS_OUI_LEN 3 /* WPS OUI length */
3072 #define WPS_OUI_TYPE 4
3074 /* ************* WFA definitions. ************* */
3076 #define MAC_OUI "\x00\x17\xF2" /* MACOSX OUI */
3077 #define MAC_OUI_TYPE_P2P 5
3080 #if defined(MACOSX) && !defined(WLP2P_NEW_WFA_OUI)
3081 #define WFA_OUI WPS_OUI /* WFA OUI */
3084 #define WFA_OUI MAC_OUI
3086 #define WFA_OUI "\x50\x6F\x9A" /* WFA OUI */
3087 #endif /* P2P_IE_OVRD */
3088 #endif /* MACOSX && !WLP2P_NEW_WFA_OUI */
3089 #define WFA_OUI_LEN 3 /* WFA OUI length */
3091 #define WFA_OUI_TYPE_P2P MAC_OUI_TYPE_P2P
3093 #define WFA_OUI_TYPE_P2P 9
3096 #define WFA_OUI_TYPE_TPC 8
3098 #define WFA_OUI_TYPE_TPQ 4 /* WFD Tunneled Probe ReQuest */
3099 #define WFA_OUI_TYPE_TPS 5 /* WFD Tunneled Probe ReSponse */
3100 #define WFA_OUI_TYPE_WFD 10
3103 /* RSN authenticated key managment suite */
3104 #define RSN_AKM_NONE 0 /* None (IBSS) */
3105 #define RSN_AKM_UNSPECIFIED 1 /* Over 802.1x */
3106 #define RSN_AKM_PSK 2 /* Pre-shared Key */
3107 #define RSN_AKM_FBT_1X 3 /* Fast Bss transition using 802.1X */
3108 #define RSN_AKM_FBT_PSK 4 /* Fast Bss transition using Pre-shared Key */
3109 #define RSN_AKM_MFP_1X 5 /* SHA256 key derivation, using 802.1X */
3110 #define RSN_AKM_MFP_PSK 6 /* SHA256 key derivation, using Pre-shared Key */
3111 #define RSN_AKM_TPK 7 /* TPK(TDLS Peer Key) handshake */
3113 /* Key related defines */
3114 #define DOT11_MAX_DEFAULT_KEYS 4 /* number of default keys */
3115 #define DOT11_MAX_KEY_SIZE 32 /* max size of any key */
3116 #define DOT11_MAX_IV_SIZE 16 /* max size of any IV */
3117 #define DOT11_EXT_IV_FLAG (1<<5) /* flag to indicate IV is > 4 bytes */
3118 #define DOT11_WPA_KEY_RSC_LEN 8 /* WPA RSC key len */
3120 #define WEP1_KEY_SIZE 5 /* max size of any WEP key */
3121 #define WEP1_KEY_HEX_SIZE 10 /* size of WEP key in hex. */
3122 #define WEP128_KEY_SIZE 13 /* max size of any WEP key */
3123 #define WEP128_KEY_HEX_SIZE 26 /* size of WEP key in hex. */
3124 #define TKIP_MIC_SIZE 8 /* size of TKIP MIC */
3125 #define TKIP_EOM_SIZE 7 /* max size of TKIP EOM */
3126 #define TKIP_EOM_FLAG 0x5a /* TKIP EOM flag byte */
3127 #define TKIP_KEY_SIZE 32 /* size of any TKIP key */
3128 #define TKIP_MIC_AUTH_TX 16 /* offset to Authenticator MIC TX key */
3129 #define TKIP_MIC_AUTH_RX 24 /* offset to Authenticator MIC RX key */
3130 #define TKIP_MIC_SUP_RX TKIP_MIC_AUTH_TX /* offset to Supplicant MIC RX key */
3131 #define TKIP_MIC_SUP_TX TKIP_MIC_AUTH_RX /* offset to Supplicant MIC TX key */
3132 #define AES_KEY_SIZE 16 /* size of AES key */
3133 #define AES_MIC_SIZE 8 /* size of AES MIC */
3134 #define BIP_KEY_SIZE 16 /* size of BIP key */
3135 #define BIP_MIC_SIZE 8 /* sizeof BIP MIC */
3138 #define WCN_OUI "\x00\x50\xf2" /* WCN OUI */
3139 #define WCN_TYPE 4 /* WCN type */
3142 /* 802.11r protocol definitions */
3144 /* Mobility Domain IE */
3145 BWL_PRE_PACKED_STRUCT
struct dot11_mdid_ie
{
3148 uint16 mdid
; /* Mobility Domain Id */
3150 } BWL_POST_PACKED_STRUCT
;
3151 typedef struct dot11_mdid_ie dot11_mdid_ie_t
;
3153 #define FBT_MDID_CAP_OVERDS 0x01 /* Fast Bss transition over the DS support */
3154 #define FBT_MDID_CAP_RRP 0x02 /* Resource request protocol support */
3156 /* Fast Bss Transition IE */
3157 BWL_PRE_PACKED_STRUCT
struct dot11_ft_ie
{
3160 uint16 mic_control
; /* Mic Control */
3164 } BWL_POST_PACKED_STRUCT
;
3165 typedef struct dot11_ft_ie dot11_ft_ie_t
;
3167 #define TIE_TYPE_RESERVED 0
3168 #define TIE_TYPE_REASSOC_DEADLINE 1
3169 #define TIE_TYPE_KEY_LIEFTIME 2
3170 #define TIE_TYPE_ASSOC_COMEBACK 3
3171 BWL_PRE_PACKED_STRUCT
struct dot11_timeout_ie
{
3174 uint8 type
; /* timeout interval type */
3175 uint32 value
; /* timeout interval value */
3176 } BWL_POST_PACKED_STRUCT
;
3177 typedef struct dot11_timeout_ie dot11_timeout_ie_t
;
3180 BWL_PRE_PACKED_STRUCT
struct dot11_gtk_ie
{
3187 } BWL_POST_PACKED_STRUCT
;
3188 typedef struct dot11_gtk_ie dot11_gtk_ie_t
;
3190 /* Management MIC ie */
3191 BWL_PRE_PACKED_STRUCT
struct mmic_ie
{
3192 uint8 id
; /* IE ID: 0xDD */
3193 uint8 len
; /* IE length */
3194 uint16 key_id
; /* key id */
3195 uint8 ipn
[6]; /* ipn */
3196 uint8 mic
[BIP_MIC_SIZE
]; /* mic */
3197 } BWL_POST_PACKED_STRUCT
;
3198 typedef struct mmic_ie mmic_ie_t
;
3200 #define BSSID_INVALID "\x00\x00\x00\x00\x00\x00"
3201 #define BSSID_BROADCAST "\xFF\xFF\xFF\xFF\xFF\xFF"
3204 /* ************* WMM Parameter definitions. ************* */
3205 #define WMM_OUI "\x00\x50\xF2" /* WNN OUI */
3206 #define WMM_OUI_LEN 3 /* WMM OUI length */
3207 #define WMM_OUI_TYPE 2 /* WMM OUT type */
3208 #define WMM_VERSION 1
3209 #define WMM_VERSION_LEN 1
3211 /* WMM OUI subtype */
3212 #define WMM_OUI_SUBTYPE_PARAMETER 1
3213 #define WMM_PARAMETER_IE_LEN 24
3215 /* Link Identifier Element */
3216 BWL_PRE_PACKED_STRUCT
struct link_id_ie
{
3219 struct ether_addr bssid
;
3220 struct ether_addr tdls_init_mac
;
3221 struct ether_addr tdls_resp_mac
;
3222 } BWL_POST_PACKED_STRUCT
;
3223 typedef struct link_id_ie link_id_ie_t
;
3224 #define TDLS_LINK_ID_IE_LEN 18
3226 /* Link Wakeup Schedule Element */
3227 BWL_PRE_PACKED_STRUCT
struct wakeup_sch_ie
{
3230 uint32 offset
; /* in ms between TSF0 and start of 1st Awake Window */
3231 uint32 interval
; /* in ms bwtween the start of 2 Awake Windows */
3232 uint32 awake_win_slots
; /* in backof slots, duration of Awake Window */
3233 uint32 max_wake_win
; /* in ms, max duration of Awake Window */
3234 uint16 idle_cnt
; /* number of consecutive Awake Windows */
3235 } BWL_POST_PACKED_STRUCT
;
3236 typedef struct wakeup_sch_ie wakeup_sch_ie_t
;
3237 #define TDLS_WAKEUP_SCH_IE_LEN 18
3239 /* Channel Switch Timing Element */
3240 BWL_PRE_PACKED_STRUCT
struct channel_switch_timing_ie
{
3243 uint16 switch_time
; /* in ms, time to switch channels */
3244 uint16 switch_timeout
; /* in ms */
3245 } BWL_POST_PACKED_STRUCT
;
3246 typedef struct channel_switch_timing_ie channel_switch_timing_ie_t
;
3247 #define TDLS_CHANNEL_SWITCH_TIMING_IE_LEN 4
3249 /* PTI Control Element */
3250 BWL_PRE_PACKED_STRUCT
struct pti_control_ie
{
3255 } BWL_POST_PACKED_STRUCT
;
3256 typedef struct pti_control_ie pti_control_ie_t
;
3257 #define TDLS_PTI_CONTROL_IE_LEN 3
3259 /* PU Buffer Status Element */
3260 BWL_PRE_PACKED_STRUCT
struct pu_buffer_status_ie
{
3264 } BWL_POST_PACKED_STRUCT
;
3265 typedef struct pu_buffer_status_ie pu_buffer_status_ie_t
;
3266 #define TDLS_PU_BUFFER_STATUS_IE_LEN 1
3267 #define TDLS_PU_BUFFER_STATUS_AC_BK 1
3268 #define TDLS_PU_BUFFER_STATUS_AC_BE 2
3269 #define TDLS_PU_BUFFER_STATUS_AC_VI 4
3270 #define TDLS_PU_BUFFER_STATUS_AC_VO 8
3272 /* 802.11u GAS action frames */
3273 #define GAS_REQUEST_ACTION_FRAME 10
3274 #define GAS_RESPONSE_ACTION_FRAME 11
3275 #define GAS_COMEBACK_REQUEST_ACTION_FRAME 12
3276 #define GAS_COMEBACK_RESPONSE_ACTION_FRAME 13
3278 /* 802.11u interworking access network options */
3279 #define IW_ANT_MASK 0x0f
3280 #define IW_INTERNET_MASK 0x10
3281 #define IW_ASRA_MASK 0x20
3282 #define IW_ESR_MASK 0x40
3283 #define IW_UESA_MASK 0x80
3285 /* 802.11u interworking access network type */
3286 #define IW_ANT_PRIVATE_NETWORK 0
3287 #define IW_ANT_PRIVATE_NETWORK_WITH_GUEST 1
3288 #define IW_ANT_CHARGEABLE_PUBLIC_NETWORK 2
3289 #define IW_ANT_FREE_PUBLIC_NETWORK 3
3290 #define IW_ANT_PERSONAL_DEVICE_NETWORK 4
3291 #define IW_ANT_EMERGENCY_SERVICES_NETWORK 5
3292 #define IW_ANT_TEST_NETWORK 14
3293 #define IW_ANT_WILDCARD_NETWORK 15
3295 /* 802.11u advertisement protocol */
3296 #define ADVP_ANQP_PROTOCOL_ID 0
3298 /* 802.11u advertisement protocol masks */
3299 #define ADVP_QRL_MASK 0x7f
3300 #define ADVP_PAME_BI_MASK 0x80
3302 /* 802.11u advertisement protocol values */
3303 #define ADVP_QRL_REQUEST 0x00
3304 #define ADVP_QRL_RESPONSE 0x7f
3305 #define ADVP_PAME_BI_DEPENDENT 0x00
3306 #define ADVP_PAME_BI_INDEPENDENT ADVP_PAME_BI_MASK
3308 /* 802.11u ANQP information ID */
3309 #define ANQP_ID_QUERY_LIST 256
3310 #define ANQP_ID_CAPABILITY_LIST 257
3311 #define ANQP_ID_VENUE_NAME_INFO 258
3312 #define ANQP_ID_EMERGENCY_CALL_NUMBER_INFO 259
3313 #define ANQP_ID_NETWORK_AUTHENTICATION_TYPE_INFO 260
3314 #define ANQP_ID_ROAMING_CONSORTIUM_LIST 261
3315 #define ANQP_ID_IP_ADDRESS_TYPE_AVAILABILITY_INFO 262
3316 #define ANQP_ID_NAI_REALM_LIST 263
3317 #define ANQP_ID_G3PP_CELLULAR_NETWORK_INFO 264
3318 #define ANQP_ID_AP_GEOSPATIAL_LOCATION 265
3319 #define ANQP_ID_AP_CIVIC_LOCATION 266
3320 #define ANQP_ID_AP_LOCATION_PUBLIC_ID_URI 267
3321 #define ANQP_ID_DOMAIN_NAME_LIST 268
3322 #define ANQP_ID_EMERGENCY_ALERT_ID_URI 269
3323 #define ANQP_ID_EMERGENCY_NAI 271
3324 #define ANQP_ID_VENDOR_SPECIFIC_LIST 56797
3326 /* 802.11u ANQP OUI */
3327 #define ANQP_OUI_SUBTYPE 9
3329 /* 802.11u venue name */
3330 #define VENUE_LANGUAGE_CODE_SIZE 3
3331 #define VENUE_NAME_SIZE 255
3333 /* 802.11u venue groups */
3334 #define VENUE_UNSPECIFIED 0
3335 #define VENUE_ASSEMBLY 1
3336 #define VENUE_BUSINESS 2
3337 #define VENUE_EDUCATIONAL 3
3338 #define VENUE_FACTORY 4
3339 #define VENUE_INSTITUTIONAL 5
3340 #define VENUE_MERCANTILE 6
3341 #define VENUE_RESIDENTIAL 7
3342 #define VENUE_STORAGE 8
3343 #define VENUE_UTILITY 9
3344 #define VENUE_VEHICULAR 10
3345 #define VENUE_OUTDOOR 11
3347 /* 802.11u network authentication type indicator */
3348 #define NATI_ACCEPTANCE_OF_TERMS_CONDITIONS 0
3349 #define NATI_ONLINE_ENROLLMENT_SUPPORTED 1
3350 #define NATI_HTTP_HTTPS_REDIRECTION 2
3351 #define NATI_DNS_REDIRECTION 3
3353 /* 802.11u IP address type availability - IPv6 */
3354 #define IPA_IPV6_SHIFT 0
3355 #define IPA_IPV6_MASK (0x03 << IPA_IPV6_SHIFT)
3356 #define IPA_IPV6_NOT_AVAILABLE 0x00
3357 #define IPA_IPV6_AVAILABLE 0x01
3358 #define IPA_IPV6_UNKNOWN_AVAILABILITY 0x02
3360 /* 802.11u IP address type availability - IPv4 */
3361 #define IPA_IPV4_SHIFT 2
3362 #define IPA_IPV4_MASK (0x3f << IPA_IPV4_SHIFT)
3363 #define IPA_IPV4_NOT_AVAILABLE 0x00
3364 #define IPA_IPV4_PUBLIC 0x01
3365 #define IPA_IPV4_PORT_RESTRICT 0x02
3366 #define IPA_IPV4_SINGLE_NAT 0x03
3367 #define IPA_IPV4_DOUBLE_NAT 0x04
3368 #define IPA_IPV4_PORT_RESTRICT_SINGLE_NAT 0x05
3369 #define IPA_IPV4_PORT_RESTRICT_DOUBLE_NAT 0x06
3370 #define IPA_IPV4_UNKNOWN_AVAILABILITY 0x07
3372 /* 802.11u NAI realm encoding */
3373 #define REALM_ENCODING_RFC4282 0
3374 #define REALM_ENCODING_UTF8 1
3376 /* 802.11u IANA EAP method type numbers */
3377 #define REALM_EAP_TLS 13
3378 #define REALM_EAP_SIM 18
3379 #define REALM_EAP_TTLS 21
3380 #define REALM_EAP_AKA 23
3381 #define REALM_EAP_PSK 47
3382 #define REALM_EAP_AKAP 50
3384 /* 802.11u authentication ID */
3385 #define REALM_EXPANDED_EAP 1
3386 #define REALM_NON_EAP_INNER_AUTHENTICATION 2
3387 #define REALM_INNER_AUTHENTICATION_EAP 3
3388 #define REALM_EXPANDED_INNER_EAP 4
3389 #define REALM_CREDENTIAL 5
3390 #define REALM_TUNNELED_EAP_CREDENTIAL 6
3391 #define REALM_VENDOR_SPECIFIC_EAP 221
3393 /* 802.11u non-EAP inner authentication type */
3395 #define REALM_CHAP 2
3396 #define REALM_MSCHAP 3
3397 #define REALM_MSCHAPV2 4
3399 /* 802.11u credential type */
3401 #define REALM_USIM 2
3403 #define REALM_HARDWARE_TOKEN 4
3404 #define REALM_SOFTOKEN 5
3405 #define REALM_CERTIFICATE 6
3406 #define REALM_USERNAME_PASSWORD 7
3407 #define REALM_SERVER_SIDE 8
3409 /* 802.11u 3GPP PLMN */
3410 #define G3PP_GUD_VERSION 0
3411 #define G3PP_PLMN_LIST_IE 0
3413 /* This marks the end of a packed structure section. */
3414 #include <packed_section_end.h>
3416 #endif /* _802_11_H_ */