Commit | Line | Data |
---|---|---|
1cac41cb MB |
1 | /* |
2 | * Fundamental types and constants relating to 802.11 | |
3 | * | |
4 | * Copyright (C) 1999-2019, Broadcom. | |
5 | * | |
6 | * Unless you and Broadcom execute a separate written software license | |
7 | * agreement governing use of this software, this software is licensed to you | |
8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | |
9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | |
10 | * following added to such license: | |
11 | * | |
12 | * As a special exception, the copyright holders of this software give you | |
13 | * permission to link this software with independent modules, and to copy and | |
14 | * distribute the resulting executable under terms of your choice, provided that | |
15 | * you also meet, for each linked independent module, the terms and conditions of | |
16 | * the license of that module. An independent module is a module which is not | |
17 | * derived from this software. The special exception does not apply to any | |
18 | * modifications of the software. | |
19 | * | |
20 | * Notwithstanding the above, under no circumstances may you combine this | |
21 | * software in any way with any other Broadcom software provided under a license | |
22 | * other than the GPL, without Broadcom's express prior written consent. | |
23 | * | |
24 | * | |
25 | * <<Broadcom-WL-IPTag/Open:>> | |
26 | * | |
5a068558 | 27 | * $Id: 802.11.h 778668 2018-08-29 01:12:46Z $ |
1cac41cb MB |
28 | */ |
29 | ||
30 | #ifndef _802_11_H_ | |
31 | #define _802_11_H_ | |
32 | ||
33 | #ifndef _TYPEDEFS_H_ | |
34 | #include <typedefs.h> | |
35 | #endif // endif | |
36 | ||
37 | #ifndef _NET_ETHERNET_H_ | |
38 | #include <ethernet.h> | |
39 | #endif // endif | |
40 | ||
41 | #include <wpa.h> | |
42 | ||
43 | /* This marks the start of a packed structure section. */ | |
44 | #include <packed_section_start.h> | |
45 | ||
46 | #define DOT11_TU_TO_US 1024 /* 802.11 Time Unit is 1024 microseconds */ | |
47 | ||
48 | /* Generic 802.11 frame constants */ | |
49 | #define DOT11_A3_HDR_LEN 24 /* d11 header length with A3 */ | |
50 | #define DOT11_A4_HDR_LEN 30 /* d11 header length with A4 */ | |
51 | #define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN /* MAC header length */ | |
52 | #define DOT11_FCS_LEN 4u /* d11 FCS length */ | |
53 | #define DOT11_ICV_LEN 4 /* d11 ICV length */ | |
54 | #define DOT11_ICV_AES_LEN 8 /* d11 ICV/AES length */ | |
55 | #define DOT11_MAX_ICV_AES_LEN 16 /* d11 MAX ICV/AES length */ | |
56 | #define DOT11_QOS_LEN 2 /* d11 QoS length */ | |
57 | #define DOT11_HTC_LEN 4 /* d11 HT Control field length */ | |
58 | ||
59 | #define DOT11_KEY_INDEX_SHIFT 6 /* d11 key index shift */ | |
60 | #define DOT11_IV_LEN 4 /* d11 IV length */ | |
61 | #define DOT11_IV_TKIP_LEN 8 /* d11 IV TKIP length */ | |
62 | #define DOT11_IV_AES_OCB_LEN 4 /* d11 IV/AES/OCB length */ | |
63 | #define DOT11_IV_AES_CCM_LEN 8 /* d11 IV/AES/CCM length */ | |
64 | #define DOT11_IV_MAX_LEN 8 /* maximum iv len for any encryption */ | |
65 | ||
66 | /* Includes MIC */ | |
67 | #define DOT11_MAX_MPDU_BODY_LEN 2304 /* max MPDU body length */ | |
68 | /* A4 header + QoS + CCMP + PDU + ICV + FCS = 2352 */ | |
69 | #define DOT11_MAX_MPDU_LEN (DOT11_A4_HDR_LEN + \ | |
70 | DOT11_QOS_LEN + \ | |
71 | DOT11_IV_AES_CCM_LEN + \ | |
72 | DOT11_MAX_MPDU_BODY_LEN + \ | |
73 | DOT11_ICV_LEN + \ | |
74 | DOT11_FCS_LEN) /* d11 max MPDU length */ | |
75 | ||
76 | #define DOT11_MAX_SSID_LEN 32 /* d11 max ssid length */ | |
77 | ||
78 | /* dot11RTSThreshold */ | |
79 | #define DOT11_DEFAULT_RTS_LEN 2347 /* d11 default RTS length */ | |
80 | #define DOT11_MAX_RTS_LEN 2347 /* d11 max RTS length */ | |
81 | ||
82 | /* dot11FragmentationThreshold */ | |
83 | #define DOT11_MIN_FRAG_LEN 256 /* d11 min fragmentation length */ | |
84 | #define DOT11_MAX_FRAG_LEN 2346 /* Max frag is also limited by aMPDUMaxLength | |
85 | * of the attached PHY | |
86 | */ | |
87 | #define DOT11_DEFAULT_FRAG_LEN 2346 /* d11 default fragmentation length */ | |
88 | ||
89 | /* dot11BeaconPeriod */ | |
90 | #define DOT11_MIN_BEACON_PERIOD 1 /* d11 min beacon period */ | |
91 | #define DOT11_MAX_BEACON_PERIOD 0xFFFF /* d11 max beacon period */ | |
92 | ||
93 | /* dot11DTIMPeriod */ | |
94 | #define DOT11_MIN_DTIM_PERIOD 1 /* d11 min DTIM period */ | |
95 | #define DOT11_MAX_DTIM_PERIOD 0xFF /* d11 max DTIM period */ | |
96 | ||
97 | /** 802.2 LLC/SNAP header used by 802.11 per 802.1H */ | |
98 | #define DOT11_LLC_SNAP_HDR_LEN 8 /* d11 LLC/SNAP header length */ | |
99 | /* minimum LLC header length; DSAP, SSAP, 8 bit Control (unnumbered) */ | |
100 | #define DOT11_LLC_HDR_LEN_MIN 3 | |
101 | #define DOT11_OUI_LEN 3 /* d11 OUI length */ | |
102 | BWL_PRE_PACKED_STRUCT struct dot11_llc_snap_header { | |
103 | uint8 dsap; /* always 0xAA */ | |
104 | uint8 ssap; /* always 0xAA */ | |
105 | uint8 ctl; /* always 0x03 */ | |
106 | uint8 oui[DOT11_OUI_LEN]; /* RFC1042: 0x00 0x00 0x00 | |
107 | * Bridge-Tunnel: 0x00 0x00 0xF8 | |
108 | */ | |
109 | uint16 type; /* ethertype */ | |
110 | } BWL_POST_PACKED_STRUCT; | |
111 | ||
112 | /* RFC1042 header used by 802.11 per 802.1H */ | |
113 | #define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN) /* RCF1042 header length */ | |
114 | ||
115 | /* Generic 802.11 MAC header */ | |
116 | /** | |
117 | * N.B.: This struct reflects the full 4 address 802.11 MAC header. | |
118 | * The fields are defined such that the shorter 1, 2, and 3 | |
119 | * address headers just use the first k fields. | |
120 | */ | |
121 | BWL_PRE_PACKED_STRUCT struct dot11_header { | |
122 | uint16 fc; /* frame control */ | |
123 | uint16 durid; /* duration/ID */ | |
124 | struct ether_addr a1; /* address 1 */ | |
125 | struct ether_addr a2; /* address 2 */ | |
126 | struct ether_addr a3; /* address 3 */ | |
127 | uint16 seq; /* sequence control */ | |
128 | struct ether_addr a4; /* address 4 */ | |
129 | } BWL_POST_PACKED_STRUCT; | |
130 | ||
131 | /* Control frames */ | |
132 | ||
133 | BWL_PRE_PACKED_STRUCT struct dot11_rts_frame { | |
134 | uint16 fc; /* frame control */ | |
135 | uint16 durid; /* duration/ID */ | |
136 | struct ether_addr ra; /* receiver address */ | |
137 | struct ether_addr ta; /* transmitter address */ | |
138 | } BWL_POST_PACKED_STRUCT; | |
139 | #define DOT11_RTS_LEN 16 /* d11 RTS frame length */ | |
140 | ||
141 | BWL_PRE_PACKED_STRUCT struct dot11_cts_frame { | |
142 | uint16 fc; /* frame control */ | |
143 | uint16 durid; /* duration/ID */ | |
144 | struct ether_addr ra; /* receiver address */ | |
145 | } BWL_POST_PACKED_STRUCT; | |
146 | #define DOT11_CTS_LEN 10u /* d11 CTS frame length */ | |
147 | ||
148 | BWL_PRE_PACKED_STRUCT struct dot11_ack_frame { | |
149 | uint16 fc; /* frame control */ | |
150 | uint16 durid; /* duration/ID */ | |
151 | struct ether_addr ra; /* receiver address */ | |
152 | } BWL_POST_PACKED_STRUCT; | |
153 | #define DOT11_ACK_LEN 10 /* d11 ACK frame length */ | |
154 | ||
155 | BWL_PRE_PACKED_STRUCT struct dot11_ps_poll_frame { | |
156 | uint16 fc; /* frame control */ | |
157 | uint16 durid; /* AID */ | |
158 | struct ether_addr bssid; /* receiver address, STA in AP */ | |
159 | struct ether_addr ta; /* transmitter address */ | |
160 | } BWL_POST_PACKED_STRUCT; | |
161 | #define DOT11_PS_POLL_LEN 16 /* d11 PS poll frame length */ | |
162 | ||
163 | BWL_PRE_PACKED_STRUCT struct dot11_cf_end_frame { | |
164 | uint16 fc; /* frame control */ | |
165 | uint16 durid; /* duration/ID */ | |
166 | struct ether_addr ra; /* receiver address */ | |
167 | struct ether_addr bssid; /* transmitter address, STA in AP */ | |
168 | } BWL_POST_PACKED_STRUCT; | |
169 | #define DOT11_CS_END_LEN 16 /* d11 CF-END frame length */ | |
170 | ||
171 | /** | |
172 | * RWL wifi protocol: The Vendor Specific Action frame is defined for vendor-specific signaling | |
173 | * category+OUI+vendor specific content ( this can be variable) | |
174 | */ | |
175 | BWL_PRE_PACKED_STRUCT struct dot11_action_wifi_vendor_specific { | |
176 | uint8 category; | |
177 | uint8 OUI[3]; | |
178 | uint8 type; | |
179 | uint8 subtype; | |
180 | uint8 data[1040]; | |
181 | } BWL_POST_PACKED_STRUCT; | |
182 | typedef struct dot11_action_wifi_vendor_specific dot11_action_wifi_vendor_specific_t; | |
183 | ||
184 | /** generic vendor specific action frame with variable length */ | |
185 | BWL_PRE_PACKED_STRUCT struct dot11_action_vs_frmhdr { | |
186 | uint8 category; | |
187 | uint8 OUI[3]; | |
188 | uint8 type; | |
189 | uint8 subtype; | |
190 | uint8 data[1]; | |
191 | } BWL_POST_PACKED_STRUCT; | |
192 | typedef struct dot11_action_vs_frmhdr dot11_action_vs_frmhdr_t; | |
193 | ||
194 | #define DOT11_ACTION_VS_HDR_LEN 6 | |
195 | ||
196 | #define BCM_ACTION_OUI_BYTE0 0x00 | |
197 | #define BCM_ACTION_OUI_BYTE1 0x90 | |
198 | #define BCM_ACTION_OUI_BYTE2 0x4c | |
199 | ||
200 | /* BA/BAR Control parameters */ | |
201 | #define DOT11_BA_CTL_POLICY_NORMAL 0x0000 /* normal ack */ | |
202 | #define DOT11_BA_CTL_POLICY_NOACK 0x0001 /* no ack */ | |
203 | #define DOT11_BA_CTL_POLICY_MASK 0x0001 /* ack policy mask */ | |
204 | ||
205 | #define DOT11_BA_CTL_MTID 0x0002 /* multi tid BA */ | |
206 | #define DOT11_BA_CTL_COMPRESSED 0x0004 /* compressed bitmap */ | |
207 | ||
208 | #define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0 /* num msdu in bitmap mask */ | |
209 | #define DOT11_BA_CTL_NUMMSDU_SHIFT 6 /* num msdu in bitmap shift */ | |
210 | ||
211 | #define DOT11_BA_CTL_TID_MASK 0xF000 /* tid mask */ | |
212 | #define DOT11_BA_CTL_TID_SHIFT 12 /* tid shift */ | |
213 | ||
214 | /** control frame header (BA/BAR) */ | |
215 | BWL_PRE_PACKED_STRUCT struct dot11_ctl_header { | |
216 | uint16 fc; /* frame control */ | |
217 | uint16 durid; /* duration/ID */ | |
218 | struct ether_addr ra; /* receiver address */ | |
219 | struct ether_addr ta; /* transmitter address */ | |
220 | } BWL_POST_PACKED_STRUCT; | |
221 | #define DOT11_CTL_HDR_LEN 16 /* control frame hdr len */ | |
222 | ||
223 | /** BAR frame payload */ | |
224 | BWL_PRE_PACKED_STRUCT struct dot11_bar { | |
225 | uint16 bar_control; /* BAR Control */ | |
226 | uint16 seqnum; /* Starting Sequence control */ | |
227 | } BWL_POST_PACKED_STRUCT; | |
228 | #define DOT11_BAR_LEN 4 /* BAR frame payload length */ | |
229 | ||
230 | #define DOT11_BA_BITMAP_LEN 128 /* bitmap length */ | |
231 | #define DOT11_BA_CMP_BITMAP_LEN 8 /* compressed bitmap length */ | |
232 | /** BA frame payload */ | |
233 | BWL_PRE_PACKED_STRUCT struct dot11_ba { | |
234 | uint16 ba_control; /* BA Control */ | |
235 | uint16 seqnum; /* Starting Sequence control */ | |
236 | uint8 bitmap[DOT11_BA_BITMAP_LEN]; /* Block Ack Bitmap */ | |
237 | } BWL_POST_PACKED_STRUCT; | |
238 | #define DOT11_BA_LEN 4 /* BA frame payload len (wo bitmap) */ | |
239 | ||
240 | /** Management frame header */ | |
241 | BWL_PRE_PACKED_STRUCT struct dot11_management_header { | |
242 | uint16 fc; /* frame control */ | |
243 | uint16 durid; /* duration/ID */ | |
244 | struct ether_addr da; /* receiver address */ | |
245 | struct ether_addr sa; /* transmitter address */ | |
246 | struct ether_addr bssid; /* BSS ID */ | |
247 | uint16 seq; /* sequence control */ | |
248 | } BWL_POST_PACKED_STRUCT; | |
249 | typedef struct dot11_management_header dot11_management_header_t; | |
250 | #define DOT11_MGMT_HDR_LEN 24 /* d11 management header length */ | |
251 | ||
252 | /* Management frame payloads */ | |
253 | ||
254 | BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb { | |
255 | uint32 timestamp[2]; | |
256 | uint16 beacon_interval; | |
257 | uint16 capability; | |
258 | } BWL_POST_PACKED_STRUCT; | |
259 | #define DOT11_BCN_PRB_LEN 12 /* 802.11 beacon/probe frame fixed length */ | |
5a068558 | 260 | #define DOT11_BCN_PRB_FIXED_LEN 12u /* 802.11 beacon/probe frame fixed length */ |
1cac41cb MB |
261 | |
262 | BWL_PRE_PACKED_STRUCT struct dot11_auth { | |
263 | uint16 alg; /* algorithm */ | |
264 | uint16 seq; /* sequence control */ | |
265 | uint16 status; /* status code */ | |
266 | } BWL_POST_PACKED_STRUCT; | |
267 | #define DOT11_AUTH_FIXED_LEN 6 /* length of auth frame without challenge IE */ | |
268 | #define DOT11_AUTH_SEQ_STATUS_LEN 4 /* length of auth frame without challenge IE and | |
269 | * without algorithm | |
270 | */ | |
271 | ||
272 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_req { | |
273 | uint16 capability; /* capability information */ | |
274 | uint16 listen; /* listen interval */ | |
275 | } BWL_POST_PACKED_STRUCT; | |
276 | #define DOT11_ASSOC_REQ_FIXED_LEN 4 /* length of assoc frame without info elts */ | |
277 | ||
278 | BWL_PRE_PACKED_STRUCT struct dot11_reassoc_req { | |
279 | uint16 capability; /* capability information */ | |
280 | uint16 listen; /* listen interval */ | |
281 | struct ether_addr ap; /* Current AP address */ | |
282 | } BWL_POST_PACKED_STRUCT; | |
283 | #define DOT11_REASSOC_REQ_FIXED_LEN 10 /* length of assoc frame without info elts */ | |
284 | ||
285 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_resp { | |
286 | uint16 capability; /* capability information */ | |
287 | uint16 status; /* status code */ | |
288 | uint16 aid; /* association ID */ | |
289 | } BWL_POST_PACKED_STRUCT; | |
290 | #define DOT11_ASSOC_RESP_FIXED_LEN 6 /* length of assoc resp frame without info elts */ | |
291 | ||
292 | BWL_PRE_PACKED_STRUCT struct dot11_action_measure { | |
293 | uint8 category; | |
294 | uint8 action; | |
295 | uint8 token; | |
296 | uint8 data[1]; | |
297 | } BWL_POST_PACKED_STRUCT; | |
298 | #define DOT11_ACTION_MEASURE_LEN 3 /* d11 action measurement header length */ | |
299 | ||
300 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_ch_width { | |
301 | uint8 category; | |
302 | uint8 action; | |
303 | uint8 ch_width; | |
304 | } BWL_POST_PACKED_STRUCT; | |
305 | ||
306 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_mimops { | |
307 | uint8 category; | |
308 | uint8 action; | |
309 | uint8 control; | |
310 | } BWL_POST_PACKED_STRUCT; | |
311 | ||
312 | BWL_PRE_PACKED_STRUCT struct dot11_action_sa_query { | |
313 | uint8 category; | |
314 | uint8 action; | |
315 | uint16 id; | |
316 | } BWL_POST_PACKED_STRUCT; | |
317 | ||
318 | BWL_PRE_PACKED_STRUCT struct dot11_action_vht_oper_mode { | |
319 | uint8 category; | |
320 | uint8 action; | |
321 | uint8 mode; | |
322 | } BWL_POST_PACKED_STRUCT; | |
323 | ||
324 | /* These lengths assume 64 MU groups, as specified in 802.11ac-2013 */ | |
325 | #define DOT11_ACTION_GID_MEMBERSHIP_LEN 8 /* bytes */ | |
326 | #define DOT11_ACTION_GID_USER_POS_LEN 16 /* bytes */ | |
327 | BWL_PRE_PACKED_STRUCT struct dot11_action_group_id { | |
328 | uint8 category; | |
329 | uint8 action; | |
330 | uint8 membership_status[DOT11_ACTION_GID_MEMBERSHIP_LEN]; | |
331 | uint8 user_position[DOT11_ACTION_GID_USER_POS_LEN]; | |
332 | } BWL_POST_PACKED_STRUCT; | |
333 | ||
334 | #define SM_PWRSAVE_ENABLE 1 | |
335 | #define SM_PWRSAVE_MODE 2 | |
336 | ||
337 | /* ************* 802.11h related definitions. ************* */ | |
338 | BWL_PRE_PACKED_STRUCT struct dot11_power_cnst { | |
339 | uint8 id; | |
340 | uint8 len; | |
341 | uint8 power; | |
342 | } BWL_POST_PACKED_STRUCT; | |
343 | typedef struct dot11_power_cnst dot11_power_cnst_t; | |
344 | ||
345 | BWL_PRE_PACKED_STRUCT struct dot11_power_cap { | |
346 | int8 min; | |
347 | int8 max; | |
348 | } BWL_POST_PACKED_STRUCT; | |
349 | typedef struct dot11_power_cap dot11_power_cap_t; | |
350 | ||
351 | BWL_PRE_PACKED_STRUCT struct dot11_tpc_rep { | |
352 | uint8 id; | |
353 | uint8 len; | |
354 | uint8 tx_pwr; | |
355 | uint8 margin; | |
356 | } BWL_POST_PACKED_STRUCT; | |
357 | typedef struct dot11_tpc_rep dot11_tpc_rep_t; | |
5a068558 | 358 | #define DOT11_MNG_IE_TPC_REPORT_SIZE (sizeof(dot11_tpc_rep_t)) |
1cac41cb MB |
359 | #define DOT11_MNG_IE_TPC_REPORT_LEN 2 /* length of IE data, not including 2 byte header */ |
360 | ||
361 | BWL_PRE_PACKED_STRUCT struct dot11_supp_channels { | |
362 | uint8 id; | |
363 | uint8 len; | |
364 | uint8 first_channel; | |
365 | uint8 num_channels; | |
366 | } BWL_POST_PACKED_STRUCT; | |
367 | typedef struct dot11_supp_channels dot11_supp_channels_t; | |
368 | ||
369 | /** | |
370 | * Extension Channel Offset IE: 802.11n-D1.0 spec. added sideband | |
371 | * offset for 40MHz operation. The possible 3 values are: | |
372 | * 1 = above control channel | |
373 | * 3 = below control channel | |
374 | * 0 = no extension channel | |
375 | */ | |
376 | BWL_PRE_PACKED_STRUCT struct dot11_extch { | |
377 | uint8 id; /* IE ID, 62, DOT11_MNG_EXT_CHANNEL_OFFSET */ | |
378 | uint8 len; /* IE length */ | |
379 | uint8 extch; | |
380 | } BWL_POST_PACKED_STRUCT; | |
381 | typedef struct dot11_extch dot11_extch_ie_t; | |
382 | ||
383 | BWL_PRE_PACKED_STRUCT struct dot11_brcm_extch { | |
384 | uint8 id; /* IE ID, 221, DOT11_MNG_PROPR_ID */ | |
385 | uint8 len; /* IE length */ | |
386 | uint8 oui[3]; | |
387 | uint8 type; /* type indicates what follows */ | |
388 | uint8 extch; | |
389 | } BWL_POST_PACKED_STRUCT; | |
390 | typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t; | |
391 | ||
392 | #define BRCM_EXTCH_IE_LEN 5 | |
393 | #define BRCM_EXTCH_IE_TYPE 53 /* 802.11n ID not yet assigned */ | |
394 | #define DOT11_EXTCH_IE_LEN 1 | |
395 | #define DOT11_EXT_CH_MASK 0x03 /* extension channel mask */ | |
396 | #define DOT11_EXT_CH_UPPER 0x01 /* ext. ch. on upper sb */ | |
397 | #define DOT11_EXT_CH_LOWER 0x03 /* ext. ch. on lower sb */ | |
398 | #define DOT11_EXT_CH_NONE 0x00 /* no extension ch. */ | |
399 | ||
400 | BWL_PRE_PACKED_STRUCT struct dot11_action_frmhdr { | |
401 | uint8 category; | |
402 | uint8 action; | |
403 | uint8 data[1]; | |
404 | } BWL_POST_PACKED_STRUCT; | |
405 | typedef struct dot11_action_frmhdr dot11_action_frmhdr_t; | |
406 | ||
407 | /* Action Field length */ | |
408 | #define DOT11_ACTION_CATEGORY_LEN 1u | |
409 | #define DOT11_ACTION_ACTION_LEN 1u | |
410 | #define DOT11_ACTION_DIALOG_TOKEN_LEN 1u | |
411 | #define DOT11_ACTION_CAPABILITY_LEN 2u | |
412 | #define DOT11_ACTION_STATUS_CODE_LEN 2u | |
413 | #define DOT11_ACTION_REASON_CODE_LEN 2u | |
414 | #define DOT11_ACTION_TARGET_CH_LEN 1u | |
415 | #define DOT11_ACTION_OPER_CLASS_LEN 1u | |
416 | ||
417 | #define DOT11_ACTION_FRMHDR_LEN 2 | |
418 | ||
419 | /** CSA IE data structure */ | |
420 | BWL_PRE_PACKED_STRUCT struct dot11_channel_switch { | |
421 | uint8 id; /* id DOT11_MNG_CHANNEL_SWITCH_ID */ | |
422 | uint8 len; /* length of IE */ | |
423 | uint8 mode; /* mode 0 or 1 */ | |
424 | uint8 channel; /* channel switch to */ | |
425 | uint8 count; /* number of beacons before switching */ | |
426 | } BWL_POST_PACKED_STRUCT; | |
427 | typedef struct dot11_channel_switch dot11_chan_switch_ie_t; | |
428 | ||
429 | #define DOT11_SWITCH_IE_LEN 3 /* length of IE data, not including 2 byte header */ | |
430 | /* CSA mode - 802.11h-2003 $7.3.2.20 */ | |
431 | #define DOT11_CSA_MODE_ADVISORY 0 /* no DOT11_CSA_MODE_NO_TX restriction imposed */ | |
432 | #define DOT11_CSA_MODE_NO_TX 1 /* no transmission upon receiving CSA frame. */ | |
433 | ||
434 | BWL_PRE_PACKED_STRUCT struct dot11_action_switch_channel { | |
435 | uint8 category; | |
436 | uint8 action; | |
437 | dot11_chan_switch_ie_t chan_switch_ie; /* for switch IE */ | |
438 | dot11_brcm_extch_ie_t extch_ie; /* extension channel offset */ | |
439 | } BWL_POST_PACKED_STRUCT; | |
440 | ||
441 | BWL_PRE_PACKED_STRUCT struct dot11_csa_body { | |
442 | uint8 mode; /* mode 0 or 1 */ | |
443 | uint8 reg; /* regulatory class */ | |
444 | uint8 channel; /* channel switch to */ | |
445 | uint8 count; /* number of beacons before switching */ | |
446 | } BWL_POST_PACKED_STRUCT; | |
447 | ||
448 | /** 11n Extended Channel Switch IE data structure */ | |
449 | BWL_PRE_PACKED_STRUCT struct dot11_ext_csa { | |
450 | uint8 id; /* id DOT11_MNG_EXT_CSA_ID */ | |
451 | uint8 len; /* length of IE */ | |
452 | struct dot11_csa_body b; /* body of the ie */ | |
453 | } BWL_POST_PACKED_STRUCT; | |
454 | typedef struct dot11_ext_csa dot11_ext_csa_ie_t; | |
455 | #define DOT11_EXT_CSA_IE_LEN 4 /* length of extended channel switch IE body */ | |
456 | ||
457 | BWL_PRE_PACKED_STRUCT struct dot11_action_ext_csa { | |
458 | uint8 category; | |
459 | uint8 action; | |
460 | dot11_ext_csa_ie_t chan_switch_ie; /* for switch IE */ | |
461 | } BWL_POST_PACKED_STRUCT; | |
462 | ||
463 | BWL_PRE_PACKED_STRUCT struct dot11y_action_ext_csa { | |
464 | uint8 category; | |
465 | uint8 action; | |
466 | struct dot11_csa_body b; /* body of the ie */ | |
467 | } BWL_POST_PACKED_STRUCT; | |
468 | ||
469 | /** Wide Bandwidth Channel Switch IE data structure */ | |
470 | BWL_PRE_PACKED_STRUCT struct dot11_wide_bw_channel_switch { | |
471 | uint8 id; /* id DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID */ | |
472 | uint8 len; /* length of IE */ | |
473 | uint8 channel_width; /* new channel width */ | |
474 | uint8 center_frequency_segment_0; /* center frequency segment 0 */ | |
475 | uint8 center_frequency_segment_1; /* center frequency segment 1 */ | |
476 | } BWL_POST_PACKED_STRUCT; | |
477 | typedef struct dot11_wide_bw_channel_switch dot11_wide_bw_chan_switch_ie_t; | |
478 | ||
479 | #define DOT11_WIDE_BW_SWITCH_IE_LEN 3 /* length of IE data, not including 2 byte header */ | |
480 | ||
481 | /** Channel Switch Wrapper IE data structure */ | |
482 | BWL_PRE_PACKED_STRUCT struct dot11_channel_switch_wrapper { | |
483 | uint8 id; /* id DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID */ | |
484 | uint8 len; /* length of IE */ | |
485 | dot11_wide_bw_chan_switch_ie_t wb_chan_switch_ie; | |
486 | } BWL_POST_PACKED_STRUCT; | |
487 | typedef struct dot11_channel_switch_wrapper dot11_chan_switch_wrapper_ie_t; | |
488 | ||
489 | typedef enum wide_bw_chan_width { | |
490 | WIDE_BW_CHAN_WIDTH_20 = 0, | |
491 | WIDE_BW_CHAN_WIDTH_40 = 1, | |
492 | WIDE_BW_CHAN_WIDTH_80 = 2, | |
493 | WIDE_BW_CHAN_WIDTH_160 = 3, | |
494 | WIDE_BW_CHAN_WIDTH_80_80 = 4 | |
495 | } wide_bw_chan_width_t; | |
496 | ||
497 | /** Wide Bandwidth Channel IE data structure */ | |
498 | BWL_PRE_PACKED_STRUCT struct dot11_wide_bw_channel { | |
499 | uint8 id; /* id DOT11_MNG_WIDE_BW_CHANNEL_ID */ | |
500 | uint8 len; /* length of IE */ | |
501 | uint8 channel_width; /* channel width */ | |
502 | uint8 center_frequency_segment_0; /* center frequency segment 0 */ | |
503 | uint8 center_frequency_segment_1; /* center frequency segment 1 */ | |
504 | } BWL_POST_PACKED_STRUCT; | |
505 | typedef struct dot11_wide_bw_channel dot11_wide_bw_chan_ie_t; | |
506 | ||
507 | #define DOT11_WIDE_BW_IE_LEN 3 /* length of IE data, not including 2 byte header */ | |
508 | /** VHT Transmit Power Envelope IE data structure */ | |
509 | BWL_PRE_PACKED_STRUCT struct dot11_vht_transmit_power_envelope { | |
510 | uint8 id; /* id DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID */ | |
511 | uint8 len; /* length of IE */ | |
512 | uint8 transmit_power_info; | |
513 | uint8 local_max_transmit_power_20; | |
514 | } BWL_POST_PACKED_STRUCT; | |
515 | typedef struct dot11_vht_transmit_power_envelope dot11_vht_transmit_power_envelope_ie_t; | |
516 | ||
517 | /* vht transmit power envelope IE length depends on channel width */ | |
518 | #define DOT11_VHT_TRANSMIT_PWR_ENVELOPE_IE_LEN_40MHZ 1 | |
519 | #define DOT11_VHT_TRANSMIT_PWR_ENVELOPE_IE_LEN_80MHZ 2 | |
520 | #define DOT11_VHT_TRANSMIT_PWR_ENVELOPE_IE_LEN_160MHZ 3 | |
521 | ||
522 | BWL_PRE_PACKED_STRUCT struct dot11_obss_coex { | |
523 | uint8 id; | |
524 | uint8 len; | |
525 | uint8 info; | |
526 | } BWL_POST_PACKED_STRUCT; | |
527 | typedef struct dot11_obss_coex dot11_obss_coex_t; | |
528 | #define DOT11_OBSS_COEXINFO_LEN 1 /* length of OBSS Coexistence INFO IE */ | |
529 | ||
530 | #define DOT11_OBSS_COEX_INFO_REQ 0x01 | |
531 | #define DOT11_OBSS_COEX_40MHZ_INTOLERANT 0x02 | |
532 | #define DOT11_OBSS_COEX_20MHZ_WIDTH_REQ 0x04 | |
533 | ||
534 | BWL_PRE_PACKED_STRUCT struct dot11_obss_chanlist { | |
535 | uint8 id; | |
536 | uint8 len; | |
537 | uint8 regclass; | |
538 | uint8 chanlist[1]; | |
539 | } BWL_POST_PACKED_STRUCT; | |
540 | typedef struct dot11_obss_chanlist dot11_obss_chanlist_t; | |
541 | #define DOT11_OBSS_CHANLIST_FIXED_LEN 1 /* fixed length of regclass */ | |
542 | ||
543 | BWL_PRE_PACKED_STRUCT struct dot11_extcap_ie { | |
544 | uint8 id; | |
545 | uint8 len; | |
546 | uint8 cap[1]; | |
547 | } BWL_POST_PACKED_STRUCT; | |
548 | typedef struct dot11_extcap_ie dot11_extcap_ie_t; | |
549 | ||
550 | #define DOT11_EXTCAP_LEN_COEX 1 | |
551 | #define DOT11_EXTCAP_LEN_BT 3 | |
552 | #define DOT11_EXTCAP_LEN_IW 4 | |
553 | #define DOT11_EXTCAP_LEN_SI 6 | |
554 | ||
555 | #define DOT11_EXTCAP_LEN_TDLS 5 | |
556 | #define DOT11_11AC_EXTCAP_LEN_TDLS 8 | |
557 | ||
558 | #define DOT11_EXTCAP_LEN_FMS 2 | |
559 | #define DOT11_EXTCAP_LEN_PROXY_ARP 2 | |
560 | #define DOT11_EXTCAP_LEN_TFS 3 | |
561 | #define DOT11_EXTCAP_LEN_WNM_SLEEP 3 | |
562 | #define DOT11_EXTCAP_LEN_TIMBC 3 | |
563 | #define DOT11_EXTCAP_LEN_BSSTRANS 3 | |
564 | #define DOT11_EXTCAP_LEN_DMS 4 | |
565 | #define DOT11_EXTCAP_LEN_WNM_NOTIFICATION 6 | |
566 | #define DOT11_EXTCAP_LEN_TDLS_WBW 8 | |
567 | #define DOT11_EXTCAP_LEN_OPMODE_NOTIFICATION 8 | |
568 | ||
569 | /* TDLS Capabilities */ | |
570 | #define DOT11_TDLS_CAP_TDLS 37 /* TDLS support */ | |
571 | #define DOT11_TDLS_CAP_PU_BUFFER_STA 28 /* TDLS Peer U-APSD buffer STA support */ | |
572 | #define DOT11_TDLS_CAP_PEER_PSM 20 /* TDLS Peer PSM support */ | |
573 | #define DOT11_TDLS_CAP_CH_SW 30 /* TDLS Channel switch */ | |
574 | #define DOT11_TDLS_CAP_PROH 38 /* TDLS prohibited */ | |
575 | #define DOT11_TDLS_CAP_CH_SW_PROH 39 /* TDLS Channel switch prohibited */ | |
576 | #define DOT11_TDLS_CAP_TDLS_WIDER_BW 61 /* TDLS Wider Band-Width */ | |
577 | ||
578 | #define TDLS_CAP_MAX_BIT 39 /* TDLS max bit defined in ext cap */ | |
579 | ||
580 | /* 802.11h/802.11k Measurement Request/Report IEs */ | |
581 | /* Measurement Type field */ | |
582 | #define DOT11_MEASURE_TYPE_BASIC 0 /* d11 measurement basic type */ | |
583 | #define DOT11_MEASURE_TYPE_CCA 1 /* d11 measurement CCA type */ | |
584 | #define DOT11_MEASURE_TYPE_RPI 2 /* d11 measurement RPI type */ | |
585 | #define DOT11_MEASURE_TYPE_CHLOAD 3 /* d11 measurement Channel Load type */ | |
586 | #define DOT11_MEASURE_TYPE_NOISE 4 /* d11 measurement Noise Histogram type */ | |
587 | #define DOT11_MEASURE_TYPE_BEACON 5 /* d11 measurement Beacon type */ | |
588 | #define DOT11_MEASURE_TYPE_FRAME 6 /* d11 measurement Frame type */ | |
589 | #define DOT11_MEASURE_TYPE_STAT 7 /* d11 measurement STA Statistics type */ | |
590 | #define DOT11_MEASURE_TYPE_LCI 8 /* d11 measurement LCI type */ | |
591 | #define DOT11_MEASURE_TYPE_TXSTREAM 9 /* d11 measurement TX Stream type */ | |
592 | #define DOT11_MEASURE_TYPE_MCDIAGS 10 /* d11 measurement multicast diagnostics */ | |
593 | #define DOT11_MEASURE_TYPE_CIVICLOC 11 /* d11 measurement location civic */ | |
594 | #define DOT11_MEASURE_TYPE_LOC_ID 12 /* d11 measurement location identifier */ | |
595 | #define DOT11_MEASURE_TYPE_DIRCHANQ 13 /* d11 measurement dir channel quality */ | |
596 | #define DOT11_MEASURE_TYPE_DIRMEAS 14 /* d11 measurement directional */ | |
597 | #define DOT11_MEASURE_TYPE_DIRSTATS 15 /* d11 measurement directional stats */ | |
598 | #define DOT11_MEASURE_TYPE_FTMRANGE 16 /* d11 measurement Fine Timing */ | |
599 | #define DOT11_MEASURE_TYPE_PAUSE 255 /* d11 measurement pause type */ | |
600 | ||
601 | /* Measurement Request Modes */ | |
602 | #define DOT11_MEASURE_MODE_PARALLEL (1<<0) /* d11 measurement parallel */ | |
603 | #define DOT11_MEASURE_MODE_ENABLE (1<<1) /* d11 measurement enable */ | |
604 | #define DOT11_MEASURE_MODE_REQUEST (1<<2) /* d11 measurement request */ | |
605 | #define DOT11_MEASURE_MODE_REPORT (1<<3) /* d11 measurement report */ | |
606 | #define DOT11_MEASURE_MODE_DUR (1<<4) /* d11 measurement dur mandatory */ | |
607 | /* Measurement Report Modes */ | |
608 | #define DOT11_MEASURE_MODE_LATE (1<<0) /* d11 measurement late */ | |
609 | #define DOT11_MEASURE_MODE_INCAPABLE (1<<1) /* d11 measurement incapable */ | |
610 | #define DOT11_MEASURE_MODE_REFUSED (1<<2) /* d11 measurement refuse */ | |
611 | /* Basic Measurement Map bits */ | |
612 | #define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0)) /* d11 measurement basic map BSS */ | |
613 | #define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1)) /* d11 measurement map OFDM */ | |
614 | #define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2)) /* d11 measurement map unknown */ | |
615 | #define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3)) /* d11 measurement map radar */ | |
616 | #define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4)) /* d11 measurement map unmeasuremnt */ | |
617 | ||
618 | BWL_PRE_PACKED_STRUCT struct dot11_meas_req { | |
619 | uint8 id; | |
620 | uint8 len; | |
621 | uint8 token; | |
622 | uint8 mode; | |
623 | uint8 type; | |
624 | uint8 channel; | |
625 | uint8 start_time[8]; | |
626 | uint16 duration; | |
627 | } BWL_POST_PACKED_STRUCT; | |
628 | typedef struct dot11_meas_req dot11_meas_req_t; | |
629 | #define DOT11_MNG_IE_MREQ_LEN 14 /* d11 measurement request IE length */ | |
630 | /* length of Measure Request IE data not including variable len */ | |
631 | #define DOT11_MNG_IE_MREQ_FIXED_LEN 3 /* d11 measurement request IE fixed length */ | |
632 | ||
633 | BWL_PRE_PACKED_STRUCT struct dot11_meas_req_loc { | |
634 | uint8 id; | |
635 | uint8 len; | |
636 | uint8 token; | |
637 | uint8 mode; | |
638 | uint8 type; | |
639 | BWL_PRE_PACKED_STRUCT union | |
640 | { | |
641 | BWL_PRE_PACKED_STRUCT struct { | |
642 | uint8 subject; | |
643 | uint8 data[1]; | |
644 | } BWL_POST_PACKED_STRUCT lci; | |
645 | BWL_PRE_PACKED_STRUCT struct { | |
646 | uint8 subject; | |
647 | uint8 type; /* type of civic location */ | |
648 | uint8 siu; /* service interval units */ | |
649 | uint16 si; /* service interval */ | |
650 | uint8 data[1]; | |
651 | } BWL_POST_PACKED_STRUCT civic; | |
652 | BWL_PRE_PACKED_STRUCT struct { | |
653 | uint8 subject; | |
654 | uint8 siu; /* service interval units */ | |
655 | uint16 si; /* service interval */ | |
656 | uint8 data[1]; | |
657 | } BWL_POST_PACKED_STRUCT locid; | |
658 | BWL_PRE_PACKED_STRUCT struct { | |
659 | uint16 max_init_delay; /* maximum random initial delay */ | |
660 | uint8 min_ap_count; | |
661 | uint8 data[1]; | |
662 | } BWL_POST_PACKED_STRUCT ftm_range; | |
663 | } BWL_POST_PACKED_STRUCT req; | |
664 | } BWL_POST_PACKED_STRUCT; | |
665 | typedef struct dot11_meas_req_loc dot11_meas_req_loc_t; | |
666 | #define DOT11_MNG_IE_MREQ_MIN_LEN 4 /* d11 measurement report IE length */ | |
667 | #define DOT11_MNG_IE_MREQ_LCI_FIXED_LEN 4 /* d11 measurement report IE length */ | |
668 | #define DOT11_MNG_IE_MREQ_CIVIC_FIXED_LEN 8 /* d11 measurement report IE length */ | |
669 | #define DOT11_MNG_IE_MREQ_FRNG_FIXED_LEN 6 /* d11 measurement report IE length */ | |
670 | ||
671 | BWL_PRE_PACKED_STRUCT struct dot11_lci_subelement { | |
672 | uint8 subelement; | |
673 | uint8 length; | |
674 | uint8 lci_data[1]; | |
675 | } BWL_POST_PACKED_STRUCT; | |
676 | typedef struct dot11_lci_subelement dot11_lci_subelement_t; | |
677 | ||
678 | BWL_PRE_PACKED_STRUCT struct dot11_colocated_bssid_list_se { | |
679 | uint8 sub_id; | |
680 | uint8 length; | |
681 | uint8 max_bssid_ind; /* MaxBSSID Indicator */ | |
682 | struct ether_addr bssid[1]; /* variable */ | |
683 | } BWL_POST_PACKED_STRUCT; | |
684 | typedef struct dot11_colocated_bssid_list_se dot11_colocated_bssid_list_se_t; | |
685 | #define DOT11_LCI_COLOCATED_BSSID_LIST_FIXED_LEN 3 | |
686 | #define DOT11_LCI_COLOCATED_BSSID_SUBELEM_ID 7 | |
687 | ||
688 | BWL_PRE_PACKED_STRUCT struct dot11_civic_subelement { | |
689 | uint8 type; /* type of civic location */ | |
690 | uint8 subelement; | |
691 | uint8 length; | |
692 | uint8 civic_data[1]; | |
693 | } BWL_POST_PACKED_STRUCT; | |
694 | typedef struct dot11_civic_subelement dot11_civic_subelement_t; | |
695 | ||
696 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep { | |
697 | uint8 id; | |
698 | uint8 len; | |
699 | uint8 token; | |
700 | uint8 mode; | |
701 | uint8 type; | |
702 | BWL_PRE_PACKED_STRUCT union | |
703 | { | |
704 | BWL_PRE_PACKED_STRUCT struct { | |
705 | uint8 channel; | |
706 | uint8 start_time[8]; | |
707 | uint16 duration; | |
708 | uint8 map; | |
709 | } BWL_POST_PACKED_STRUCT basic; | |
710 | BWL_PRE_PACKED_STRUCT struct { | |
711 | uint8 subelement; | |
712 | uint8 length; | |
713 | uint8 data[1]; | |
714 | } BWL_POST_PACKED_STRUCT lci; | |
715 | BWL_PRE_PACKED_STRUCT struct { | |
716 | uint8 type; /* type of civic location */ | |
717 | uint8 subelement; | |
718 | uint8 length; | |
719 | uint8 data[1]; | |
720 | } BWL_POST_PACKED_STRUCT civic; | |
721 | BWL_PRE_PACKED_STRUCT struct { | |
722 | uint8 exp_tsf[8]; | |
723 | uint8 subelement; | |
724 | uint8 length; | |
725 | uint8 data[1]; | |
726 | } BWL_POST_PACKED_STRUCT locid; | |
727 | BWL_PRE_PACKED_STRUCT struct { | |
728 | uint8 entry_count; | |
729 | uint8 data[1]; | |
730 | } BWL_POST_PACKED_STRUCT ftm_range; | |
731 | uint8 data[1]; | |
732 | } BWL_POST_PACKED_STRUCT rep; | |
733 | } BWL_POST_PACKED_STRUCT; | |
734 | typedef struct dot11_meas_rep dot11_meas_rep_t; | |
735 | #define DOT11_MNG_IE_MREP_MIN_LEN 5 /* d11 measurement report IE length */ | |
736 | #define DOT11_MNG_IE_MREP_LCI_FIXED_LEN 5 /* d11 measurement report IE length */ | |
737 | #define DOT11_MNG_IE_MREP_CIVIC_FIXED_LEN 6 /* d11 measurement report IE length */ | |
738 | #define DOT11_MNG_IE_MREP_LOCID_FIXED_LEN 13 /* d11 measurement report IE length */ | |
739 | #define DOT11_MNG_IE_MREP_BASIC_FIXED_LEN 15 /* d11 measurement report IE length */ | |
740 | #define DOT11_MNG_IE_MREP_FRNG_FIXED_LEN 4 | |
741 | ||
742 | /* length of Measure Report IE data not including variable len */ | |
743 | #define DOT11_MNG_IE_MREP_FIXED_LEN 3 /* d11 measurement response IE fixed length */ | |
744 | ||
745 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep_basic { | |
746 | uint8 channel; | |
747 | uint8 start_time[8]; | |
748 | uint16 duration; | |
749 | uint8 map; | |
750 | } BWL_POST_PACKED_STRUCT; | |
751 | typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t; | |
752 | #define DOT11_MEASURE_BASIC_REP_LEN 12 /* d11 measurement basic report length */ | |
753 | ||
754 | BWL_PRE_PACKED_STRUCT struct dot11_quiet { | |
755 | uint8 id; | |
756 | uint8 len; | |
757 | uint8 count; /* TBTTs until beacon interval in quiet starts */ | |
758 | uint8 period; /* Beacon intervals between periodic quiet periods ? */ | |
759 | uint16 duration; /* Length of quiet period, in TU's */ | |
760 | uint16 offset; /* TU's offset from TBTT in Count field */ | |
761 | } BWL_POST_PACKED_STRUCT; | |
762 | typedef struct dot11_quiet dot11_quiet_t; | |
763 | ||
764 | BWL_PRE_PACKED_STRUCT struct chan_map_tuple { | |
765 | uint8 channel; | |
766 | uint8 map; | |
767 | } BWL_POST_PACKED_STRUCT; | |
768 | typedef struct chan_map_tuple chan_map_tuple_t; | |
769 | ||
770 | BWL_PRE_PACKED_STRUCT struct dot11_ibss_dfs { | |
771 | uint8 id; | |
772 | uint8 len; | |
773 | uint8 eaddr[ETHER_ADDR_LEN]; | |
774 | uint8 interval; | |
775 | chan_map_tuple_t map[1]; | |
776 | } BWL_POST_PACKED_STRUCT; | |
777 | typedef struct dot11_ibss_dfs dot11_ibss_dfs_t; | |
778 | ||
779 | /* WME Elements */ | |
780 | #define WME_OUI "\x00\x50\xf2" /* WME OUI */ | |
781 | #define WME_OUI_LEN 3 | |
782 | #define WME_OUI_TYPE 2 /* WME type */ | |
783 | #define WME_TYPE 2 /* WME type, deprecated */ | |
784 | #define WME_SUBTYPE_IE 0 /* Information Element */ | |
785 | #define WME_SUBTYPE_PARAM_IE 1 /* Parameter Element */ | |
786 | #define WME_SUBTYPE_TSPEC 2 /* Traffic Specification */ | |
787 | #define WME_VER 1 /* WME version */ | |
788 | ||
789 | /* WME Access Category Indices (ACIs) */ | |
790 | #define AC_BE 0 /* Best Effort */ | |
791 | #define AC_BK 1 /* Background */ | |
792 | #define AC_VI 2 /* Video */ | |
793 | #define AC_VO 3 /* Voice */ | |
794 | #define AC_COUNT 4 /* number of ACs */ | |
795 | ||
796 | typedef uint8 ac_bitmap_t; /* AC bitmap of (1 << AC_xx) */ | |
797 | ||
798 | #define AC_BITMAP_NONE 0x0 /* No ACs */ | |
799 | #define AC_BITMAP_ALL 0xf /* All ACs */ | |
800 | #define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0) | |
801 | #define AC_BITMAP_SET(ab, ac) (((ab) |= (1 << (ac)))) | |
802 | #define AC_BITMAP_RESET(ab, ac) (((ab) &= ~(1 << (ac)))) | |
803 | ||
804 | /* Management PKT Lifetime indices */ | |
805 | /* Removing flag checks 'BCMINTERNAL || WLTEST' | |
806 | * while merging MERGE BIS120RC4 to DINGO2 | |
807 | */ | |
808 | #define MGMT_ALL 0xffff | |
809 | #define MGMT_AUTH_LT FC_SUBTYPE_AUTH | |
810 | #define MGMT_ASSOC_LT FC_SUBTYPE_ASSOC_REQ | |
811 | ||
812 | /** WME Information Element (IE) */ | |
813 | BWL_PRE_PACKED_STRUCT struct wme_ie { | |
814 | uint8 oui[3]; | |
815 | uint8 type; | |
816 | uint8 subtype; | |
817 | uint8 version; | |
818 | uint8 qosinfo; | |
819 | } BWL_POST_PACKED_STRUCT; | |
820 | typedef struct wme_ie wme_ie_t; | |
821 | #define WME_IE_LEN 7 /* WME IE length */ | |
822 | ||
823 | BWL_PRE_PACKED_STRUCT struct edcf_acparam { | |
824 | uint8 ACI; | |
825 | uint8 ECW; | |
826 | uint16 TXOP; /* stored in network order (ls octet first) */ | |
827 | } BWL_POST_PACKED_STRUCT; | |
828 | typedef struct edcf_acparam edcf_acparam_t; | |
829 | ||
830 | /** WME Parameter Element (PE) */ | |
831 | BWL_PRE_PACKED_STRUCT struct wme_param_ie { | |
832 | uint8 oui[3]; | |
833 | uint8 type; | |
834 | uint8 subtype; | |
835 | uint8 version; | |
836 | uint8 qosinfo; | |
837 | uint8 rsvd; | |
838 | edcf_acparam_t acparam[AC_COUNT]; | |
839 | } BWL_POST_PACKED_STRUCT; | |
840 | typedef struct wme_param_ie wme_param_ie_t; | |
841 | #define WME_PARAM_IE_LEN 24 /* WME Parameter IE length */ | |
842 | ||
843 | /* QoS Info field for IE as sent from AP */ | |
844 | #define WME_QI_AP_APSD_MASK 0x80 /* U-APSD Supported mask */ | |
845 | #define WME_QI_AP_APSD_SHIFT 7 /* U-APSD Supported shift */ | |
846 | #define WME_QI_AP_COUNT_MASK 0x0f /* Parameter set count mask */ | |
847 | #define WME_QI_AP_COUNT_SHIFT 0 /* Parameter set count shift */ | |
848 | ||
849 | /* QoS Info field for IE as sent from STA */ | |
850 | #define WME_QI_STA_MAXSPLEN_MASK 0x60 /* Max Service Period Length mask */ | |
851 | #define WME_QI_STA_MAXSPLEN_SHIFT 5 /* Max Service Period Length shift */ | |
852 | #define WME_QI_STA_APSD_ALL_MASK 0xf /* APSD all AC bits mask */ | |
853 | #define WME_QI_STA_APSD_ALL_SHIFT 0 /* APSD all AC bits shift */ | |
854 | #define WME_QI_STA_APSD_BE_MASK 0x8 /* APSD AC_BE mask */ | |
855 | #define WME_QI_STA_APSD_BE_SHIFT 3 /* APSD AC_BE shift */ | |
856 | #define WME_QI_STA_APSD_BK_MASK 0x4 /* APSD AC_BK mask */ | |
857 | #define WME_QI_STA_APSD_BK_SHIFT 2 /* APSD AC_BK shift */ | |
858 | #define WME_QI_STA_APSD_VI_MASK 0x2 /* APSD AC_VI mask */ | |
859 | #define WME_QI_STA_APSD_VI_SHIFT 1 /* APSD AC_VI shift */ | |
860 | #define WME_QI_STA_APSD_VO_MASK 0x1 /* APSD AC_VO mask */ | |
861 | #define WME_QI_STA_APSD_VO_SHIFT 0 /* APSD AC_VO shift */ | |
862 | ||
863 | /* ACI */ | |
864 | #define EDCF_AIFSN_MIN 1 /* AIFSN minimum value */ | |
865 | #define EDCF_AIFSN_MAX 15 /* AIFSN maximum value */ | |
866 | #define EDCF_AIFSN_MASK 0x0f /* AIFSN mask */ | |
867 | #define EDCF_ACM_MASK 0x10 /* ACM mask */ | |
868 | #define EDCF_ACI_MASK 0x60 /* ACI mask */ | |
869 | #define EDCF_ACI_SHIFT 5 /* ACI shift */ | |
870 | #define EDCF_AIFSN_SHIFT 12 /* 4 MSB(0xFFF) in ifs_ctl for AC idx */ | |
871 | ||
872 | /* ECW */ | |
873 | #define EDCF_ECW_MIN 0 /* cwmin/cwmax exponent minimum value */ | |
874 | #define EDCF_ECW_MAX 15 /* cwmin/cwmax exponent maximum value */ | |
875 | #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1) | |
876 | #define EDCF_ECWMIN_MASK 0x0f /* cwmin exponent form mask */ | |
877 | #define EDCF_ECWMAX_MASK 0xf0 /* cwmax exponent form mask */ | |
878 | #define EDCF_ECWMAX_SHIFT 4 /* cwmax exponent form shift */ | |
879 | ||
880 | /* TXOP */ | |
881 | #define EDCF_TXOP_MIN 0 /* TXOP minimum value */ | |
882 | #define EDCF_TXOP_MAX 65535 /* TXOP maximum value */ | |
883 | #define EDCF_TXOP2USEC(txop) ((txop) << 5) | |
884 | ||
885 | /* Default BE ACI value for non-WME connection STA */ | |
886 | #define NON_EDCF_AC_BE_ACI_STA 0x02 | |
887 | ||
888 | /* Default EDCF parameters that AP advertises for STA to use; WMM draft Table 12 */ | |
889 | #define EDCF_AC_BE_ACI_STA 0x03 /* STA ACI value for best effort AC */ | |
890 | #define EDCF_AC_BE_ECW_STA 0xA4 /* STA ECW value for best effort AC */ | |
891 | #define EDCF_AC_BE_TXOP_STA 0x0000 /* STA TXOP value for best effort AC */ | |
892 | #define EDCF_AC_BK_ACI_STA 0x27 /* STA ACI value for background AC */ | |
893 | #define EDCF_AC_BK_ECW_STA 0xA4 /* STA ECW value for background AC */ | |
894 | #define EDCF_AC_BK_TXOP_STA 0x0000 /* STA TXOP value for background AC */ | |
895 | #define EDCF_AC_VI_ACI_STA 0x42 /* STA ACI value for video AC */ | |
896 | #define EDCF_AC_VI_ECW_STA 0x43 /* STA ECW value for video AC */ | |
897 | #define EDCF_AC_VI_TXOP_STA 0x005e /* STA TXOP value for video AC */ | |
898 | #define EDCF_AC_VO_ACI_STA 0x62 /* STA ACI value for audio AC */ | |
899 | #define EDCF_AC_VO_ECW_STA 0x32 /* STA ECW value for audio AC */ | |
900 | #define EDCF_AC_VO_TXOP_STA 0x002f /* STA TXOP value for audio AC */ | |
901 | ||
902 | /* Default EDCF parameters that AP uses; WMM draft Table 14 */ | |
903 | #define EDCF_AC_BE_ACI_AP 0x03 /* AP ACI value for best effort AC */ | |
904 | #define EDCF_AC_BE_ECW_AP 0x64 /* AP ECW value for best effort AC */ | |
905 | #define EDCF_AC_BE_TXOP_AP 0x0000 /* AP TXOP value for best effort AC */ | |
906 | #define EDCF_AC_BK_ACI_AP 0x27 /* AP ACI value for background AC */ | |
907 | #define EDCF_AC_BK_ECW_AP 0xA4 /* AP ECW value for background AC */ | |
908 | #define EDCF_AC_BK_TXOP_AP 0x0000 /* AP TXOP value for background AC */ | |
909 | #define EDCF_AC_VI_ACI_AP 0x41 /* AP ACI value for video AC */ | |
910 | #define EDCF_AC_VI_ECW_AP 0x43 /* AP ECW value for video AC */ | |
911 | #define EDCF_AC_VI_TXOP_AP 0x005e /* AP TXOP value for video AC */ | |
912 | #define EDCF_AC_VO_ACI_AP 0x61 /* AP ACI value for audio AC */ | |
913 | #define EDCF_AC_VO_ECW_AP 0x32 /* AP ECW value for audio AC */ | |
914 | #define EDCF_AC_VO_TXOP_AP 0x002f /* AP TXOP value for audio AC */ | |
915 | ||
916 | /** EDCA Parameter IE */ | |
917 | BWL_PRE_PACKED_STRUCT struct edca_param_ie { | |
918 | uint8 qosinfo; | |
919 | uint8 rsvd; | |
920 | edcf_acparam_t acparam[AC_COUNT]; | |
921 | } BWL_POST_PACKED_STRUCT; | |
922 | typedef struct edca_param_ie edca_param_ie_t; | |
923 | #define EDCA_PARAM_IE_LEN 18 /* EDCA Parameter IE length */ | |
924 | ||
925 | /** QoS Capability IE */ | |
926 | BWL_PRE_PACKED_STRUCT struct qos_cap_ie { | |
927 | uint8 qosinfo; | |
928 | } BWL_POST_PACKED_STRUCT; | |
929 | typedef struct qos_cap_ie qos_cap_ie_t; | |
930 | ||
931 | BWL_PRE_PACKED_STRUCT struct dot11_qbss_load_ie { | |
932 | uint8 id; /* 11, DOT11_MNG_QBSS_LOAD_ID */ | |
933 | uint8 length; | |
934 | uint16 station_count; /* total number of STAs associated */ | |
935 | uint8 channel_utilization; /* % of time, normalized to 255, QAP sensed medium busy */ | |
936 | uint16 aac; /* available admission capacity */ | |
937 | } BWL_POST_PACKED_STRUCT; | |
938 | typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t; | |
939 | #define BSS_LOAD_IE_SIZE 7 /* BSS load IE size */ | |
940 | ||
941 | #define WLC_QBSS_LOAD_CHAN_FREE_MAX 0xff /* max for channel free score */ | |
942 | ||
943 | /* Estimated Service Parameters (ESP) IE - 802.11-2016 9.4.2.174 */ | |
944 | typedef BWL_PRE_PACKED_STRUCT struct dot11_esp_ie { | |
945 | uint8 id; | |
946 | uint8 length; | |
947 | uint8 id_ext; | |
948 | /* variable len info */ | |
949 | uint8 esp_info_lists[]; | |
950 | } BWL_POST_PACKED_STRUCT dot11_esp_ie_t; | |
951 | ||
952 | #define DOT11_ESP_IE_HDR_SIZE (OFFSETOF(dot11_esp_ie_t, esp_info_lists)) | |
953 | ||
954 | /* ESP Information list - 802.11-2016 9.4.2.174 */ | |
955 | typedef BWL_PRE_PACKED_STRUCT struct dot11_esp_ie_info_list { | |
956 | /* acess category, data format, ba win size */ | |
957 | uint8 ac_df_baws; | |
958 | /* estimated air time fraction */ | |
959 | uint8 eat_frac; | |
960 | /* data PPDU duration target (50us units) */ | |
961 | uint8 ppdu_dur; | |
962 | } BWL_POST_PACKED_STRUCT dot11_esp_ie_info_list_t; | |
963 | ||
964 | #define DOT11_ESP_IE_INFO_LIST_SIZE (sizeof(dot11_esp_ie_info_list_t)) | |
965 | ||
966 | #define DOT11_ESP_NBR_INFO_LISTS 4u /* max nbr of esp information lists */ | |
967 | #define DOT11_ESP_INFO_LIST_AC_BK 0u /* access category of esp information list AC_BK */ | |
968 | #define DOT11_ESP_INFO_LIST_AC_BE 1u /* access category of esp information list AC_BE */ | |
969 | #define DOT11_ESP_INFO_LIST_AC_VI 2u /* access category of esp information list AC_VI */ | |
970 | #define DOT11_ESP_INFO_LIST_AC_VO 3u /* access category of esp information list AC_VO */ | |
971 | ||
972 | #define DOT11_ESP_INFO_LIST_DF_MASK 0x18 /* Data Format Mask */ | |
973 | #define DOT11_ESP_INFO_LIST_BAWS_MASK 0xE0 /* BA window size mask */ | |
974 | ||
975 | /* nom_msdu_size */ | |
976 | #define FIXED_MSDU_SIZE 0x8000 /* MSDU size is fixed */ | |
977 | #define MSDU_SIZE_MASK 0x7fff /* (Nominal or fixed) MSDU size */ | |
978 | ||
979 | /* surplus_bandwidth */ | |
980 | /* Represented as 3 bits of integer, binary point, 13 bits fraction */ | |
981 | #define INTEGER_SHIFT 13 /* integer shift */ | |
982 | #define FRACTION_MASK 0x1FFF /* fraction mask */ | |
983 | ||
984 | /** Management Notification Frame */ | |
985 | BWL_PRE_PACKED_STRUCT struct dot11_management_notification { | |
986 | uint8 category; /* DOT11_ACTION_NOTIFICATION */ | |
987 | uint8 action; | |
988 | uint8 token; | |
989 | uint8 status; | |
990 | uint8 data[1]; /* Elements */ | |
991 | } BWL_POST_PACKED_STRUCT; | |
992 | #define DOT11_MGMT_NOTIFICATION_LEN 4 /* Fixed length */ | |
993 | ||
994 | /** Timeout Interval IE */ | |
995 | BWL_PRE_PACKED_STRUCT struct ti_ie { | |
996 | uint8 ti_type; | |
997 | uint32 ti_val; | |
998 | } BWL_POST_PACKED_STRUCT; | |
999 | typedef struct ti_ie ti_ie_t; | |
1000 | #define TI_TYPE_REASSOC_DEADLINE 1 | |
1001 | #define TI_TYPE_KEY_LIFETIME 2 | |
1002 | ||
1003 | #ifndef CISCO_AIRONET_OUI | |
1004 | #define CISCO_AIRONET_OUI "\x00\x40\x96" /* Cisco AIRONET OUI */ | |
1005 | #endif // endif | |
1006 | /* QoS FastLane IE. */ | |
1007 | BWL_PRE_PACKED_STRUCT struct ccx_qfl_ie { | |
1008 | uint8 id; /* 221, DOT11_MNG_VS_ID */ | |
1009 | uint8 length; /* 5 */ | |
1010 | uint8 oui[3]; /* 00:40:96 */ | |
1011 | uint8 type; /* 11 */ | |
1012 | uint8 data; | |
1013 | } BWL_POST_PACKED_STRUCT; | |
1014 | typedef struct ccx_qfl_ie ccx_qfl_ie_t; | |
1015 | #define CCX_QFL_IE_TYPE 11 | |
1016 | #define CCX_QFL_ENABLE_SHIFT 5 | |
1017 | #define CCX_QFL_ENALBE (1 << CCX_QFL_ENABLE_SHIFT) | |
1018 | ||
1019 | /* WME Action Codes */ | |
1020 | #define WME_ADDTS_REQUEST 0 /* WME ADDTS request */ | |
1021 | #define WME_ADDTS_RESPONSE 1 /* WME ADDTS response */ | |
1022 | #define WME_DELTS_REQUEST 2 /* WME DELTS request */ | |
1023 | ||
1024 | /* WME Setup Response Status Codes */ | |
1025 | #define WME_ADMISSION_ACCEPTED 0 /* WME admission accepted */ | |
1026 | #define WME_INVALID_PARAMETERS 1 /* WME invalide parameters */ | |
1027 | #define WME_ADMISSION_REFUSED 3 /* WME admission refused */ | |
1028 | ||
1029 | /* Macro to take a pointer to a beacon or probe response | |
1030 | * body and return the char* pointer to the SSID info element | |
1031 | */ | |
1032 | #define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN) | |
1033 | ||
1034 | /* Authentication frame payload constants */ | |
1035 | #define DOT11_OPEN_SYSTEM 0 /* d11 open authentication */ | |
1036 | #define DOT11_SHARED_KEY 1 /* d11 shared authentication */ | |
1037 | #define DOT11_FAST_BSS 2 /* d11 fast bss authentication */ | |
1038 | #define DOT11_SAE 3 /* d11 simultaneous authentication of equals */ | |
1039 | #define DOT11_FILS_SKEY 4 /* d11 fils shared key authentication w/o pfs */ | |
1040 | #define DOT11_FILS_SKEY_PFS 5 /* d11 fils shared key authentication w/ pfs */ | |
1041 | #define DOT11_FILS_PKEY 6 /* d11 fils public key authentication */ | |
1042 | #define DOT11_CHALLENGE_LEN 128 /* d11 challenge text length */ | |
1043 | ||
1044 | /* Frame control macros */ | |
1045 | #define FC_PVER_MASK 0x3 /* PVER mask */ | |
1046 | #define FC_PVER_SHIFT 0 /* PVER shift */ | |
1047 | #define FC_TYPE_MASK 0xC /* type mask */ | |
1048 | #define FC_TYPE_SHIFT 2 /* type shift */ | |
1049 | #define FC_SUBTYPE_MASK 0xF0 /* subtype mask */ | |
1050 | #define FC_SUBTYPE_SHIFT 4 /* subtype shift */ | |
1051 | #define FC_TODS 0x100 /* to DS */ | |
1052 | #define FC_TODS_SHIFT 8 /* to DS shift */ | |
1053 | #define FC_FROMDS 0x200 /* from DS */ | |
1054 | #define FC_FROMDS_SHIFT 9 /* from DS shift */ | |
1055 | #define FC_MOREFRAG 0x400 /* more frag. */ | |
1056 | #define FC_MOREFRAG_SHIFT 10 /* more frag. shift */ | |
1057 | #define FC_RETRY 0x800 /* retry */ | |
1058 | #define FC_RETRY_SHIFT 11 /* retry shift */ | |
1059 | #define FC_PM 0x1000 /* PM */ | |
1060 | #define FC_PM_SHIFT 12 /* PM shift */ | |
1061 | #define FC_MOREDATA 0x2000 /* more data */ | |
1062 | #define FC_MOREDATA_SHIFT 13 /* more data shift */ | |
1063 | #define FC_WEP 0x4000 /* WEP */ | |
1064 | #define FC_WEP_SHIFT 14 /* WEP shift */ | |
1065 | #define FC_ORDER 0x8000 /* order */ | |
1066 | #define FC_ORDER_SHIFT 15 /* order shift */ | |
1067 | ||
1068 | /* sequence control macros */ | |
1069 | #define SEQNUM_SHIFT 4 /* seq. number shift */ | |
1070 | #define SEQNUM_MAX 0x1000 /* max seqnum + 1 */ | |
1071 | #define FRAGNUM_MASK 0xF /* frag. number mask */ | |
1072 | ||
1073 | /* Frame Control type/subtype defs */ | |
1074 | ||
1075 | /* FC Types */ | |
1076 | #define FC_TYPE_MNG 0 /* management type */ | |
1077 | #define FC_TYPE_CTL 1 /* control type */ | |
1078 | #define FC_TYPE_DATA 2 /* data type */ | |
1079 | ||
1080 | /* Management Subtypes */ | |
1081 | #define FC_SUBTYPE_ASSOC_REQ 0 /* assoc. request */ | |
1082 | #define FC_SUBTYPE_ASSOC_RESP 1 /* assoc. response */ | |
1083 | #define FC_SUBTYPE_REASSOC_REQ 2 /* reassoc. request */ | |
1084 | #define FC_SUBTYPE_REASSOC_RESP 3 /* reassoc. response */ | |
1085 | #define FC_SUBTYPE_PROBE_REQ 4 /* probe request */ | |
1086 | #define FC_SUBTYPE_PROBE_RESP 5 /* probe response */ | |
1087 | #define FC_SUBTYPE_BEACON 8 /* beacon */ | |
1088 | #define FC_SUBTYPE_ATIM 9 /* ATIM */ | |
1089 | #define FC_SUBTYPE_DISASSOC 10 /* disassoc. */ | |
1090 | #define FC_SUBTYPE_AUTH 11 /* authentication */ | |
1091 | #define FC_SUBTYPE_DEAUTH 12 /* de-authentication */ | |
1092 | #define FC_SUBTYPE_ACTION 13 /* action */ | |
1093 | #define FC_SUBTYPE_ACTION_NOACK 14 /* action no-ack */ | |
1094 | ||
1095 | /* Control Subtypes */ | |
1096 | #define FC_SUBTYPE_TRIGGER 2 /* Trigger frame */ | |
1097 | #define FC_SUBTYPE_CTL_WRAPPER 7 /* Control Wrapper */ | |
1098 | #define FC_SUBTYPE_BLOCKACK_REQ 8 /* Block Ack Req */ | |
1099 | #define FC_SUBTYPE_BLOCKACK 9 /* Block Ack */ | |
1100 | #define FC_SUBTYPE_PS_POLL 10 /* PS poll */ | |
1101 | #define FC_SUBTYPE_RTS 11 /* RTS */ | |
1102 | #define FC_SUBTYPE_CTS 12 /* CTS */ | |
1103 | #define FC_SUBTYPE_ACK 13 /* ACK */ | |
1104 | #define FC_SUBTYPE_CF_END 14 /* CF-END */ | |
1105 | #define FC_SUBTYPE_CF_END_ACK 15 /* CF-END ACK */ | |
1106 | ||
1107 | /* Data Subtypes */ | |
1108 | #define FC_SUBTYPE_DATA 0 /* Data */ | |
1109 | #define FC_SUBTYPE_DATA_CF_ACK 1 /* Data + CF-ACK */ | |
1110 | #define FC_SUBTYPE_DATA_CF_POLL 2 /* Data + CF-Poll */ | |
1111 | #define FC_SUBTYPE_DATA_CF_ACK_POLL 3 /* Data + CF-Ack + CF-Poll */ | |
1112 | #define FC_SUBTYPE_NULL 4 /* Null */ | |
1113 | #define FC_SUBTYPE_CF_ACK 5 /* CF-Ack */ | |
1114 | #define FC_SUBTYPE_CF_POLL 6 /* CF-Poll */ | |
1115 | #define FC_SUBTYPE_CF_ACK_POLL 7 /* CF-Ack + CF-Poll */ | |
1116 | #define FC_SUBTYPE_QOS_DATA 8 /* QoS Data */ | |
1117 | #define FC_SUBTYPE_QOS_DATA_CF_ACK 9 /* QoS Data + CF-Ack */ | |
1118 | #define FC_SUBTYPE_QOS_DATA_CF_POLL 10 /* QoS Data + CF-Poll */ | |
1119 | #define FC_SUBTYPE_QOS_DATA_CF_ACK_POLL 11 /* QoS Data + CF-Ack + CF-Poll */ | |
1120 | #define FC_SUBTYPE_QOS_NULL 12 /* QoS Null */ | |
1121 | #define FC_SUBTYPE_QOS_CF_POLL 14 /* QoS CF-Poll */ | |
1122 | #define FC_SUBTYPE_QOS_CF_ACK_POLL 15 /* QoS CF-Ack + CF-Poll */ | |
1123 | ||
1124 | /* Data Subtype Groups */ | |
1125 | #define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0) | |
1126 | #define FC_SUBTYPE_ANY_NULL(s) (((s) & 4) != 0) | |
1127 | #define FC_SUBTYPE_ANY_CF_POLL(s) (((s) & 2) != 0) | |
1128 | #define FC_SUBTYPE_ANY_CF_ACK(s) (((s) & 1) != 0) | |
1129 | #define FC_SUBTYPE_ANY_PSPOLL(s) (((s) & 10) != 0) | |
1130 | ||
1131 | /* Type/Subtype Combos */ | |
1132 | #define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK) /* FC kind mask */ | |
1133 | ||
1134 | #define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT)) /* FC kind */ | |
1135 | ||
1136 | #define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT) /* Subtype from FC */ | |
1137 | #define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT) /* Type from FC */ | |
1138 | ||
1139 | #define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ) /* assoc. request */ | |
1140 | #define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP) /* assoc. response */ | |
1141 | #define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ) /* reassoc. request */ | |
1142 | #define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP) /* reassoc. response */ | |
1143 | #define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ) /* probe request */ | |
1144 | #define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP) /* probe response */ | |
1145 | #define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON) /* beacon */ | |
1146 | #define FC_ATIM FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ATIM) /* ATIM */ | |
1147 | #define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC) /* disassoc */ | |
1148 | #define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH) /* authentication */ | |
1149 | #define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH) /* deauthentication */ | |
1150 | #define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION) /* action */ | |
1151 | #define FC_ACTION_NOACK FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION_NOACK) /* action no-ack */ | |
1152 | ||
1153 | #define FC_CTL_TRIGGER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_TRIGGER) /* Trigger frame */ | |
1154 | #define FC_CTL_WRAPPER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTL_WRAPPER) /* Control Wrapper */ | |
1155 | #define FC_BLOCKACK_REQ FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK_REQ) /* Block Ack Req */ | |
1156 | #define FC_BLOCKACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK) /* Block Ack */ | |
1157 | #define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL) /* PS poll */ | |
1158 | #define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS) /* RTS */ | |
1159 | #define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS) /* CTS */ | |
1160 | #define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK) /* ACK */ | |
1161 | #define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END) /* CF-END */ | |
1162 | #define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK) /* CF-END ACK */ | |
1163 | ||
1164 | #define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA) /* data */ | |
1165 | #define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL) /* null data */ | |
1166 | #define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK) /* data CF ACK */ | |
1167 | #define FC_QOS_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA) /* QoS data */ | |
1168 | #define FC_QOS_NULL FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL) /* QoS null */ | |
1169 | ||
1170 | /* QoS Control Field */ | |
1171 | ||
1172 | /* 802.1D Priority */ | |
1173 | #define QOS_PRIO_SHIFT 0 /* QoS priority shift */ | |
1174 | #define QOS_PRIO_MASK 0x0007 /* QoS priority mask */ | |
1175 | #define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT) /* QoS priority */ | |
1176 | ||
1177 | /* Traffic Identifier */ | |
1178 | #define QOS_TID_SHIFT 0 /* QoS TID shift */ | |
1179 | #define QOS_TID_MASK 0x000f /* QoS TID mask */ | |
1180 | #define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT) /* QoS TID */ | |
1181 | ||
1182 | /* End of Service Period (U-APSD) */ | |
1183 | #define QOS_EOSP_SHIFT 4 /* QoS End of Service Period shift */ | |
1184 | #define QOS_EOSP_MASK 0x0010 /* QoS End of Service Period mask */ | |
1185 | #define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT) /* Qos EOSP */ | |
1186 | ||
1187 | /* Ack Policy */ | |
1188 | #define QOS_ACK_NORMAL_ACK 0 /* Normal Ack */ | |
1189 | #define QOS_ACK_NO_ACK 1 /* No Ack (eg mcast) */ | |
1190 | #define QOS_ACK_NO_EXP_ACK 2 /* No Explicit Ack */ | |
1191 | #define QOS_ACK_BLOCK_ACK 3 /* Block Ack */ | |
1192 | #define QOS_ACK_SHIFT 5 /* QoS ACK shift */ | |
1193 | #define QOS_ACK_MASK 0x0060 /* QoS ACK mask */ | |
1194 | #define QOS_ACK(qos) (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT) /* QoS ACK */ | |
1195 | ||
1196 | /* A-MSDU flag */ | |
1197 | #define QOS_AMSDU_SHIFT 7 /* AMSDU shift */ | |
1198 | #define QOS_AMSDU_MASK 0x0080 /* AMSDU mask */ | |
1199 | ||
1200 | /* Management Frames */ | |
1201 | ||
1202 | /* Management Frame Constants */ | |
1203 | ||
1204 | /* Fixed fields */ | |
1205 | #define DOT11_MNG_AUTH_ALGO_LEN 2 /* d11 management auth. algo. length */ | |
1206 | #define DOT11_MNG_AUTH_SEQ_LEN 2 /* d11 management auth. seq. length */ | |
1207 | #define DOT11_MNG_BEACON_INT_LEN 2 /* d11 management beacon interval length */ | |
1208 | #define DOT11_MNG_CAP_LEN 2 /* d11 management cap. length */ | |
1209 | #define DOT11_MNG_AP_ADDR_LEN 6 /* d11 management AP address length */ | |
1210 | #define DOT11_MNG_LISTEN_INT_LEN 2 /* d11 management listen interval length */ | |
1211 | #define DOT11_MNG_REASON_LEN 2 /* d11 management reason length */ | |
1212 | #define DOT11_MNG_AID_LEN 2 /* d11 management AID length */ | |
1213 | #define DOT11_MNG_STATUS_LEN 2 /* d11 management status length */ | |
1214 | #define DOT11_MNG_TIMESTAMP_LEN 8 /* d11 management timestamp length */ | |
1215 | ||
1216 | /* DUR/ID field in assoc resp is 0xc000 | AID */ | |
1217 | #define DOT11_AID_MASK 0x3fff /* d11 AID mask */ | |
1218 | ||
1219 | /* Reason Codes */ | |
1220 | #define DOT11_RC_RESERVED 0 /* d11 RC reserved */ | |
1221 | #define DOT11_RC_UNSPECIFIED 1 /* Unspecified reason */ | |
1222 | #define DOT11_RC_AUTH_INVAL 2 /* Previous authentication no longer valid */ | |
1223 | #define DOT11_RC_DEAUTH_LEAVING 3 /* Deauthenticated because sending station | |
1224 | * is leaving (or has left) IBSS or ESS | |
1225 | */ | |
1226 | #define DOT11_RC_INACTIVITY 4 /* Disassociated due to inactivity */ | |
1227 | #define DOT11_RC_BUSY 5 /* Disassociated because AP is unable to handle | |
1228 | * all currently associated stations | |
1229 | */ | |
1230 | #define DOT11_RC_INVAL_CLASS_2 6 /* Class 2 frame received from | |
1231 | * nonauthenticated station | |
1232 | */ | |
1233 | #define DOT11_RC_INVAL_CLASS_3 7 /* Class 3 frame received from | |
1234 | * nonassociated station | |
1235 | */ | |
1236 | #define DOT11_RC_DISASSOC_LEAVING 8 /* Disassociated because sending station is | |
1237 | * leaving (or has left) BSS | |
1238 | */ | |
1239 | #define DOT11_RC_NOT_AUTH 9 /* Station requesting (re)association is not | |
1240 | * authenticated with responding station | |
1241 | */ | |
1242 | #define DOT11_RC_BAD_PC 10 /* Unacceptable power capability element */ | |
1243 | #define DOT11_RC_BAD_CHANNELS 11 /* Unacceptable supported channels element */ | |
1244 | ||
1245 | /* 12 is unused by STA but could be used by AP/GO */ | |
1246 | #define DOT11_RC_DISASSOC_BTM 12 /* Disassociated due to BSS Transition Magmt */ | |
1247 | ||
1248 | /* 32-39 are QSTA specific reasons added in 11e */ | |
1249 | #define DOT11_RC_UNSPECIFIED_QOS 32 /* unspecified QoS-related reason */ | |
1250 | #define DOT11_RC_INSUFFCIENT_BW 33 /* QAP lacks sufficient bandwidth */ | |
1251 | #define DOT11_RC_EXCESSIVE_FRAMES 34 /* excessive number of frames need ack */ | |
1252 | #define DOT11_RC_TX_OUTSIDE_TXOP 35 /* transmitting outside the limits of txop */ | |
1253 | #define DOT11_RC_LEAVING_QBSS 36 /* QSTA is leaving the QBSS (or restting) */ | |
1254 | #define DOT11_RC_BAD_MECHANISM 37 /* does not want to use the mechanism */ | |
1255 | #define DOT11_RC_SETUP_NEEDED 38 /* mechanism needs a setup */ | |
1256 | #define DOT11_RC_TIMEOUT 39 /* timeout */ | |
1257 | ||
1258 | #define DOT11_RC_MESH_PEERING_CANCELLED 52 | |
1259 | #define DOT11_RC_MESH_MAX_PEERS 53 | |
1260 | #define DOT11_RC_MESH_CONFIG_POLICY_VIOLN 54 | |
1261 | #define DOT11_RC_MESH_CLOSE_RECVD 55 | |
1262 | #define DOT11_RC_MESH_MAX_RETRIES 56 | |
1263 | #define DOT11_RC_MESH_CONFIRM_TIMEOUT 57 | |
1264 | #define DOT11_RC_MESH_INVALID_GTK 58 | |
1265 | #define DOT11_RC_MESH_INCONSISTENT_PARAMS 59 | |
1266 | ||
1267 | #define DOT11_RC_MESH_INVALID_SEC_CAP 60 | |
1268 | #define DOT11_RC_MESH_PATHERR_NOPROXYINFO 61 | |
1269 | #define DOT11_RC_MESH_PATHERR_NOFWINFO 62 | |
1270 | #define DOT11_RC_MESH_PATHERR_DSTUNREACH 63 | |
1271 | #define DOT11_RC_MESH_MBSSMAC_EXISTS 64 | |
1272 | #define DOT11_RC_MESH_CHANSWITCH_REGREQ 65 | |
1273 | #define DOT11_RC_MESH_CHANSWITCH_UNSPEC 66 | |
1274 | ||
1275 | #define DOT11_RC_MAX 66 /* Reason codes > 66 are reserved */ | |
1276 | ||
1277 | #define DOT11_RC_TDLS_PEER_UNREACH 25 | |
1278 | #define DOT11_RC_TDLS_DOWN_UNSPECIFIED 26 | |
1279 | ||
1280 | /* Status Codes */ | |
1281 | #define DOT11_SC_SUCCESS 0 /* Successful */ | |
1282 | #define DOT11_SC_FAILURE 1 /* Unspecified failure */ | |
1283 | #define DOT11_SC_TDLS_WAKEUP_SCH_ALT 2 /* TDLS wakeup schedule rejected but alternative */ | |
1284 | /* schedule provided */ | |
1285 | #define DOT11_SC_TDLS_WAKEUP_SCH_REJ 3 /* TDLS wakeup schedule rejected */ | |
1286 | #define DOT11_SC_TDLS_SEC_DISABLED 5 /* TDLS Security disabled */ | |
1287 | #define DOT11_SC_LIFETIME_REJ 6 /* Unacceptable lifetime */ | |
1288 | #define DOT11_SC_NOT_SAME_BSS 7 /* Not in same BSS */ | |
1289 | #define DOT11_SC_CAP_MISMATCH 10 /* Cannot support all requested | |
1290 | * capabilities in the Capability | |
1291 | * Information field | |
1292 | */ | |
1293 | #define DOT11_SC_REASSOC_FAIL 11 /* Reassociation denied due to inability | |
1294 | * to confirm that association exists | |
1295 | */ | |
1296 | #define DOT11_SC_ASSOC_FAIL 12 /* Association denied due to reason | |
1297 | * outside the scope of this standard | |
1298 | */ | |
1299 | #define DOT11_SC_AUTH_MISMATCH 13 /* Responding station does not support | |
1300 | * the specified authentication | |
1301 | * algorithm | |
1302 | */ | |
1303 | #define DOT11_SC_AUTH_SEQ 14 /* Received an Authentication frame | |
1304 | * with authentication transaction | |
1305 | * sequence number out of expected | |
1306 | * sequence | |
1307 | */ | |
1308 | #define DOT11_SC_AUTH_CHALLENGE_FAIL 15 /* Authentication rejected because of | |
1309 | * challenge failure | |
1310 | */ | |
1311 | #define DOT11_SC_AUTH_TIMEOUT 16 /* Authentication rejected due to timeout | |
1312 | * waiting for next frame in sequence | |
1313 | */ | |
1314 | #define DOT11_SC_ASSOC_BUSY_FAIL 17 /* Association denied because AP is | |
1315 | * unable to handle additional | |
1316 | * associated stations | |
1317 | */ | |
1318 | #define DOT11_SC_ASSOC_RATE_MISMATCH 18 /* Association denied due to requesting | |
1319 | * station not supporting all of the | |
1320 | * data rates in the BSSBasicRateSet | |
1321 | * parameter | |
1322 | */ | |
1323 | #define DOT11_SC_ASSOC_SHORT_REQUIRED 19 /* Association denied due to requesting | |
1324 | * station not supporting the Short | |
1325 | * Preamble option | |
1326 | */ | |
1327 | #define DOT11_SC_ASSOC_PBCC_REQUIRED 20 /* Association denied due to requesting | |
1328 | * station not supporting the PBCC | |
1329 | * Modulation option | |
1330 | */ | |
1331 | #define DOT11_SC_ASSOC_AGILITY_REQUIRED 21 /* Association denied due to requesting | |
1332 | * station not supporting the Channel | |
1333 | * Agility option | |
1334 | */ | |
1335 | #define DOT11_SC_ASSOC_SPECTRUM_REQUIRED 22 /* Association denied because Spectrum | |
1336 | * Management capability is required. | |
1337 | */ | |
1338 | #define DOT11_SC_ASSOC_BAD_POWER_CAP 23 /* Association denied because the info | |
1339 | * in the Power Cap element is | |
1340 | * unacceptable. | |
1341 | */ | |
1342 | #define DOT11_SC_ASSOC_BAD_SUP_CHANNELS 24 /* Association denied because the info | |
1343 | * in the Supported Channel element is | |
1344 | * unacceptable | |
1345 | */ | |
1346 | #define DOT11_SC_ASSOC_SHORTSLOT_REQUIRED 25 /* Association denied due to requesting | |
1347 | * station not supporting the Short Slot | |
1348 | * Time option | |
1349 | */ | |
1350 | #define DOT11_SC_ASSOC_DSSSOFDM_REQUIRED 26 /* Association denied because requesting station | |
1351 | * does not support the DSSS-OFDM option | |
1352 | */ | |
1353 | #define DOT11_SC_ASSOC_HT_REQUIRED 27 /* Association denied because the requesting | |
1354 | * station does not support HT features | |
1355 | */ | |
1356 | #define DOT11_SC_ASSOC_R0KH_UNREACHABLE 28 /* Association denied due to AP | |
1357 | * being unable to reach the R0 Key Holder | |
1358 | */ | |
1359 | #define DOT11_SC_ASSOC_TRY_LATER 30 /* Association denied temporarily, try again later | |
1360 | */ | |
1361 | #define DOT11_SC_ASSOC_MFP_VIOLATION 31 /* Association denied due to Robust Management | |
1362 | * frame policy violation | |
1363 | */ | |
1364 | ||
1365 | #define DOT11_SC_DECLINED 37 /* request declined */ | |
1366 | #define DOT11_SC_INVALID_PARAMS 38 /* One or more params have invalid values */ | |
1367 | #define DOT11_SC_INVALID_PAIRWISE_CIPHER 42 /* invalid pairwise cipher */ | |
1368 | #define DOT11_SC_INVALID_AKMP 43 /* Association denied due to invalid AKMP */ | |
1369 | #define DOT11_SC_INVALID_RSNIE_CAP 45 /* invalid RSN IE capabilities */ | |
1370 | #define DOT11_SC_DLS_NOT_ALLOWED 48 /* DLS is not allowed in the BSS by policy */ | |
1371 | #define DOT11_SC_INVALID_PMKID 53 /* Association denied due to invalid PMKID */ | |
1372 | #define DOT11_SC_INVALID_MDID 54 /* Association denied due to invalid MDID */ | |
1373 | #define DOT11_SC_INVALID_FTIE 55 /* Association denied due to invalid FTIE */ | |
1374 | ||
1375 | #define DOT11_SC_ADV_PROTO_NOT_SUPPORTED 59 /* ad proto not supported */ | |
1376 | #define DOT11_SC_NO_OUTSTAND_REQ 60 /* no outstanding req */ | |
1377 | #define DOT11_SC_RSP_NOT_RX_FROM_SERVER 61 /* no response from server */ | |
1378 | #define DOT11_SC_TIMEOUT 62 /* timeout */ | |
1379 | #define DOT11_SC_QUERY_RSP_TOO_LARGE 63 /* query rsp too large */ | |
1380 | #define DOT11_SC_SERVER_UNREACHABLE 65 /* server unreachable */ | |
1381 | ||
1382 | #define DOT11_SC_UNEXP_MSG 70 /* Unexpected message */ | |
1383 | #define DOT11_SC_INVALID_SNONCE 71 /* Invalid SNonce */ | |
1384 | #define DOT11_SC_INVALID_RSNIE 72 /* Invalid contents of RSNIE */ | |
1385 | ||
1386 | #define DOT11_SC_ANTICLOG_TOCKEN_REQUIRED 76 /* Anti-clogging tocken required */ | |
1387 | #define DOT11_SC_INVALID_FINITE_CYCLIC_GRP 77 /* Invalid contents of RSNIE */ | |
1388 | ||
1389 | #define DOT11_SC_ASSOC_VHT_REQUIRED 104 /* Association denied because the requesting | |
1390 | * station does not support VHT features. | |
1391 | */ | |
1392 | ||
1393 | #define DOT11_SC_TRANSMIT_FAILURE 79 /* transmission failure */ | |
1394 | ||
1395 | /* Info Elts, length of INFORMATION portion of Info Elts */ | |
1396 | #define DOT11_MNG_DS_PARAM_LEN 1 /* d11 management DS parameter length */ | |
1397 | #define DOT11_MNG_IBSS_PARAM_LEN 2 /* d11 management IBSS parameter length */ | |
1398 | ||
1399 | /* TIM Info element has 3 bytes fixed info in INFORMATION field, | |
1400 | * followed by 1 to 251 bytes of Partial Virtual Bitmap | |
1401 | */ | |
1402 | #define DOT11_MNG_TIM_FIXED_LEN 3 /* d11 management TIM fixed length */ | |
1403 | #define DOT11_MNG_TIM_DTIM_COUNT 0 /* d11 management DTIM count */ | |
1404 | #define DOT11_MNG_TIM_DTIM_PERIOD 1 /* d11 management DTIM period */ | |
1405 | #define DOT11_MNG_TIM_BITMAP_CTL 2 /* d11 management TIM BITMAP control */ | |
1406 | #define DOT11_MNG_TIM_PVB 3 /* d11 management TIM PVB */ | |
1407 | ||
1408 | /* TLV defines */ | |
1409 | #define TLV_TAG_OFF 0 /* tag offset */ | |
1410 | #define TLV_LEN_OFF 1 /* length offset */ | |
1411 | #define TLV_HDR_LEN 2 /* header length */ | |
1412 | #define TLV_BODY_OFF 2 /* body offset */ | |
1413 | #define TLV_BODY_LEN_MAX 255 /* max body length */ | |
1414 | ||
1415 | /* Management Frame Information Element IDs */ | |
1416 | #define DOT11_MNG_SSID_ID 0 /* d11 management SSID id */ | |
1417 | #define DOT11_MNG_RATES_ID 1 /* d11 management rates id */ | |
1418 | #define DOT11_MNG_FH_PARMS_ID 2 /* d11 management FH parameter id */ | |
1419 | #define DOT11_MNG_DS_PARMS_ID 3 /* d11 management DS parameter id */ | |
1420 | #define DOT11_MNG_CF_PARMS_ID 4 /* d11 management CF parameter id */ | |
1421 | #define DOT11_MNG_TIM_ID 5 /* d11 management TIM id */ | |
1422 | #define DOT11_MNG_IBSS_PARMS_ID 6 /* d11 management IBSS parameter id */ | |
1423 | #define DOT11_MNG_COUNTRY_ID 7 /* d11 management country id */ | |
1424 | #define DOT11_MNG_HOPPING_PARMS_ID 8 /* d11 management hopping parameter id */ | |
1425 | #define DOT11_MNG_HOPPING_TABLE_ID 9 /* d11 management hopping table id */ | |
1426 | #define DOT11_MNG_FTM_SYNC_INFO_ID 9 /* 11mc D4.3 */ | |
1427 | #define DOT11_MNG_REQUEST_ID 10 /* d11 management request id */ | |
1428 | #define DOT11_MNG_QBSS_LOAD_ID 11 /* d11 management QBSS Load id */ | |
1429 | #define DOT11_MNG_EDCA_PARAM_ID 12 /* 11E EDCA Parameter id */ | |
1430 | #define DOT11_MNG_TSPEC_ID 13 /* d11 management TSPEC id */ | |
1431 | #define DOT11_MNG_TCLAS_ID 14 /* d11 management TCLAS id */ | |
1432 | #define DOT11_MNG_CHALLENGE_ID 16 /* d11 management chanllenge id */ | |
1433 | #define DOT11_MNG_PWR_CONSTRAINT_ID 32 /* 11H PowerConstraint */ | |
1434 | #define DOT11_MNG_PWR_CAP_ID 33 /* 11H PowerCapability */ | |
1435 | #define DOT11_MNG_TPC_REQUEST_ID 34 /* 11H TPC Request */ | |
1436 | #define DOT11_MNG_TPC_REPORT_ID 35 /* 11H TPC Report */ | |
1437 | #define DOT11_MNG_SUPP_CHANNELS_ID 36 /* 11H Supported Channels */ | |
1438 | #define DOT11_MNG_CHANNEL_SWITCH_ID 37 /* 11H ChannelSwitch Announcement */ | |
1439 | #define DOT11_MNG_MEASURE_REQUEST_ID 38 /* 11H MeasurementRequest */ | |
1440 | #define DOT11_MNG_MEASURE_REPORT_ID 39 /* 11H MeasurementReport */ | |
1441 | #define DOT11_MNG_QUIET_ID 40 /* 11H Quiet */ | |
1442 | #define DOT11_MNG_IBSS_DFS_ID 41 /* 11H IBSS_DFS */ | |
1443 | #define DOT11_MNG_ERP_ID 42 /* d11 management ERP id */ | |
1444 | #define DOT11_MNG_TS_DELAY_ID 43 /* d11 management TS Delay id */ | |
1445 | #define DOT11_MNG_TCLAS_PROC_ID 44 /* d11 management TCLAS processing id */ | |
1446 | #define DOT11_MNG_HT_CAP 45 /* d11 mgmt HT cap id */ | |
1447 | #define DOT11_MNG_QOS_CAP_ID 46 /* 11E QoS Capability id */ | |
1448 | #define DOT11_MNG_NONERP_ID 47 /* d11 management NON-ERP id */ | |
1449 | #define DOT11_MNG_RSN_ID 48 /* d11 management RSN id */ | |
1450 | #define DOT11_MNG_EXT_RATES_ID 50 /* d11 management ext. rates id */ | |
1451 | #define DOT11_MNG_AP_CHREP_ID 51 /* 11k AP Channel report id */ | |
1452 | #define DOT11_MNG_NEIGHBOR_REP_ID 52 /* 11k & 11v Neighbor report id */ | |
1453 | #define DOT11_MNG_RCPI_ID 53 /* 11k RCPI */ | |
1454 | #define DOT11_MNG_MDIE_ID 54 /* 11r Mobility domain id */ | |
1455 | #define DOT11_MNG_FTIE_ID 55 /* 11r Fast Bss Transition id */ | |
1456 | #define DOT11_MNG_FT_TI_ID 56 /* 11r Timeout Interval id */ | |
1457 | #define DOT11_MNG_RDE_ID 57 /* 11r RIC Data Element id */ | |
1458 | #define DOT11_MNG_REGCLASS_ID 59 /* d11 management regulatory class id */ | |
1459 | #define DOT11_MNG_EXT_CSA_ID 60 /* d11 Extended CSA */ | |
1460 | #define DOT11_MNG_HT_ADD 61 /* d11 mgmt additional HT info */ | |
1461 | #define DOT11_MNG_EXT_CHANNEL_OFFSET 62 /* d11 mgmt ext channel offset */ | |
1462 | #define DOT11_MNG_BSS_AVR_ACCESS_DELAY_ID 63 /* 11k bss average access delay */ | |
1463 | #define DOT11_MNG_ANTENNA_ID 64 /* 11k antenna id */ | |
1464 | #define DOT11_MNG_RSNI_ID 65 /* 11k RSNI id */ | |
1465 | #define DOT11_MNG_MEASUREMENT_PILOT_TX_ID 66 /* 11k measurement pilot tx info id */ | |
1466 | #define DOT11_MNG_BSS_AVAL_ADMISSION_CAP_ID 67 /* 11k bss aval admission cap id */ | |
1467 | #define DOT11_MNG_BSS_AC_ACCESS_DELAY_ID 68 /* 11k bss AC access delay id */ | |
1468 | #define DOT11_MNG_WAPI_ID 68 /* d11 management WAPI id */ | |
1469 | #define DOT11_MNG_TIME_ADVERTISE_ID 69 /* 11p time advertisement */ | |
1470 | #define DOT11_MNG_RRM_CAP_ID 70 /* 11k radio measurement capability */ | |
1471 | #define DOT11_MNG_MULTIPLE_BSSID_ID 71 /* 11k multiple BSSID id */ | |
1472 | #define DOT11_MNG_HT_BSS_COEXINFO_ID 72 /* d11 mgmt OBSS Coexistence INFO */ | |
1473 | #define DOT11_MNG_HT_BSS_CHANNEL_REPORT_ID 73 /* d11 mgmt OBSS Intolerant Channel list */ | |
1474 | #define DOT11_MNG_HT_OBSS_ID 74 /* d11 mgmt OBSS HT info */ | |
1475 | #define DOT11_MNG_MMIE_ID 76 /* d11 mgmt MIC IE */ | |
1476 | #define DOT11_MNG_FMS_DESCR_ID 86 /* 11v FMS descriptor */ | |
1477 | #define DOT11_MNG_FMS_REQ_ID 87 /* 11v FMS request id */ | |
1478 | #define DOT11_MNG_FMS_RESP_ID 88 /* 11v FMS response id */ | |
1479 | #define DOT11_MNG_BSS_MAX_IDLE_PERIOD_ID 90 /* 11v bss max idle id */ | |
1480 | #define DOT11_MNG_TFS_REQUEST_ID 91 /* 11v tfs request id */ | |
1481 | #define DOT11_MNG_TFS_RESPONSE_ID 92 /* 11v tfs response id */ | |
1482 | #define DOT11_MNG_WNM_SLEEP_MODE_ID 93 /* 11v wnm-sleep mode id */ | |
1483 | #define DOT11_MNG_TIMBC_REQ_ID 94 /* 11v TIM broadcast request id */ | |
1484 | #define DOT11_MNG_TIMBC_RESP_ID 95 /* 11v TIM broadcast response id */ | |
1485 | #define DOT11_MNG_CHANNEL_USAGE 97 /* 11v channel usage */ | |
1486 | #define DOT11_MNG_TIME_ZONE_ID 98 /* 11v time zone */ | |
1487 | #define DOT11_MNG_DMS_REQUEST_ID 99 /* 11v dms request id */ | |
1488 | #define DOT11_MNG_DMS_RESPONSE_ID 100 /* 11v dms response id */ | |
1489 | #define DOT11_MNG_LINK_IDENTIFIER_ID 101 /* 11z TDLS Link Identifier IE */ | |
1490 | #define DOT11_MNG_WAKEUP_SCHEDULE_ID 102 /* 11z TDLS Wakeup Schedule IE */ | |
1491 | #define DOT11_MNG_CHANNEL_SWITCH_TIMING_ID 104 /* 11z TDLS Channel Switch Timing IE */ | |
1492 | #define DOT11_MNG_PTI_CONTROL_ID 105 /* 11z TDLS PTI Control IE */ | |
1493 | #define DOT11_MNG_PU_BUFFER_STATUS_ID 106 /* 11z TDLS PU Buffer Status IE */ | |
1494 | #define DOT11_MNG_INTERWORKING_ID 107 /* 11u interworking */ | |
1495 | #define DOT11_MNG_ADVERTISEMENT_ID 108 /* 11u advertisement protocol */ | |
1496 | #define DOT11_MNG_EXP_BW_REQ_ID 109 /* 11u expedited bandwith request */ | |
1497 | #define DOT11_MNG_QOS_MAP_ID 110 /* 11u QoS map set */ | |
1498 | #define DOT11_MNG_ROAM_CONSORT_ID 111 /* 11u roaming consortium */ | |
1499 | #define DOT11_MNG_EMERGCY_ALERT_ID 112 /* 11u emergency alert identifier */ | |
1500 | #define DOT11_MNG_MESH_CONFIG 113 /* Mesh Configuration */ | |
1501 | #define DOT11_MNG_MESH_ID 114 /* Mesh ID */ | |
1502 | #define DOT11_MNG_MESH_PEER_MGMT_ID 117 /* Mesh PEER MGMT IE */ | |
1503 | #define DOT11_MNG_EXT_CAP_ID 127 /* d11 mgmt ext capability */ | |
1504 | #define DOT11_MNG_EXT_PREQ_ID 130 /* Mesh PREQ IE */ | |
1505 | #define DOT11_MNG_EXT_PREP_ID 131 /* Mesh PREP IE */ | |
1506 | #define DOT11_MNG_EXT_PERR_ID 132 /* Mesh PERR IE */ | |
1507 | #define DOT11_MNG_VHT_CAP_ID 191 /* d11 mgmt VHT cap id */ | |
1508 | #define DOT11_MNG_VHT_OPERATION_ID 192 /* d11 mgmt VHT op id */ | |
1509 | #define DOT11_MNG_EXT_BSSLOAD_ID 193 /* d11 mgmt VHT extended bss load id */ | |
1510 | #define DOT11_MNG_WIDE_BW_CHANNEL_SWITCH_ID 194 /* Wide BW Channel Switch IE */ | |
1511 | #define DOT11_MNG_VHT_TRANSMIT_POWER_ENVELOPE_ID 195 /* VHT transmit Power Envelope IE */ | |
1512 | #define DOT11_MNG_CHANNEL_SWITCH_WRAPPER_ID 196 /* Channel Switch Wrapper IE */ | |
1513 | #define DOT11_MNG_AID_ID 197 /* Association ID IE */ | |
1514 | #define DOT11_MNG_OPER_MODE_NOTIF_ID 199 /* d11 mgmt VHT oper mode notif */ | |
1515 | #define DOT11_MNG_RNR_ID 201 | |
1516 | #define DOT11_MNG_FTM_PARAMS_ID 206 | |
1517 | #define DOT11_MNG_TWT_ID 216 /* 11ah D5.0 */ | |
1518 | #define DOT11_MNG_WPA_ID 221 /* d11 management WPA id */ | |
1519 | #define DOT11_MNG_PROPR_ID 221 | |
1520 | /* should start using this one instead of above two */ | |
1521 | #define DOT11_MNG_VS_ID 221 /* d11 management Vendor Specific IE */ | |
1522 | #define DOT11_MNG_MESH_CSP_ID 222 /* d11 Mesh Channel Switch Parameter */ | |
1523 | #define DOT11_MNG_FILS_IND_ID 240 /* 11ai FILS Indication element */ | |
1524 | #define DOT11_MNG_FRAGMENT_ID 242 /* IE's fragment ID */ | |
1525 | ||
1526 | /* The follwing ID extensions should be defined >= 255 | |
1527 | * i.e. the values should include 255 (DOT11_MNG_ID_EXT_ID + ID Extension). | |
1528 | */ | |
1529 | #define DOT11_MNG_ID_EXT_ID 255 /* Element ID Extension 11mc D4.3 */ | |
1530 | #define EXT_MNG_OWE_DH_PARAM_ID 32u /* OWE DH Param ID - RFC 8110 */ | |
1531 | #define DOT11_MNG_OWE_DH_PARAM_ID (DOT11_MNG_ID_EXT_ID + EXT_MNG_OWE_DH_PARAM_ID) | |
1532 | #define EXT_MNG_HE_CAP_ID 35u /* HE Capabilities, 11ax */ | |
1533 | #define DOT11_MNG_HE_CAP_ID (DOT11_MNG_ID_EXT_ID + EXT_MNG_HE_CAP_ID) | |
1534 | #define EXT_MNG_HE_OP_ID 36u /* HE Operation IE, 11ax */ | |
1535 | #define DOT11_MNG_HE_OP_ID (DOT11_MNG_ID_EXT_ID + EXT_MNG_HE_OP_ID) | |
1536 | #define EXT_MNG_RAPS_ID 37u /* OFDMA Random Access Parameter Set */ | |
1537 | #define DOT11_MNG_RAPS_ID (DOT11_MNG_ID_EXT_ID + EXT_MNG_RAPS_ID) | |
1538 | #define EXT_MNG_MU_EDCA_ID 38u /* MU EDCA Parameter Set */ | |
1539 | #define DOT11_MNG_MU_EDCA_ID (DOT11_MNG_ID_EXT_ID + EXT_MNG_MU_EDCA_ID) | |
1540 | #define EXT_MNG_SRPS_ID 39u /* Spatial Reuse Parameter Set */ | |
1541 | #define DOT11_MNG_SRPS_ID (DOT11_MNG_ID_EXT_ID + EXT_MNG_SRPS_ID) | |
1542 | #define EXT_MNG_BSSCOLOR_CHANGE_ID 42u /* BSS Color Change Announcement */ | |
1543 | #define DOT11_MNG_BSSCOLOR_CHANGE_ID (DOT11_MNG_ID_EXT_ID + EXT_MNG_BSSCOLOR_CHANGE_ID) | |
1544 | ||
1545 | /* FILS and OCE ext ids */ | |
1546 | #define FILS_EXTID_MNG_REQ_PARAMS 2u /* FILS Request Parameters element */ | |
1547 | #define DOT11_MNG_FILS_REQ_PARAMS (DOT11_MNG_ID_EXT_ID + FILS_EXTID_MNG_REQ_PARAMS) | |
1548 | #define FILS_EXTID_MNG_KEY_CONFIRMATION_ID 3u /* FILS Key Confirmation element */ | |
1549 | #define DOT11_MNG_FILS_KEY_CONFIRMATION (DOT11_MNG_ID_EXT_ID +\ | |
1550 | FILS_EXTID_MNG_KEY_CONFIRMATION_ID) | |
1551 | #define FILS_EXTID_MNG_SESSION_ID 4u /* FILS Session element */ | |
1552 | #define DOT11_MNG_FILS_SESSION (DOT11_MNG_ID_EXT_ID + FILS_EXTID_MNG_SESSION_ID) | |
1553 | #define FILS_EXTID_MNG_HLP_CONTAINER_ID 5u /* FILS HLP Container element */ | |
1554 | #define DOT11_MNG_FILS_HLP_CONTAINER (DOT11_MNG_ID_EXT_ID +\ | |
1555 | FILS_EXTID_MNG_HLP_CONTAINER_ID) | |
5a068558 MB |
1556 | #define FILS_EXTID_MNG_KEY_DELIVERY_ID 7u /* FILS Key Delivery element */ |
1557 | #define DOT11_MNG_FILS_KEY_DELIVERY (DOT11_MNG_ID_EXT_ID +\ | |
1558 | FILS_EXTID_MNG_KEY_DELIVERY_ID) | |
1cac41cb MB |
1559 | #define FILS_EXTID_MNG_WRAPPED_DATA_ID 8u /* FILS Wrapped Data element */ |
1560 | #define DOT11_MNG_FILS_WRAPPED_DATA (DOT11_MNG_ID_EXT_ID +\ | |
1561 | FILS_EXTID_MNG_WRAPPED_DATA_ID) | |
1562 | #define OCE_EXTID_MNG_ESP_ID 11u /* Estimated Service Parameters element */ | |
1563 | #define DOT11_MNG_ESP (DOT11_MNG_ID_EXT_ID + OCE_EXTID_MNG_ESP_ID) | |
1564 | #define FILS_EXTID_MNG_NONCE_ID 13u /* FILS Nonce element */ | |
1565 | #define DOT11_MNG_FILS_NONCE (DOT11_MNG_ID_EXT_ID + FILS_EXTID_MNG_NONCE_ID) | |
1566 | ||
1567 | /* deprecated definitions, do not use, to be deleted later */ | |
1568 | #define FILS_HLP_CONTAINER_EXT_ID FILS_EXTID_MNG_HLP_CONTAINER_ID | |
1569 | #define DOT11_ESP_EXT_ID OCE_EXTID_MNG_ESP_ID | |
1570 | #define FILS_REQ_PARAMS_EXT_ID FILS_EXTID_MNG_REQ_PARAMS | |
1571 | /* End of deprecated definitions */ | |
1572 | ||
1573 | #define DOT11_MNG_IE_ID_EXT_MATCH(_ie, _id) (\ | |
1574 | ((_ie)->id == DOT11_MNG_ID_EXT_ID) && \ | |
1575 | ((_ie)->len > 0) && \ | |
1576 | ((_id) == ((uint8 *)(_ie) + TLV_HDR_LEN)[0])) | |
1577 | ||
1578 | #define DOT11_MNG_IE_ID_EXT_INIT(_ie, _id, _len) do {\ | |
1579 | (_ie)->id = DOT11_MNG_ID_EXT_ID; \ | |
1580 | (_ie)->len = _len; \ | |
1581 | (_ie)->id_ext = _id; \ | |
1582 | } while (0) | |
1583 | ||
1584 | /* Rate Defines */ | |
1585 | ||
1586 | /* Valid rates for the Supported Rates and Extended Supported Rates IEs. | |
1587 | * Encoding is the rate in 500kbps units, rouding up for fractional values. | |
1588 | * 802.11-2012, section 6.5.5.2, DATA_RATE parameter enumerates all the values. | |
1589 | * The rate values cover DSSS, HR/DSSS, ERP, and OFDM phy rates. | |
1590 | * The defines below do not cover the rates specific to 10MHz, {3, 4.5, 27}, | |
1591 | * and 5MHz, {1.5, 2.25, 3, 4.5, 13.5}, which are not supported by Broadcom devices. | |
1592 | */ | |
1593 | ||
1594 | #define DOT11_RATE_1M 2 /* 1 Mbps in 500kbps units */ | |
1595 | #define DOT11_RATE_2M 4 /* 2 Mbps in 500kbps units */ | |
1596 | #define DOT11_RATE_5M5 11 /* 5.5 Mbps in 500kbps units */ | |
1597 | #define DOT11_RATE_11M 22 /* 11 Mbps in 500kbps units */ | |
1598 | #define DOT11_RATE_6M 12 /* 6 Mbps in 500kbps units */ | |
1599 | #define DOT11_RATE_9M 18 /* 9 Mbps in 500kbps units */ | |
1600 | #define DOT11_RATE_12M 24 /* 12 Mbps in 500kbps units */ | |
1601 | #define DOT11_RATE_18M 36 /* 18 Mbps in 500kbps units */ | |
1602 | #define DOT11_RATE_24M 48 /* 24 Mbps in 500kbps units */ | |
1603 | #define DOT11_RATE_36M 72 /* 36 Mbps in 500kbps units */ | |
1604 | #define DOT11_RATE_48M 96 /* 48 Mbps in 500kbps units */ | |
1605 | #define DOT11_RATE_54M 108 /* 54 Mbps in 500kbps units */ | |
1606 | #define DOT11_RATE_MAX 108 /* highest rate (54 Mbps) in 500kbps units */ | |
1607 | ||
1608 | /* Supported Rates and Extended Supported Rates IEs | |
1609 | * The supported rates octets are defined a the MSB indicatin a Basic Rate | |
1610 | * and bits 0-6 as the rate value | |
1611 | */ | |
1612 | #define DOT11_RATE_BASIC 0x80 /* flag for a Basic Rate */ | |
1613 | #define DOT11_RATE_MASK 0x7F /* mask for numeric part of rate */ | |
1614 | ||
1615 | /* BSS Membership Selector parameters | |
1616 | * 802.11-2016 (and 802.11ax-D1.1), Sec 9.4.2.3 | |
1617 | * These selector values are advertised in Supported Rates and Extended Supported Rates IEs | |
1618 | * in the supported rates list with the Basic rate bit set. | |
1619 | * Constants below include the basic bit. | |
1620 | */ | |
1621 | #define DOT11_BSS_MEMBERSHIP_HT 0xFF /* Basic 0x80 + 127, HT Required to join */ | |
1622 | #define DOT11_BSS_MEMBERSHIP_VHT 0xFE /* Basic 0x80 + 126, VHT Required to join */ | |
1623 | #define DOT11_BSS_MEMBERSHIP_HE 0xFD /* Basic 0x80 + 125, HE Required to join */ | |
1624 | ||
1625 | /* ERP info element bit values */ | |
1626 | #define DOT11_MNG_ERP_LEN 1 /* ERP is currently 1 byte long */ | |
1627 | #define DOT11_MNG_NONERP_PRESENT 0x01 /* NonERP (802.11b) STAs are present | |
1628 | *in the BSS | |
1629 | */ | |
1630 | #define DOT11_MNG_USE_PROTECTION 0x02 /* Use protection mechanisms for | |
1631 | *ERP-OFDM frames | |
1632 | */ | |
1633 | #define DOT11_MNG_BARKER_PREAMBLE 0x04 /* Short Preambles: 0 == allowed, | |
1634 | * 1 == not allowed | |
1635 | */ | |
1636 | /* TS Delay element offset & size */ | |
1637 | #define DOT11_MGN_TS_DELAY_LEN 4 /* length of TS DELAY IE */ | |
1638 | #define TS_DELAY_FIELD_SIZE 4 /* TS DELAY field size */ | |
1639 | ||
1640 | /* Capability Information Field */ | |
1641 | #define DOT11_CAP_ESS 0x0001 /* d11 cap. ESS */ | |
1642 | #define DOT11_CAP_IBSS 0x0002 /* d11 cap. IBSS */ | |
1643 | #define DOT11_CAP_POLLABLE 0x0004 /* d11 cap. pollable */ | |
1644 | #define DOT11_CAP_POLL_RQ 0x0008 /* d11 cap. poll request */ | |
1645 | #define DOT11_CAP_PRIVACY 0x0010 /* d11 cap. privacy */ | |
1646 | #define DOT11_CAP_SHORT 0x0020 /* d11 cap. short */ | |
1647 | #define DOT11_CAP_PBCC 0x0040 /* d11 cap. PBCC */ | |
1648 | #define DOT11_CAP_AGILITY 0x0080 /* d11 cap. agility */ | |
1649 | #define DOT11_CAP_SPECTRUM 0x0100 /* d11 cap. spectrum */ | |
1650 | #define DOT11_CAP_QOS 0x0200 /* d11 cap. qos */ | |
1651 | #define DOT11_CAP_SHORTSLOT 0x0400 /* d11 cap. shortslot */ | |
1652 | #define DOT11_CAP_APSD 0x0800 /* d11 cap. apsd */ | |
1653 | #define DOT11_CAP_RRM 0x1000 /* d11 cap. 11k radio measurement */ | |
1654 | #define DOT11_CAP_CCK_OFDM 0x2000 /* d11 cap. CCK/OFDM */ | |
1655 | #define DOT11_CAP_DELAY_BA 0x4000 /* d11 cap. delayed block ack */ | |
1656 | #define DOT11_CAP_IMMEDIATE_BA 0x8000 /* d11 cap. immediate block ack */ | |
1657 | ||
1658 | /* Extended capabilities IE bitfields */ | |
1659 | /* 20/40 BSS Coexistence Management support bit position */ | |
1660 | #define DOT11_EXT_CAP_OBSS_COEX_MGMT 0 | |
1661 | /* Extended Channel Switching support bit position */ | |
1662 | #define DOT11_EXT_CAP_EXT_CHAN_SWITCHING 2 | |
1663 | /* scheduled PSMP support bit position */ | |
1664 | #define DOT11_EXT_CAP_SPSMP 6 | |
1665 | /* Flexible Multicast Service */ | |
1666 | #define DOT11_EXT_CAP_FMS 11 | |
1667 | /* proxy ARP service support bit position */ | |
1668 | #define DOT11_EXT_CAP_PROXY_ARP 12 | |
1669 | /* Civic Location */ | |
1670 | #define DOT11_EXT_CAP_CIVIC_LOC 14 | |
1671 | /* Geospatial Location */ | |
1672 | #define DOT11_EXT_CAP_LCI 15 | |
1673 | /* Traffic Filter Service */ | |
1674 | #define DOT11_EXT_CAP_TFS 16 | |
1675 | /* WNM-Sleep Mode */ | |
1676 | #define DOT11_EXT_CAP_WNM_SLEEP 17 | |
1677 | /* TIM Broadcast service */ | |
1678 | #define DOT11_EXT_CAP_TIMBC 18 | |
1679 | /* BSS Transition Management support bit position */ | |
1680 | #define DOT11_EXT_CAP_BSSTRANS_MGMT 19 | |
1681 | /* Direct Multicast Service */ | |
1682 | #define DOT11_EXT_CAP_DMS 26 | |
1683 | /* Interworking support bit position */ | |
1684 | #define DOT11_EXT_CAP_IW 31 | |
1685 | /* QoS map support bit position */ | |
1686 | #define DOT11_EXT_CAP_QOS_MAP 32 | |
1687 | /* service Interval granularity bit position and mask */ | |
1688 | #define DOT11_EXT_CAP_SI 41 | |
1689 | #define DOT11_EXT_CAP_SI_MASK 0x0E | |
1690 | /* Location Identifier service */ | |
1691 | #define DOT11_EXT_CAP_IDENT_LOC 44 | |
1692 | /* WNM notification */ | |
1693 | #define DOT11_EXT_CAP_WNM_NOTIF 46 | |
1694 | /* Operating mode notification - VHT (11ac D3.0 - 8.4.2.29) */ | |
1695 | #define DOT11_EXT_CAP_OPER_MODE_NOTIF 62 | |
1696 | /* Fine timing measurement - D3.0 */ | |
1697 | #define DOT11_EXT_CAP_FTM_RESPONDER 70 | |
1698 | #define DOT11_EXT_CAP_FTM_INITIATOR 71 /* tentative 11mcd3.0 */ | |
1699 | #define DOT11_EXT_CAP_FILS 72 /* FILS Capability */ | |
1700 | /* TWT support */ | |
1701 | #define DOT11_EXT_CAP_TWT_REQUESTER 75 | |
1702 | #define DOT11_EXT_CAP_TWT_RESPONDER 76 | |
1703 | /* TODO: Update DOT11_EXT_CAP_MAX_IDX to reflect the highest offset. | |
1704 | * Note: DOT11_EXT_CAP_MAX_IDX must only be used in attach path. | |
1705 | * It will cause ROM invalidation otherwise. | |
1706 | */ | |
1707 | #define DOT11_EXT_CAP_MAX_IDX 76 | |
1708 | ||
1709 | #define DOT11_EXT_CAP_MAX_BIT_IDX 95 /* !!!update this please!!! */ | |
1710 | ||
1711 | /* extended capability */ | |
1712 | #ifndef DOT11_EXTCAP_LEN_MAX | |
1713 | #define DOT11_EXTCAP_LEN_MAX ((DOT11_EXT_CAP_MAX_BIT_IDX + 8) >> 3) | |
1714 | #endif // endif | |
1715 | BWL_PRE_PACKED_STRUCT struct dot11_extcap { | |
1716 | uint8 extcap[DOT11_EXTCAP_LEN_MAX]; | |
1717 | } BWL_POST_PACKED_STRUCT; | |
1718 | typedef struct dot11_extcap dot11_extcap_t; | |
1719 | ||
1720 | /* VHT Operating mode bit fields - (11ac D8.0/802.11-2016 - 9.4.1.53) */ | |
1721 | #define DOT11_OPER_MODE_CHANNEL_WIDTH_SHIFT 0 | |
1722 | #define DOT11_OPER_MODE_CHANNEL_WIDTH_MASK 0x3 | |
1723 | #define DOT11_OPER_MODE_160_8080_BW_SHIFT 2 | |
1724 | #define DOT11_OPER_MODE_160_8080_BW_MASK 0x04 | |
1725 | #define DOT11_OPER_MODE_NOLDPC_SHIFT 3 | |
1726 | #define DOT11_OPER_MODE_NOLDPC_MASK 0x08 | |
1727 | #define DOT11_OPER_MODE_RXNSS_SHIFT 4 | |
1728 | #define DOT11_OPER_MODE_RXNSS_MASK 0x70 | |
1729 | #define DOT11_OPER_MODE_RXNSS_TYPE_SHIFT 7 | |
1730 | #define DOT11_OPER_MODE_RXNSS_TYPE_MASK 0x80 | |
1731 | ||
1732 | #define DOT11_OPER_MODE(type, nss, chanw) (\ | |
1733 | ((type) << DOT11_OPER_MODE_RXNSS_TYPE_SHIFT &\ | |
1734 | DOT11_OPER_MODE_RXNSS_TYPE_MASK) |\ | |
1735 | (((nss) - 1) << DOT11_OPER_MODE_RXNSS_SHIFT & DOT11_OPER_MODE_RXNSS_MASK) |\ | |
1736 | ((chanw) << DOT11_OPER_MODE_CHANNEL_WIDTH_SHIFT &\ | |
1737 | DOT11_OPER_MODE_CHANNEL_WIDTH_MASK)) | |
1738 | ||
1739 | #define DOT11_D8_OPER_MODE(type, nss, ldpc, bw160_8080, chanw) (\ | |
1740 | ((type) << DOT11_OPER_MODE_RXNSS_TYPE_SHIFT &\ | |
1741 | DOT11_OPER_MODE_RXNSS_TYPE_MASK) |\ | |
1742 | (((nss) - 1) << DOT11_OPER_MODE_RXNSS_SHIFT & DOT11_OPER_MODE_RXNSS_MASK) |\ | |
1743 | ((ldpc) << DOT11_OPER_MODE_NOLDPC_SHIFT & DOT11_OPER_MODE_NOLDPC_MASK) |\ | |
1744 | ((bw160_8080) << DOT11_OPER_MODE_160_8080_BW_SHIFT &\ | |
1745 | DOT11_OPER_MODE_160_8080_BW_MASK) |\ | |
1746 | ((chanw) << DOT11_OPER_MODE_CHANNEL_WIDTH_SHIFT &\ | |
1747 | DOT11_OPER_MODE_CHANNEL_WIDTH_MASK)) | |
1748 | ||
1749 | #define DOT11_OPER_MODE_CHANNEL_WIDTH(mode) \ | |
1750 | (((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK)\ | |
1751 | >> DOT11_OPER_MODE_CHANNEL_WIDTH_SHIFT) | |
1752 | #define DOT11_OPER_MODE_160_8080(mode) \ | |
1753 | (((mode) & DOT11_OPER_MODE_160_8080_BW_MASK)\ | |
1754 | >> DOT11_OPER_MODE_160_8080_BW_SHIFT) | |
1755 | #define DOT11_OPER_MODE_RXNSS(mode) \ | |
1756 | ((((mode) & DOT11_OPER_MODE_RXNSS_MASK) \ | |
1757 | >> DOT11_OPER_MODE_RXNSS_SHIFT) + 1) | |
1758 | #define DOT11_OPER_MODE_RXNSS_TYPE(mode) \ | |
1759 | (((mode) & DOT11_OPER_MODE_RXNSS_TYPE_MASK)\ | |
1760 | >> DOT11_OPER_MODE_RXNSS_TYPE_SHIFT) | |
1761 | ||
1762 | #define DOT11_OPER_MODE_20MHZ 0 | |
1763 | #define DOT11_OPER_MODE_40MHZ 1 | |
1764 | #define DOT11_OPER_MODE_80MHZ 2 | |
1765 | #define DOT11_OPER_MODE_160MHZ 3 | |
1766 | #define DOT11_OPER_MODE_8080MHZ 3 | |
1767 | #define DOT11_OPER_MODE_1608080MHZ 1 | |
1768 | ||
1769 | #define DOT11_OPER_MODE_CHANNEL_WIDTH_20MHZ(mode) (\ | |
1770 | ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_20MHZ) | |
1771 | #define DOT11_OPER_MODE_CHANNEL_WIDTH_40MHZ(mode) (\ | |
1772 | ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_40MHZ) | |
1773 | #define DOT11_OPER_MODE_CHANNEL_WIDTH_80MHZ(mode) (\ | |
1774 | ((mode) & DOT11_OPER_MODE_CHANNEL_WIDTH_MASK) == DOT11_OPER_MODE_80MHZ) | |
1775 | #define DOT11_OPER_MODE_CHANNEL_WIDTH_160MHZ(mode) (\ | |
1776 | ((mode) & DOT11_OPER_MODE_160_8080_BW_MASK)) | |
1777 | #define DOT11_OPER_MODE_CHANNEL_WIDTH_8080MHZ(mode) (\ | |
1778 | ((mode) & DOT11_OPER_MODE_160_8080_BW_MASK)) | |
1779 | ||
1780 | /* Operating mode information element 802.11ac D3.0 - 8.4.2.168 */ | |
1781 | BWL_PRE_PACKED_STRUCT struct dot11_oper_mode_notif_ie { | |
1782 | uint8 mode; | |
1783 | } BWL_POST_PACKED_STRUCT; | |
1784 | typedef struct dot11_oper_mode_notif_ie dot11_oper_mode_notif_ie_t; | |
1785 | ||
1786 | #define DOT11_OPER_MODE_NOTIF_IE_LEN 1 | |
1787 | ||
1788 | /* Extended Capability Information Field */ | |
1789 | #define DOT11_OBSS_COEX_MNG_SUPPORT 0x01 /* 20/40 BSS Coexistence Management support */ | |
1790 | ||
1791 | /* | |
1792 | * Action Frame Constants | |
1793 | */ | |
1794 | #define DOT11_ACTION_HDR_LEN 2 /* action frame category + action field */ | |
1795 | #define DOT11_ACTION_CAT_OFF 0 /* category offset */ | |
1796 | #define DOT11_ACTION_ACT_OFF 1 /* action offset */ | |
1797 | ||
1798 | /* Action Category field (sec 8.4.1.11) */ | |
1799 | #define DOT11_ACTION_CAT_ERR_MASK 0x80 /* category error mask */ | |
1800 | #define DOT11_ACTION_CAT_MASK 0x7F /* category mask */ | |
1801 | #define DOT11_ACTION_CAT_SPECT_MNG 0 /* category spectrum management */ | |
1802 | #define DOT11_ACTION_CAT_QOS 1 /* category QoS */ | |
1803 | #define DOT11_ACTION_CAT_DLS 2 /* category DLS */ | |
1804 | #define DOT11_ACTION_CAT_BLOCKACK 3 /* category block ack */ | |
1805 | #define DOT11_ACTION_CAT_PUBLIC 4 /* category public */ | |
1806 | #define DOT11_ACTION_CAT_RRM 5 /* category radio measurements */ | |
1807 | #define DOT11_ACTION_CAT_FBT 6 /* category fast bss transition */ | |
1808 | #define DOT11_ACTION_CAT_HT 7 /* category for HT */ | |
1809 | #define DOT11_ACTION_CAT_SA_QUERY 8 /* security association query */ | |
1810 | #define DOT11_ACTION_CAT_PDPA 9 /* protected dual of public action */ | |
1811 | #define DOT11_ACTION_CAT_WNM 10 /* category for WNM */ | |
1812 | #define DOT11_ACTION_CAT_UWNM 11 /* category for Unprotected WNM */ | |
1813 | #define DOT11_ACTION_CAT_MESH 13 /* category for Mesh */ | |
1814 | #define DOT11_ACTION_CAT_SELFPROT 15 /* category for Mesh, self protected */ | |
1815 | #define DOT11_ACTION_NOTIFICATION 17 | |
1816 | #define DOT11_ACTION_CAT_VHT 21 /* VHT action */ | |
1817 | #define DOT11_ACTION_CAT_S1G 22 /* S1G action */ | |
1818 | #define DOT11_ACTION_CAT_HE 27 /* HE action frame */ | |
1819 | #define DOT11_ACTION_CAT_FILS 26 /* FILS action frame */ | |
1820 | #define DOT11_ACTION_CAT_VSP 126 /* protected vendor specific */ | |
1821 | #define DOT11_ACTION_CAT_VS 127 /* category Vendor Specific */ | |
1822 | ||
1823 | /* Spectrum Management Action IDs (sec 7.4.1) */ | |
1824 | #define DOT11_SM_ACTION_M_REQ 0 /* d11 action measurement request */ | |
1825 | #define DOT11_SM_ACTION_M_REP 1 /* d11 action measurement response */ | |
1826 | #define DOT11_SM_ACTION_TPC_REQ 2 /* d11 action TPC request */ | |
1827 | #define DOT11_SM_ACTION_TPC_REP 3 /* d11 action TPC response */ | |
1828 | #define DOT11_SM_ACTION_CHANNEL_SWITCH 4 /* d11 action channel switch */ | |
1829 | #define DOT11_SM_ACTION_EXT_CSA 5 /* d11 extened CSA for 11n */ | |
1830 | ||
1831 | /* QoS action ids */ | |
1832 | #define DOT11_QOS_ACTION_ADDTS_REQ 0 /* d11 action ADDTS request */ | |
1833 | #define DOT11_QOS_ACTION_ADDTS_RESP 1 /* d11 action ADDTS response */ | |
1834 | #define DOT11_QOS_ACTION_DELTS 2 /* d11 action DELTS */ | |
1835 | #define DOT11_QOS_ACTION_SCHEDULE 3 /* d11 action schedule */ | |
1836 | #define DOT11_QOS_ACTION_QOS_MAP 4 /* d11 action QOS map */ | |
1837 | ||
1838 | /* HT action ids */ | |
1839 | #define DOT11_ACTION_ID_HT_CH_WIDTH 0 /* notify channel width action id */ | |
1840 | #define DOT11_ACTION_ID_HT_MIMO_PS 1 /* mimo ps action id */ | |
1841 | ||
1842 | /* Public action ids */ | |
1843 | #define DOT11_PUB_ACTION_BSS_COEX_MNG 0 /* 20/40 Coexistence Management action id */ | |
1844 | #define DOT11_PUB_ACTION_CHANNEL_SWITCH 4 /* d11 action channel switch */ | |
1845 | #define DOT11_PUB_ACTION_VENDOR_SPEC 9 /* Vendor specific */ | |
1846 | #define DOT11_PUB_ACTION_GAS_CB_REQ 12 /* GAS Comeback Request */ | |
1847 | #define DOT11_PUB_ACTION_FTM_REQ 32 /* FTM request */ | |
1848 | #define DOT11_PUB_ACTION_FTM 33 /* FTM measurement */ | |
1849 | #define DOT11_PUB_ACTION_FTM_REQ_TRIGGER_START 1u /* FTM request start trigger */ | |
1850 | #define DOT11_PUB_ACTION_FTM_REQ_TRIGGER_STOP 0u /* FTM request stop trigger */ | |
1851 | ||
1852 | /* Block Ack action types */ | |
1853 | #define DOT11_BA_ACTION_ADDBA_REQ 0 /* ADDBA Req action frame type */ | |
1854 | #define DOT11_BA_ACTION_ADDBA_RESP 1 /* ADDBA Resp action frame type */ | |
1855 | #define DOT11_BA_ACTION_DELBA 2 /* DELBA action frame type */ | |
1856 | ||
1857 | /* ADDBA action parameters */ | |
1858 | #define DOT11_ADDBA_PARAM_AMSDU_SUP 0x0001 /* AMSDU supported under BA */ | |
1859 | #define DOT11_ADDBA_PARAM_POLICY_MASK 0x0002 /* policy mask(ack vs delayed) */ | |
1860 | #define DOT11_ADDBA_PARAM_POLICY_SHIFT 1 /* policy shift */ | |
1861 | #define DOT11_ADDBA_PARAM_TID_MASK 0x003c /* tid mask */ | |
1862 | #define DOT11_ADDBA_PARAM_TID_SHIFT 2 /* tid shift */ | |
1863 | #define DOT11_ADDBA_PARAM_BSIZE_MASK 0xffc0 /* buffer size mask */ | |
1864 | #define DOT11_ADDBA_PARAM_BSIZE_SHIFT 6 /* buffer size shift */ | |
1865 | ||
1866 | #define DOT11_ADDBA_POLICY_DELAYED 0 /* delayed BA policy */ | |
1867 | #define DOT11_ADDBA_POLICY_IMMEDIATE 1 /* immediate BA policy */ | |
1868 | ||
1869 | /* Fast Transition action types */ | |
1870 | #define DOT11_FT_ACTION_FT_RESERVED 0 | |
1871 | #define DOT11_FT_ACTION_FT_REQ 1 /* FBT request - for over-the-DS FBT */ | |
1872 | #define DOT11_FT_ACTION_FT_RES 2 /* FBT response - for over-the-DS FBT */ | |
1873 | #define DOT11_FT_ACTION_FT_CON 3 /* FBT confirm - for OTDS with RRP */ | |
1874 | #define DOT11_FT_ACTION_FT_ACK 4 /* FBT ack */ | |
1875 | ||
1876 | /* DLS action types */ | |
1877 | #define DOT11_DLS_ACTION_REQ 0 /* DLS Request */ | |
1878 | #define DOT11_DLS_ACTION_RESP 1 /* DLS Response */ | |
1879 | #define DOT11_DLS_ACTION_TD 2 /* DLS Teardown */ | |
1880 | ||
1881 | /* Wireless Network Management (WNM) action types */ | |
1882 | #define DOT11_WNM_ACTION_EVENT_REQ 0 | |
1883 | #define DOT11_WNM_ACTION_EVENT_REP 1 | |
1884 | #define DOT11_WNM_ACTION_DIAG_REQ 2 | |
1885 | #define DOT11_WNM_ACTION_DIAG_REP 3 | |
1886 | #define DOT11_WNM_ACTION_LOC_CFG_REQ 4 | |
1887 | #define DOT11_WNM_ACTION_LOC_RFG_RESP 5 | |
1888 | #define DOT11_WNM_ACTION_BSSTRANS_QUERY 6 | |
1889 | #define DOT11_WNM_ACTION_BSSTRANS_REQ 7 | |
1890 | #define DOT11_WNM_ACTION_BSSTRANS_RESP 8 | |
1891 | #define DOT11_WNM_ACTION_FMS_REQ 9 | |
1892 | #define DOT11_WNM_ACTION_FMS_RESP 10 | |
1893 | #define DOT11_WNM_ACTION_COL_INTRFRNCE_REQ 11 | |
1894 | #define DOT11_WNM_ACTION_COL_INTRFRNCE_REP 12 | |
1895 | #define DOT11_WNM_ACTION_TFS_REQ 13 | |
1896 | #define DOT11_WNM_ACTION_TFS_RESP 14 | |
1897 | #define DOT11_WNM_ACTION_TFS_NOTIFY_REQ 15 | |
1898 | #define DOT11_WNM_ACTION_WNM_SLEEP_REQ 16 | |
1899 | #define DOT11_WNM_ACTION_WNM_SLEEP_RESP 17 | |
1900 | #define DOT11_WNM_ACTION_TIMBC_REQ 18 | |
1901 | #define DOT11_WNM_ACTION_TIMBC_RESP 19 | |
1902 | #define DOT11_WNM_ACTION_QOS_TRFC_CAP_UPD 20 | |
1903 | #define DOT11_WNM_ACTION_CHAN_USAGE_REQ 21 | |
1904 | #define DOT11_WNM_ACTION_CHAN_USAGE_RESP 22 | |
1905 | #define DOT11_WNM_ACTION_DMS_REQ 23 | |
1906 | #define DOT11_WNM_ACTION_DMS_RESP 24 | |
1907 | #define DOT11_WNM_ACTION_TMNG_MEASUR_REQ 25 | |
1908 | #define DOT11_WNM_ACTION_NOTFCTN_REQ 26 | |
1909 | #define DOT11_WNM_ACTION_NOTFCTN_RESP 27 | |
1910 | #define DOT11_WNM_ACTION_TFS_NOTIFY_RESP 28 | |
1911 | ||
1912 | /* Unprotected Wireless Network Management (WNM) action types */ | |
1913 | #define DOT11_UWNM_ACTION_TIM 0 | |
1914 | #define DOT11_UWNM_ACTION_TIMING_MEASUREMENT 1 | |
1915 | ||
1916 | #define DOT11_MNG_COUNTRY_ID_LEN 3 | |
1917 | ||
1918 | /* VHT category action types - 802.11ac D3.0 - 8.5.23.1 */ | |
1919 | #define DOT11_VHT_ACTION_CBF 0 /* Compressed Beamforming */ | |
1920 | #define DOT11_VHT_ACTION_GID_MGMT 1 /* Group ID Management */ | |
1921 | #define DOT11_VHT_ACTION_OPER_MODE_NOTIF 2 /* Operating mode notif'n */ | |
1922 | ||
1923 | /* FILS category action types - 802.11ai D11.0 - 9.6.8.1 */ | |
1924 | #define DOT11_FILS_ACTION_DISCOVERY 34 /* FILS Discovery */ | |
1925 | ||
1926 | /** DLS Request frame header */ | |
1927 | BWL_PRE_PACKED_STRUCT struct dot11_dls_req { | |
1928 | uint8 category; /* category of action frame (2) */ | |
1929 | uint8 action; /* DLS action: req (0) */ | |
1930 | struct ether_addr da; /* destination address */ | |
1931 | struct ether_addr sa; /* source address */ | |
1932 | uint16 cap; /* capability */ | |
1933 | uint16 timeout; /* timeout value */ | |
1934 | uint8 data[1]; /* IE:support rate, extend support rate, HT cap */ | |
1935 | } BWL_POST_PACKED_STRUCT; | |
1936 | typedef struct dot11_dls_req dot11_dls_req_t; | |
1937 | #define DOT11_DLS_REQ_LEN 18 /* Fixed length */ | |
1938 | ||
1939 | /** DLS response frame header */ | |
1940 | BWL_PRE_PACKED_STRUCT struct dot11_dls_resp { | |
1941 | uint8 category; /* category of action frame (2) */ | |
1942 | uint8 action; /* DLS action: req (0) */ | |
1943 | uint16 status; /* status code field */ | |
1944 | struct ether_addr da; /* destination address */ | |
1945 | struct ether_addr sa; /* source address */ | |
1946 | uint8 data[1]; /* optional: capability, rate ... */ | |
1947 | } BWL_POST_PACKED_STRUCT; | |
1948 | typedef struct dot11_dls_resp dot11_dls_resp_t; | |
1949 | #define DOT11_DLS_RESP_LEN 16 /* Fixed length */ | |
1950 | ||
1951 | /* ************* 802.11v related definitions. ************* */ | |
1952 | ||
1953 | /** BSS Management Transition Query frame header */ | |
1954 | BWL_PRE_PACKED_STRUCT struct dot11_bsstrans_query { | |
1955 | uint8 category; /* category of action frame (10) */ | |
1956 | uint8 action; /* WNM action: trans_query (6) */ | |
1957 | uint8 token; /* dialog token */ | |
1958 | uint8 reason; /* transition query reason */ | |
1959 | uint8 data[1]; /* Elements */ | |
1960 | } BWL_POST_PACKED_STRUCT; | |
1961 | typedef struct dot11_bsstrans_query dot11_bsstrans_query_t; | |
1962 | #define DOT11_BSSTRANS_QUERY_LEN 4 /* Fixed length */ | |
1963 | ||
1964 | /* BTM transition reason */ | |
1965 | #define DOT11_BSSTRANS_REASON_UNSPECIFIED 0 | |
1966 | #define DOT11_BSSTRANS_REASON_EXC_FRAME_LOSS 1 | |
1967 | #define DOT11_BSSTRANS_REASON_EXC_TRAFFIC_DELAY 2 | |
1968 | #define DOT11_BSSTRANS_REASON_INSUFF_QOS_CAPACITY 3 | |
1969 | #define DOT11_BSSTRANS_REASON_FIRST_ASSOC 4 | |
1970 | #define DOT11_BSSTRANS_REASON_LOAD_BALANCING 5 | |
1971 | #define DOT11_BSSTRANS_REASON_BETTER_AP_FOUND 6 | |
1972 | #define DOT11_BSSTRANS_REASON_DEAUTH_RX 7 | |
1973 | #define DOT11_BSSTRANS_REASON_8021X_EAP_AUTH_FAIL 8 | |
1974 | #define DOT11_BSSTRANS_REASON_4WAY_HANDSHK_FAIL 9 | |
1975 | #define DOT11_BSSTRANS_REASON_MANY_REPLAYCNT_FAIL 10 | |
1976 | #define DOT11_BSSTRANS_REASON_MANY_DATAMIC_FAIL 11 | |
1977 | #define DOT11_BSSTRANS_REASON_EXCEED_MAX_RETRANS 12 | |
1978 | #define DOT11_BSSTRANS_REASON_MANY_BCAST_DISASSOC_RX 13 | |
1979 | #define DOT11_BSSTRANS_REASON_MANY_BCAST_DEAUTH_RX 14 | |
1980 | #define DOT11_BSSTRANS_REASON_PREV_TRANSITION_FAIL 15 | |
1981 | #define DOT11_BSSTRANS_REASON_LOW_RSSI 16 | |
1982 | #define DOT11_BSSTRANS_REASON_ROAM_FROM_NON_80211 17 | |
1983 | #define DOT11_BSSTRANS_REASON_RX_BTM_REQ 18 | |
1984 | #define DOT11_BSSTRANS_REASON_PREF_LIST_INCLUDED 19 | |
1985 | #define DOT11_BSSTRANS_REASON_LEAVING_ESS 20 | |
1986 | ||
1987 | /** BSS Management Transition Request frame header */ | |
1988 | BWL_PRE_PACKED_STRUCT struct dot11_bsstrans_req { | |
1989 | uint8 category; /* category of action frame (10) */ | |
1990 | uint8 action; /* WNM action: trans_req (7) */ | |
1991 | uint8 token; /* dialog token */ | |
1992 | uint8 reqmode; /* transition request mode */ | |
1993 | uint16 disassoc_tmr; /* disassociation timer */ | |
1994 | uint8 validity_intrvl; /* validity interval */ | |
1995 | uint8 data[1]; /* optional: BSS term duration, ... */ | |
1996 | /* ...session info URL, candidate list */ | |
1997 | } BWL_POST_PACKED_STRUCT; | |
1998 | typedef struct dot11_bsstrans_req dot11_bsstrans_req_t; | |
1999 | #define DOT11_BSSTRANS_REQ_LEN 7 /* Fixed length */ | |
5a068558 | 2000 | #define DOT11_BSSTRANS_REQ_FIXED_LEN 7u /* Fixed length */ |
1cac41cb MB |
2001 | |
2002 | /* BSS Mgmt Transition Request Mode Field - 802.11v */ | |
2003 | #define DOT11_BSSTRANS_REQMODE_PREF_LIST_INCL 0x01 | |
2004 | #define DOT11_BSSTRANS_REQMODE_ABRIDGED 0x02 | |
2005 | #define DOT11_BSSTRANS_REQMODE_DISASSOC_IMMINENT 0x04 | |
2006 | #define DOT11_BSSTRANS_REQMODE_BSS_TERM_INCL 0x08 | |
2007 | #define DOT11_BSSTRANS_REQMODE_ESS_DISASSOC_IMNT 0x10 | |
2008 | ||
2009 | /** BSS Management transition response frame header */ | |
2010 | BWL_PRE_PACKED_STRUCT struct dot11_bsstrans_resp { | |
2011 | uint8 category; /* category of action frame (10) */ | |
2012 | uint8 action; /* WNM action: trans_resp (8) */ | |
2013 | uint8 token; /* dialog token */ | |
2014 | uint8 status; /* transition status */ | |
2015 | uint8 term_delay; /* validity interval */ | |
2016 | uint8 data[1]; /* optional: BSSID target, candidate list */ | |
2017 | } BWL_POST_PACKED_STRUCT; | |
2018 | typedef struct dot11_bsstrans_resp dot11_bsstrans_resp_t; | |
2019 | #define DOT11_BSSTRANS_RESP_LEN 5 /* Fixed length */ | |
2020 | ||
2021 | /* BSS Mgmt Transition Response Status Field */ | |
2022 | #define DOT11_BSSTRANS_RESP_STATUS_ACCEPT 0 | |
2023 | #define DOT11_BSSTRANS_RESP_STATUS_REJECT 1 | |
2024 | #define DOT11_BSSTRANS_RESP_STATUS_REJ_INSUFF_BCN 2 | |
2025 | #define DOT11_BSSTRANS_RESP_STATUS_REJ_INSUFF_CAP 3 | |
2026 | #define DOT11_BSSTRANS_RESP_STATUS_REJ_TERM_UNDESIRED 4 | |
2027 | #define DOT11_BSSTRANS_RESP_STATUS_REJ_TERM_DELAY_REQ 5 | |
2028 | #define DOT11_BSSTRANS_RESP_STATUS_REJ_BSS_LIST_PROVIDED 6 | |
2029 | #define DOT11_BSSTRANS_RESP_STATUS_REJ_NO_SUITABLE_BSS 7 | |
2030 | #define DOT11_BSSTRANS_RESP_STATUS_REJ_LEAVING_ESS 8 | |
2031 | ||
2032 | /** BSS Max Idle Period element */ | |
2033 | BWL_PRE_PACKED_STRUCT struct dot11_bss_max_idle_period_ie { | |
2034 | uint8 id; /* 90, DOT11_MNG_BSS_MAX_IDLE_PERIOD_ID */ | |
2035 | uint8 len; | |
2036 | uint16 max_idle_period; /* in unit of 1000 TUs */ | |
2037 | uint8 idle_opt; | |
2038 | } BWL_POST_PACKED_STRUCT; | |
2039 | typedef struct dot11_bss_max_idle_period_ie dot11_bss_max_idle_period_ie_t; | |
2040 | #define DOT11_BSS_MAX_IDLE_PERIOD_IE_LEN 3 /* bss max idle period IE size */ | |
2041 | #define DOT11_BSS_MAX_IDLE_PERIOD_OPT_PROTECTED 1 /* BSS max idle option */ | |
2042 | ||
2043 | /** TIM Broadcast request element */ | |
2044 | BWL_PRE_PACKED_STRUCT struct dot11_timbc_req_ie { | |
2045 | uint8 id; /* 94, DOT11_MNG_TIMBC_REQ_ID */ | |
2046 | uint8 len; | |
2047 | uint8 interval; /* in unit of beacon interval */ | |
2048 | } BWL_POST_PACKED_STRUCT; | |
2049 | typedef struct dot11_timbc_req_ie dot11_timbc_req_ie_t; | |
2050 | #define DOT11_TIMBC_REQ_IE_LEN 1 /* Fixed length */ | |
2051 | ||
2052 | /** TIM Broadcast request frame header */ | |
2053 | BWL_PRE_PACKED_STRUCT struct dot11_timbc_req { | |
2054 | uint8 category; /* category of action frame (10) */ | |
2055 | uint8 action; /* WNM action: DOT11_WNM_ACTION_TIMBC_REQ(18) */ | |
2056 | uint8 token; /* dialog token */ | |
2057 | uint8 data[1]; /* TIM broadcast request element */ | |
2058 | } BWL_POST_PACKED_STRUCT; | |
2059 | typedef struct dot11_timbc_req dot11_timbc_req_t; | |
2060 | #define DOT11_TIMBC_REQ_LEN 3 /* Fixed length */ | |
2061 | ||
2062 | /** TIM Broadcast response element */ | |
2063 | BWL_PRE_PACKED_STRUCT struct dot11_timbc_resp_ie { | |
2064 | uint8 id; /* 95, DOT11_MNG_TIM_BROADCAST_RESP_ID */ | |
2065 | uint8 len; | |
2066 | uint8 status; /* status of add request */ | |
2067 | uint8 interval; /* in unit of beacon interval */ | |
2068 | int32 offset; /* in unit of ms */ | |
2069 | uint16 high_rate; /* in unit of 0.5 Mb/s */ | |
2070 | uint16 low_rate; /* in unit of 0.5 Mb/s */ | |
2071 | } BWL_POST_PACKED_STRUCT; | |
2072 | typedef struct dot11_timbc_resp_ie dot11_timbc_resp_ie_t; | |
2073 | #define DOT11_TIMBC_DENY_RESP_IE_LEN 1 /* Deny. Fixed length */ | |
2074 | #define DOT11_TIMBC_ACCEPT_RESP_IE_LEN 10 /* Accept. Fixed length */ | |
2075 | ||
2076 | #define DOT11_TIMBC_STATUS_ACCEPT 0 | |
2077 | #define DOT11_TIMBC_STATUS_ACCEPT_TSTAMP 1 | |
2078 | #define DOT11_TIMBC_STATUS_DENY 2 | |
2079 | #define DOT11_TIMBC_STATUS_OVERRIDDEN 3 | |
2080 | #define DOT11_TIMBC_STATUS_RESERVED 4 | |
2081 | ||
2082 | /** TIM Broadcast request frame header */ | |
2083 | BWL_PRE_PACKED_STRUCT struct dot11_timbc_resp { | |
2084 | uint8 category; /* category of action frame (10) */ | |
2085 | uint8 action; /* action: DOT11_WNM_ACTION_TIMBC_RESP(19) */ | |
2086 | uint8 token; /* dialog token */ | |
2087 | uint8 data[1]; /* TIM broadcast response element */ | |
2088 | } BWL_POST_PACKED_STRUCT; | |
2089 | typedef struct dot11_timbc_resp dot11_timbc_resp_t; | |
2090 | #define DOT11_TIMBC_RESP_LEN 3 /* Fixed length */ | |
2091 | ||
2092 | /** TIM element */ | |
2093 | BWL_PRE_PACKED_STRUCT struct dot11_tim_ie { | |
2094 | uint8 id; /* 5, DOT11_MNG_TIM_ID */ | |
2095 | uint8 len; /* 4 - 255 */ | |
2096 | uint8 dtim_count; /* DTIM decrementing counter */ | |
2097 | uint8 dtim_period; /* DTIM period */ | |
2098 | uint8 bitmap_control; /* AID 0 + bitmap offset */ | |
2099 | uint8 pvb[1]; /* Partial Virtual Bitmap, variable length */ | |
2100 | } BWL_POST_PACKED_STRUCT; | |
2101 | typedef struct dot11_tim_ie dot11_tim_ie_t; | |
2102 | #define DOT11_TIM_IE_FIXED_LEN 3 /* Fixed length, without id and len */ | |
2103 | #define DOT11_TIM_IE_FIXED_TOTAL_LEN 5 /* Fixed length, with id and len */ | |
2104 | ||
2105 | /** TIM Broadcast frame header */ | |
2106 | BWL_PRE_PACKED_STRUCT struct dot11_timbc { | |
2107 | uint8 category; /* category of action frame (11) */ | |
2108 | uint8 action; /* action: TIM (0) */ | |
2109 | uint8 check_beacon; /* need to check-beacon */ | |
2110 | uint8 tsf[8]; /* Time Synchronization Function */ | |
2111 | dot11_tim_ie_t tim_ie; /* TIM element */ | |
2112 | } BWL_POST_PACKED_STRUCT; | |
2113 | typedef struct dot11_timbc dot11_timbc_t; | |
2114 | #define DOT11_TIMBC_HDR_LEN (sizeof(dot11_timbc_t) - sizeof(dot11_tim_ie_t)) | |
2115 | #define DOT11_TIMBC_FIXED_LEN (sizeof(dot11_timbc_t) - 1) /* Fixed length */ | |
2116 | #define DOT11_TIMBC_LEN 11 /* Fixed length */ | |
2117 | ||
2118 | /** TCLAS frame classifier type */ | |
2119 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_fc_hdr { | |
2120 | uint8 type; | |
2121 | uint8 mask; | |
2122 | uint8 data[1]; | |
2123 | } BWL_POST_PACKED_STRUCT; | |
2124 | typedef struct dot11_tclas_fc_hdr dot11_tclas_fc_hdr_t; | |
2125 | #define DOT11_TCLAS_FC_HDR_LEN 2 /* Fixed length */ | |
2126 | ||
2127 | #define DOT11_TCLAS_MASK_0 0x1 | |
2128 | #define DOT11_TCLAS_MASK_1 0x2 | |
2129 | #define DOT11_TCLAS_MASK_2 0x4 | |
2130 | #define DOT11_TCLAS_MASK_3 0x8 | |
2131 | #define DOT11_TCLAS_MASK_4 0x10 | |
2132 | #define DOT11_TCLAS_MASK_5 0x20 | |
2133 | #define DOT11_TCLAS_MASK_6 0x40 | |
2134 | #define DOT11_TCLAS_MASK_7 0x80 | |
2135 | ||
2136 | #define DOT11_TCLAS_FC_0_ETH 0 | |
2137 | #define DOT11_TCLAS_FC_1_IP 1 | |
2138 | #define DOT11_TCLAS_FC_2_8021Q 2 | |
2139 | #define DOT11_TCLAS_FC_3_OFFSET 3 | |
2140 | #define DOT11_TCLAS_FC_4_IP_HIGHER 4 | |
2141 | #define DOT11_TCLAS_FC_5_8021D 5 | |
2142 | ||
2143 | /** TCLAS frame classifier type 0 parameters for Ethernet */ | |
2144 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_fc_0_eth { | |
2145 | uint8 type; | |
2146 | uint8 mask; | |
2147 | uint8 sa[ETHER_ADDR_LEN]; | |
2148 | uint8 da[ETHER_ADDR_LEN]; | |
2149 | uint16 eth_type; | |
2150 | } BWL_POST_PACKED_STRUCT; | |
2151 | typedef struct dot11_tclas_fc_0_eth dot11_tclas_fc_0_eth_t; | |
2152 | #define DOT11_TCLAS_FC_0_ETH_LEN 16 | |
2153 | ||
2154 | /** TCLAS frame classifier type 1 parameters for IPV4 */ | |
2155 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_fc_1_ipv4 { | |
2156 | uint8 type; | |
2157 | uint8 mask; | |
2158 | uint8 version; | |
2159 | uint32 src_ip; | |
2160 | uint32 dst_ip; | |
2161 | uint16 src_port; | |
2162 | uint16 dst_port; | |
2163 | uint8 dscp; | |
2164 | uint8 protocol; | |
2165 | uint8 reserved; | |
2166 | } BWL_POST_PACKED_STRUCT; | |
2167 | typedef struct dot11_tclas_fc_1_ipv4 dot11_tclas_fc_1_ipv4_t; | |
2168 | #define DOT11_TCLAS_FC_1_IPV4_LEN 18 | |
2169 | ||
2170 | /** TCLAS frame classifier type 2 parameters for 802.1Q */ | |
2171 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_fc_2_8021q { | |
2172 | uint8 type; | |
2173 | uint8 mask; | |
2174 | uint16 tci; | |
2175 | } BWL_POST_PACKED_STRUCT; | |
2176 | typedef struct dot11_tclas_fc_2_8021q dot11_tclas_fc_2_8021q_t; | |
2177 | #define DOT11_TCLAS_FC_2_8021Q_LEN 4 | |
2178 | ||
2179 | /** TCLAS frame classifier type 3 parameters for filter offset */ | |
2180 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_fc_3_filter { | |
2181 | uint8 type; | |
2182 | uint8 mask; | |
2183 | uint16 offset; | |
2184 | uint8 data[1]; | |
2185 | } BWL_POST_PACKED_STRUCT; | |
2186 | typedef struct dot11_tclas_fc_3_filter dot11_tclas_fc_3_filter_t; | |
2187 | #define DOT11_TCLAS_FC_3_FILTER_LEN 4 | |
2188 | ||
2189 | /** TCLAS frame classifier type 4 parameters for IPV4 is the same as TCLAS type 1 */ | |
2190 | typedef struct dot11_tclas_fc_1_ipv4 dot11_tclas_fc_4_ipv4_t; | |
2191 | #define DOT11_TCLAS_FC_4_IPV4_LEN DOT11_TCLAS_FC_1_IPV4_LEN | |
2192 | ||
2193 | /** TCLAS frame classifier type 4 parameters for IPV6 */ | |
2194 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_fc_4_ipv6 { | |
2195 | uint8 type; | |
2196 | uint8 mask; | |
2197 | uint8 version; | |
2198 | uint8 saddr[16]; | |
2199 | uint8 daddr[16]; | |
2200 | uint16 src_port; | |
2201 | uint16 dst_port; | |
2202 | uint8 dscp; | |
2203 | uint8 nexthdr; | |
2204 | uint8 flow_lbl[3]; | |
2205 | } BWL_POST_PACKED_STRUCT; | |
2206 | typedef struct dot11_tclas_fc_4_ipv6 dot11_tclas_fc_4_ipv6_t; | |
2207 | #define DOT11_TCLAS_FC_4_IPV6_LEN 44 | |
2208 | ||
2209 | /** TCLAS frame classifier type 5 parameters for 802.1D */ | |
2210 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_fc_5_8021d { | |
2211 | uint8 type; | |
2212 | uint8 mask; | |
2213 | uint8 pcp; | |
2214 | uint8 cfi; | |
2215 | uint16 vid; | |
2216 | } BWL_POST_PACKED_STRUCT; | |
2217 | typedef struct dot11_tclas_fc_5_8021d dot11_tclas_fc_5_8021d_t; | |
2218 | #define DOT11_TCLAS_FC_5_8021D_LEN 6 | |
2219 | ||
2220 | /** TCLAS frame classifier type parameters */ | |
2221 | BWL_PRE_PACKED_STRUCT union dot11_tclas_fc { | |
2222 | uint8 data[1]; | |
2223 | dot11_tclas_fc_hdr_t hdr; | |
2224 | dot11_tclas_fc_0_eth_t t0_eth; | |
2225 | dot11_tclas_fc_1_ipv4_t t1_ipv4; | |
2226 | dot11_tclas_fc_2_8021q_t t2_8021q; | |
2227 | dot11_tclas_fc_3_filter_t t3_filter; | |
2228 | dot11_tclas_fc_4_ipv4_t t4_ipv4; | |
2229 | dot11_tclas_fc_4_ipv6_t t4_ipv6; | |
2230 | dot11_tclas_fc_5_8021d_t t5_8021d; | |
2231 | } BWL_POST_PACKED_STRUCT; | |
2232 | typedef union dot11_tclas_fc dot11_tclas_fc_t; | |
2233 | ||
2234 | #define DOT11_TCLAS_FC_MIN_LEN 4 /* Classifier Type 2 has the min size */ | |
2235 | #define DOT11_TCLAS_FC_MAX_LEN 254 | |
2236 | ||
2237 | /** TCLAS element */ | |
2238 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_ie { | |
2239 | uint8 id; /* 14, DOT11_MNG_TCLAS_ID */ | |
2240 | uint8 len; | |
2241 | uint8 user_priority; | |
2242 | dot11_tclas_fc_t fc; | |
2243 | } BWL_POST_PACKED_STRUCT; | |
2244 | typedef struct dot11_tclas_ie dot11_tclas_ie_t; | |
2245 | #define DOT11_TCLAS_IE_LEN 3u /* Fixed length, include id and len */ | |
2246 | ||
2247 | /** TCLAS processing element */ | |
2248 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_proc_ie { | |
2249 | uint8 id; /* 44, DOT11_MNG_TCLAS_PROC_ID */ | |
2250 | uint8 len; | |
2251 | uint8 process; | |
2252 | } BWL_POST_PACKED_STRUCT; | |
2253 | typedef struct dot11_tclas_proc_ie dot11_tclas_proc_ie_t; | |
2254 | #define DOT11_TCLAS_PROC_IE_LEN 3 /* Fixed length, include id and len */ | |
2255 | ||
2256 | #define DOT11_TCLAS_PROC_LEN 1u /* Proc ie length is always 1 byte */ | |
2257 | ||
2258 | #define DOT11_TCLAS_PROC_MATCHALL 0 /* All high level element need to match */ | |
2259 | #define DOT11_TCLAS_PROC_MATCHONE 1 /* One high level element need to match */ | |
2260 | #define DOT11_TCLAS_PROC_NONMATCH 2 /* Non match to any high level element */ | |
2261 | ||
2262 | /* TSPEC element defined in 802.11 std section 8.4.2.32 - Not supported */ | |
2263 | #define DOT11_TSPEC_IE_LEN 57 /* Fixed length */ | |
2264 | ||
2265 | /** TFS request element */ | |
2266 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_req_ie { | |
2267 | uint8 id; /* 91, DOT11_MNG_TFS_REQUEST_ID */ | |
2268 | uint8 len; | |
2269 | uint8 tfs_id; | |
2270 | uint8 actcode; | |
2271 | uint8 data[1]; | |
2272 | } BWL_POST_PACKED_STRUCT; | |
2273 | typedef struct dot11_tfs_req_ie dot11_tfs_req_ie_t; | |
2274 | #define DOT11_TFS_REQ_IE_LEN 2 /* Fixed length, without id and len */ | |
2275 | ||
2276 | /** TFS request action codes (bitfield) */ | |
2277 | #define DOT11_TFS_ACTCODE_DELETE 1 | |
2278 | #define DOT11_TFS_ACTCODE_NOTIFY 2 | |
2279 | ||
2280 | /** TFS request subelement IDs */ | |
2281 | #define DOT11_TFS_REQ_TFS_SE_ID 1 | |
2282 | #define DOT11_TFS_REQ_VENDOR_SE_ID 221 | |
2283 | ||
2284 | /** TFS subelement */ | |
2285 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_se { | |
2286 | uint8 sub_id; | |
2287 | uint8 len; | |
2288 | uint8 data[1]; /* TCLAS element(s) + optional TCLAS proc */ | |
2289 | } BWL_POST_PACKED_STRUCT; | |
2290 | typedef struct dot11_tfs_se dot11_tfs_se_t; | |
2291 | ||
2292 | /** TFS response element */ | |
2293 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_resp_ie { | |
2294 | uint8 id; /* 92, DOT11_MNG_TFS_RESPONSE_ID */ | |
2295 | uint8 len; | |
2296 | uint8 tfs_id; | |
2297 | uint8 data[1]; | |
2298 | } BWL_POST_PACKED_STRUCT; | |
2299 | typedef struct dot11_tfs_resp_ie dot11_tfs_resp_ie_t; | |
2300 | #define DOT11_TFS_RESP_IE_LEN 1u /* Fixed length, without id and len */ | |
2301 | ||
2302 | /** TFS response subelement IDs (same subelments, but different IDs than in TFS request */ | |
2303 | #define DOT11_TFS_RESP_TFS_STATUS_SE_ID 1 | |
2304 | #define DOT11_TFS_RESP_TFS_SE_ID 2 | |
2305 | #define DOT11_TFS_RESP_VENDOR_SE_ID 221 | |
2306 | ||
2307 | /** TFS status subelement */ | |
2308 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_status_se { | |
2309 | uint8 sub_id; /* 92, DOT11_MNG_TFS_RESPONSE_ID */ | |
2310 | uint8 len; | |
2311 | uint8 resp_st; | |
2312 | uint8 data[1]; /* Potential dot11_tfs_se_t included */ | |
2313 | } BWL_POST_PACKED_STRUCT; | |
2314 | typedef struct dot11_tfs_status_se dot11_tfs_status_se_t; | |
2315 | #define DOT11_TFS_STATUS_SE_LEN 1 /* Fixed length, without id and len */ | |
2316 | ||
2317 | /* Following Definition should be merged to FMS_TFS macro below */ | |
2318 | /* TFS Response status code. Identical to FMS Element status, without N/A */ | |
2319 | #define DOT11_TFS_STATUS_ACCEPT 0 | |
2320 | #define DOT11_TFS_STATUS_DENY_FORMAT 1 | |
2321 | #define DOT11_TFS_STATUS_DENY_RESOURCE 2 | |
2322 | #define DOT11_TFS_STATUS_DENY_POLICY 4 | |
2323 | #define DOT11_TFS_STATUS_DENY_UNSPECIFIED 5 | |
2324 | #define DOT11_TFS_STATUS_ALTPREF_POLICY 7 | |
2325 | #define DOT11_TFS_STATUS_ALTPREF_TCLAS_UNSUPP 14 | |
2326 | ||
2327 | /* FMS Element Status and TFS Response Status Definition */ | |
2328 | #define DOT11_FMS_TFS_STATUS_ACCEPT 0 | |
2329 | #define DOT11_FMS_TFS_STATUS_DENY_FORMAT 1 | |
2330 | #define DOT11_FMS_TFS_STATUS_DENY_RESOURCE 2 | |
2331 | #define DOT11_FMS_TFS_STATUS_DENY_MULTIPLE_DI 3 | |
2332 | #define DOT11_FMS_TFS_STATUS_DENY_POLICY 4 | |
2333 | #define DOT11_FMS_TFS_STATUS_DENY_UNSPECIFIED 5 | |
2334 | #define DOT11_FMS_TFS_STATUS_ALT_DIFF_DI 6 | |
2335 | #define DOT11_FMS_TFS_STATUS_ALT_POLICY 7 | |
2336 | #define DOT11_FMS_TFS_STATUS_ALT_CHANGE_DI 8 | |
2337 | #define DOT11_FMS_TFS_STATUS_ALT_MCRATE 9 | |
2338 | #define DOT11_FMS_TFS_STATUS_TERM_POLICY 10 | |
2339 | #define DOT11_FMS_TFS_STATUS_TERM_RESOURCE 11 | |
2340 | #define DOT11_FMS_TFS_STATUS_TERM_HIGHER_PRIO 12 | |
2341 | #define DOT11_FMS_TFS_STATUS_ALT_CHANGE_MDI 13 | |
2342 | #define DOT11_FMS_TFS_STATUS_ALT_TCLAS_UNSUPP 14 | |
2343 | ||
2344 | /** TFS Management Request frame header */ | |
2345 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_req { | |
2346 | uint8 category; /* category of action frame (10) */ | |
2347 | uint8 action; /* WNM action: TFS request (13) */ | |
2348 | uint8 token; /* dialog token */ | |
2349 | uint8 data[1]; /* Elements */ | |
2350 | } BWL_POST_PACKED_STRUCT; | |
2351 | typedef struct dot11_tfs_req dot11_tfs_req_t; | |
2352 | #define DOT11_TFS_REQ_LEN 3 /* Fixed length */ | |
2353 | ||
2354 | /** TFS Management Response frame header */ | |
2355 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_resp { | |
2356 | uint8 category; /* category of action frame (10) */ | |
2357 | uint8 action; /* WNM action: TFS request (14) */ | |
2358 | uint8 token; /* dialog token */ | |
2359 | uint8 data[1]; /* Elements */ | |
2360 | } BWL_POST_PACKED_STRUCT; | |
2361 | typedef struct dot11_tfs_resp dot11_tfs_resp_t; | |
2362 | #define DOT11_TFS_RESP_LEN 3 /* Fixed length */ | |
2363 | ||
2364 | /** TFS Management Notify frame request header */ | |
2365 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_notify_req { | |
2366 | uint8 category; /* category of action frame (10) */ | |
2367 | uint8 action; /* WNM action: TFS notify request (15) */ | |
2368 | uint8 tfs_id_cnt; /* TFS IDs count */ | |
2369 | uint8 tfs_id[1]; /* Array of TFS IDs */ | |
2370 | } BWL_POST_PACKED_STRUCT; | |
2371 | typedef struct dot11_tfs_notify_req dot11_tfs_notify_req_t; | |
2372 | #define DOT11_TFS_NOTIFY_REQ_LEN 3 /* Fixed length */ | |
2373 | ||
2374 | /** TFS Management Notify frame response header */ | |
2375 | BWL_PRE_PACKED_STRUCT struct dot11_tfs_notify_resp { | |
2376 | uint8 category; /* category of action frame (10) */ | |
2377 | uint8 action; /* WNM action: TFS notify response (28) */ | |
2378 | uint8 tfs_id_cnt; /* TFS IDs count */ | |
2379 | uint8 tfs_id[1]; /* Array of TFS IDs */ | |
2380 | } BWL_POST_PACKED_STRUCT; | |
2381 | typedef struct dot11_tfs_notify_resp dot11_tfs_notify_resp_t; | |
2382 | #define DOT11_TFS_NOTIFY_RESP_LEN 3 /* Fixed length */ | |
2383 | ||
2384 | /** WNM-Sleep Management Request frame header */ | |
2385 | BWL_PRE_PACKED_STRUCT struct dot11_wnm_sleep_req { | |
2386 | uint8 category; /* category of action frame (10) */ | |
2387 | uint8 action; /* WNM action: wnm-sleep request (16) */ | |
2388 | uint8 token; /* dialog token */ | |
2389 | uint8 data[1]; /* Elements */ | |
2390 | } BWL_POST_PACKED_STRUCT; | |
2391 | typedef struct dot11_wnm_sleep_req dot11_wnm_sleep_req_t; | |
2392 | #define DOT11_WNM_SLEEP_REQ_LEN 3 /* Fixed length */ | |
2393 | ||
2394 | /** WNM-Sleep Management Response frame header */ | |
2395 | BWL_PRE_PACKED_STRUCT struct dot11_wnm_sleep_resp { | |
2396 | uint8 category; /* category of action frame (10) */ | |
2397 | uint8 action; /* WNM action: wnm-sleep request (17) */ | |
2398 | uint8 token; /* dialog token */ | |
2399 | uint16 key_len; /* key data length */ | |
2400 | uint8 data[1]; /* Elements */ | |
2401 | } BWL_POST_PACKED_STRUCT; | |
2402 | typedef struct dot11_wnm_sleep_resp dot11_wnm_sleep_resp_t; | |
2403 | #define DOT11_WNM_SLEEP_RESP_LEN 5 /* Fixed length */ | |
2404 | ||
2405 | #define DOT11_WNM_SLEEP_SUBELEM_ID_GTK 0 | |
2406 | #define DOT11_WNM_SLEEP_SUBELEM_ID_IGTK 1 | |
2407 | ||
2408 | BWL_PRE_PACKED_STRUCT struct dot11_wnm_sleep_subelem_gtk { | |
2409 | uint8 sub_id; | |
2410 | uint8 len; | |
2411 | uint16 key_info; | |
2412 | uint8 key_length; | |
2413 | uint8 rsc[8]; | |
2414 | uint8 key[1]; | |
2415 | } BWL_POST_PACKED_STRUCT; | |
2416 | typedef struct dot11_wnm_sleep_subelem_gtk dot11_wnm_sleep_subelem_gtk_t; | |
2417 | #define DOT11_WNM_SLEEP_SUBELEM_GTK_FIXED_LEN 11 /* without sub_id, len, and key */ | |
2418 | #define DOT11_WNM_SLEEP_SUBELEM_GTK_MAX_LEN 43 /* without sub_id and len */ | |
2419 | ||
2420 | BWL_PRE_PACKED_STRUCT struct dot11_wnm_sleep_subelem_igtk { | |
2421 | uint8 sub_id; | |
2422 | uint8 len; | |
2423 | uint16 key_id; | |
2424 | uint8 pn[6]; | |
2425 | uint8 key[16]; | |
2426 | } BWL_POST_PACKED_STRUCT; | |
2427 | typedef struct dot11_wnm_sleep_subelem_igtk dot11_wnm_sleep_subelem_igtk_t; | |
2428 | #define DOT11_WNM_SLEEP_SUBELEM_IGTK_LEN 24 /* Fixed length */ | |
2429 | ||
2430 | BWL_PRE_PACKED_STRUCT struct dot11_wnm_sleep_ie { | |
2431 | uint8 id; /* 93, DOT11_MNG_WNM_SLEEP_MODE_ID */ | |
2432 | uint8 len; | |
2433 | uint8 act_type; | |
2434 | uint8 resp_status; | |
2435 | uint16 interval; | |
2436 | } BWL_POST_PACKED_STRUCT; | |
2437 | typedef struct dot11_wnm_sleep_ie dot11_wnm_sleep_ie_t; | |
2438 | #define DOT11_WNM_SLEEP_IE_LEN 4 /* Fixed length */ | |
2439 | ||
2440 | #define DOT11_WNM_SLEEP_ACT_TYPE_ENTER 0 | |
2441 | #define DOT11_WNM_SLEEP_ACT_TYPE_EXIT 1 | |
2442 | ||
2443 | #define DOT11_WNM_SLEEP_RESP_ACCEPT 0 | |
2444 | #define DOT11_WNM_SLEEP_RESP_UPDATE 1 | |
2445 | #define DOT11_WNM_SLEEP_RESP_DENY 2 | |
2446 | #define DOT11_WNM_SLEEP_RESP_DENY_TEMP 3 | |
2447 | #define DOT11_WNM_SLEEP_RESP_DENY_KEY 4 | |
2448 | #define DOT11_WNM_SLEEP_RESP_DENY_INUSE 5 | |
2449 | #define DOT11_WNM_SLEEP_RESP_LAST 6 | |
2450 | ||
2451 | /** DMS Management Request frame header */ | |
2452 | BWL_PRE_PACKED_STRUCT struct dot11_dms_req { | |
2453 | uint8 category; /* category of action frame (10) */ | |
2454 | uint8 action; /* WNM action: dms request (23) */ | |
2455 | uint8 token; /* dialog token */ | |
2456 | uint8 data[1]; /* Elements */ | |
2457 | } BWL_POST_PACKED_STRUCT; | |
2458 | typedef struct dot11_dms_req dot11_dms_req_t; | |
2459 | #define DOT11_DMS_REQ_LEN 3 /* Fixed length */ | |
2460 | ||
2461 | /** DMS Management Response frame header */ | |
2462 | BWL_PRE_PACKED_STRUCT struct dot11_dms_resp { | |
2463 | uint8 category; /* category of action frame (10) */ | |
2464 | uint8 action; /* WNM action: dms request (24) */ | |
2465 | uint8 token; /* dialog token */ | |
2466 | uint8 data[1]; /* Elements */ | |
2467 | } BWL_POST_PACKED_STRUCT; | |
2468 | typedef struct dot11_dms_resp dot11_dms_resp_t; | |
2469 | #define DOT11_DMS_RESP_LEN 3 /* Fixed length */ | |
2470 | ||
2471 | /** DMS request element */ | |
2472 | BWL_PRE_PACKED_STRUCT struct dot11_dms_req_ie { | |
2473 | uint8 id; /* 99, DOT11_MNG_DMS_REQUEST_ID */ | |
2474 | uint8 len; | |
2475 | uint8 data[1]; | |
2476 | } BWL_POST_PACKED_STRUCT; | |
2477 | typedef struct dot11_dms_req_ie dot11_dms_req_ie_t; | |
2478 | #define DOT11_DMS_REQ_IE_LEN 2 /* Fixed length */ | |
2479 | ||
2480 | /** DMS response element */ | |
2481 | BWL_PRE_PACKED_STRUCT struct dot11_dms_resp_ie { | |
2482 | uint8 id; /* 100, DOT11_MNG_DMS_RESPONSE_ID */ | |
2483 | uint8 len; | |
2484 | uint8 data[1]; | |
2485 | } BWL_POST_PACKED_STRUCT; | |
2486 | typedef struct dot11_dms_resp_ie dot11_dms_resp_ie_t; | |
2487 | #define DOT11_DMS_RESP_IE_LEN 2 /* Fixed length */ | |
2488 | ||
2489 | /** DMS request descriptor */ | |
2490 | BWL_PRE_PACKED_STRUCT struct dot11_dms_req_desc { | |
2491 | uint8 dms_id; | |
2492 | uint8 len; | |
2493 | uint8 type; | |
2494 | uint8 data[1]; | |
2495 | } BWL_POST_PACKED_STRUCT; | |
2496 | typedef struct dot11_dms_req_desc dot11_dms_req_desc_t; | |
2497 | #define DOT11_DMS_REQ_DESC_LEN 3 /* Fixed length */ | |
2498 | ||
2499 | #define DOT11_DMS_REQ_TYPE_ADD 0 | |
2500 | #define DOT11_DMS_REQ_TYPE_REMOVE 1 | |
2501 | #define DOT11_DMS_REQ_TYPE_CHANGE 2 | |
2502 | ||
2503 | /** DMS response status */ | |
2504 | BWL_PRE_PACKED_STRUCT struct dot11_dms_resp_st { | |
2505 | uint8 dms_id; | |
2506 | uint8 len; | |
2507 | uint8 type; | |
2508 | uint16 lsc; | |
2509 | uint8 data[1]; | |
2510 | } BWL_POST_PACKED_STRUCT; | |
2511 | typedef struct dot11_dms_resp_st dot11_dms_resp_st_t; | |
2512 | #define DOT11_DMS_RESP_STATUS_LEN 5 /* Fixed length */ | |
2513 | ||
2514 | #define DOT11_DMS_RESP_TYPE_ACCEPT 0 | |
2515 | #define DOT11_DMS_RESP_TYPE_DENY 1 | |
2516 | #define DOT11_DMS_RESP_TYPE_TERM 2 | |
2517 | ||
2518 | #define DOT11_DMS_RESP_LSC_UNSUPPORTED 0xFFFF | |
2519 | ||
2520 | /** WNM-Notification Request frame header */ | |
2521 | BWL_PRE_PACKED_STRUCT struct dot11_wnm_notif_req { | |
2522 | uint8 category; /* category of action frame (10) */ | |
2523 | uint8 action; /* WNM action: Notification request (26) */ | |
2524 | uint8 token; /* dialog token */ | |
2525 | uint8 type; /* type */ | |
2526 | uint8 data[1]; /* Sub-elements */ | |
2527 | } BWL_POST_PACKED_STRUCT; | |
2528 | typedef struct dot11_wnm_notif_req dot11_wnm_notif_req_t; | |
2529 | #define DOT11_WNM_NOTIF_REQ_LEN 4 /* Fixed length */ | |
2530 | ||
2531 | /** FMS Management Request frame header */ | |
2532 | BWL_PRE_PACKED_STRUCT struct dot11_fms_req { | |
2533 | uint8 category; /* category of action frame (10) */ | |
2534 | uint8 action; /* WNM action: fms request (9) */ | |
2535 | uint8 token; /* dialog token */ | |
2536 | uint8 data[1]; /* Elements */ | |
2537 | } BWL_POST_PACKED_STRUCT; | |
2538 | typedef struct dot11_fms_req dot11_fms_req_t; | |
2539 | #define DOT11_FMS_REQ_LEN 3 /* Fixed length */ | |
2540 | ||
2541 | /** FMS Management Response frame header */ | |
2542 | BWL_PRE_PACKED_STRUCT struct dot11_fms_resp { | |
2543 | uint8 category; /* category of action frame (10) */ | |
2544 | uint8 action; /* WNM action: fms request (10) */ | |
2545 | uint8 token; /* dialog token */ | |
2546 | uint8 data[1]; /* Elements */ | |
2547 | } BWL_POST_PACKED_STRUCT; | |
2548 | typedef struct dot11_fms_resp dot11_fms_resp_t; | |
2549 | #define DOT11_FMS_RESP_LEN 3 /* Fixed length */ | |
2550 | ||
2551 | /** FMS Descriptor element */ | |
2552 | BWL_PRE_PACKED_STRUCT struct dot11_fms_desc { | |
2553 | uint8 id; | |
2554 | uint8 len; | |
2555 | uint8 num_fms_cnt; | |
2556 | uint8 data[1]; | |
2557 | } BWL_POST_PACKED_STRUCT; | |
2558 | typedef struct dot11_fms_desc dot11_fms_desc_t; | |
2559 | #define DOT11_FMS_DESC_LEN 1 /* Fixed length */ | |
2560 | ||
2561 | #define DOT11_FMS_CNTR_MAX 0x8 | |
2562 | #define DOT11_FMS_CNTR_ID_MASK 0x7 | |
2563 | #define DOT11_FMS_CNTR_ID_SHIFT 0x0 | |
2564 | #define DOT11_FMS_CNTR_COUNT_MASK 0xf1 | |
2565 | #define DOT11_FMS_CNTR_SHIFT 0x3 | |
2566 | ||
2567 | /** FMS request element */ | |
2568 | BWL_PRE_PACKED_STRUCT struct dot11_fms_req_ie { | |
2569 | uint8 id; | |
2570 | uint8 len; | |
2571 | uint8 fms_token; /* token used to identify fms stream set */ | |
2572 | uint8 data[1]; | |
2573 | } BWL_POST_PACKED_STRUCT; | |
2574 | typedef struct dot11_fms_req_ie dot11_fms_req_ie_t; | |
2575 | #define DOT11_FMS_REQ_IE_FIX_LEN 1 /* Fixed length */ | |
2576 | ||
2577 | BWL_PRE_PACKED_STRUCT struct dot11_rate_id_field { | |
2578 | uint8 mask; | |
2579 | uint8 mcs_idx; | |
2580 | uint16 rate; | |
2581 | } BWL_POST_PACKED_STRUCT; | |
2582 | typedef struct dot11_rate_id_field dot11_rate_id_field_t; | |
2583 | #define DOT11_RATE_ID_FIELD_MCS_SEL_MASK 0x7 | |
2584 | #define DOT11_RATE_ID_FIELD_MCS_SEL_OFFSET 0 | |
2585 | #define DOT11_RATE_ID_FIELD_RATETYPE_MASK 0x18 | |
2586 | #define DOT11_RATE_ID_FIELD_RATETYPE_OFFSET 3 | |
2587 | #define DOT11_RATE_ID_FIELD_LEN sizeof(dot11_rate_id_field_t) | |
2588 | ||
2589 | /** FMS request subelements */ | |
2590 | BWL_PRE_PACKED_STRUCT struct dot11_fms_se { | |
2591 | uint8 sub_id; | |
2592 | uint8 len; | |
2593 | uint8 interval; | |
2594 | uint8 max_interval; | |
2595 | dot11_rate_id_field_t rate; | |
2596 | uint8 data[1]; | |
2597 | } BWL_POST_PACKED_STRUCT; | |
2598 | typedef struct dot11_fms_se dot11_fms_se_t; | |
2599 | #define DOT11_FMS_REQ_SE_LEN 6 /* Fixed length */ | |
2600 | ||
2601 | #define DOT11_FMS_REQ_SE_ID_FMS 1 /* FMS subelement */ | |
2602 | #define DOT11_FMS_REQ_SE_ID_VS 221 /* Vendor Specific subelement */ | |
2603 | ||
2604 | /** FMS response element */ | |
2605 | BWL_PRE_PACKED_STRUCT struct dot11_fms_resp_ie { | |
2606 | uint8 id; | |
2607 | uint8 len; | |
2608 | uint8 fms_token; | |
2609 | uint8 data[1]; | |
2610 | } BWL_POST_PACKED_STRUCT; | |
2611 | typedef struct dot11_fms_resp_ie dot11_fms_resp_ie_t; | |
2612 | #define DOT11_FMS_RESP_IE_FIX_LEN 1 /* Fixed length */ | |
2613 | ||
2614 | /* FMS status subelements */ | |
2615 | #define DOT11_FMS_STATUS_SE_ID_FMS 1 /* FMS Status */ | |
2616 | #define DOT11_FMS_STATUS_SE_ID_TCLAS 2 /* TCLAS Status */ | |
2617 | #define DOT11_FMS_STATUS_SE_ID_VS 221 /* Vendor Specific subelement */ | |
2618 | ||
2619 | /** FMS status subelement */ | |
2620 | BWL_PRE_PACKED_STRUCT struct dot11_fms_status_se { | |
2621 | uint8 sub_id; | |
2622 | uint8 len; | |
2623 | uint8 status; | |
2624 | uint8 interval; | |
2625 | uint8 max_interval; | |
2626 | uint8 fmsid; | |
2627 | uint8 counter; | |
2628 | dot11_rate_id_field_t rate; | |
2629 | uint8 mcast_addr[ETHER_ADDR_LEN]; | |
2630 | } BWL_POST_PACKED_STRUCT; | |
2631 | typedef struct dot11_fms_status_se dot11_fms_status_se_t; | |
2632 | #define DOT11_FMS_STATUS_SE_LEN 15 /* Fixed length */ | |
2633 | ||
2634 | /** TCLAS status subelement */ | |
2635 | BWL_PRE_PACKED_STRUCT struct dot11_tclas_status_se { | |
2636 | uint8 sub_id; | |
2637 | uint8 len; | |
2638 | uint8 fmsid; | |
2639 | uint8 data[1]; | |
2640 | } BWL_POST_PACKED_STRUCT; | |
2641 | typedef struct dot11_tclas_status_se dot11_tclas_status_se_t; | |
2642 | #define DOT11_TCLAS_STATUS_SE_LEN 1 /* Fixed length */ | |
2643 | ||
2644 | BWL_PRE_PACKED_STRUCT struct dot11_addba_req { | |
2645 | uint8 category; /* category of action frame (3) */ | |
2646 | uint8 action; /* action: addba req */ | |
2647 | uint8 token; /* identifier */ | |
2648 | uint16 addba_param_set; /* parameter set */ | |
2649 | uint16 timeout; /* timeout in seconds */ | |
2650 | uint16 start_seqnum; /* starting sequence number */ | |
2651 | } BWL_POST_PACKED_STRUCT; | |
2652 | typedef struct dot11_addba_req dot11_addba_req_t; | |
2653 | #define DOT11_ADDBA_REQ_LEN 9 /* length of addba req frame */ | |
2654 | ||
2655 | BWL_PRE_PACKED_STRUCT struct dot11_addba_resp { | |
2656 | uint8 category; /* category of action frame (3) */ | |
2657 | uint8 action; /* action: addba resp */ | |
2658 | uint8 token; /* identifier */ | |
2659 | uint16 status; /* status of add request */ | |
2660 | uint16 addba_param_set; /* negotiated parameter set */ | |
2661 | uint16 timeout; /* negotiated timeout in seconds */ | |
2662 | } BWL_POST_PACKED_STRUCT; | |
2663 | typedef struct dot11_addba_resp dot11_addba_resp_t; | |
2664 | #define DOT11_ADDBA_RESP_LEN 9 /* length of addba resp frame */ | |
2665 | ||
2666 | /* DELBA action parameters */ | |
2667 | #define DOT11_DELBA_PARAM_INIT_MASK 0x0800 /* initiator mask */ | |
2668 | #define DOT11_DELBA_PARAM_INIT_SHIFT 11 /* initiator shift */ | |
2669 | #define DOT11_DELBA_PARAM_TID_MASK 0xf000 /* tid mask */ | |
2670 | #define DOT11_DELBA_PARAM_TID_SHIFT 12 /* tid shift */ | |
2671 | ||
2672 | BWL_PRE_PACKED_STRUCT struct dot11_delba { | |
2673 | uint8 category; /* category of action frame (3) */ | |
2674 | uint8 action; /* action: addba req */ | |
2675 | uint16 delba_param_set; /* paarmeter set */ | |
2676 | uint16 reason; /* reason for dellba */ | |
2677 | } BWL_POST_PACKED_STRUCT; | |
2678 | typedef struct dot11_delba dot11_delba_t; | |
2679 | #define DOT11_DELBA_LEN 6 /* length of delba frame */ | |
2680 | ||
2681 | /* SA Query action field value */ | |
2682 | #define SA_QUERY_REQUEST 0 | |
2683 | #define SA_QUERY_RESPONSE 1 | |
2684 | ||
2685 | /* ************* 802.11r related definitions. ************* */ | |
2686 | ||
2687 | /** Over-the-DS Fast Transition Request frame header */ | |
2688 | BWL_PRE_PACKED_STRUCT struct dot11_ft_req { | |
2689 | uint8 category; /* category of action frame (6) */ | |
2690 | uint8 action; /* action: ft req */ | |
2691 | uint8 sta_addr[ETHER_ADDR_LEN]; | |
2692 | uint8 tgt_ap_addr[ETHER_ADDR_LEN]; | |
2693 | uint8 data[1]; /* Elements */ | |
2694 | } BWL_POST_PACKED_STRUCT; | |
2695 | typedef struct dot11_ft_req dot11_ft_req_t; | |
2696 | #define DOT11_FT_REQ_FIXED_LEN 14 | |
2697 | ||
2698 | /** Over-the-DS Fast Transition Response frame header */ | |
2699 | BWL_PRE_PACKED_STRUCT struct dot11_ft_res { | |
2700 | uint8 category; /* category of action frame (6) */ | |
2701 | uint8 action; /* action: ft resp */ | |
2702 | uint8 sta_addr[ETHER_ADDR_LEN]; | |
2703 | uint8 tgt_ap_addr[ETHER_ADDR_LEN]; | |
2704 | uint16 status; /* status code */ | |
2705 | uint8 data[1]; /* Elements */ | |
2706 | } BWL_POST_PACKED_STRUCT; | |
2707 | typedef struct dot11_ft_res dot11_ft_res_t; | |
2708 | #define DOT11_FT_RES_FIXED_LEN 16 | |
2709 | ||
2710 | /** RDE RIC Data Element. */ | |
2711 | BWL_PRE_PACKED_STRUCT struct dot11_rde_ie { | |
2712 | uint8 id; /* 11r, DOT11_MNG_RDE_ID */ | |
2713 | uint8 length; | |
2714 | uint8 rde_id; /* RDE identifier. */ | |
2715 | uint8 rd_count; /* Resource Descriptor Count. */ | |
2716 | uint16 status; /* Status Code. */ | |
2717 | } BWL_POST_PACKED_STRUCT; | |
2718 | typedef struct dot11_rde_ie dot11_rde_ie_t; | |
2719 | ||
2720 | /* 11r - Size of the RDE (RIC Data Element) IE, including TLV header. */ | |
2721 | #define DOT11_MNG_RDE_IE_LEN sizeof(dot11_rde_ie_t) | |
2722 | ||
2723 | /* ************* 802.11k related definitions. ************* */ | |
2724 | ||
2725 | /* Radio measurements enabled capability ie */ | |
2726 | #define DOT11_RRM_CAP_LEN 5 /* length of rrm cap bitmap */ | |
2727 | #define RCPI_IE_LEN 1 | |
2728 | #define RSNI_IE_LEN 1 | |
2729 | BWL_PRE_PACKED_STRUCT struct dot11_rrm_cap_ie { | |
2730 | uint8 cap[DOT11_RRM_CAP_LEN]; | |
2731 | } BWL_POST_PACKED_STRUCT; | |
2732 | typedef struct dot11_rrm_cap_ie dot11_rrm_cap_ie_t; | |
2733 | ||
2734 | /* Bitmap definitions for cap ie */ | |
2735 | #define DOT11_RRM_CAP_LINK 0 | |
2736 | #define DOT11_RRM_CAP_NEIGHBOR_REPORT 1 | |
2737 | #define DOT11_RRM_CAP_PARALLEL 2 | |
2738 | #define DOT11_RRM_CAP_REPEATED 3 | |
2739 | #define DOT11_RRM_CAP_BCN_PASSIVE 4 | |
2740 | #define DOT11_RRM_CAP_BCN_ACTIVE 5 | |
2741 | #define DOT11_RRM_CAP_BCN_TABLE 6 | |
2742 | #define DOT11_RRM_CAP_BCN_REP_COND 7 | |
2743 | #define DOT11_RRM_CAP_FM 8 | |
2744 | #define DOT11_RRM_CAP_CLM 9 | |
2745 | #define DOT11_RRM_CAP_NHM 10 | |
2746 | #define DOT11_RRM_CAP_SM 11 | |
2747 | #define DOT11_RRM_CAP_LCIM 12 | |
2748 | #define DOT11_RRM_CAP_LCIA 13 | |
2749 | #define DOT11_RRM_CAP_TSCM 14 | |
2750 | #define DOT11_RRM_CAP_TTSCM 15 | |
2751 | #define DOT11_RRM_CAP_AP_CHANREP 16 | |
2752 | #define DOT11_RRM_CAP_RMMIB 17 | |
2753 | /* bit18-bit23, not used for RRM_IOVAR */ | |
2754 | #define DOT11_RRM_CAP_MPC0 24 | |
2755 | #define DOT11_RRM_CAP_MPC1 25 | |
2756 | #define DOT11_RRM_CAP_MPC2 26 | |
2757 | #define DOT11_RRM_CAP_MPTI 27 | |
2758 | #define DOT11_RRM_CAP_NBRTSFO 28 | |
2759 | #define DOT11_RRM_CAP_RCPI 29 | |
2760 | #define DOT11_RRM_CAP_RSNI 30 | |
2761 | #define DOT11_RRM_CAP_BSSAAD 31 | |
2762 | #define DOT11_RRM_CAP_BSSAAC 32 | |
2763 | #define DOT11_RRM_CAP_AI 33 | |
2764 | #define DOT11_RRM_CAP_FTM_RANGE 34 | |
2765 | #define DOT11_RRM_CAP_CIVIC_LOC 35 | |
2766 | #define DOT11_RRM_CAP_IDENT_LOC 36 | |
2767 | #define DOT11_RRM_CAP_LAST 36 | |
2768 | ||
2769 | #ifdef WL11K_ALL_MEAS | |
2770 | #define DOT11_RRM_CAP_LINK_ENAB (1 << DOT11_RRM_CAP_LINK) | |
2771 | #define DOT11_RRM_CAP_FM_ENAB (1 << (DOT11_RRM_CAP_FM - 8)) | |
2772 | #define DOT11_RRM_CAP_CLM_ENAB (1 << (DOT11_RRM_CAP_CLM - 8)) | |
2773 | #define DOT11_RRM_CAP_NHM_ENAB (1 << (DOT11_RRM_CAP_NHM - 8)) | |
2774 | #define DOT11_RRM_CAP_SM_ENAB (1 << (DOT11_RRM_CAP_SM - 8)) | |
2775 | #define DOT11_RRM_CAP_LCIM_ENAB (1 << (DOT11_RRM_CAP_LCIM - 8)) | |
2776 | #define DOT11_RRM_CAP_TSCM_ENAB (1 << (DOT11_RRM_CAP_TSCM - 8)) | |
2777 | #ifdef WL11K_AP | |
2778 | #define DOT11_RRM_CAP_MPC0_ENAB (1 << (DOT11_RRM_CAP_MPC0 - 24)) | |
2779 | #define DOT11_RRM_CAP_MPC1_ENAB (1 << (DOT11_RRM_CAP_MPC1 - 24)) | |
2780 | #define DOT11_RRM_CAP_MPC2_ENAB (1 << (DOT11_RRM_CAP_MPC2 - 24)) | |
2781 | #define DOT11_RRM_CAP_MPTI_ENAB (1 << (DOT11_RRM_CAP_MPTI - 24)) | |
2782 | #else | |
2783 | #define DOT11_RRM_CAP_MPC0_ENAB 0 | |
2784 | #define DOT11_RRM_CAP_MPC1_ENAB 0 | |
2785 | #define DOT11_RRM_CAP_MPC2_ENAB 0 | |
2786 | #define DOT11_RRM_CAP_MPTI_ENAB 0 | |
2787 | #endif /* WL11K_AP */ | |
2788 | #define DOT11_RRM_CAP_CIVIC_LOC_ENAB (1 << (DOT11_RRM_CAP_CIVIC_LOC - 32)) | |
2789 | #define DOT11_RRM_CAP_IDENT_LOC_ENAB (1 << (DOT11_RRM_CAP_IDENT_LOC - 32)) | |
2790 | #else | |
2791 | #define DOT11_RRM_CAP_LINK_ENAB 0 | |
2792 | #define DOT11_RRM_CAP_FM_ENAB 0 | |
2793 | #define DOT11_RRM_CAP_CLM_ENAB 0 | |
2794 | #define DOT11_RRM_CAP_NHM_ENAB 0 | |
2795 | #define DOT11_RRM_CAP_SM_ENAB 0 | |
2796 | #define DOT11_RRM_CAP_LCIM_ENAB 0 | |
2797 | #define DOT11_RRM_CAP_TSCM_ENAB 0 | |
2798 | #define DOT11_RRM_CAP_MPC0_ENAB 0 | |
2799 | #define DOT11_RRM_CAP_MPC1_ENAB 0 | |
2800 | #define DOT11_RRM_CAP_MPC2_ENAB 0 | |
2801 | #define DOT11_RRM_CAP_MPTI_ENAB 0 | |
2802 | #define DOT11_RRM_CAP_CIVIC_LOC_ENAB 0 | |
2803 | #define DOT11_RRM_CAP_IDENT_LOC_ENAB 0 | |
2804 | #endif /* WL11K_ALL_MEAS */ | |
2805 | #ifdef WL11K_NBR_MEAS | |
2806 | #define DOT11_RRM_CAP_NEIGHBOR_REPORT_ENAB (1 << DOT11_RRM_CAP_NEIGHBOR_REPORT) | |
2807 | #else | |
2808 | #define DOT11_RRM_CAP_NEIGHBOR_REPORT_ENAB 0 | |
2809 | #endif /* WL11K_NBR_MEAS */ | |
2810 | #ifdef WL11K_BCN_MEAS | |
2811 | #define DOT11_RRM_CAP_BCN_PASSIVE_ENAB (1 << DOT11_RRM_CAP_BCN_PASSIVE) | |
2812 | #define DOT11_RRM_CAP_BCN_ACTIVE_ENAB (1 << DOT11_RRM_CAP_BCN_ACTIVE) | |
2813 | #else | |
2814 | #define DOT11_RRM_CAP_BCN_PASSIVE_ENAB 0 | |
2815 | #define DOT11_RRM_CAP_BCN_ACTIVE_ENAB 0 | |
2816 | #endif /* WL11K_BCN_MEAS */ | |
2817 | #define DOT11_RRM_CAP_MPA_MASK 0x7 | |
2818 | /* Operating Class (formerly "Regulatory Class") definitions */ | |
2819 | #define DOT11_OP_CLASS_NONE 255 | |
2820 | ||
2821 | BWL_PRE_PACKED_STRUCT struct do11_ap_chrep { | |
2822 | uint8 id; | |
2823 | uint8 len; | |
2824 | uint8 reg; | |
2825 | uint8 chanlist[1]; | |
2826 | } BWL_POST_PACKED_STRUCT; | |
2827 | typedef struct do11_ap_chrep dot11_ap_chrep_t; | |
2828 | ||
2829 | /* Radio Measurements action ids */ | |
2830 | #define DOT11_RM_ACTION_RM_REQ 0 /* Radio measurement request */ | |
2831 | #define DOT11_RM_ACTION_RM_REP 1 /* Radio measurement report */ | |
2832 | #define DOT11_RM_ACTION_LM_REQ 2 /* Link measurement request */ | |
2833 | #define DOT11_RM_ACTION_LM_REP 3 /* Link measurement report */ | |
2834 | #define DOT11_RM_ACTION_NR_REQ 4 /* Neighbor report request */ | |
2835 | #define DOT11_RM_ACTION_NR_REP 5 /* Neighbor report response */ | |
2836 | #define DOT11_PUB_ACTION_MP 7 /* Measurement Pilot public action id */ | |
2837 | ||
2838 | /** Generic radio measurement action frame header */ | |
2839 | BWL_PRE_PACKED_STRUCT struct dot11_rm_action { | |
2840 | uint8 category; /* category of action frame (5) */ | |
2841 | uint8 action; /* radio measurement action */ | |
2842 | uint8 token; /* dialog token */ | |
2843 | uint8 data[1]; | |
2844 | } BWL_POST_PACKED_STRUCT; | |
2845 | typedef struct dot11_rm_action dot11_rm_action_t; | |
2846 | #define DOT11_RM_ACTION_LEN 3 | |
2847 | ||
2848 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq { | |
2849 | uint8 category; /* category of action frame (5) */ | |
2850 | uint8 action; /* radio measurement action */ | |
2851 | uint8 token; /* dialog token */ | |
2852 | uint16 reps; /* no. of repetitions */ | |
2853 | uint8 data[1]; | |
2854 | } BWL_POST_PACKED_STRUCT; | |
2855 | typedef struct dot11_rmreq dot11_rmreq_t; | |
2856 | #define DOT11_RMREQ_LEN 5 | |
2857 | ||
2858 | BWL_PRE_PACKED_STRUCT struct dot11_rm_ie { | |
2859 | uint8 id; | |
2860 | uint8 len; | |
2861 | uint8 token; | |
2862 | uint8 mode; | |
2863 | uint8 type; | |
2864 | } BWL_POST_PACKED_STRUCT; | |
2865 | typedef struct dot11_rm_ie dot11_rm_ie_t; | |
2866 | #define DOT11_RM_IE_LEN 5 | |
2867 | ||
2868 | /* Definitions for "mode" bits in rm req */ | |
2869 | #define DOT11_RMREQ_MODE_PARALLEL 1 | |
2870 | #define DOT11_RMREQ_MODE_ENABLE 2 | |
2871 | #define DOT11_RMREQ_MODE_REQUEST 4 | |
2872 | #define DOT11_RMREQ_MODE_REPORT 8 | |
2873 | #define DOT11_RMREQ_MODE_DURMAND 0x10 /* Duration Mandatory */ | |
2874 | ||
2875 | /* Definitions for "mode" bits in rm rep */ | |
2876 | #define DOT11_RMREP_MODE_LATE 1 | |
2877 | #define DOT11_RMREP_MODE_INCAPABLE 2 | |
2878 | #define DOT11_RMREP_MODE_REFUSED 4 | |
2879 | ||
2880 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_bcn { | |
2881 | uint8 id; | |
2882 | uint8 len; | |
2883 | uint8 token; | |
2884 | uint8 mode; | |
2885 | uint8 type; | |
2886 | uint8 reg; | |
2887 | uint8 channel; | |
2888 | uint16 interval; | |
2889 | uint16 duration; | |
2890 | uint8 bcn_mode; | |
2891 | struct ether_addr bssid; | |
2892 | } BWL_POST_PACKED_STRUCT; | |
2893 | typedef struct dot11_rmreq_bcn dot11_rmreq_bcn_t; | |
5a068558 | 2894 | #define DOT11_RMREQ_BCN_LEN 18u |
1cac41cb MB |
2895 | |
2896 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_bcn { | |
2897 | uint8 reg; | |
2898 | uint8 channel; | |
2899 | uint32 starttime[2]; | |
2900 | uint16 duration; | |
2901 | uint8 frame_info; | |
2902 | uint8 rcpi; | |
2903 | uint8 rsni; | |
2904 | struct ether_addr bssid; | |
2905 | uint8 antenna_id; | |
2906 | uint32 parent_tsf; | |
2907 | } BWL_POST_PACKED_STRUCT; | |
2908 | typedef struct dot11_rmrep_bcn dot11_rmrep_bcn_t; | |
2909 | #define DOT11_RMREP_BCN_LEN 26 | |
2910 | ||
2911 | /* Beacon request measurement mode */ | |
2912 | #define DOT11_RMREQ_BCN_PASSIVE 0 | |
2913 | #define DOT11_RMREQ_BCN_ACTIVE 1 | |
2914 | #define DOT11_RMREQ_BCN_TABLE 2 | |
2915 | ||
2916 | /* Sub-element IDs for Beacon Request */ | |
2917 | #define DOT11_RMREQ_BCN_SSID_ID 0 | |
2918 | #define DOT11_RMREQ_BCN_REPINFO_ID 1 | |
2919 | #define DOT11_RMREQ_BCN_REPDET_ID 2 | |
2920 | #define DOT11_RMREQ_BCN_REQUEST_ID 10 | |
2921 | #define DOT11_RMREQ_BCN_APCHREP_ID DOT11_MNG_AP_CHREP_ID | |
2922 | #define DOT11_RMREQ_BCN_LAST_RPT_IND_REQ_ID 164 | |
2923 | ||
2924 | /* Reporting Detail element definition */ | |
2925 | #define DOT11_RMREQ_BCN_REPDET_FIXED 0 /* Fixed length fields only */ | |
2926 | #define DOT11_RMREQ_BCN_REPDET_REQUEST 1 /* + requested information elems */ | |
2927 | #define DOT11_RMREQ_BCN_REPDET_ALL 2 /* All fields */ | |
2928 | ||
2929 | /* Reporting Information (reporting condition) element definition */ | |
2930 | #define DOT11_RMREQ_BCN_REPINFO_LEN 2 /* Beacon Reporting Information length */ | |
2931 | #define DOT11_RMREQ_BCN_REPCOND_DEFAULT 0 /* Report to be issued after each measurement */ | |
2932 | ||
2933 | /* Last Beacon Report Indication Request definition */ | |
2934 | #define DOT11_RMREQ_BCN_LAST_RPT_IND_REQ_ENAB 1 | |
2935 | ||
2936 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_last_bcn_rpt_ind_req { | |
2937 | uint8 id; /* DOT11_RMREQ_BCN_LAST_RPT_IND_REQ_ID */ | |
2938 | uint8 len; /* length of remaining fields */ | |
2939 | uint8 data; /* data = 1 means last bcn rpt ind requested */ | |
2940 | } BWL_POST_PACKED_STRUCT; | |
2941 | typedef struct dot11_rmrep_last_bcn_rpt_ind_req dot11_rmrep_last_bcn_rpt_ind_req_t; | |
2942 | ||
2943 | /* Sub-element IDs for Beacon Report */ | |
2944 | #define DOT11_RMREP_BCN_FRM_BODY 1 | |
2945 | #define DOT11_RMREP_BCN_FRM_BODY_FRAG_ID 2 | |
2946 | #define DOT11_RMREP_BCN_LAST_RPT_IND 164 | |
2947 | #define DOT11_RMREP_BCN_FRM_BODY_LEN_MAX 224 /* 802.11k-2008 7.3.2.22.6 */ | |
2948 | ||
2949 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_bcn_frm_body_frag_id { | |
2950 | uint8 id; /* DOT11_RMREP_BCN_FRM_BODY_FRAG_ID */ | |
2951 | uint8 len; /* length of remaining fields */ | |
2952 | uint8 bcn_rpt_id; /* Bcn rpt instance ID */ | |
2953 | uint8 frag_info; /* fragment Id(7 bits) | More fragments(1 bit) */ | |
2954 | } BWL_POST_PACKED_STRUCT; | |
2955 | ||
2956 | typedef struct dot11_rmrep_bcn_frm_body_frag_id dot11_rmrep_bcn_frm_body_frag_id_t; | |
2957 | #define DOT11_RMREP_BCNRPT_FRAG_ID_DATA_LEN 2 | |
2958 | #define DOT11_RMREP_BCNRPT_FRAG_ID_SE_LEN sizeof(dot11_rmrep_bcn_frm_body_frag_id_t) | |
2959 | #define DOT11_RMREP_BCNRPT_FRAG_ID_NUM_SHIFT 1 | |
2960 | ||
2961 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_last_bcn_rpt_ind { | |
2962 | uint8 id; /* DOT11_RMREP_BCN_LAST_RPT_IND */ | |
2963 | uint8 len; /* length of remaining fields */ | |
2964 | uint8 data; /* data = 1 is last bcn rpt */ | |
2965 | } BWL_POST_PACKED_STRUCT; | |
2966 | ||
2967 | typedef struct dot11_rmrep_last_bcn_rpt_ind dot11_rmrep_last_bcn_rpt_ind_t; | |
2968 | #define DOT11_RMREP_LAST_BCN_RPT_IND_DATA_LEN 1 | |
2969 | #define DOT11_RMREP_LAST_BCN_RPT_IND_SE_LEN sizeof(dot11_rmrep_last_bcn_rpt_ind_t) | |
2970 | ||
2971 | /* Sub-element IDs for Frame Report */ | |
2972 | #define DOT11_RMREP_FRAME_COUNT_REPORT 1 | |
2973 | ||
2974 | /* Channel load request */ | |
2975 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_chanload { | |
2976 | uint8 id; | |
2977 | uint8 len; | |
2978 | uint8 token; | |
2979 | uint8 mode; | |
2980 | uint8 type; | |
2981 | uint8 reg; | |
2982 | uint8 channel; | |
2983 | uint16 interval; | |
2984 | uint16 duration; | |
2985 | } BWL_POST_PACKED_STRUCT; | |
2986 | typedef struct dot11_rmreq_chanload dot11_rmreq_chanload_t; | |
2987 | #define DOT11_RMREQ_CHANLOAD_LEN 11 | |
2988 | ||
2989 | /** Channel load report */ | |
2990 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_chanload { | |
2991 | uint8 reg; | |
2992 | uint8 channel; | |
2993 | uint32 starttime[2]; | |
2994 | uint16 duration; | |
2995 | uint8 channel_load; | |
2996 | } BWL_POST_PACKED_STRUCT; | |
2997 | typedef struct dot11_rmrep_chanload dot11_rmrep_chanload_t; | |
2998 | #define DOT11_RMREP_CHANLOAD_LEN 13 | |
2999 | ||
3000 | /** Noise histogram request */ | |
3001 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_noise { | |
3002 | uint8 id; | |
3003 | uint8 len; | |
3004 | uint8 token; | |
3005 | uint8 mode; | |
3006 | uint8 type; | |
3007 | uint8 reg; | |
3008 | uint8 channel; | |
3009 | uint16 interval; | |
3010 | uint16 duration; | |
3011 | } BWL_POST_PACKED_STRUCT; | |
3012 | typedef struct dot11_rmreq_noise dot11_rmreq_noise_t; | |
3013 | #define DOT11_RMREQ_NOISE_LEN 11 | |
3014 | ||
3015 | /** Noise histogram report */ | |
3016 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_noise { | |
3017 | uint8 reg; | |
3018 | uint8 channel; | |
3019 | uint32 starttime[2]; | |
3020 | uint16 duration; | |
3021 | uint8 antid; | |
3022 | uint8 anpi; | |
3023 | uint8 ipi0_dens; | |
3024 | uint8 ipi1_dens; | |
3025 | uint8 ipi2_dens; | |
3026 | uint8 ipi3_dens; | |
3027 | uint8 ipi4_dens; | |
3028 | uint8 ipi5_dens; | |
3029 | uint8 ipi6_dens; | |
3030 | uint8 ipi7_dens; | |
3031 | uint8 ipi8_dens; | |
3032 | uint8 ipi9_dens; | |
3033 | uint8 ipi10_dens; | |
3034 | } BWL_POST_PACKED_STRUCT; | |
3035 | typedef struct dot11_rmrep_noise dot11_rmrep_noise_t; | |
3036 | #define DOT11_RMREP_NOISE_LEN 25 | |
3037 | ||
3038 | /** Frame request */ | |
3039 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_frame { | |
3040 | uint8 id; | |
3041 | uint8 len; | |
3042 | uint8 token; | |
3043 | uint8 mode; | |
3044 | uint8 type; | |
3045 | uint8 reg; | |
3046 | uint8 channel; | |
3047 | uint16 interval; | |
3048 | uint16 duration; | |
3049 | uint8 req_type; | |
3050 | struct ether_addr ta; | |
3051 | } BWL_POST_PACKED_STRUCT; | |
3052 | typedef struct dot11_rmreq_frame dot11_rmreq_frame_t; | |
3053 | #define DOT11_RMREQ_FRAME_LEN 18 | |
3054 | ||
3055 | /** Frame report */ | |
3056 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_frame { | |
3057 | uint8 reg; | |
3058 | uint8 channel; | |
3059 | uint32 starttime[2]; | |
3060 | uint16 duration; | |
3061 | } BWL_POST_PACKED_STRUCT; | |
3062 | typedef struct dot11_rmrep_frame dot11_rmrep_frame_t; | |
3063 | #define DOT11_RMREP_FRAME_LEN 12 | |
3064 | ||
3065 | /** Frame report entry */ | |
3066 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_frmentry { | |
3067 | struct ether_addr ta; | |
3068 | struct ether_addr bssid; | |
3069 | uint8 phy_type; | |
3070 | uint8 avg_rcpi; | |
3071 | uint8 last_rsni; | |
3072 | uint8 last_rcpi; | |
3073 | uint8 ant_id; | |
3074 | uint16 frame_cnt; | |
3075 | } BWL_POST_PACKED_STRUCT; | |
3076 | typedef struct dot11_rmrep_frmentry dot11_rmrep_frmentry_t; | |
3077 | #define DOT11_RMREP_FRMENTRY_LEN 19 | |
3078 | ||
3079 | /** STA statistics request */ | |
3080 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_stat { | |
3081 | uint8 id; | |
3082 | uint8 len; | |
3083 | uint8 token; | |
3084 | uint8 mode; | |
3085 | uint8 type; | |
3086 | struct ether_addr peer; | |
3087 | uint16 interval; | |
3088 | uint16 duration; | |
3089 | uint8 group_id; | |
3090 | } BWL_POST_PACKED_STRUCT; | |
3091 | typedef struct dot11_rmreq_stat dot11_rmreq_stat_t; | |
3092 | #define DOT11_RMREQ_STAT_LEN 16 | |
3093 | ||
3094 | /** STA statistics report */ | |
3095 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_stat { | |
3096 | uint16 duration; | |
3097 | uint8 group_id; | |
3098 | } BWL_POST_PACKED_STRUCT; | |
3099 | typedef struct dot11_rmrep_stat dot11_rmrep_stat_t; | |
3100 | ||
3101 | /* Statistics Group Report: Group IDs */ | |
3102 | enum { | |
3103 | DOT11_RRM_STATS_GRP_ID_0 = 0, | |
3104 | DOT11_RRM_STATS_GRP_ID_1, | |
3105 | DOT11_RRM_STATS_GRP_ID_2, | |
3106 | DOT11_RRM_STATS_GRP_ID_3, | |
3107 | DOT11_RRM_STATS_GRP_ID_4, | |
3108 | DOT11_RRM_STATS_GRP_ID_5, | |
3109 | DOT11_RRM_STATS_GRP_ID_6, | |
3110 | DOT11_RRM_STATS_GRP_ID_7, | |
3111 | DOT11_RRM_STATS_GRP_ID_8, | |
3112 | DOT11_RRM_STATS_GRP_ID_9, | |
3113 | DOT11_RRM_STATS_GRP_ID_10, | |
3114 | DOT11_RRM_STATS_GRP_ID_11, | |
3115 | DOT11_RRM_STATS_GRP_ID_12, | |
3116 | DOT11_RRM_STATS_GRP_ID_13, | |
3117 | DOT11_RRM_STATS_GRP_ID_14, | |
3118 | DOT11_RRM_STATS_GRP_ID_15, | |
3119 | DOT11_RRM_STATS_GRP_ID_16 | |
3120 | }; | |
3121 | ||
3122 | /* Statistics Group Report: Group Data length */ | |
3123 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_0 28 | |
3124 | typedef struct rrm_stat_group_0 { | |
3125 | uint32 txfrag; | |
3126 | uint32 txmulti; | |
3127 | uint32 txfail; | |
3128 | uint32 rxframe; | |
3129 | uint32 rxmulti; | |
3130 | uint32 rxbadfcs; | |
3131 | uint32 txframe; | |
3132 | } rrm_stat_group_0_t; | |
3133 | ||
3134 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_1 24 | |
3135 | typedef struct rrm_stat_group_1 { | |
3136 | uint32 txretry; | |
3137 | uint32 txretries; | |
3138 | uint32 rxdup; | |
3139 | uint32 txrts; | |
3140 | uint32 rtsfail; | |
3141 | uint32 ackfail; | |
3142 | } rrm_stat_group_1_t; | |
3143 | ||
3144 | /* group 2-9 use same qos data structure (tid 0-7), total 52 bytes */ | |
3145 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_2_9 52 | |
3146 | typedef struct rrm_stat_group_qos { | |
3147 | uint32 txfrag; | |
3148 | uint32 txfail; | |
3149 | uint32 txretry; | |
3150 | uint32 txretries; | |
3151 | uint32 rxdup; | |
3152 | uint32 txrts; | |
3153 | uint32 rtsfail; | |
3154 | uint32 ackfail; | |
3155 | uint32 rxfrag; | |
3156 | uint32 txframe; | |
3157 | uint32 txdrop; | |
3158 | uint32 rxmpdu; | |
3159 | uint32 rxretries; | |
3160 | } rrm_stat_group_qos_t; | |
3161 | ||
3162 | /* dot11BSSAverageAccessDelay Group (only available at an AP): 8 byte */ | |
3163 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_10 8 | |
3164 | typedef BWL_PRE_PACKED_STRUCT struct rrm_stat_group_10 { | |
3165 | uint8 apavgdelay; | |
3166 | uint8 avgdelaybe; | |
3167 | uint8 avgdelaybg; | |
3168 | uint8 avgdelayvi; | |
3169 | uint8 avgdelayvo; | |
3170 | uint16 stacount; | |
3171 | uint8 chanutil; | |
3172 | } BWL_POST_PACKED_STRUCT rrm_stat_group_10_t; | |
3173 | ||
3174 | /* AMSDU, 40 bytes */ | |
3175 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_11 40 | |
3176 | typedef struct rrm_stat_group_11 { | |
3177 | uint32 txamsdu; | |
3178 | uint32 amsdufail; | |
3179 | uint32 amsduretry; | |
3180 | uint32 amsduretries; | |
3181 | uint32 txamsdubyte_h; | |
3182 | uint32 txamsdubyte_l; | |
3183 | uint32 amsduackfail; | |
3184 | uint32 rxamsdu; | |
3185 | uint32 rxamsdubyte_h; | |
3186 | uint32 rxamsdubyte_l; | |
3187 | } rrm_stat_group_11_t; | |
3188 | ||
3189 | /* AMPDU, 36 bytes */ | |
3190 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_12 36 | |
3191 | typedef struct rrm_stat_group_12 { | |
3192 | uint32 txampdu; | |
3193 | uint32 txmpdu; | |
3194 | uint32 txampdubyte_h; | |
3195 | uint32 txampdubyte_l; | |
3196 | uint32 rxampdu; | |
3197 | uint32 rxmpdu; | |
3198 | uint32 rxampdubyte_h; | |
3199 | uint32 rxampdubyte_l; | |
3200 | uint32 ampducrcfail; | |
3201 | } rrm_stat_group_12_t; | |
3202 | ||
3203 | /* BACK etc, 36 bytes */ | |
3204 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_13 36 | |
3205 | typedef struct rrm_stat_group_13 { | |
3206 | uint32 rximpbarfail; | |
3207 | uint32 rxexpbarfail; | |
3208 | uint32 chanwidthsw; | |
3209 | uint32 txframe20mhz; | |
3210 | uint32 txframe40mhz; | |
3211 | uint32 rxframe20mhz; | |
3212 | uint32 rxframe40mhz; | |
3213 | uint32 psmpgrantdur; | |
3214 | uint32 psmpuseddur; | |
3215 | } rrm_stat_group_13_t; | |
3216 | ||
3217 | /* RD Dual CTS etc, 36 bytes */ | |
3218 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_14 36 | |
3219 | typedef struct rrm_stat_group_14 { | |
3220 | uint32 grantrdgused; | |
3221 | uint32 grantrdgunused; | |
3222 | uint32 txframeingrantrdg; | |
3223 | uint32 txbyteingrantrdg_h; | |
3224 | uint32 txbyteingrantrdg_l; | |
3225 | uint32 dualcts; | |
3226 | uint32 dualctsfail; | |
3227 | uint32 rtslsi; | |
3228 | uint32 rtslsifail; | |
3229 | } rrm_stat_group_14_t; | |
3230 | ||
3231 | /* bf and STBC etc, 20 bytes */ | |
3232 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_15 20 | |
3233 | typedef struct rrm_stat_group_15 { | |
3234 | uint32 bfframe; | |
3235 | uint32 stbccts; | |
3236 | uint32 stbcctsfail; | |
3237 | uint32 nonstbccts; | |
3238 | uint32 nonstbcctsfail; | |
3239 | } rrm_stat_group_15_t; | |
3240 | ||
3241 | /* RSNA, 28 bytes */ | |
3242 | #define DOT11_RRM_STATS_RPT_LEN_GRP_ID_16 28 | |
3243 | typedef struct rrm_stat_group_16 { | |
3244 | uint32 rsnacmacicverr; | |
3245 | uint32 rsnacmacreplay; | |
3246 | uint32 rsnarobustmgmtccmpreplay; | |
3247 | uint32 rsnatkipicverr; | |
3248 | uint32 rsnatkipicvreplay; | |
3249 | uint32 rsnaccmpdecrypterr; | |
3250 | uint32 rsnaccmpreplay; | |
3251 | } rrm_stat_group_16_t; | |
3252 | ||
3253 | /* Transmit stream/category measurement request */ | |
3254 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_tx_stream { | |
3255 | uint8 id; | |
3256 | uint8 len; | |
3257 | uint8 token; | |
3258 | uint8 mode; | |
3259 | uint8 type; | |
3260 | uint16 interval; | |
3261 | uint16 duration; | |
3262 | struct ether_addr peer; | |
3263 | uint8 traffic_id; | |
3264 | uint8 bin0_range; | |
3265 | } BWL_POST_PACKED_STRUCT; | |
3266 | typedef struct dot11_rmreq_tx_stream dot11_rmreq_tx_stream_t; | |
3267 | #define DOT11_RMREQ_TXSTREAM_LEN 17 | |
3268 | ||
3269 | /** Transmit stream/category measurement report */ | |
3270 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_tx_stream { | |
3271 | uint32 starttime[2]; | |
3272 | uint16 duration; | |
3273 | struct ether_addr peer; | |
3274 | uint8 traffic_id; | |
3275 | uint8 reason; | |
3276 | uint32 txmsdu_cnt; | |
3277 | uint32 msdu_discarded_cnt; | |
3278 | uint32 msdufailed_cnt; | |
3279 | uint32 msduretry_cnt; | |
3280 | uint32 cfpolls_lost_cnt; | |
3281 | uint32 avrqueue_delay; | |
3282 | uint32 avrtx_delay; | |
3283 | uint8 bin0_range; | |
3284 | uint32 bin0; | |
3285 | uint32 bin1; | |
3286 | uint32 bin2; | |
3287 | uint32 bin3; | |
3288 | uint32 bin4; | |
3289 | uint32 bin5; | |
3290 | } BWL_POST_PACKED_STRUCT; | |
3291 | typedef struct dot11_rmrep_tx_stream dot11_rmrep_tx_stream_t; | |
3292 | #define DOT11_RMREP_TXSTREAM_LEN 71 | |
3293 | ||
3294 | typedef struct rrm_tscm { | |
3295 | uint32 msdu_tx; | |
3296 | uint32 msdu_exp; | |
3297 | uint32 msdu_fail; | |
3298 | uint32 msdu_retries; | |
3299 | uint32 cfpolls_lost; | |
3300 | uint32 queue_delay; | |
3301 | uint32 tx_delay_sum; | |
3302 | uint32 tx_delay_cnt; | |
3303 | uint32 bin0_range_us; | |
3304 | uint32 bin0; | |
3305 | uint32 bin1; | |
3306 | uint32 bin2; | |
3307 | uint32 bin3; | |
3308 | uint32 bin4; | |
3309 | uint32 bin5; | |
3310 | } rrm_tscm_t; | |
3311 | enum { | |
3312 | DOT11_FTM_LOCATION_SUBJ_LOCAL = 0, /* Where am I? */ | |
3313 | DOT11_FTM_LOCATION_SUBJ_REMOTE = 1, /* Where are you? */ | |
3314 | DOT11_FTM_LOCATION_SUBJ_THIRDPARTY = 2 /* Where is he/she? */ | |
3315 | }; | |
3316 | ||
3317 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_ftm_lci { | |
3318 | uint8 id; | |
3319 | uint8 len; | |
3320 | uint8 token; | |
3321 | uint8 mode; | |
3322 | uint8 type; | |
3323 | uint8 subj; | |
3324 | ||
3325 | /* Following 3 fields are unused. Keep for ROM compatibility. */ | |
3326 | uint8 lat_res; | |
3327 | uint8 lon_res; | |
3328 | uint8 alt_res; | |
3329 | ||
3330 | /* optional sub-elements */ | |
3331 | } BWL_POST_PACKED_STRUCT; | |
3332 | typedef struct dot11_rmreq_ftm_lci dot11_rmreq_ftm_lci_t; | |
3333 | #define DOT11_RMREQ_LCI_LEN 9 | |
3334 | ||
3335 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_ftm_lci { | |
3336 | uint8 id; | |
3337 | uint8 len; | |
3338 | uint8 token; | |
3339 | uint8 mode; | |
3340 | uint8 type; | |
3341 | uint8 lci_sub_id; | |
3342 | uint8 lci_sub_len; | |
3343 | /* optional LCI field */ | |
3344 | /* optional sub-elements */ | |
3345 | } BWL_POST_PACKED_STRUCT; | |
3346 | typedef struct dot11_rmrep_ftm_lci dot11_rmrep_ftm_lci_t; | |
3347 | ||
3348 | #define DOT11_FTM_LCI_SUBELEM_ID 0 | |
3349 | #define DOT11_FTM_LCI_SUBELEM_LEN 2 | |
3350 | #define DOT11_FTM_LCI_FIELD_LEN 16 | |
3351 | #define DOT11_FTM_LCI_UNKNOWN_LEN 2 | |
3352 | ||
3353 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_ftm_civic { | |
3354 | uint8 id; | |
3355 | uint8 len; | |
3356 | uint8 token; | |
3357 | uint8 mode; | |
3358 | uint8 type; | |
3359 | uint8 subj; | |
3360 | uint8 civloc_type; | |
3361 | uint8 siu; /* service interval units */ | |
3362 | uint16 si; /* service interval */ | |
3363 | /* optional sub-elements */ | |
3364 | } BWL_POST_PACKED_STRUCT; | |
3365 | typedef struct dot11_rmreq_ftm_civic dot11_rmreq_ftm_civic_t; | |
3366 | #define DOT11_RMREQ_CIVIC_LEN 10 | |
3367 | ||
3368 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_ftm_civic { | |
3369 | uint8 id; | |
3370 | uint8 len; | |
3371 | uint8 token; | |
3372 | uint8 mode; | |
3373 | uint8 type; | |
3374 | uint8 civloc_type; | |
3375 | uint8 civloc_sub_id; | |
3376 | uint8 civloc_sub_len; | |
3377 | /* optional location civic field */ | |
3378 | /* optional sub-elements */ | |
3379 | } BWL_POST_PACKED_STRUCT; | |
3380 | typedef struct dot11_rmrep_ftm_civic dot11_rmrep_ftm_civic_t; | |
3381 | ||
3382 | #define DOT11_FTM_CIVIC_LOC_TYPE_RFC4776 0 | |
3383 | #define DOT11_FTM_CIVIC_SUBELEM_ID 0 | |
3384 | #define DOT11_FTM_CIVIC_SUBELEM_LEN 2 | |
3385 | #define DOT11_FTM_CIVIC_LOC_SI_NONE 0 | |
3386 | #define DOT11_FTM_CIVIC_TYPE_LEN 1 | |
3387 | #define DOT11_FTM_CIVIC_UNKNOWN_LEN 3 | |
3388 | ||
3389 | /* Location Identifier measurement request */ | |
3390 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_locid { | |
3391 | uint8 id; | |
3392 | uint8 len; | |
3393 | uint8 token; | |
3394 | uint8 mode; | |
3395 | uint8 type; | |
3396 | uint8 subj; | |
3397 | uint8 siu; | |
3398 | uint16 si; | |
3399 | } BWL_POST_PACKED_STRUCT; | |
3400 | typedef struct dot11_rmreq_locid dot11_rmreq_locid_t; | |
3401 | #define DOT11_RMREQ_LOCID_LEN 9 | |
3402 | ||
3403 | /* Location Identifier measurement report */ | |
3404 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_locid { | |
3405 | uint8 id; | |
3406 | uint8 len; | |
3407 | uint8 token; | |
3408 | uint8 mode; | |
3409 | uint8 type; | |
3410 | uint8 exp_tsf[8]; | |
3411 | uint8 locid_sub_id; | |
3412 | uint8 locid_sub_len; | |
3413 | /* optional location identifier field */ | |
3414 | /* optional sub-elements */ | |
3415 | } BWL_POST_PACKED_STRUCT; | |
3416 | typedef struct dot11_rmrep_locid dot11_rmrep_locid_t; | |
3417 | #define DOT11_LOCID_UNKNOWN_LEN 10 | |
3418 | #define DOT11_LOCID_SUBELEM_ID 0 | |
3419 | ||
3420 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_range_subel { | |
3421 | uint8 id; | |
3422 | uint8 len; | |
3423 | uint16 max_age; | |
3424 | } BWL_POST_PACKED_STRUCT; | |
3425 | typedef struct dot11_ftm_range_subel dot11_ftm_range_subel_t; | |
3426 | #define DOT11_FTM_RANGE_SUBELEM_ID 4 | |
3427 | #define DOT11_FTM_RANGE_SUBELEM_LEN 2 | |
3428 | ||
3429 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_ftm_range { | |
3430 | uint8 id; | |
3431 | uint8 len; | |
3432 | uint8 token; | |
3433 | uint8 mode; | |
3434 | uint8 type; | |
3435 | uint16 max_init_delay; /* maximum random initial delay */ | |
3436 | uint8 min_ap_count; | |
3437 | uint8 data[1]; | |
3438 | /* neighbor report sub-elements */ | |
3439 | /* optional sub-elements */ | |
3440 | } BWL_POST_PACKED_STRUCT; | |
3441 | typedef struct dot11_rmreq_ftm_range dot11_rmreq_ftm_range_t; | |
3442 | #define DOT11_RMREQ_FTM_RANGE_LEN 8 | |
3443 | ||
3444 | #define DOT11_FTM_RANGE_LEN 3 | |
3445 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_range_entry { | |
3446 | uint32 start_tsf; /* 4 lsb of tsf */ | |
3447 | struct ether_addr bssid; | |
3448 | uint8 range[DOT11_FTM_RANGE_LEN]; | |
3449 | uint8 max_err[DOT11_FTM_RANGE_LEN]; | |
3450 | uint8 rsvd; | |
3451 | } BWL_POST_PACKED_STRUCT; | |
3452 | typedef struct dot11_ftm_range_entry dot11_ftm_range_entry_t; | |
3453 | #define DOT11_FTM_RANGE_ENTRY_MAX_COUNT 15 | |
3454 | ||
3455 | enum { | |
3456 | DOT11_FTM_RANGE_ERROR_AP_INCAPABLE = 2, | |
3457 | DOT11_FTM_RANGE_ERROR_AP_FAILED = 3, | |
3458 | DOT11_FTM_RANGE_ERROR_TX_FAILED = 8, | |
3459 | DOT11_FTM_RANGE_ERROR_MAX | |
3460 | }; | |
3461 | ||
3462 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_range_error_entry { | |
3463 | uint32 start_tsf; /* 4 lsb of tsf */ | |
3464 | struct ether_addr bssid; | |
3465 | uint8 code; | |
3466 | } BWL_POST_PACKED_STRUCT; | |
3467 | typedef struct dot11_ftm_range_error_entry dot11_ftm_range_error_entry_t; | |
3468 | #define DOT11_FTM_RANGE_ERROR_ENTRY_MAX_COUNT 11 | |
3469 | ||
3470 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_ftm_range { | |
3471 | uint8 id; | |
3472 | uint8 len; | |
3473 | uint8 token; | |
3474 | uint8 mode; | |
3475 | uint8 type; | |
3476 | uint8 entry_count; | |
3477 | uint8 data[2]; /* includes pad */ | |
3478 | /* | |
3479 | dot11_ftm_range_entry_t entries[entry_count]; | |
3480 | uint8 error_count; | |
3481 | dot11_ftm_error_entry_t errors[error_count]; | |
3482 | */ | |
3483 | } BWL_POST_PACKED_STRUCT; | |
3484 | typedef struct dot11_rmrep_ftm_range dot11_rmrep_ftm_range_t; | |
3485 | ||
3486 | #define DOT11_FTM_RANGE_REP_MIN_LEN 6 /* No extra byte for error_count */ | |
3487 | #define DOT11_FTM_RANGE_ENTRY_CNT_MAX 15 | |
3488 | #define DOT11_FTM_RANGE_ERROR_CNT_MAX 11 | |
3489 | #define DOT11_FTM_RANGE_REP_FIXED_LEN 1 /* No extra byte for error_count */ | |
3490 | /** Measurement pause request */ | |
3491 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_pause_time { | |
3492 | uint8 id; | |
3493 | uint8 len; | |
3494 | uint8 token; | |
3495 | uint8 mode; | |
3496 | uint8 type; | |
3497 | uint16 pause_time; | |
3498 | } BWL_POST_PACKED_STRUCT; | |
3499 | typedef struct dot11_rmreq_pause_time dot11_rmreq_pause_time_t; | |
3500 | #define DOT11_RMREQ_PAUSE_LEN 7 | |
3501 | ||
3502 | /* Neighbor Report subelements ID (11k & 11v) */ | |
3503 | #define DOT11_NGBR_TSF_INFO_SE_ID 1 | |
3504 | #define DOT11_NGBR_CCS_SE_ID 2 | |
3505 | #define DOT11_NGBR_BSSTRANS_PREF_SE_ID 3 | |
3506 | #define DOT11_NGBR_BSS_TERM_DUR_SE_ID 4 | |
3507 | #define DOT11_NGBR_BEARING_SE_ID 5 | |
3508 | #define DOT11_NGBR_WIDE_BW_CHAN_SE_ID 6 | |
3509 | ||
3510 | /** Neighbor Report, BSS Transition Candidate Preference subelement */ | |
3511 | BWL_PRE_PACKED_STRUCT struct dot11_ngbr_bsstrans_pref_se { | |
3512 | uint8 sub_id; | |
3513 | uint8 len; | |
3514 | uint8 preference; | |
3515 | } BWL_POST_PACKED_STRUCT; | |
3516 | typedef struct dot11_ngbr_bsstrans_pref_se dot11_ngbr_bsstrans_pref_se_t; | |
3517 | #define DOT11_NGBR_BSSTRANS_PREF_SE_LEN 1 | |
3518 | #define DOT11_NGBR_BSSTRANS_PREF_SE_IE_LEN 3 | |
3519 | #define DOT11_NGBR_BSSTRANS_PREF_SE_HIGHEST 0xff | |
3520 | ||
3521 | /** Neighbor Report, BSS Termination Duration subelement */ | |
3522 | BWL_PRE_PACKED_STRUCT struct dot11_ngbr_bss_term_dur_se { | |
3523 | uint8 sub_id; | |
3524 | uint8 len; | |
3525 | uint8 tsf[8]; | |
3526 | uint16 duration; | |
3527 | } BWL_POST_PACKED_STRUCT; | |
3528 | typedef struct dot11_ngbr_bss_term_dur_se dot11_ngbr_bss_term_dur_se_t; | |
3529 | #define DOT11_NGBR_BSS_TERM_DUR_SE_LEN 10 | |
3530 | ||
3531 | /* Neighbor Report BSSID Information Field */ | |
3532 | #define DOT11_NGBR_BI_REACHABILTY_UNKN 0x0002 | |
3533 | #define DOT11_NGBR_BI_REACHABILTY 0x0003 | |
3534 | #define DOT11_NGBR_BI_SEC 0x0004 | |
3535 | #define DOT11_NGBR_BI_KEY_SCOPE 0x0008 | |
3536 | #define DOT11_NGBR_BI_CAP 0x03f0 | |
3537 | #define DOT11_NGBR_BI_CAP_SPEC_MGMT 0x0010 | |
3538 | #define DOT11_NGBR_BI_CAP_QOS 0x0020 | |
3539 | #define DOT11_NGBR_BI_CAP_APSD 0x0040 | |
3540 | #define DOT11_NGBR_BI_CAP_RDIO_MSMT 0x0080 | |
3541 | #define DOT11_NGBR_BI_CAP_DEL_BA 0x0100 | |
3542 | #define DOT11_NGBR_BI_CAP_IMM_BA 0x0200 | |
3543 | #define DOT11_NGBR_BI_MOBILITY 0x0400 | |
3544 | #define DOT11_NGBR_BI_HT 0x0800 | |
3545 | #define DOT11_NGBR_BI_VHT 0x1000 | |
3546 | #define DOT11_NGBR_BI_FTM 0x2000 | |
3547 | ||
3548 | /** Neighbor Report element (11k & 11v) */ | |
3549 | BWL_PRE_PACKED_STRUCT struct dot11_neighbor_rep_ie { | |
3550 | uint8 id; | |
3551 | uint8 len; | |
3552 | struct ether_addr bssid; | |
3553 | uint32 bssid_info; | |
3554 | uint8 reg; /* Operating class */ | |
3555 | uint8 channel; | |
3556 | uint8 phytype; | |
3557 | uint8 data[1]; /* Variable size subelements */ | |
3558 | } BWL_POST_PACKED_STRUCT; | |
3559 | typedef struct dot11_neighbor_rep_ie dot11_neighbor_rep_ie_t; | |
3560 | #define DOT11_NEIGHBOR_REP_IE_FIXED_LEN 13u | |
3561 | ||
3562 | /* MLME Enumerations */ | |
3563 | #define DOT11_BSSTYPE_INFRASTRUCTURE 0 /* d11 infrastructure */ | |
3564 | #define DOT11_BSSTYPE_INDEPENDENT 1 /* d11 independent */ | |
3565 | #define DOT11_BSSTYPE_ANY 2 /* d11 any BSS type */ | |
3566 | #define DOT11_BSSTYPE_MESH 3 /* d11 Mesh */ | |
3567 | #define DOT11_SCANTYPE_ACTIVE 0 /* d11 scan active */ | |
3568 | #define DOT11_SCANTYPE_PASSIVE 1 /* d11 scan passive */ | |
3569 | ||
3570 | /** Link Measurement */ | |
3571 | BWL_PRE_PACKED_STRUCT struct dot11_lmreq { | |
3572 | uint8 category; /* category of action frame (5) */ | |
3573 | uint8 action; /* radio measurement action */ | |
3574 | uint8 token; /* dialog token */ | |
3575 | uint8 txpwr; /* Transmit Power Used */ | |
3576 | uint8 maxtxpwr; /* Max Transmit Power */ | |
3577 | } BWL_POST_PACKED_STRUCT; | |
3578 | typedef struct dot11_lmreq dot11_lmreq_t; | |
3579 | #define DOT11_LMREQ_LEN 5 | |
3580 | ||
3581 | BWL_PRE_PACKED_STRUCT struct dot11_lmrep { | |
3582 | uint8 category; /* category of action frame (5) */ | |
3583 | uint8 action; /* radio measurement action */ | |
3584 | uint8 token; /* dialog token */ | |
3585 | dot11_tpc_rep_t tpc; /* TPC element */ | |
3586 | uint8 rxant; /* Receive Antenna ID */ | |
3587 | uint8 txant; /* Transmit Antenna ID */ | |
3588 | uint8 rcpi; /* RCPI */ | |
3589 | uint8 rsni; /* RSNI */ | |
3590 | } BWL_POST_PACKED_STRUCT; | |
3591 | typedef struct dot11_lmrep dot11_lmrep_t; | |
3592 | #define DOT11_LMREP_LEN 11 | |
3593 | ||
3594 | #define DOT11_MP_CAP_SPECTRUM 0x01 /* d11 cap. spectrum */ | |
3595 | #define DOT11_MP_CAP_SHORTSLOT 0x02 /* d11 cap. shortslot */ | |
3596 | /* Measurement Pilot */ | |
3597 | BWL_PRE_PACKED_STRUCT struct dot11_mprep { | |
3598 | uint8 cap_info; /* Condensed capability Info. */ | |
3599 | uint8 country[2]; /* Condensed country string */ | |
3600 | uint8 opclass; /* Op. Class */ | |
3601 | uint8 channel; /* Channel */ | |
3602 | uint8 mp_interval; /* Measurement Pilot Interval */ | |
3603 | } BWL_POST_PACKED_STRUCT; | |
3604 | typedef struct dot11_mprep dot11_mprep_t; | |
3605 | #define DOT11_MPREP_LEN 6 | |
3606 | ||
3607 | /* 802.11 BRCM "Compromise" Pre N constants */ | |
3608 | #define PREN_PREAMBLE 24 /* green field preamble time */ | |
3609 | #define PREN_MM_EXT 12 /* extra mixed mode preamble time */ | |
3610 | #define PREN_PREAMBLE_EXT 4 /* extra preamble (multiply by unique_streams-1) */ | |
3611 | ||
3612 | /* 802.11N PHY constants */ | |
3613 | #define RIFS_11N_TIME 2 /* NPHY RIFS time */ | |
3614 | ||
3615 | /* 802.11 HT PLCP format 802.11n-2009, sec 20.3.9.4.3 | |
3616 | * HT-SIG is composed of two 24 bit parts, HT-SIG1 and HT-SIG2 | |
3617 | */ | |
3618 | /* HT-SIG1 */ | |
3619 | #define HT_SIG1_MCS_MASK 0x00007F | |
3620 | #define HT_SIG1_CBW 0x000080 | |
3621 | #define HT_SIG1_HT_LENGTH 0xFFFF00 | |
3622 | ||
3623 | /* HT-SIG2 */ | |
3624 | #define HT_SIG2_SMOOTHING 0x000001 | |
3625 | #define HT_SIG2_NOT_SOUNDING 0x000002 | |
3626 | #define HT_SIG2_RESERVED 0x000004 | |
3627 | #define HT_SIG2_AGGREGATION 0x000008 | |
3628 | #define HT_SIG2_STBC_MASK 0x000030 | |
3629 | #define HT_SIG2_STBC_SHIFT 4 | |
3630 | #define HT_SIG2_FEC_CODING 0x000040 | |
3631 | #define HT_SIG2_SHORT_GI 0x000080 | |
3632 | #define HT_SIG2_ESS_MASK 0x000300 | |
3633 | #define HT_SIG2_ESS_SHIFT 8 | |
3634 | #define HT_SIG2_CRC 0x03FC00 | |
3635 | #define HT_SIG2_TAIL 0x1C0000 | |
3636 | ||
3637 | /* HT Timing-related parameters (802.11-2012, sec 20.3.6) */ | |
3638 | #define HT_T_LEG_PREAMBLE 16 | |
3639 | #define HT_T_L_SIG 4 | |
3640 | #define HT_T_SIG 8 | |
3641 | #define HT_T_LTF1 4 | |
3642 | #define HT_T_GF_LTF1 8 | |
3643 | #define HT_T_LTFs 4 | |
3644 | #define HT_T_STF 4 | |
3645 | #define HT_T_GF_STF 8 | |
3646 | #define HT_T_SYML 4 | |
3647 | ||
3648 | #define HT_N_SERVICE 16 /* bits in SERVICE field */ | |
3649 | #define HT_N_TAIL 6 /* tail bits per BCC encoder */ | |
3650 | ||
3651 | /* 802.11 A PHY constants */ | |
3652 | #define APHY_SLOT_TIME 9 /* APHY slot time */ | |
3653 | #define APHY_SIFS_TIME 16 /* APHY SIFS time */ | |
3654 | #define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME)) /* APHY DIFS time */ | |
3655 | #define APHY_PREAMBLE_TIME 16 /* APHY preamble time */ | |
3656 | #define APHY_SIGNAL_TIME 4 /* APHY signal time */ | |
3657 | #define APHY_SYMBOL_TIME 4 /* APHY symbol time */ | |
3658 | #define APHY_SERVICE_NBITS 16 /* APHY service nbits */ | |
3659 | #define APHY_TAIL_NBITS 6 /* APHY tail nbits */ | |
3660 | #define APHY_CWMIN 15 /* APHY cwmin */ | |
3661 | #define APHY_PHYHDR_DUR 20 /* APHY PHY Header Duration */ | |
3662 | ||
3663 | /* 802.11 B PHY constants */ | |
3664 | #define BPHY_SLOT_TIME 20 /* BPHY slot time */ | |
3665 | #define BPHY_SIFS_TIME 10 /* BPHY SIFS time */ | |
3666 | #define BPHY_DIFS_TIME 50 /* BPHY DIFS time */ | |
3667 | #define BPHY_PLCP_TIME 192 /* BPHY PLCP time */ | |
3668 | #define BPHY_PLCP_SHORT_TIME 96 /* BPHY PLCP short time */ | |
3669 | #define BPHY_CWMIN 31 /* BPHY cwmin */ | |
3670 | #define BPHY_SHORT_PHYHDR_DUR 96 /* BPHY Short PHY Header Duration */ | |
3671 | #define BPHY_LONG_PHYHDR_DUR 192 /* BPHY Long PHY Header Duration */ | |
3672 | ||
3673 | /* 802.11 G constants */ | |
3674 | #define DOT11_OFDM_SIGNAL_EXTENSION 6 /* d11 OFDM signal extension */ | |
3675 | ||
3676 | #define PHY_CWMAX 1023 /* PHY cwmax */ | |
3677 | ||
3678 | #define DOT11_MAXNUMFRAGS 16 /* max # fragments per MSDU */ | |
3679 | ||
3680 | /* 802.11 VHT constants */ | |
3681 | ||
3682 | typedef int vht_group_id_t; | |
3683 | ||
3684 | /* for VHT-A1 */ | |
3685 | /* SIG-A1 reserved bits */ | |
3686 | #define VHT_SIGA1_CONST_MASK 0x800004 | |
3687 | ||
3688 | #define VHT_SIGA1_BW_MASK 0x000003 | |
3689 | #define VHT_SIGA1_20MHZ_VAL 0x000000 | |
3690 | #define VHT_SIGA1_40MHZ_VAL 0x000001 | |
3691 | #define VHT_SIGA1_80MHZ_VAL 0x000002 | |
3692 | #define VHT_SIGA1_160MHZ_VAL 0x000003 | |
3693 | ||
3694 | #define VHT_SIGA1_STBC 0x000008 | |
3695 | ||
3696 | #define VHT_SIGA1_GID_MASK 0x0003f0 | |
3697 | #define VHT_SIGA1_GID_SHIFT 4 | |
3698 | #define VHT_SIGA1_GID_TO_AP 0x00 | |
3699 | #define VHT_SIGA1_GID_NOT_TO_AP 0x3f | |
3700 | #define VHT_SIGA1_GID_MAX_GID 0x3f | |
3701 | ||
3702 | #define VHT_SIGA1_NSTS_SHIFT_MASK_USER0 0x001C00 | |
3703 | #define VHT_SIGA1_NSTS_SHIFT 10 | |
3704 | #define VHT_SIGA1_MAX_USERPOS 3 | |
3705 | ||
3706 | #define VHT_SIGA1_PARTIAL_AID_MASK 0x3fe000 | |
3707 | #define VHT_SIGA1_PARTIAL_AID_SHIFT 13 | |
3708 | ||
3709 | #define VHT_SIGA1_TXOP_PS_NOT_ALLOWED 0x400000 | |
3710 | ||
3711 | /* for VHT-A2 */ | |
3712 | #define VHT_SIGA2_GI_NONE 0x000000 | |
3713 | #define VHT_SIGA2_GI_SHORT 0x000001 | |
3714 | #define VHT_SIGA2_GI_W_MOD10 0x000002 | |
3715 | #define VHT_SIGA2_CODING_LDPC 0x000004 | |
3716 | #define VHT_SIGA2_LDPC_EXTRA_OFDM_SYM 0x000008 | |
3717 | #define VHT_SIGA2_BEAMFORM_ENABLE 0x000100 | |
3718 | #define VHT_SIGA2_MCS_SHIFT 4 | |
3719 | ||
3720 | #define VHT_SIGA2_B9_RESERVED 0x000200 | |
3721 | #define VHT_SIGA2_TAIL_MASK 0xfc0000 | |
3722 | #define VHT_SIGA2_TAIL_VALUE 0x000000 | |
3723 | ||
3724 | /* VHT Timing-related parameters (802.11ac D4.0, sec 22.3.6) */ | |
3725 | #define VHT_T_LEG_PREAMBLE 16 | |
3726 | #define VHT_T_L_SIG 4 | |
3727 | #define VHT_T_SIG_A 8 | |
3728 | #define VHT_T_LTF 4 | |
3729 | #define VHT_T_STF 4 | |
3730 | #define VHT_T_SIG_B 4 | |
3731 | #define VHT_T_SYML 4 | |
3732 | ||
3733 | #define VHT_N_SERVICE 16 /* bits in SERVICE field */ | |
3734 | #define VHT_N_TAIL 6 /* tail bits per BCC encoder */ | |
3735 | ||
3736 | /** dot11Counters Table - 802.11 spec., Annex D */ | |
3737 | typedef struct d11cnt { | |
3738 | uint32 txfrag; /* dot11TransmittedFragmentCount */ | |
3739 | uint32 txmulti; /* dot11MulticastTransmittedFrameCount */ | |
3740 | uint32 txfail; /* dot11FailedCount */ | |
3741 | uint32 txretry; /* dot11RetryCount */ | |
3742 | uint32 txretrie; /* dot11MultipleRetryCount */ | |
3743 | uint32 rxdup; /* dot11FrameduplicateCount */ | |
3744 | uint32 txrts; /* dot11RTSSuccessCount */ | |
3745 | uint32 txnocts; /* dot11RTSFailureCount */ | |
3746 | uint32 txnoack; /* dot11ACKFailureCount */ | |
3747 | uint32 rxfrag; /* dot11ReceivedFragmentCount */ | |
3748 | uint32 rxmulti; /* dot11MulticastReceivedFrameCount */ | |
3749 | uint32 rxcrc; /* dot11FCSErrorCount */ | |
3750 | uint32 txfrmsnt; /* dot11TransmittedFrameCount */ | |
3751 | uint32 rxundec; /* dot11WEPUndecryptableCount */ | |
3752 | } d11cnt_t; | |
3753 | ||
3754 | #define BRCM_PROP_OUI "\x00\x90\x4C" | |
3755 | ||
3756 | #define BRCM_FTM_IE_TYPE 14 | |
3757 | ||
3758 | /* #define HT_CAP_IE_TYPE 51 | |
3759 | * #define HT_ADD_IE_TYPE 52 | |
3760 | * #define BRCM_EXTCH_IE_TYPE 53 | |
3761 | * #define MEMBER_OF_BRCM_PROP_IE_TYPE 54 | |
3762 | * #define BRCM_RELMACST_IE_TYPE 55 | |
3763 | * #define BRCM_EVT_WL_BSS_INFO 64 | |
3764 | * #define RWL_ACTION_WIFI_FRAG_TYPE 85 | |
3765 | * #define BTC_INFO_BRCM_PROP_IE_TYPE 90 | |
3766 | * #define ULB_BRCM_PROP_IE_TYPE 91 | |
3767 | * #define SDB_BRCM_PROP_IE_TYPE 92 | |
3768 | */ | |
3769 | ||
3770 | /* Action frame type for RWL */ | |
3771 | #define RWL_WIFI_DEFAULT 0 | |
3772 | #define RWL_WIFI_FIND_MY_PEER 9 /* Used while finding server */ | |
3773 | #define RWL_WIFI_FOUND_PEER 10 /* Server response to the client */ | |
3774 | #define RWL_ACTION_WIFI_FRAG_TYPE 85 /* Fragment indicator for receiver */ | |
3775 | ||
3776 | #define PROXD_AF_TYPE 11 /* Wifi proximity action frame type */ | |
3777 | #define BRCM_RELMACST_AF_TYPE 12 /* RMC action frame type */ | |
3778 | ||
3779 | /* Action frame type for FTM Initiator Report */ | |
3780 | #define BRCM_FTM_VS_AF_TYPE 14 | |
3781 | enum { | |
3782 | BRCM_FTM_VS_INITIATOR_RPT_SUBTYPE = 1, /* FTM Initiator Report */ | |
3783 | BRCM_FTM_VS_COLLECT_SUBTYPE = 2, /* FTM Collect debug protocol */ | |
3784 | }; | |
3785 | ||
3786 | /* brcm syscap_ie cap */ | |
3787 | #define BRCM_SYSCAP_WET_TUNNEL 0x0100 /* Device with WET_TUNNEL support */ | |
3788 | ||
3789 | #define BRCM_OUI "\x00\x10\x18" /* Broadcom OUI */ | |
3790 | ||
3791 | /** BRCM info element */ | |
3792 | BWL_PRE_PACKED_STRUCT struct brcm_ie { | |
3793 | uint8 id; /* IE ID, 221, DOT11_MNG_PROPR_ID */ | |
3794 | uint8 len; /* IE length */ | |
3795 | uint8 oui[3]; | |
3796 | uint8 ver; /* type/ver of this IE */ | |
3797 | uint8 assoc; /* # of assoc STAs */ | |
3798 | uint8 flags; /* misc flags */ | |
3799 | uint8 flags1; /* misc flags */ | |
3800 | uint16 amsdu_mtu_pref; /* preferred A-MSDU MTU */ | |
3801 | } BWL_POST_PACKED_STRUCT; | |
3802 | typedef struct brcm_ie brcm_ie_t; | |
3803 | #define BRCM_IE_LEN 11 /* BRCM IE length */ | |
3804 | #define BRCM_IE_VER 2 /* BRCM IE version */ | |
3805 | #define BRCM_IE_LEGACY_AES_VER 1 /* BRCM IE legacy AES version */ | |
3806 | ||
3807 | /* brcm_ie flags */ | |
3808 | #define BRF_ABCAP 0x1 /* afterburner is obsolete, defined for backward compat */ | |
3809 | #define BRF_ABRQRD 0x2 /* afterburner is obsolete, defined for backward compat */ | |
3810 | #define BRF_LZWDS 0x4 /* lazy wds enabled */ | |
3811 | #define BRF_BLOCKACK 0x8 /* BlockACK capable */ | |
3812 | #define BRF_ABCOUNTER_MASK 0xf0 /* afterburner is obsolete, defined for backward compat */ | |
3813 | #define BRF_PROP_11N_MCS 0x10 /* re-use afterburner bit */ | |
3814 | #define BRF_MEDIA_CLIENT 0x20 /* re-use afterburner bit to indicate media client device */ | |
3815 | ||
3816 | #define GET_BRF_PROP_11N_MCS(brcm_ie) \ | |
3817 | (!((brcm_ie)->flags & BRF_ABCAP) && ((brcm_ie)->flags & BRF_PROP_11N_MCS)) | |
3818 | ||
3819 | /* brcm_ie flags1 */ | |
3820 | #define BRF1_AMSDU 0x1 /* A-MSDU capable */ | |
3821 | #define BRF1_WNM 0x2 /* WNM capable */ | |
3822 | #define BRF1_WMEPS 0x4 /* AP is capable of handling WME + PS w/o APSD */ | |
3823 | #define BRF1_PSOFIX 0x8 /* AP has fixed PS mode out-of-order packets */ | |
3824 | #define BRF1_RX_LARGE_AGG 0x10 /* device can rx large aggregates */ | |
3825 | #define BRF1_RFAWARE_DCS 0x20 /* RFAWARE dynamic channel selection (DCS) */ | |
3826 | #define BRF1_SOFTAP 0x40 /* Configure as Broadcom SOFTAP */ | |
3827 | #define BRF1_DWDS 0x80 /* DWDS capable */ | |
3828 | ||
3829 | /** Vendor IE structure */ | |
3830 | BWL_PRE_PACKED_STRUCT struct vndr_ie { | |
3831 | uchar id; | |
3832 | uchar len; | |
3833 | uchar oui [3]; | |
3834 | uchar data [1]; /* Variable size data */ | |
3835 | } BWL_POST_PACKED_STRUCT; | |
3836 | typedef struct vndr_ie vndr_ie_t; | |
3837 | ||
3838 | #define VNDR_IE_HDR_LEN 2u /* id + len field */ | |
3839 | #define VNDR_IE_MIN_LEN 3u /* size of the oui field */ | |
3840 | #define VNDR_IE_FIXED_LEN (VNDR_IE_HDR_LEN + VNDR_IE_MIN_LEN) | |
3841 | ||
3842 | #define VNDR_IE_MAX_LEN 255u /* vendor IE max length, without ID and len */ | |
3843 | ||
3844 | /** BRCM PROP DEVICE PRIMARY MAC ADDRESS IE */ | |
3845 | BWL_PRE_PACKED_STRUCT struct member_of_brcm_prop_ie { | |
3846 | uchar id; | |
3847 | uchar len; | |
3848 | uchar oui[3]; | |
3849 | uint8 type; /* type indicates what follows */ | |
3850 | struct ether_addr ea; /* Device Primary MAC Adrress */ | |
3851 | } BWL_POST_PACKED_STRUCT; | |
3852 | typedef struct member_of_brcm_prop_ie member_of_brcm_prop_ie_t; | |
3853 | ||
3854 | #define MEMBER_OF_BRCM_PROP_IE_LEN 10 /* IE max length */ | |
3855 | #define MEMBER_OF_BRCM_PROP_IE_HDRLEN (sizeof(member_of_brcm_prop_ie_t)) | |
3856 | #define MEMBER_OF_BRCM_PROP_IE_TYPE 54 | |
3857 | ||
3858 | /** BRCM Reliable Multicast IE */ | |
3859 | BWL_PRE_PACKED_STRUCT struct relmcast_brcm_prop_ie { | |
3860 | uint8 id; | |
3861 | uint8 len; | |
3862 | uint8 oui[3]; | |
3863 | uint8 type; /* type indicates what follows */ | |
3864 | struct ether_addr ea; /* The ack sender's MAC Adrress */ | |
3865 | struct ether_addr mcast_ea; /* The multicast MAC address */ | |
3866 | uint8 updtmo; /* time interval(second) for client to send null packet to report its rssi */ | |
3867 | } BWL_POST_PACKED_STRUCT; | |
3868 | typedef struct relmcast_brcm_prop_ie relmcast_brcm_prop_ie_t; | |
3869 | ||
3870 | /* IE length */ | |
3871 | /* BRCM_PROP_IE_LEN = sizeof(relmcast_brcm_prop_ie_t)-((sizeof (id) + sizeof (len)))? */ | |
3872 | #define RELMCAST_BRCM_PROP_IE_LEN (sizeof(relmcast_brcm_prop_ie_t)-(2*sizeof(uint8))) | |
3873 | ||
3874 | #define RELMCAST_BRCM_PROP_IE_TYPE 55 | |
3875 | ||
3876 | /* BRCM BTC IE */ | |
3877 | BWL_PRE_PACKED_STRUCT struct btc_brcm_prop_ie { | |
3878 | uint8 id; | |
3879 | uint8 len; | |
3880 | uint8 oui[3]; | |
3881 | uint8 type; /* type inidicates what follows */ | |
3882 | uint32 info; | |
3883 | } BWL_POST_PACKED_STRUCT; | |
3884 | typedef struct btc_brcm_prop_ie btc_brcm_prop_ie_t; | |
3885 | ||
3886 | #define BTC_INFO_BRCM_PROP_IE_TYPE 90 | |
3887 | #define BRCM_BTC_INFO_TYPE_LEN (sizeof(btc_brcm_prop_ie_t) - (2 * sizeof(uint8))) | |
3888 | ||
3889 | /* ************* HT definitions. ************* */ | |
3890 | #define MCSSET_LEN 16 /* 16-bits per 8-bit set to give 128-bits bitmap of MCS Index */ | |
3891 | #define MAX_MCS_NUM (128) /* max mcs number = 128 */ | |
3892 | #define BASIC_HT_MCS 0xFFu /* HT MCS supported rates */ | |
3893 | ||
3894 | BWL_PRE_PACKED_STRUCT struct ht_cap_ie { | |
3895 | uint16 cap; | |
3896 | uint8 params; | |
3897 | uint8 supp_mcs[MCSSET_LEN]; | |
3898 | uint16 ext_htcap; | |
3899 | uint32 txbf_cap; | |
3900 | uint8 as_cap; | |
3901 | } BWL_POST_PACKED_STRUCT; | |
3902 | typedef struct ht_cap_ie ht_cap_ie_t; | |
3903 | ||
3904 | BWL_PRE_PACKED_STRUCT struct dot11_ht_cap_ie { | |
3905 | uint8 id; | |
3906 | uint8 len; | |
3907 | ht_cap_ie_t ht_cap; | |
3908 | } BWL_POST_PACKED_STRUCT; | |
3909 | typedef struct dot11_ht_cap_ie dot11_ht_cap_ie_t; | |
3910 | ||
3911 | /* CAP IE: HT 1.0 spec. simply stole a 802.11 IE, we use our prop. IE until this is resolved */ | |
3912 | /* the capability IE is primarily used to convey this nodes abilities */ | |
3913 | BWL_PRE_PACKED_STRUCT struct ht_prop_cap_ie { | |
3914 | uint8 id; /* IE ID, 221, DOT11_MNG_PROPR_ID */ | |
3915 | uint8 len; /* IE length */ | |
3916 | uint8 oui[3]; | |
3917 | uint8 type; /* type indicates what follows */ | |
3918 | ht_cap_ie_t cap_ie; | |
3919 | } BWL_POST_PACKED_STRUCT; | |
3920 | typedef struct ht_prop_cap_ie ht_prop_cap_ie_t; | |
3921 | ||
3922 | #define HT_PROP_IE_OVERHEAD 4 /* overhead bytes for prop oui ie */ | |
3923 | #define HT_CAP_IE_LEN 26 /* HT capability len (based on .11n d2.0) */ | |
3924 | #define HT_CAP_IE_TYPE 51 | |
3925 | ||
3926 | #define HT_CAP_LDPC_CODING 0x0001 /* Support for rx of LDPC coded pkts */ | |
3927 | #define HT_CAP_40MHZ 0x0002 /* FALSE:20Mhz, TRUE:20/40MHZ supported */ | |
3928 | #define HT_CAP_MIMO_PS_MASK 0x000C /* Mimo PS mask */ | |
3929 | #define HT_CAP_MIMO_PS_SHIFT 0x0002 /* Mimo PS shift */ | |
3930 | #define HT_CAP_MIMO_PS_OFF 0x0003 /* Mimo PS, no restriction */ | |
3931 | #define HT_CAP_MIMO_PS_RTS 0x0001 /* Mimo PS, send RTS/CTS around MIMO frames */ | |
3932 | #define HT_CAP_MIMO_PS_ON 0x0000 /* Mimo PS, MIMO disallowed */ | |
3933 | #define HT_CAP_GF 0x0010 /* Greenfield preamble support */ | |
3934 | #define HT_CAP_SHORT_GI_20 0x0020 /* 20MHZ short guard interval support */ | |
3935 | #define HT_CAP_SHORT_GI_40 0x0040 /* 40Mhz short guard interval support */ | |
3936 | #define HT_CAP_TX_STBC 0x0080 /* Tx STBC support */ | |
3937 | #define HT_CAP_RX_STBC_MASK 0x0300 /* Rx STBC mask */ | |
3938 | #define HT_CAP_RX_STBC_SHIFT 8 /* Rx STBC shift */ | |
3939 | #define HT_CAP_DELAYED_BA 0x0400 /* delayed BA support */ | |
3940 | #define HT_CAP_MAX_AMSDU 0x0800 /* Max AMSDU size in bytes , 0=3839, 1=7935 */ | |
3941 | ||
3942 | #define HT_CAP_DSSS_CCK 0x1000 /* DSSS/CCK supported by the BSS */ | |
3943 | #define HT_CAP_PSMP 0x2000 /* Power Save Multi Poll support */ | |
3944 | #define HT_CAP_40MHZ_INTOLERANT 0x4000 /* 40MHz Intolerant */ | |
3945 | #define HT_CAP_LSIG_TXOP 0x8000 /* L-SIG TXOP protection support */ | |
3946 | ||
3947 | #define HT_CAP_RX_STBC_NO 0x0 /* no rx STBC support */ | |
3948 | #define HT_CAP_RX_STBC_ONE_STREAM 0x1 /* rx STBC support of 1 spatial stream */ | |
3949 | #define HT_CAP_RX_STBC_TWO_STREAM 0x2 /* rx STBC support of 1-2 spatial streams */ | |
3950 | #define HT_CAP_RX_STBC_THREE_STREAM 0x3 /* rx STBC support of 1-3 spatial streams */ | |
3951 | ||
3952 | #define HT_CAP_TXBF_CAP_IMPLICIT_TXBF_RX 0x1 | |
3953 | #define HT_CAP_TXBF_CAP_NDP_RX 0x8 | |
3954 | #define HT_CAP_TXBF_CAP_NDP_TX 0x10 | |
3955 | #define HT_CAP_TXBF_CAP_EXPLICIT_CSI 0x100 | |
3956 | #define HT_CAP_TXBF_CAP_EXPLICIT_NC_STEERING 0x200 | |
3957 | #define HT_CAP_TXBF_CAP_EXPLICIT_C_STEERING 0x400 | |
3958 | #define HT_CAP_TXBF_CAP_EXPLICIT_CSI_FB_MASK 0x1800 | |
3959 | #define HT_CAP_TXBF_CAP_EXPLICIT_CSI_FB_SHIFT 11 | |
3960 | #define HT_CAP_TXBF_CAP_EXPLICIT_NC_FB_MASK 0x6000 | |
3961 | #define HT_CAP_TXBF_CAP_EXPLICIT_NC_FB_SHIFT 13 | |
3962 | #define HT_CAP_TXBF_CAP_EXPLICIT_C_FB_MASK 0x18000 | |
3963 | #define HT_CAP_TXBF_CAP_EXPLICIT_C_FB_SHIFT 15 | |
3964 | #define HT_CAP_TXBF_CAP_CSI_BFR_ANT_SHIFT 19 | |
3965 | #define HT_CAP_TXBF_CAP_NC_BFR_ANT_SHIFT 21 | |
3966 | #define HT_CAP_TXBF_CAP_C_BFR_ANT_SHIFT 23 | |
3967 | #define HT_CAP_TXBF_CAP_C_BFR_ANT_MASK 0x1800000 | |
3968 | ||
3969 | #define HT_CAP_TXBF_CAP_CHAN_ESTIM_SHIFT 27 | |
3970 | #define HT_CAP_TXBF_CAP_CHAN_ESTIM_MASK 0x18000000 | |
3971 | ||
3972 | #define HT_CAP_TXBF_FB_TYPE_NONE 0 | |
3973 | #define HT_CAP_TXBF_FB_TYPE_DELAYED 1 | |
3974 | #define HT_CAP_TXBF_FB_TYPE_IMMEDIATE 2 | |
3975 | #define HT_CAP_TXBF_FB_TYPE_BOTH 3 | |
3976 | ||
3977 | #define HT_CAP_TX_BF_CAP_EXPLICIT_CSI_FB_MASK 0x400 | |
3978 | #define HT_CAP_TX_BF_CAP_EXPLICIT_CSI_FB_SHIFT 10 | |
3979 | #define HT_CAP_TX_BF_CAP_EXPLICIT_COMPRESSED_FB_MASK 0x18000 | |
3980 | #define HT_CAP_TX_BF_CAP_EXPLICIT_COMPRESSED_FB_SHIFT 15 | |
3981 | ||
3982 | #define HT_CAP_MCS_FLAGS_SUPP_BYTE 12 /* byte offset in HT Cap Supported MCS for various flags */ | |
3983 | #define HT_CAP_MCS_RX_8TO15_BYTE_OFFSET 1 | |
3984 | #define HT_CAP_MCS_FLAGS_TX_RX_UNEQUAL 0x02 | |
3985 | #define HT_CAP_MCS_FLAGS_MAX_SPATIAL_STREAM_MASK 0x0C | |
3986 | ||
3987 | #define VHT_MAX_MPDU 11454 /* max mpdu size for now (bytes) */ | |
3988 | #define VHT_MPDU_MSDU_DELTA 56 /* Difference in spec - vht mpdu, amsdu len */ | |
3989 | /* Max AMSDU len - per spec */ | |
3990 | #define VHT_MAX_AMSDU (VHT_MAX_MPDU - VHT_MPDU_MSDU_DELTA) | |
3991 | ||
3992 | #define HT_MAX_AMSDU 7935 /* max amsdu size (bytes) per the HT spec */ | |
3993 | #define HT_MIN_AMSDU 3835 /* min amsdu size (bytes) per the HT spec */ | |
3994 | ||
3995 | #define HT_PARAMS_RX_FACTOR_MASK 0x03 /* ampdu rcv factor mask */ | |
3996 | #define HT_PARAMS_DENSITY_MASK 0x1C /* ampdu density mask */ | |
3997 | #define HT_PARAMS_DENSITY_SHIFT 2 /* ampdu density shift */ | |
3998 | ||
3999 | /* HT/AMPDU specific define */ | |
4000 | #define AMPDU_MAX_MPDU_DENSITY 7 /* max mpdu density; in 1/4 usec units */ | |
4001 | #define AMPDU_DENSITY_NONE 0 /* No density requirement */ | |
4002 | #define AMPDU_DENSITY_1over4_US 1 /* 1/4 us density */ | |
4003 | #define AMPDU_DENSITY_1over2_US 2 /* 1/2 us density */ | |
4004 | #define AMPDU_DENSITY_1_US 3 /* 1 us density */ | |
4005 | #define AMPDU_DENSITY_2_US 4 /* 2 us density */ | |
4006 | #define AMPDU_DENSITY_4_US 5 /* 4 us density */ | |
4007 | #define AMPDU_DENSITY_8_US 6 /* 8 us density */ | |
4008 | #define AMPDU_DENSITY_16_US 7 /* 16 us density */ | |
4009 | #define AMPDU_RX_FACTOR_8K 0 /* max rcv ampdu len (8kb) */ | |
4010 | #define AMPDU_RX_FACTOR_16K 1 /* max rcv ampdu len (16kb) */ | |
4011 | #define AMPDU_RX_FACTOR_32K 2 /* max rcv ampdu len (32kb) */ | |
4012 | #define AMPDU_RX_FACTOR_64K 3 /* max rcv ampdu len (64kb) */ | |
4013 | ||
4014 | /* AMPDU RX factors for VHT rates */ | |
4015 | #define AMPDU_RX_FACTOR_128K 4 /* max rcv ampdu len (128kb) */ | |
4016 | #define AMPDU_RX_FACTOR_256K 5 /* max rcv ampdu len (256kb) */ | |
4017 | #define AMPDU_RX_FACTOR_512K 6 /* max rcv ampdu len (512kb) */ | |
4018 | #define AMPDU_RX_FACTOR_1024K 7 /* max rcv ampdu len (1024kb) */ | |
4019 | ||
4020 | #define AMPDU_RX_FACTOR_BASE 8*1024 /* ampdu factor base for rx len */ | |
4021 | #define AMPDU_RX_FACTOR_BASE_PWR 13 /* ampdu factor base for rx len in power of 2 */ | |
4022 | ||
4023 | #define AMPDU_DELIMITER_LEN 4u /* length of ampdu delimiter */ | |
4024 | #define AMPDU_DELIMITER_LEN_MAX 63 /* max length of ampdu delimiter(enforced in HW) */ | |
4025 | ||
4026 | #define HT_CAP_EXT_PCO 0x0001 | |
4027 | #define HT_CAP_EXT_PCO_TTIME_MASK 0x0006 | |
4028 | #define HT_CAP_EXT_PCO_TTIME_SHIFT 1 | |
4029 | #define HT_CAP_EXT_MCS_FEEDBACK_MASK 0x0300 | |
4030 | #define HT_CAP_EXT_MCS_FEEDBACK_SHIFT 8 | |
4031 | #define HT_CAP_EXT_HTC 0x0400 | |
4032 | #define HT_CAP_EXT_RD_RESP 0x0800 | |
4033 | ||
4034 | /** 'ht_add' is called 'HT Operation' information element in the 802.11 standard */ | |
4035 | BWL_PRE_PACKED_STRUCT struct ht_add_ie { | |
4036 | uint8 ctl_ch; /* control channel number */ | |
4037 | uint8 byte1; /* ext ch,rec. ch. width, RIFS support */ | |
4038 | uint16 opmode; /* operation mode */ | |
4039 | uint16 misc_bits; /* misc bits */ | |
4040 | uint8 basic_mcs[MCSSET_LEN]; /* required MCS set */ | |
4041 | } BWL_POST_PACKED_STRUCT; | |
4042 | typedef struct ht_add_ie ht_add_ie_t; | |
4043 | ||
4044 | /* ADD IE: HT 1.0 spec. simply stole a 802.11 IE, we use our prop. IE until this is resolved */ | |
4045 | /* the additional IE is primarily used to convey the current BSS configuration */ | |
4046 | BWL_PRE_PACKED_STRUCT struct ht_prop_add_ie { | |
4047 | uint8 id; /* IE ID, 221, DOT11_MNG_PROPR_ID */ | |
4048 | uint8 len; /* IE length */ | |
4049 | uint8 oui[3]; | |
4050 | uint8 type; /* indicates what follows */ | |
4051 | ht_add_ie_t add_ie; | |
4052 | } BWL_POST_PACKED_STRUCT; | |
4053 | typedef struct ht_prop_add_ie ht_prop_add_ie_t; | |
4054 | ||
4055 | #define HT_ADD_IE_LEN 22 | |
4056 | #define HT_ADD_IE_TYPE 52 | |
4057 | ||
4058 | /* byte1 defn's */ | |
4059 | #define HT_BW_ANY 0x04 /* set, STA can use 20 or 40MHz */ | |
4060 | #define HT_RIFS_PERMITTED 0x08 /* RIFS allowed */ | |
4061 | ||
4062 | /* opmode defn's */ | |
4063 | #define HT_OPMODE_MASK 0x0003 /* protection mode mask */ | |
4064 | #define HT_OPMODE_SHIFT 0 /* protection mode shift */ | |
4065 | #define HT_OPMODE_PURE 0x0000 /* protection mode PURE */ | |
4066 | #define HT_OPMODE_OPTIONAL 0x0001 /* protection mode optional */ | |
4067 | #define HT_OPMODE_HT20IN40 0x0002 /* protection mode 20MHz HT in 40MHz BSS */ | |
4068 | #define HT_OPMODE_MIXED 0x0003 /* protection mode Mixed Mode */ | |
4069 | #define HT_OPMODE_NONGF 0x0004 /* protection mode non-GF */ | |
4070 | #define DOT11N_TXBURST 0x0008 /* Tx burst limit */ | |
4071 | #define DOT11N_OBSS_NONHT 0x0010 /* OBSS Non-HT STA present */ | |
4072 | #define HT_OPMODE_CCFS2_MASK 0x1fe0 /* Channel Center Frequency Segment 2 mask */ | |
4073 | #define HT_OPMODE_CCFS2_SHIFT 5 /* Channel Center Frequency Segment 2 shift */ | |
4074 | ||
4075 | /* misc_bites defn's */ | |
4076 | #define HT_BASIC_STBC_MCS 0x007f /* basic STBC MCS */ | |
4077 | #define HT_DUAL_STBC_PROT 0x0080 /* Dual STBC Protection */ | |
4078 | #define HT_SECOND_BCN 0x0100 /* Secondary beacon support */ | |
4079 | #define HT_LSIG_TXOP 0x0200 /* L-SIG TXOP Protection full support */ | |
4080 | #define HT_PCO_ACTIVE 0x0400 /* PCO active */ | |
4081 | #define HT_PCO_PHASE 0x0800 /* PCO phase */ | |
4082 | #define HT_DUALCTS_PROTECTION 0x0080 /* DUAL CTS protection needed */ | |
4083 | ||
4084 | /* Tx Burst Limits */ | |
4085 | #define DOT11N_2G_TXBURST_LIMIT 6160 /* 2G band Tx burst limit per 802.11n Draft 1.10 (usec) */ | |
4086 | #define DOT11N_5G_TXBURST_LIMIT 3080 /* 5G band Tx burst limit per 802.11n Draft 1.10 (usec) */ | |
4087 | ||
4088 | /* Macros for opmode */ | |
4089 | #define GET_HT_OPMODE(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | |
4090 | >> HT_OPMODE_SHIFT) | |
4091 | #define HT_MIXEDMODE_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | |
4092 | == HT_OPMODE_MIXED) /* mixed mode present */ | |
4093 | #define HT_HT20_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | |
4094 | == HT_OPMODE_HT20IN40) /* 20MHz HT present */ | |
4095 | #define HT_OPTIONAL_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | |
4096 | == HT_OPMODE_OPTIONAL) /* Optional protection present */ | |
4097 | #define HT_USE_PROTECTION(add_ie) (HT_HT20_PRESENT((add_ie)) || \ | |
4098 | HT_MIXEDMODE_PRESENT((add_ie))) /* use protection */ | |
4099 | #define HT_NONGF_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_NONGF) \ | |
4100 | == HT_OPMODE_NONGF) /* non-GF present */ | |
4101 | #define DOT11N_TXBURST_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) \ | |
4102 | == DOT11N_TXBURST) /* Tx Burst present */ | |
4103 | #define DOT11N_OBSS_NONHT_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) \ | |
4104 | == DOT11N_OBSS_NONHT) /* OBSS Non-HT present */ | |
4105 | #define HT_OPMODE_CCFS2_GET(add_ie) ((ltoh16_ua(&(add_ie)->opmode) & HT_OPMODE_CCFS2_MASK) \ | |
4106 | >> HT_OPMODE_CCFS2_SHIFT) /* get CCFS2 */ | |
4107 | #define HT_OPMODE_CCFS2_SET(add_ie, ccfs2) do { /* set CCFS2 */ \ | |
4108 | (add_ie)->opmode &= htol16(~HT_OPMODE_CCFS2_MASK); \ | |
4109 | (add_ie)->opmode |= htol16(((ccfs2) << HT_OPMODE_CCFS2_SHIFT) & HT_OPMODE_CCFS2_MASK); \ | |
4110 | } while (0) | |
4111 | ||
4112 | /* Macros for HT MCS field access */ | |
4113 | #define HT_CAP_MCS_BITMASK(supp_mcs) \ | |
4114 | ((supp_mcs)[HT_CAP_MCS_RX_8TO15_BYTE_OFFSET]) | |
4115 | #define HT_CAP_MCS_TX_RX_UNEQUAL(supp_mcs) \ | |
4116 | ((supp_mcs)[HT_CAP_MCS_FLAGS_SUPP_BYTE] & HT_CAP_MCS_FLAGS_TX_RX_UNEQUAL) | |
4117 | #define HT_CAP_MCS_TX_STREAM_SUPPORT(supp_mcs) \ | |
4118 | ((supp_mcs)[HT_CAP_MCS_FLAGS_SUPP_BYTE] & HT_CAP_MCS_FLAGS_MAX_SPATIAL_STREAM_MASK) | |
4119 | ||
4120 | BWL_PRE_PACKED_STRUCT struct obss_params { | |
4121 | uint16 passive_dwell; | |
4122 | uint16 active_dwell; | |
4123 | uint16 bss_widthscan_interval; | |
4124 | uint16 passive_total; | |
4125 | uint16 active_total; | |
4126 | uint16 chanwidth_transition_dly; | |
4127 | uint16 activity_threshold; | |
4128 | } BWL_POST_PACKED_STRUCT; | |
4129 | typedef struct obss_params obss_params_t; | |
4130 | ||
4131 | BWL_PRE_PACKED_STRUCT struct dot11_obss_ie { | |
4132 | uint8 id; | |
4133 | uint8 len; | |
4134 | obss_params_t obss_params; | |
4135 | } BWL_POST_PACKED_STRUCT; | |
4136 | typedef struct dot11_obss_ie dot11_obss_ie_t; | |
4137 | #define DOT11_OBSS_SCAN_IE_LEN sizeof(obss_params_t) /* HT OBSS len (based on 802.11n d3.0) */ | |
4138 | ||
4139 | /* HT control field */ | |
4140 | #define HT_CTRL_LA_TRQ 0x00000002 /* sounding request */ | |
4141 | #define HT_CTRL_LA_MAI 0x0000003C /* MCS request or antenna selection indication */ | |
4142 | #define HT_CTRL_LA_MAI_SHIFT 2 | |
4143 | #define HT_CTRL_LA_MAI_MRQ 0x00000004 /* MCS request */ | |
4144 | #define HT_CTRL_LA_MAI_MSI 0x00000038 /* MCS request sequence identifier */ | |
4145 | #define HT_CTRL_LA_MFSI 0x000001C0 /* MFB sequence identifier */ | |
4146 | #define HT_CTRL_LA_MFSI_SHIFT 6 | |
4147 | #define HT_CTRL_LA_MFB_ASELC 0x0000FE00 /* MCS feedback, antenna selection command/data */ | |
4148 | #define HT_CTRL_LA_MFB_ASELC_SH 9 | |
4149 | #define HT_CTRL_LA_ASELC_CMD 0x00000C00 /* ASEL command */ | |
4150 | #define HT_CTRL_LA_ASELC_DATA 0x0000F000 /* ASEL data */ | |
4151 | #define HT_CTRL_CAL_POS 0x00030000 /* Calibration position */ | |
4152 | #define HT_CTRL_CAL_SEQ 0x000C0000 /* Calibration sequence */ | |
4153 | #define HT_CTRL_CSI_STEERING 0x00C00000 /* CSI/Steering */ | |
4154 | #define HT_CTRL_CSI_STEER_SHIFT 22 | |
4155 | #define HT_CTRL_CSI_STEER_NFB 0 /* no fedback required */ | |
4156 | #define HT_CTRL_CSI_STEER_CSI 1 /* CSI, H matrix */ | |
4157 | #define HT_CTRL_CSI_STEER_NCOM 2 /* non-compressed beamforming */ | |
4158 | #define HT_CTRL_CSI_STEER_COM 3 /* compressed beamforming */ | |
4159 | #define HT_CTRL_NDP_ANNOUNCE 0x01000000 /* NDP announcement */ | |
4160 | #define HT_CTRL_AC_CONSTRAINT 0x40000000 /* AC Constraint */ | |
4161 | #define HT_CTRL_RDG_MOREPPDU 0x80000000 /* RDG/More PPDU */ | |
4162 | ||
4163 | /* ************* VHT definitions. ************* */ | |
4164 | ||
4165 | /** | |
4166 | * VHT Capabilites IE (sec 8.4.2.160) | |
4167 | */ | |
4168 | ||
4169 | BWL_PRE_PACKED_STRUCT struct vht_cap_ie { | |
4170 | uint32 vht_cap_info; | |
4171 | /* supported MCS set - 64 bit field */ | |
4172 | uint16 rx_mcs_map; | |
4173 | uint16 rx_max_rate; | |
4174 | uint16 tx_mcs_map; | |
4175 | uint16 tx_max_rate; | |
4176 | } BWL_POST_PACKED_STRUCT; | |
4177 | typedef struct vht_cap_ie vht_cap_ie_t; | |
4178 | ||
4179 | /* 4B cap_info + 8B supp_mcs */ | |
4180 | #define VHT_CAP_IE_LEN 12 | |
4181 | ||
4182 | /* VHT Capabilities Info field - 32bit - in VHT Cap IE */ | |
4183 | #define VHT_CAP_INFO_MAX_MPDU_LEN_MASK 0x00000003 | |
4184 | #define VHT_CAP_INFO_SUPP_CHAN_WIDTH_MASK 0x0000000c | |
4185 | #define VHT_CAP_INFO_LDPC 0x00000010 | |
4186 | #define VHT_CAP_INFO_SGI_80MHZ 0x00000020 | |
4187 | #define VHT_CAP_INFO_SGI_160MHZ 0x00000040 | |
4188 | #define VHT_CAP_INFO_TX_STBC 0x00000080 | |
4189 | #define VHT_CAP_INFO_RX_STBC_MASK 0x00000700 | |
4190 | #define VHT_CAP_INFO_RX_STBC_SHIFT 8 | |
4191 | #define VHT_CAP_INFO_SU_BEAMFMR 0x00000800 | |
4192 | #define VHT_CAP_INFO_SU_BEAMFMEE 0x00001000 | |
4193 | #define VHT_CAP_INFO_NUM_BMFMR_ANT_MASK 0x0000e000 | |
4194 | #define VHT_CAP_INFO_NUM_BMFMR_ANT_SHIFT 13 | |
4195 | #define VHT_CAP_INFO_NUM_SOUNDING_DIM_MASK 0x00070000 | |
4196 | #define VHT_CAP_INFO_NUM_SOUNDING_DIM_SHIFT 16 | |
4197 | #define VHT_CAP_INFO_MU_BEAMFMR 0x00080000 | |
4198 | #define VHT_CAP_INFO_MU_BEAMFMEE 0x00100000 | |
4199 | #define VHT_CAP_INFO_TXOPPS 0x00200000 | |
4200 | #define VHT_CAP_INFO_HTCVHT 0x00400000 | |
4201 | #define VHT_CAP_INFO_AMPDU_MAXLEN_EXP_MASK 0x03800000 | |
4202 | #define VHT_CAP_INFO_AMPDU_MAXLEN_EXP_SHIFT 23 | |
4203 | #define VHT_CAP_INFO_LINK_ADAPT_CAP_MASK 0x0c000000 | |
4204 | #define VHT_CAP_INFO_LINK_ADAPT_CAP_SHIFT 26 | |
4205 | #define VHT_CAP_INFO_EXT_NSS_BW_SUP_MASK 0xc0000000 | |
4206 | #define VHT_CAP_INFO_EXT_NSS_BW_SUP_SHIFT 30 | |
4207 | ||
4208 | /* get Extended NSS BW Support passing vht cap info */ | |
4209 | #define VHT_CAP_EXT_NSS_BW_SUP(cap_info) \ | |
4210 | (((cap_info) & VHT_CAP_INFO_EXT_NSS_BW_SUP_MASK) >> VHT_CAP_INFO_EXT_NSS_BW_SUP_SHIFT) | |
4211 | ||
4212 | /* VHT CAP INFO extended NSS BW support - refer to IEEE 802.11 REVmc D8.0 Figure 9-559 */ | |
4213 | #define VHT_CAP_INFO_EXT_NSS_BW_HALF_160 1 /* 160MHz at half NSS CAP */ | |
4214 | #define VHT_CAP_INFO_EXT_NSS_BW_HALF_160_80P80 2 /* 160 & 80p80 MHz at half NSS CAP */ | |
4215 | ||
4216 | /* VHT Supported MCS Set - 64-bit - in VHT Cap IE */ | |
4217 | #define VHT_CAP_SUPP_MCS_RX_HIGHEST_RATE_MASK 0x1fff | |
4218 | #define VHT_CAP_SUPP_MCS_RX_HIGHEST_RATE_SHIFT 0 | |
4219 | #define VHT_CAP_SUPP_CHAN_WIDTH_SHIFT 5 | |
4220 | ||
4221 | #define VHT_CAP_SUPP_MCS_TX_HIGHEST_RATE_MASK 0x1fff | |
4222 | #define VHT_CAP_SUPP_MCS_TX_HIGHEST_RATE_SHIFT 0 | |
4223 | ||
4224 | /* defines for field(s) in vht_cap_ie->rx_max_rate */ | |
4225 | #define VHT_CAP_MAX_NSTS_MASK 0xe000 | |
4226 | #define VHT_CAP_MAX_NSTS_SHIFT 13 | |
4227 | ||
4228 | /* defines for field(s) in vht_cap_ie->tx_max_rate */ | |
4229 | #define VHT_CAP_EXT_NSS_BW_CAP 0x2000 | |
4230 | ||
4231 | #define VHT_CAP_MCS_MAP_0_7 0 | |
4232 | #define VHT_CAP_MCS_MAP_0_8 1 | |
4233 | #define VHT_CAP_MCS_MAP_0_9 2 | |
4234 | #define VHT_CAP_MCS_MAP_NONE 3 | |
4235 | #define VHT_CAP_MCS_MAP_S 2 /* num bits for 1-stream */ | |
4236 | #define VHT_CAP_MCS_MAP_M 0x3 /* mask for 1-stream */ | |
4237 | /* assumes VHT_CAP_MCS_MAP_NONE is 3 and 2 bits are used for encoding */ | |
4238 | #define VHT_CAP_MCS_MAP_NONE_ALL 0xffff | |
4239 | ||
4240 | /* VHT rates bitmap */ | |
4241 | #define VHT_CAP_MCS_0_7_RATEMAP 0x00ff | |
4242 | #define VHT_CAP_MCS_0_8_RATEMAP 0x01ff | |
4243 | #define VHT_CAP_MCS_0_9_RATEMAP 0x03ff | |
4244 | #define VHT_CAP_MCS_FULL_RATEMAP VHT_CAP_MCS_0_9_RATEMAP | |
4245 | ||
4246 | #define VHT_PROP_MCS_MAP_10_11 0 | |
4247 | #define VHT_PROP_MCS_MAP_UNUSED1 1 | |
4248 | #define VHT_PROP_MCS_MAP_UNUSED2 2 | |
4249 | #define VHT_PROP_MCS_MAP_NONE 3 | |
4250 | #define VHT_PROP_MCS_MAP_NONE_ALL 0xffff | |
4251 | ||
4252 | /* VHT prop rates bitmap */ | |
4253 | #define VHT_PROP_MCS_10_11_RATEMAP 0x0c00 | |
4254 | #define VHT_PROP_MCS_FULL_RATEMAP VHT_PROP_MCS_10_11_RATEMAP | |
4255 | ||
4256 | #if !defined(VHT_CAP_MCS_MAP_0_9_NSS3) | |
4257 | /* mcsmap with MCS0-9 for Nss = 3 */ | |
4258 | #define VHT_CAP_MCS_MAP_0_9_NSS3 \ | |
4259 | ((VHT_CAP_MCS_MAP_0_9 << VHT_MCS_MAP_GET_SS_IDX(1)) | \ | |
4260 | (VHT_CAP_MCS_MAP_0_9 << VHT_MCS_MAP_GET_SS_IDX(2)) | \ | |
4261 | (VHT_CAP_MCS_MAP_0_9 << VHT_MCS_MAP_GET_SS_IDX(3))) | |
4262 | #endif /* !VHT_CAP_MCS_MAP_0_9_NSS3 */ | |
4263 | ||
4264 | #define VHT_CAP_MCS_MAP_NSS_MAX 8 | |
4265 | ||
4266 | /* get mcsmap with given mcs for given nss streams */ | |
4267 | #define VHT_CAP_MCS_MAP_CREATE(mcsmap, nss, mcs) \ | |
4268 | do { \ | |
4269 | int i; \ | |
4270 | for (i = 1; i <= nss; i++) { \ | |
4271 | VHT_MCS_MAP_SET_MCS_PER_SS(i, mcs, mcsmap); \ | |
4272 | } \ | |
4273 | } while (0) | |
4274 | ||
4275 | /* Map the mcs code to mcs bit map */ | |
4276 | #define VHT_MCS_CODE_TO_MCS_MAP(mcs_code) \ | |
4277 | ((mcs_code == VHT_CAP_MCS_MAP_0_7) ? VHT_CAP_MCS_0_7_RATEMAP : \ | |
4278 | (mcs_code == VHT_CAP_MCS_MAP_0_8) ? VHT_CAP_MCS_0_8_RATEMAP : \ | |
4279 | (mcs_code == VHT_CAP_MCS_MAP_0_9) ? VHT_CAP_MCS_0_9_RATEMAP : 0) | |
4280 | ||
4281 | #define VHT_PROP_MCS_CODE_TO_PROP_MCS_MAP(mcs_code) \ | |
4282 | ((mcs_code == VHT_PROP_MCS_MAP_10_11) ? VHT_PROP_MCS_10_11_RATEMAP : 0) | |
4283 | ||
4284 | /* Map the mcs bit map to mcs code */ | |
4285 | #define VHT_MCS_MAP_TO_MCS_CODE(mcs_map) \ | |
4286 | ((mcs_map == VHT_CAP_MCS_0_7_RATEMAP) ? VHT_CAP_MCS_MAP_0_7 : \ | |
4287 | (mcs_map == VHT_CAP_MCS_0_8_RATEMAP) ? VHT_CAP_MCS_MAP_0_8 : \ | |
4288 | (mcs_map == VHT_CAP_MCS_0_9_RATEMAP) ? VHT_CAP_MCS_MAP_0_9 : VHT_CAP_MCS_MAP_NONE) | |
4289 | ||
4290 | #define VHT_PROP_MCS_MAP_TO_PROP_MCS_CODE(mcs_map) \ | |
4291 | (((mcs_map & 0xc00) == 0xc00) ? VHT_PROP_MCS_MAP_10_11 : VHT_PROP_MCS_MAP_NONE) | |
4292 | ||
4293 | /** VHT Capabilities Supported Channel Width */ | |
4294 | typedef enum vht_cap_chan_width { | |
4295 | VHT_CAP_CHAN_WIDTH_SUPPORT_MANDATORY = 0x00, | |
4296 | VHT_CAP_CHAN_WIDTH_SUPPORT_160 = 0x04, | |
4297 | VHT_CAP_CHAN_WIDTH_SUPPORT_160_8080 = 0x08 | |
4298 | } vht_cap_chan_width_t; | |
4299 | ||
4300 | /** VHT Capabilities Supported max MPDU LEN (sec 8.4.2.160.2) */ | |
4301 | typedef enum vht_cap_max_mpdu_len { | |
4302 | VHT_CAP_MPDU_MAX_4K = 0x00, | |
4303 | VHT_CAP_MPDU_MAX_8K = 0x01, | |
4304 | VHT_CAP_MPDU_MAX_11K = 0x02 | |
4305 | } vht_cap_max_mpdu_len_t; | |
4306 | ||
4307 | /* Maximum MPDU Length byte counts for the VHT Capabilities advertised limits */ | |
4308 | #define VHT_MPDU_LIMIT_4K 3895 | |
4309 | #define VHT_MPDU_LIMIT_8K 7991 | |
4310 | #define VHT_MPDU_LIMIT_11K 11454 | |
4311 | ||
4312 | /** | |
4313 | * VHT Operation IE (sec 8.4.2.161) | |
4314 | */ | |
4315 | ||
4316 | BWL_PRE_PACKED_STRUCT struct vht_op_ie { | |
4317 | uint8 chan_width; | |
4318 | uint8 chan1; | |
4319 | uint8 chan2; | |
4320 | uint16 supp_mcs; /* same def as above in vht cap */ | |
4321 | } BWL_POST_PACKED_STRUCT; | |
4322 | typedef struct vht_op_ie vht_op_ie_t; | |
4323 | ||
4324 | /* 3B VHT Op info + 2B Basic MCS */ | |
4325 | #define VHT_OP_IE_LEN 5 | |
4326 | ||
4327 | typedef enum vht_op_chan_width { | |
4328 | VHT_OP_CHAN_WIDTH_20_40 = 0, | |
4329 | VHT_OP_CHAN_WIDTH_80 = 1, | |
4330 | VHT_OP_CHAN_WIDTH_160 = 2, /* deprecated - IEEE 802.11 REVmc D8.0 Table 11-25 */ | |
4331 | VHT_OP_CHAN_WIDTH_80_80 = 3 /* deprecated - IEEE 802.11 REVmc D8.0 Table 11-25 */ | |
4332 | } vht_op_chan_width_t; | |
4333 | ||
5a068558 MB |
4334 | #define VHT_OP_INFO_LEN 3 |
4335 | ||
1cac41cb MB |
4336 | /* AID length */ |
4337 | #define AID_IE_LEN 2 | |
4338 | /** | |
4339 | * BRCM vht features IE header | |
4340 | * The header if the fixed part of the IE | |
4341 | * On the 5GHz band this is the entire IE, | |
4342 | * on 2.4GHz the VHT IEs as defined in the 802.11ac | |
4343 | * specification follows | |
4344 | * | |
4345 | * | |
4346 | * VHT features rates bitmap. | |
4347 | * Bit0: 5G MCS 0-9 BW 160MHz | |
4348 | * Bit1: 5G MCS 0-9 support BW 80MHz | |
4349 | * Bit2: 5G MCS 0-9 support BW 20MHz | |
4350 | * Bit3: 2.4G MCS 0-9 support BW 20MHz | |
4351 | * Bits:4-7 Reserved for future use | |
4352 | * | |
4353 | */ | |
4354 | #define VHT_FEATURES_IE_TYPE 0x4 | |
4355 | BWL_PRE_PACKED_STRUCT struct vht_features_ie_hdr { | |
4356 | uint8 oui[3]; | |
4357 | uint8 type; /* type of this IE = 4 */ | |
4358 | uint8 rate_mask; /* VHT rate mask */ | |
4359 | } BWL_POST_PACKED_STRUCT; | |
4360 | typedef struct vht_features_ie_hdr vht_features_ie_hdr_t; | |
4361 | ||
4362 | /* Def for rx & tx basic mcs maps - ea ss num has 2 bits of info */ | |
4363 | #define VHT_MCS_MAP_GET_SS_IDX(nss) (((nss)-1) * VHT_CAP_MCS_MAP_S) | |
4364 | #define VHT_MCS_MAP_GET_MCS_PER_SS(nss, mcsMap) \ | |
4365 | (((mcsMap) >> VHT_MCS_MAP_GET_SS_IDX(nss)) & VHT_CAP_MCS_MAP_M) | |
4366 | #define VHT_MCS_MAP_SET_MCS_PER_SS(nss, numMcs, mcsMap) \ | |
4367 | do { \ | |
4368 | (mcsMap) &= (~(VHT_CAP_MCS_MAP_M << VHT_MCS_MAP_GET_SS_IDX(nss))); \ | |
4369 | (mcsMap) |= (((numMcs) & VHT_CAP_MCS_MAP_M) << VHT_MCS_MAP_GET_SS_IDX(nss)); \ | |
4370 | } while (0) | |
4371 | #define VHT_MCS_SS_SUPPORTED(nss, mcsMap) \ | |
4372 | (VHT_MCS_MAP_GET_MCS_PER_SS((nss), (mcsMap)) != VHT_CAP_MCS_MAP_NONE) | |
4373 | ||
4374 | /* Get the max ss supported from the mcs map */ | |
4375 | #define VHT_MAX_SS_SUPPORTED(mcsMap) \ | |
4376 | VHT_MCS_SS_SUPPORTED(8, mcsMap) ? 8 : \ | |
4377 | VHT_MCS_SS_SUPPORTED(7, mcsMap) ? 7 : \ | |
4378 | VHT_MCS_SS_SUPPORTED(6, mcsMap) ? 6 : \ | |
4379 | VHT_MCS_SS_SUPPORTED(5, mcsMap) ? 5 : \ | |
4380 | VHT_MCS_SS_SUPPORTED(4, mcsMap) ? 4 : \ | |
4381 | VHT_MCS_SS_SUPPORTED(3, mcsMap) ? 3 : \ | |
4382 | VHT_MCS_SS_SUPPORTED(2, mcsMap) ? 2 : \ | |
4383 | VHT_MCS_SS_SUPPORTED(1, mcsMap) ? 1 : 0 | |
4384 | ||
4385 | /* ************* WPA definitions. ************* */ | |
4386 | #define WPA_OUI "\x00\x50\xF2" /* WPA OUI */ | |
4387 | #define WPA_OUI_LEN 3 /* WPA OUI length */ | |
4388 | #define WPA_OUI_TYPE 1 | |
4389 | #define WPA_VERSION 1 /* WPA version */ | |
4390 | #define WPA_VERSION_LEN 2 /* WPA version length */ | |
4391 | #define WPA2_OUI "\x00\x0F\xAC" /* WPA2 OUI */ | |
4392 | #define WPA2_OUI_LEN 3 /* WPA2 OUI length */ | |
4393 | #define WPA2_VERSION 1 /* WPA2 version */ | |
4394 | #define WPA2_VERSION_LEN 2 /* WAP2 version length */ | |
4395 | #define MAX_RSNE_SUPPORTED_VERSION WPA2_VERSION /* Max supported version */ | |
4396 | ||
4397 | /* ************* WPS definitions. ************* */ | |
4398 | #define WPS_OUI "\x00\x50\xF2" /* WPS OUI */ | |
4399 | #define WPS_OUI_LEN 3 /* WPS OUI length */ | |
4400 | #define WPS_OUI_TYPE 4 | |
4401 | ||
4402 | /* ************* WFA definitions. ************* */ | |
4403 | #define WFA_OUI "\x50\x6F\x9A" /* WFA OUI */ | |
4404 | #define WFA_OUI_LEN 3 /* WFA OUI length */ | |
4405 | #define WFA_OUI_TYPE_P2P 9 | |
4406 | ||
4407 | #ifdef WL_LEGACY_P2P | |
4408 | #define APPLE_OUI "\x00\x17\xF2" /* MACOSX OUI */ | |
4409 | #define APPLE_OUI_LEN 3 | |
5a068558 | 4410 | #define APPLE_OUI_TYPE_P2P 5 |
1cac41cb MB |
4411 | #endif /* WL_LEGACY_P2P */ |
4412 | ||
4413 | #ifndef WL_LEGACY_P2P | |
4414 | #define P2P_OUI WFA_OUI | |
4415 | #define P2P_OUI_LEN WFA_OUI_LEN | |
4416 | #define P2P_OUI_TYPE WFA_OUI_TYPE_P2P | |
4417 | #else | |
4418 | #define P2P_OUI APPLE_OUI | |
4419 | #define P2P_OUI_LEN APPLE_OUI_LEN | |
4420 | #define P2P_OUI_TYPE APPLE_OUI_TYPE_P2P | |
4421 | #endif /* !WL_LEGACY_P2P */ | |
4422 | ||
4423 | #define WFA_OUI_TYPE_TPC 8 | |
4424 | #ifdef WLTDLS | |
4425 | #define WFA_OUI_TYPE_TPQ 4 /* WFD Tunneled Probe ReQuest */ | |
4426 | #define WFA_OUI_TYPE_TPS 5 /* WFD Tunneled Probe ReSponse */ | |
4427 | #define WFA_OUI_TYPE_WFD 10 | |
4428 | #endif /* WTDLS */ | |
4429 | #define WFA_OUI_TYPE_HS20 0x10 | |
4430 | #define WFA_OUI_TYPE_OSEN 0x12 | |
4431 | #define WFA_OUI_TYPE_NAN 0x13 | |
4432 | #define WFA_OUI_TYPE_MBO 0x16 | |
4433 | #define WFA_OUI_TYPE_MBO_OCE 0x16 | |
4434 | ||
4435 | /* RSN authenticated key managment suite */ | |
4436 | #define RSN_AKM_NONE 0 /* None (IBSS) */ | |
4437 | #define RSN_AKM_UNSPECIFIED 1 /* Over 802.1x */ | |
4438 | #define RSN_AKM_PSK 2 /* Pre-shared Key */ | |
4439 | #define RSN_AKM_FBT_1X 3 /* Fast Bss transition using 802.1X */ | |
4440 | #define RSN_AKM_FBT_PSK 4 /* Fast Bss transition using Pre-shared Key */ | |
4441 | /* RSN_AKM_MFP_1X and RSN_AKM_MFP_PSK are not used any more | |
4442 | * Just kept here to avoid build issue in BISON/CARIBOU branch | |
4443 | */ | |
4444 | #define RSN_AKM_MFP_1X 5 /* SHA256 key derivation, using 802.1X */ | |
4445 | #define RSN_AKM_MFP_PSK 6 /* SHA256 key derivation, using Pre-shared Key */ | |
4446 | #define RSN_AKM_SHA256_1X 5 /* SHA256 key derivation, using 802.1X */ | |
4447 | #define RSN_AKM_SHA256_PSK 6 /* SHA256 key derivation, using Pre-shared Key */ | |
4448 | #define RSN_AKM_TPK 7 /* TPK(TDLS Peer Key) handshake */ | |
4449 | #define RSN_AKM_SAE_PSK 8 /* AKM for SAE with 4-way handshake */ | |
4450 | #define RSN_AKM_SAE_FBT 9 /* AKM for SAE with FBT */ | |
4451 | #define RSN_AKM_SUITEB_SHA256_1X 11 /* Suite B SHA256 */ | |
4452 | #define RSN_AKM_SUITEB_SHA384_1X 12 /* Suite B-192 SHA384 */ | |
4453 | #define RSN_AKM_FBT_SHA384_1X 13 /* FBT SHA384 */ | |
4454 | #define RSN_AKM_FILS_SHA256 14 /* SHA256 key derivation, using FILS */ | |
4455 | #define RSN_AKM_FILS_SHA384 15 /* SHA384 key derivation, using FILS */ | |
4456 | #define RSN_AKM_FBT_SHA256_FILS 16 | |
4457 | #define RSN_AKM_FBT_SHA384_FILS 17 | |
4458 | #define RSN_AKM_OWE 18 /* RFC 8110 OWE */ | |
4459 | #define RSN_AKM_FBT_SHA384_PSK 19 | |
4460 | #define RSN_AKM_PSK_SHA384 20 | |
4461 | /* OSEN authenticated key managment suite */ | |
4462 | #define OSEN_AKM_UNSPECIFIED RSN_AKM_UNSPECIFIED /* Over 802.1x */ | |
4463 | ||
4464 | /* Key related defines */ | |
4465 | #define DOT11_MAX_DEFAULT_KEYS 4 /* number of default keys */ | |
4466 | #define DOT11_MAX_IGTK_KEYS 2 | |
4467 | #define DOT11_MAX_KEY_SIZE 32 /* max size of any key */ | |
4468 | #define DOT11_MAX_IV_SIZE 16 /* max size of any IV */ | |
4469 | #define DOT11_EXT_IV_FLAG (1<<5) /* flag to indicate IV is > 4 bytes */ | |
4470 | #define DOT11_WPA_KEY_RSC_LEN 8 /* WPA RSC key len */ | |
4471 | ||
4472 | #define WEP1_KEY_SIZE 5 /* max size of any WEP key */ | |
4473 | #define WEP1_KEY_HEX_SIZE 10 /* size of WEP key in hex. */ | |
4474 | #define WEP128_KEY_SIZE 13 /* max size of any WEP key */ | |
4475 | #define WEP128_KEY_HEX_SIZE 26 /* size of WEP key in hex. */ | |
4476 | #define TKIP_MIC_SIZE 8 /* size of TKIP MIC */ | |
4477 | #define TKIP_EOM_SIZE 7 /* max size of TKIP EOM */ | |
4478 | #define TKIP_EOM_FLAG 0x5a /* TKIP EOM flag byte */ | |
4479 | #define TKIP_KEY_SIZE 32 /* size of any TKIP key, includs MIC keys */ | |
4480 | #define TKIP_TK_SIZE 16 | |
4481 | #define TKIP_MIC_KEY_SIZE 8 | |
4482 | #define TKIP_MIC_AUTH_TX 16 /* offset to Authenticator MIC TX key */ | |
4483 | #define TKIP_MIC_AUTH_RX 24 /* offset to Authenticator MIC RX key */ | |
4484 | #define TKIP_MIC_SUP_RX TKIP_MIC_AUTH_TX /* offset to Supplicant MIC RX key */ | |
4485 | #define TKIP_MIC_SUP_TX TKIP_MIC_AUTH_RX /* offset to Supplicant MIC TX key */ | |
4486 | #define AES_KEY_SIZE 16 /* size of AES key */ | |
4487 | #define AES_MIC_SIZE 8 /* size of AES MIC */ | |
4488 | #define BIP_KEY_SIZE 16 /* size of BIP key */ | |
4489 | #define BIP_MIC_SIZE 8 /* sizeof BIP MIC */ | |
4490 | ||
4491 | #define AES_GCM_MIC_SIZE 16 /* size of MIC for 128-bit GCM - .11adD9 */ | |
4492 | ||
4493 | #define AES256_KEY_SIZE 32 /* size of AES 256 key - .11acD5 */ | |
4494 | #define AES256_MIC_SIZE 16 /* size of MIC for 256 bit keys, incl BIP */ | |
4495 | ||
4496 | /* WCN */ | |
4497 | #define WCN_OUI "\x00\x50\xf2" /* WCN OUI */ | |
4498 | #define WCN_TYPE 4 /* WCN type */ | |
4499 | ||
4500 | #ifdef BCMWAPI_WPI | |
4501 | #define SMS4_KEY_LEN 16 | |
4502 | #define SMS4_WPI_CBC_MAC_LEN 16 | |
4503 | #endif // endif | |
4504 | ||
4505 | /* 802.11r protocol definitions */ | |
4506 | ||
4507 | /** Mobility Domain IE */ | |
4508 | BWL_PRE_PACKED_STRUCT struct dot11_mdid_ie { | |
4509 | uint8 id; | |
4510 | uint8 len; /* DOT11_MDID_IE_DATA_LEN (3) */ | |
4511 | uint16 mdid; /* Mobility Domain Id */ | |
4512 | uint8 cap; | |
4513 | } BWL_POST_PACKED_STRUCT; | |
4514 | typedef struct dot11_mdid_ie dot11_mdid_ie_t; | |
4515 | ||
4516 | /* length of data portion of Mobility Domain IE */ | |
4517 | #define DOT11_MDID_IE_DATA_LEN 3 | |
4518 | ||
4519 | #define FBT_MDID_CAP_OVERDS 0x01 /* Fast Bss transition over the DS support */ | |
4520 | #define FBT_MDID_CAP_RRP 0x02 /* Resource request protocol support */ | |
4521 | ||
4522 | /** Fast Bss Transition IE */ | |
4523 | BWL_PRE_PACKED_STRUCT struct dot11_ft_ie { | |
4524 | uint8 id; | |
4525 | uint8 len; /* At least equal to DOT11_FT_IE_FIXED_LEN (82) */ | |
4526 | uint16 mic_control; /* Mic Control */ | |
4527 | uint8 mic[16]; | |
4528 | uint8 anonce[32]; | |
4529 | uint8 snonce[32]; | |
4530 | /* Optional sub-elements follow */ | |
4531 | } BWL_POST_PACKED_STRUCT; | |
4532 | typedef struct dot11_ft_ie dot11_ft_ie_t; | |
4533 | ||
4534 | /* Fixed length of data portion of Fast BSS Transition IE. There could be | |
4535 | * optional parameters, which if present, could raise the FT IE length to 255. | |
4536 | */ | |
4537 | #define DOT11_FT_IE_FIXED_LEN 82 | |
4538 | ||
4539 | #define TIE_TYPE_RESERVED 0 | |
4540 | #define TIE_TYPE_REASSOC_DEADLINE 1 | |
4541 | #define TIE_TYPE_KEY_LIEFTIME 2 | |
4542 | #define TIE_TYPE_ASSOC_COMEBACK 3 | |
4543 | BWL_PRE_PACKED_STRUCT struct dot11_timeout_ie { | |
4544 | uint8 id; | |
4545 | uint8 len; | |
4546 | uint8 type; /* timeout interval type */ | |
4547 | uint32 value; /* timeout interval value */ | |
4548 | } BWL_POST_PACKED_STRUCT; | |
4549 | typedef struct dot11_timeout_ie dot11_timeout_ie_t; | |
4550 | ||
4551 | /** GTK ie */ | |
4552 | BWL_PRE_PACKED_STRUCT struct dot11_gtk_ie { | |
4553 | uint8 id; | |
4554 | uint8 len; | |
4555 | uint16 key_info; | |
4556 | uint8 key_len; | |
4557 | uint8 rsc[8]; | |
4558 | uint8 data[1]; | |
4559 | } BWL_POST_PACKED_STRUCT; | |
4560 | typedef struct dot11_gtk_ie dot11_gtk_ie_t; | |
4561 | ||
4562 | /** Management MIC ie */ | |
4563 | BWL_PRE_PACKED_STRUCT struct mmic_ie { | |
4564 | uint8 id; /* IE ID: DOT11_MNG_MMIE_ID */ | |
4565 | uint8 len; /* IE length */ | |
4566 | uint16 key_id; /* key id */ | |
4567 | uint8 ipn[6]; /* ipn */ | |
4568 | uint8 mic[16]; /* mic */ | |
4569 | } BWL_POST_PACKED_STRUCT; | |
4570 | typedef struct mmic_ie mmic_ie_t; | |
4571 | ||
4572 | /* 802.11r-2008, 11A.10.3 - RRB frame format */ | |
4573 | BWL_PRE_PACKED_STRUCT struct dot11_ft_rrb_frame { | |
4574 | uint8 frame_type; /* 1 for RRB */ | |
4575 | uint8 packet_type; /* 0 for Request 1 for Response */ | |
4576 | uint16 len; | |
4577 | uint8 cur_ap_addr[ETHER_ADDR_LEN]; | |
4578 | uint8 data[1]; /* IEs Received/Sent in FT Action Req/Resp Frame */ | |
4579 | } BWL_POST_PACKED_STRUCT; | |
4580 | ||
4581 | typedef struct dot11_ft_rrb_frame dot11_ft_rrb_frame_t; | |
4582 | ||
4583 | #define DOT11_FT_RRB_FIXED_LEN 10 | |
4584 | #define DOT11_FT_REMOTE_FRAME_TYPE 1 | |
4585 | #define DOT11_FT_PACKET_REQ 0 | |
4586 | #define DOT11_FT_PACKET_RESP 1 | |
4587 | ||
4588 | #define BSSID_INVALID "\x00\x00\x00\x00\x00\x00" | |
4589 | #define BSSID_BROADCAST "\xFF\xFF\xFF\xFF\xFF\xFF" | |
4590 | ||
4591 | #ifdef BCMWAPI_WAI | |
4592 | #define WAPI_IE_MIN_LEN 20 /* WAPI IE min length */ | |
4593 | #define WAPI_VERSION 1 /* WAPI version */ | |
4594 | #define WAPI_VERSION_LEN 2 /* WAPI version length */ | |
4595 | #define WAPI_OUI "\x00\x14\x72" /* WAPI OUI */ | |
4596 | #define WAPI_OUI_LEN DOT11_OUI_LEN /* WAPI OUI length */ | |
4597 | #endif /* BCMWAPI_WAI */ | |
4598 | ||
4599 | /* ************* WMM Parameter definitions. ************* */ | |
4600 | #define WMM_OUI "\x00\x50\xF2" /* WNN OUI */ | |
4601 | #define WMM_OUI_LEN 3 /* WMM OUI length */ | |
4602 | #define WMM_OUI_TYPE 2 /* WMM OUT type */ | |
4603 | #define WMM_VERSION 1 | |
4604 | #define WMM_VERSION_LEN 1 | |
4605 | ||
4606 | /* WMM OUI subtype */ | |
4607 | #define WMM_OUI_SUBTYPE_PARAMETER 1 | |
4608 | #define WMM_PARAMETER_IE_LEN 24 | |
4609 | ||
4610 | /** Link Identifier Element */ | |
4611 | BWL_PRE_PACKED_STRUCT struct link_id_ie { | |
4612 | uint8 id; | |
4613 | uint8 len; | |
4614 | struct ether_addr bssid; | |
4615 | struct ether_addr tdls_init_mac; | |
4616 | struct ether_addr tdls_resp_mac; | |
4617 | } BWL_POST_PACKED_STRUCT; | |
4618 | typedef struct link_id_ie link_id_ie_t; | |
4619 | #define TDLS_LINK_ID_IE_LEN 18u | |
4620 | ||
4621 | /** Link Wakeup Schedule Element */ | |
4622 | BWL_PRE_PACKED_STRUCT struct wakeup_sch_ie { | |
4623 | uint8 id; | |
4624 | uint8 len; | |
4625 | uint32 offset; /* in ms between TSF0 and start of 1st Awake Window */ | |
4626 | uint32 interval; /* in ms bwtween the start of 2 Awake Windows */ | |
4627 | uint32 awake_win_slots; /* in backof slots, duration of Awake Window */ | |
4628 | uint32 max_wake_win; /* in ms, max duration of Awake Window */ | |
4629 | uint16 idle_cnt; /* number of consecutive Awake Windows */ | |
4630 | } BWL_POST_PACKED_STRUCT; | |
4631 | typedef struct wakeup_sch_ie wakeup_sch_ie_t; | |
4632 | #define TDLS_WAKEUP_SCH_IE_LEN 18 | |
4633 | ||
4634 | /** Channel Switch Timing Element */ | |
4635 | BWL_PRE_PACKED_STRUCT struct channel_switch_timing_ie { | |
4636 | uint8 id; | |
4637 | uint8 len; | |
4638 | uint16 switch_time; /* in ms, time to switch channels */ | |
4639 | uint16 switch_timeout; /* in ms */ | |
4640 | } BWL_POST_PACKED_STRUCT; | |
4641 | typedef struct channel_switch_timing_ie channel_switch_timing_ie_t; | |
4642 | #define TDLS_CHANNEL_SWITCH_TIMING_IE_LEN 4 | |
4643 | ||
4644 | /** PTI Control Element */ | |
4645 | BWL_PRE_PACKED_STRUCT struct pti_control_ie { | |
4646 | uint8 id; | |
4647 | uint8 len; | |
4648 | uint8 tid; | |
4649 | uint16 seq_control; | |
4650 | } BWL_POST_PACKED_STRUCT; | |
4651 | typedef struct pti_control_ie pti_control_ie_t; | |
4652 | #define TDLS_PTI_CONTROL_IE_LEN 3 | |
4653 | ||
4654 | /** PU Buffer Status Element */ | |
4655 | BWL_PRE_PACKED_STRUCT struct pu_buffer_status_ie { | |
4656 | uint8 id; | |
4657 | uint8 len; | |
4658 | uint8 status; | |
4659 | } BWL_POST_PACKED_STRUCT; | |
4660 | typedef struct pu_buffer_status_ie pu_buffer_status_ie_t; | |
4661 | #define TDLS_PU_BUFFER_STATUS_IE_LEN 1 | |
4662 | #define TDLS_PU_BUFFER_STATUS_AC_BK 1 | |
4663 | #define TDLS_PU_BUFFER_STATUS_AC_BE 2 | |
4664 | #define TDLS_PU_BUFFER_STATUS_AC_VI 4 | |
4665 | #define TDLS_PU_BUFFER_STATUS_AC_VO 8 | |
4666 | ||
4667 | /* TDLS Action Field Values */ | |
4668 | #define TDLS_SETUP_REQ 0 | |
4669 | #define TDLS_SETUP_RESP 1 | |
4670 | #define TDLS_SETUP_CONFIRM 2 | |
4671 | #define TDLS_TEARDOWN 3 | |
4672 | #define TDLS_PEER_TRAFFIC_IND 4 | |
4673 | #define TDLS_CHANNEL_SWITCH_REQ 5 | |
4674 | #define TDLS_CHANNEL_SWITCH_RESP 6 | |
4675 | #define TDLS_PEER_PSM_REQ 7 | |
4676 | #define TDLS_PEER_PSM_RESP 8 | |
4677 | #define TDLS_PEER_TRAFFIC_RESP 9 | |
4678 | #define TDLS_DISCOVERY_REQ 10 | |
4679 | ||
4680 | /* 802.11z TDLS Public Action Frame action field */ | |
4681 | #define TDLS_DISCOVERY_RESP 14 | |
4682 | ||
4683 | /* 802.11u GAS action frames */ | |
4684 | #define GAS_REQUEST_ACTION_FRAME 10 | |
4685 | #define GAS_RESPONSE_ACTION_FRAME 11 | |
4686 | #define GAS_COMEBACK_REQUEST_ACTION_FRAME 12 | |
4687 | #define GAS_COMEBACK_RESPONSE_ACTION_FRAME 13 | |
4688 | ||
4689 | /* FTM - fine timing measurement public action frames */ | |
4690 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_req { | |
4691 | uint8 category; /* category of action frame (4) */ | |
4692 | uint8 action; /* public action (32) */ | |
4693 | uint8 trigger; /* trigger/continue? */ | |
4694 | /* optional lci, civic loc, ftm params */ | |
4695 | } BWL_POST_PACKED_STRUCT; | |
4696 | typedef struct dot11_ftm_req dot11_ftm_req_t; | |
4697 | ||
4698 | BWL_PRE_PACKED_STRUCT struct dot11_ftm { | |
4699 | uint8 category; /* category of action frame (4) */ | |
4700 | uint8 action; /* public action (33) */ | |
4701 | uint8 dialog; /* dialog token */ | |
4702 | uint8 follow_up; /* follow up dialog token */ | |
4703 | uint8 tod[6]; /* t1 - last depart timestamp */ | |
4704 | uint8 toa[6]; /* t4 - last ack arrival timestamp */ | |
4705 | uint8 tod_err[2]; /* t1 error */ | |
4706 | uint8 toa_err[2]; /* t4 error */ | |
4707 | /* optional lci report, civic loc report, ftm params */ | |
4708 | } BWL_POST_PACKED_STRUCT; | |
4709 | typedef struct dot11_ftm dot11_ftm_t; | |
4710 | ||
4711 | #define DOT11_FTM_ERR_NOT_CONT_OFFSET 1 | |
4712 | #define DOT11_FTM_ERR_NOT_CONT_MASK 0x80 | |
4713 | #define DOT11_FTM_ERR_NOT_CONT_SHIFT 7 | |
4714 | #define DOT11_FTM_ERR_NOT_CONT(_err) (((_err)[DOT11_FTM_ERR_NOT_CONT_OFFSET] & \ | |
4715 | DOT11_FTM_ERR_NOT_CONT_MASK) >> DOT11_FTM_ERR_NOT_CONT_SHIFT) | |
4716 | #define DOT11_FTM_ERR_SET_NOT_CONT(_err, _val) do {\ | |
4717 | uint8 _err2 = (_err)[DOT11_FTM_ERR_NOT_CONT_OFFSET]; \ | |
4718 | _err2 &= ~DOT11_FTM_ERR_NOT_CONT_MASK; \ | |
4719 | _err2 |= ((_val) << DOT11_FTM_ERR_NOT_CONT_SHIFT) & DOT11_FTM_ERR_NOT_CONT_MASK; \ | |
4720 | (_err)[DOT11_FTM_ERR_NOT_CONT_OFFSET] = _err2; \ | |
4721 | } while (0) | |
4722 | ||
4723 | #define DOT11_FTM_ERR_MAX_ERR_OFFSET 0 | |
4724 | #define DOT11_FTM_ERR_MAX_ERR_MASK 0x7fff | |
4725 | #define DOT11_FTM_ERR_MAX_ERR_SHIFT 0 | |
4726 | #define DOT11_FTM_ERR_MAX_ERR(_err) (((((_err)[1] & 0x7f) << 8) | (_err)[0])) | |
4727 | #define DOT11_FTM_ERR_SET_MAX_ERR(_err, _val) do {\ | |
4728 | uint16 _val2; \ | |
4729 | uint16 _not_cont; \ | |
4730 | _val2 = (((_val) & DOT11_FTM_ERR_MAX_ERR_MASK) << DOT11_FTM_ERR_MAX_ERR_SHIFT); \ | |
4731 | _val2 = (_val2 > 0x3fff) ? 0 : _val2; /* not expecting > 16ns error */ \ | |
4732 | _not_cont = DOT11_FTM_ERR_NOT_CONT(_err); \ | |
4733 | (_err)[0] = _val2 & 0xff; \ | |
4734 | (_err)[1] = (_val2 >> 8) & 0xff; \ | |
4735 | DOT11_FTM_ERR_SET_NOT_CONT(_err, _not_cont); \ | |
4736 | } while (0) | |
4737 | ||
4738 | #if defined(DOT11_FTM_ERR_ROM_COMPAT) | |
4739 | /* incorrect defs - here for ROM compatibiity */ | |
4740 | #undef DOT11_FTM_ERR_NOT_CONT_OFFSET | |
4741 | #undef DOT11_FTM_ERR_NOT_CONT_MASK | |
4742 | #undef DOT11_FTM_ERR_NOT_CONT_SHIFT | |
4743 | #undef DOT11_FTM_ERR_NOT_CONT | |
4744 | #undef DOT11_FTM_ERR_SET_NOT_CONT | |
4745 | ||
4746 | #define DOT11_FTM_ERR_NOT_CONT_OFFSET 0 | |
4747 | #define DOT11_FTM_ERR_NOT_CONT_MASK 0x0001 | |
4748 | #define DOT11_FTM_ERR_NOT_CONT_SHIFT 0 | |
4749 | #define DOT11_FTM_ERR_NOT_CONT(_err) (((_err)[DOT11_FTM_ERR_NOT_CONT_OFFSET] & \ | |
4750 | DOT11_FTM_ERR_NOT_CONT_MASK) >> DOT11_FTM_ERR_NOT_CONT_SHIFT) | |
4751 | #define DOT11_FTM_ERR_SET_NOT_CONT(_err, _val) do {\ | |
4752 | uint8 _err2 = (_err)[DOT11_FTM_ERR_NOT_CONT_OFFSET]; \ | |
4753 | _err2 &= ~DOT11_FTM_ERR_NOT_CONT_MASK; \ | |
4754 | _err2 |= ((_val) << DOT11_FTM_ERR_NOT_CONT_SHIFT) & DOT11_FTM_ERR_NOT_CONT_MASK; \ | |
4755 | (_err)[DOT11_FTM_ERR_NOT_CONT_OFFSET] = _err2; \ | |
4756 | } while (0) | |
4757 | ||
4758 | #undef DOT11_FTM_ERR_MAX_ERR_OFFSET | |
4759 | #undef DOT11_FTM_ERR_MAX_ERR_MASK | |
4760 | #undef DOT11_FTM_ERR_MAX_ERR_SHIFT | |
4761 | #undef DOT11_FTM_ERR_MAX_ERR | |
4762 | #undef DOT11_FTM_ERR_SET_MAX_ERR | |
4763 | ||
4764 | #define DOT11_FTM_ERR_MAX_ERR_OFFSET 0 | |
4765 | #define DOT11_FTM_ERR_MAX_ERR_MASK 0xfff7 | |
4766 | #define DOT11_FTM_ERR_MAX_ERR_SHIFT 1 | |
4767 | #define DOT11_FTM_ERR_MAX_ERR(_err) ((((_err)[1] << 7) | (_err)[0]) >> 1) | |
4768 | #define DOT11_FTM_ERR_SET_MAX_ERR(_err, _val) do {\ | |
4769 | uint16 _val2; \ | |
4770 | _val2 = (((_val) << DOT11_FTM_ERR_MAX_ERR_SHIFT) |\ | |
4771 | ((_err)[DOT11_FTM_ERR_NOT_CONT_OFFSET] & DOT11_FTM_ERR_NOT_CONT_MASK)); \ | |
4772 | (_err)[0] = _val2 & 0xff; \ | |
4773 | (_err)[1] = _val2 >> 8 & 0xff; \ | |
4774 | } while (0) | |
4775 | #endif /* DOT11_FTM_ERR_ROM_COMPAT */ | |
4776 | ||
4777 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_params { | |
4778 | uint8 id; /* DOT11_MNG_FTM_PARAM_ID 8.4.2.166 11mcd2.6/2014 - revisit */ | |
4779 | uint8 len; | |
4780 | uint8 info[9]; | |
4781 | } BWL_POST_PACKED_STRUCT; | |
4782 | typedef struct dot11_ftm_params dot11_ftm_params_t; | |
4783 | #define DOT11_FTM_PARAMS_IE_LEN (sizeof(dot11_ftm_params_t) - 2) | |
4784 | ||
4785 | #define FTM_PARAMS_FIELD(_p, _off, _mask, _shift) (((_p)->info[(_off)] & (_mask)) >> (_shift)) | |
4786 | #define FTM_PARAMS_SET_FIELD(_p, _off, _mask, _shift, _val) do {\ | |
4787 | uint8 _ptmp = (_p)->info[_off] & ~(_mask); \ | |
4788 | (_p)->info[(_off)] = _ptmp | (((_val) << (_shift)) & (_mask)); \ | |
4789 | } while (0) | |
4790 | ||
4791 | #define FTM_PARAMS_STATUS_OFFSET 0 | |
4792 | #define FTM_PARAMS_STATUS_MASK 0x03 | |
4793 | #define FTM_PARAMS_STATUS_SHIFT 0 | |
4794 | #define FTM_PARAMS_STATUS(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_STATUS_OFFSET, \ | |
4795 | FTM_PARAMS_STATUS_MASK, FTM_PARAMS_STATUS_SHIFT) | |
4796 | #define FTM_PARAMS_SET_STATUS(_p, _status) FTM_PARAMS_SET_FIELD(_p, \ | |
4797 | FTM_PARAMS_STATUS_OFFSET, FTM_PARAMS_STATUS_MASK, FTM_PARAMS_STATUS_SHIFT, _status) | |
4798 | ||
4799 | #define FTM_PARAMS_VALUE_OFFSET 0 | |
4800 | #define FTM_PARAMS_VALUE_MASK 0x7c | |
4801 | #define FTM_PARAMS_VALUE_SHIFT 2 | |
4802 | #define FTM_PARAMS_VALUE(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_VALUE_OFFSET, \ | |
4803 | FTM_PARAMS_VALUE_MASK, FTM_PARAMS_VALUE_SHIFT) | |
4804 | #define FTM_PARAMS_SET_VALUE(_p, _value) FTM_PARAMS_SET_FIELD(_p, \ | |
4805 | FTM_PARAMS_VALUE_OFFSET, FTM_PARAMS_VALUE_MASK, FTM_PARAMS_VALUE_SHIFT, _value) | |
4806 | #define FTM_PARAMS_MAX_VALUE 32 | |
4807 | ||
4808 | #define FTM_PARAMS_NBURSTEXP_OFFSET 1 | |
4809 | #define FTM_PARAMS_NBURSTEXP_MASK 0x0f | |
4810 | #define FTM_PARAMS_NBURSTEXP_SHIFT 0 | |
4811 | #define FTM_PARAMS_NBURSTEXP(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_NBURSTEXP_OFFSET, \ | |
4812 | FTM_PARAMS_NBURSTEXP_MASK, FTM_PARAMS_NBURSTEXP_SHIFT) | |
4813 | #define FTM_PARAMS_SET_NBURSTEXP(_p, _bexp) FTM_PARAMS_SET_FIELD(_p, \ | |
4814 | FTM_PARAMS_NBURSTEXP_OFFSET, FTM_PARAMS_NBURSTEXP_MASK, FTM_PARAMS_NBURSTEXP_SHIFT, \ | |
4815 | _bexp) | |
4816 | ||
4817 | #define FTM_PARAMS_NBURST(_p) (1 << FTM_PARAMS_NBURSTEXP(_p)) | |
4818 | ||
4819 | enum { | |
4820 | FTM_PARAMS_NBURSTEXP_NOPREF = 15 | |
4821 | }; | |
4822 | ||
4823 | enum { | |
4824 | FTM_PARAMS_BURSTTMO_NOPREF = 15 | |
4825 | }; | |
4826 | ||
4827 | #define FTM_PARAMS_BURSTTMO_OFFSET 1 | |
4828 | #define FTM_PARAMS_BURSTTMO_MASK 0xf0 | |
4829 | #define FTM_PARAMS_BURSTTMO_SHIFT 4 | |
4830 | #define FTM_PARAMS_BURSTTMO(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_BURSTTMO_OFFSET, \ | |
4831 | FTM_PARAMS_BURSTTMO_MASK, FTM_PARAMS_BURSTTMO_SHIFT) | |
4832 | /* set timeout in params using _tmo where timeout = 2^(_tmo) * 250us */ | |
4833 | #define FTM_PARAMS_SET_BURSTTMO(_p, _tmo) FTM_PARAMS_SET_FIELD(_p, \ | |
4834 | FTM_PARAMS_BURSTTMO_OFFSET, FTM_PARAMS_BURSTTMO_MASK, FTM_PARAMS_BURSTTMO_SHIFT, (_tmo)+2) | |
4835 | ||
4836 | #define FTM_PARAMS_BURSTTMO_USEC(_val) ((1 << ((_val)-2)) * 250) | |
4837 | #define FTM_PARAMS_BURSTTMO_VALID(_val) ((((_val) < 12 && (_val) > 1)) || \ | |
4838 | (_val) == FTM_PARAMS_BURSTTMO_NOPREF) | |
4839 | #define FTM_PARAMS_BURSTTMO_MAX_MSEC 128 /* 2^9 * 250us */ | |
4840 | #define FTM_PARAMS_BURSTTMO_MAX_USEC 128000 /* 2^9 * 250us */ | |
4841 | ||
4842 | #define FTM_PARAMS_MINDELTA_OFFSET 2 | |
4843 | #define FTM_PARAMS_MINDELTA_USEC(_p) ((_p)->info[FTM_PARAMS_MINDELTA_OFFSET] * 100) | |
4844 | #define FTM_PARAMS_SET_MINDELTA_USEC(_p, _delta) do { \ | |
4845 | (_p)->info[FTM_PARAMS_MINDELTA_OFFSET] = (_delta) / 100; \ | |
4846 | } while (0) | |
4847 | ||
4848 | enum { | |
4849 | FTM_PARAMS_MINDELTA_NOPREF = 0 | |
4850 | }; | |
4851 | ||
4852 | #define FTM_PARAMS_PARTIAL_TSF(_p) ((_p)->info[4] << 8 | (_p)->info[3]) | |
4853 | #define FTM_PARAMS_SET_PARTIAL_TSF(_p, _partial_tsf) do { \ | |
4854 | (_p)->info[3] = (_partial_tsf) & 0xff; \ | |
4855 | (_p)->info[4] = ((_partial_tsf) >> 8) & 0xff; \ | |
4856 | } while (0) | |
4857 | ||
4858 | #define FTM_PARAMS_PARTIAL_TSF_MASK 0x0000000003fffc00ULL | |
4859 | #define FTM_PARAMS_PARTIAL_TSF_SHIFT 10 | |
4860 | #define FTM_PARAMS_PARTIAL_TSF_BIT_LEN 16 | |
4861 | #define FTM_PARAMS_PARTIAL_TSF_MAX 0xffff | |
4862 | ||
4863 | /* FTM can indicate upto 62k TUs forward and 1k TU backward */ | |
4864 | #define FTM_PARAMS_TSF_FW_HI (63487 << 10) /* in micro sec */ | |
4865 | #define FTM_PARAMS_TSF_BW_LOW (64512 << 10) /* in micro sec */ | |
4866 | #define FTM_PARAMS_TSF_BW_HI (65535 << 10) /* in micro sec */ | |
4867 | #define FTM_PARAMS_TSF_FW_MAX FTM_PARAMS_TSF_FW_HI | |
4868 | #define FTM_PARAMS_TSF_BW_MAX (FTM_PARAMS_TSF_BW_HI - FTM_PARAMS_TSF_BW_LOW) | |
4869 | ||
4870 | #define FTM_PARAMS_PTSFNOPREF_OFFSET 5 | |
4871 | #define FTM_PARAMS_PTSFNOPREF_MASK 0x1 | |
4872 | #define FTM_PARAMS_PTSFNOPREF_SHIFT 0 | |
4873 | #define FTM_PARAMS_PTSFNOPREF(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_PTSFNOPREF_OFFSET, \ | |
4874 | FTM_PARAMS_PTSFNOPREF_MASK, FTM_PARAMS_PTSFNOPREF_SHIFT) | |
4875 | #define FTM_PARAMS_SET_PTSFNOPREF(_p, _nopref) FTM_PARAMS_SET_FIELD(_p, \ | |
4876 | FTM_PARAMS_PTSFNOPREF_OFFSET, FTM_PARAMS_PTSFNOPREF_MASK, \ | |
4877 | FTM_PARAMS_PTSFNOPREF_SHIFT, _nopref) | |
4878 | ||
4879 | #define FTM_PARAMS_ASAP_OFFSET 5 | |
4880 | #define FTM_PARAMS_ASAP_MASK 0x4 | |
4881 | #define FTM_PARAMS_ASAP_SHIFT 2 | |
4882 | #define FTM_PARAMS_ASAP(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_ASAP_OFFSET, \ | |
4883 | FTM_PARAMS_ASAP_MASK, FTM_PARAMS_ASAP_SHIFT) | |
4884 | #define FTM_PARAMS_SET_ASAP(_p, _asap) FTM_PARAMS_SET_FIELD(_p, \ | |
4885 | FTM_PARAMS_ASAP_OFFSET, FTM_PARAMS_ASAP_MASK, FTM_PARAMS_ASAP_SHIFT, _asap) | |
4886 | ||
4887 | /* FTM1 - AKA ASAP Capable */ | |
4888 | #define FTM_PARAMS_FTM1_OFFSET 5 | |
4889 | #define FTM_PARAMS_FTM1_MASK 0x02 | |
4890 | #define FTM_PARAMS_FTM1_SHIFT 1 | |
4891 | #define FTM_PARAMS_FTM1(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_FTM1_OFFSET, \ | |
4892 | FTM_PARAMS_FTM1_MASK, FTM_PARAMS_FTM1_SHIFT) | |
4893 | #define FTM_PARAMS_SET_FTM1(_p, _ftm1) FTM_PARAMS_SET_FIELD(_p, \ | |
4894 | FTM_PARAMS_FTM1_OFFSET, FTM_PARAMS_FTM1_MASK, FTM_PARAMS_FTM1_SHIFT, _ftm1) | |
4895 | ||
4896 | #define FTM_PARAMS_FTMS_PER_BURST_OFFSET 5 | |
4897 | #define FTM_PARAMS_FTMS_PER_BURST_MASK 0xf8 | |
4898 | #define FTM_PARAMS_FTMS_PER_BURST_SHIFT 3 | |
4899 | #define FTM_PARAMS_FTMS_PER_BURST(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_FTMS_PER_BURST_OFFSET, \ | |
4900 | FTM_PARAMS_FTMS_PER_BURST_MASK, FTM_PARAMS_FTMS_PER_BURST_SHIFT) | |
4901 | #define FTM_PARAMS_SET_FTMS_PER_BURST(_p, _nftms) FTM_PARAMS_SET_FIELD(_p, \ | |
4902 | FTM_PARAMS_FTMS_PER_BURST_OFFSET, FTM_PARAMS_FTMS_PER_BURST_MASK, \ | |
4903 | FTM_PARAMS_FTMS_PER_BURST_SHIFT, _nftms) | |
4904 | ||
4905 | enum { | |
4906 | FTM_PARAMS_FTMS_PER_BURST_NOPREF = 0 | |
4907 | }; | |
4908 | ||
4909 | #define FTM_PARAMS_CHAN_INFO_OFFSET 6 | |
4910 | #define FTM_PARAMS_CHAN_INFO_MASK 0xfc | |
4911 | #define FTM_PARAMS_CHAN_INFO_SHIFT 2 | |
4912 | #define FTM_PARAMS_CHAN_INFO(_p) FTM_PARAMS_FIELD(_p, FTM_PARAMS_CHAN_INFO_OFFSET, \ | |
4913 | FTM_PARAMS_CHAN_INFO_MASK, FTM_PARAMS_CHAN_INFO_SHIFT) | |
4914 | #define FTM_PARAMS_SET_CHAN_INFO(_p, _ci) FTM_PARAMS_SET_FIELD(_p, \ | |
4915 | FTM_PARAMS_CHAN_INFO_OFFSET, FTM_PARAMS_CHAN_INFO_MASK, FTM_PARAMS_CHAN_INFO_SHIFT, _ci) | |
4916 | ||
4917 | /* burst period - units of 100ms */ | |
4918 | #define FTM_PARAMS_BURST_PERIOD(_p) (((_p)->info[8] << 8) | (_p)->info[7]) | |
4919 | #define FTM_PARAMS_SET_BURST_PERIOD(_p, _bp) do {\ | |
4920 | (_p)->info[7] = (_bp) & 0xff; \ | |
4921 | (_p)->info[8] = ((_bp) >> 8) & 0xff; \ | |
4922 | } while (0) | |
4923 | ||
4924 | #define FTM_PARAMS_BURST_PERIOD_MS(_p) (FTM_PARAMS_BURST_PERIOD(_p) * 100) | |
4925 | ||
4926 | enum { | |
4927 | FTM_PARAMS_BURST_PERIOD_NOPREF = 0 | |
4928 | }; | |
4929 | ||
4930 | /* FTM status values - last updated from 11mcD4.0 */ | |
4931 | enum { | |
4932 | FTM_PARAMS_STATUS_RESERVED = 0, | |
4933 | FTM_PARAMS_STATUS_SUCCESSFUL = 1, | |
4934 | FTM_PARAMS_STATUS_INCAPABLE = 2, | |
4935 | FTM_PARAMS_STATUS_FAILED = 3, | |
4936 | /* Below are obsolte */ | |
4937 | FTM_PARAMS_STATUS_OVERRIDDEN = 4, | |
4938 | FTM_PARAMS_STATUS_ASAP_INCAPABLE = 5, | |
4939 | FTM_PARAMS_STATUS_ASAP_FAILED = 6, | |
4940 | /* rest are reserved */ | |
4941 | }; | |
4942 | ||
4943 | enum { | |
4944 | FTM_PARAMS_CHAN_INFO_NO_PREF = 0, | |
4945 | FTM_PARAMS_CHAN_INFO_RESERVE1 = 1, | |
4946 | FTM_PARAMS_CHAN_INFO_RESERVE2 = 2, | |
4947 | FTM_PARAMS_CHAN_INFO_RESERVE3 = 3, | |
4948 | FTM_PARAMS_CHAN_INFO_NON_HT_5 = 4, | |
4949 | FTM_PARAMS_CHAN_INFO_RESERVE5 = 5, | |
4950 | FTM_PARAMS_CHAN_INFO_NON_HT_10 = 6, | |
4951 | FTM_PARAMS_CHAN_INFO_RESERVE7 = 7, | |
4952 | FTM_PARAMS_CHAN_INFO_NON_HT_20 = 8, /* excludes 2.4G, and High rate DSSS */ | |
4953 | FTM_PARAMS_CHAN_INFO_HT_MF_20 = 9, | |
4954 | FTM_PARAMS_CHAN_INFO_VHT_20 = 10, | |
4955 | FTM_PARAMS_CHAN_INFO_HT_MF_40 = 11, | |
4956 | FTM_PARAMS_CHAN_INFO_VHT_40 = 12, | |
4957 | FTM_PARAMS_CHAN_INFO_VHT_80 = 13, | |
4958 | FTM_PARAMS_CHAN_INFO_VHT_80_80 = 14, | |
4959 | FTM_PARAMS_CHAN_INFO_VHT_160_2_RFLOS = 15, | |
4960 | FTM_PARAMS_CHAN_INFO_VHT_160 = 16, | |
4961 | /* Reserved from 17 - 30 */ | |
4962 | FTM_PARAMS_CHAN_INFO_DMG_2160 = 31, | |
4963 | /* Reserved from 32 - 63 */ | |
4964 | FTM_PARAMS_CHAN_INFO_MAX = 63 | |
4965 | }; | |
4966 | ||
4967 | /* tag_ID/length/value_buffer tuple */ | |
4968 | typedef BWL_PRE_PACKED_STRUCT struct { | |
4969 | uint8 id; | |
4970 | uint8 len; | |
4971 | uint8 data[1]; | |
4972 | } BWL_POST_PACKED_STRUCT ftm_vs_tlv_t; | |
4973 | ||
4974 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_vs_ie { | |
4975 | uint8 id; /* DOT11_MNG_VS_ID */ | |
4976 | uint8 len; /* length following */ | |
4977 | uint8 oui[3]; /* BRCM_PROP_OUI (or Customer) */ | |
4978 | uint8 sub_type; /* BRCM_FTM_IE_TYPE (or Customer) */ | |
4979 | uint8 version; | |
4980 | ftm_vs_tlv_t tlvs[1]; | |
4981 | } BWL_POST_PACKED_STRUCT; | |
4982 | typedef struct dot11_ftm_vs_ie dot11_ftm_vs_ie_t; | |
4983 | ||
5a068558 MB |
4984 | /* same as payload of dot11_ftm_vs_ie. |
4985 | * This definition helps in having struct access | |
4986 | * of pay load while building FTM VS IE from other modules(NAN) | |
4987 | */ | |
4988 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_vs_ie_pyld { | |
4989 | uint8 sub_type; /* BRCM_FTM_IE_TYPE (or Customer) */ | |
4990 | uint8 version; | |
4991 | ftm_vs_tlv_t tlvs[1]; | |
4992 | } BWL_POST_PACKED_STRUCT; | |
4993 | typedef struct dot11_ftm_vs_ie_pyld dot11_ftm_vs_ie_pyld_t; | |
4994 | ||
1cac41cb MB |
4995 | /* ftm vs api version */ |
4996 | #define BCM_FTM_VS_PARAMS_VERSION 0x01 | |
4997 | ||
4998 | /* ftm vendor specific information tlv types */ | |
4999 | enum { | |
5000 | FTM_VS_TLV_NONE = 0, | |
5001 | FTM_VS_TLV_REQ_PARAMS = 1, /* additional request params (in FTM_REQ) */ | |
5002 | FTM_VS_TLV_MEAS_INFO = 2, /* measurement information (in FTM_MEAS) */ | |
5003 | FTM_VS_TLV_SEC_PARAMS = 3, /* security parameters (in either) */ | |
5004 | FTM_VS_TLV_SEQ_PARAMS = 4, /* toast parameters (FTM_REQ, BRCM proprietary) */ | |
5005 | FTM_VS_TLV_MF_BUF = 5, /* multi frame buffer - may span ftm vs ie's */ | |
5006 | FTM_VS_TLV_TIMING_PARAMS = 6, /* timing adjustments */ | |
5007 | FTM_VS_TLV_MF_STATS_BUF = 7 /* multi frame statistics buffer */ | |
5008 | /* add additional types above */ | |
5009 | }; | |
5010 | ||
5011 | /* the following definitions are *DEPRECATED* and moved to implemenetion files. They | |
5012 | * are retained here because previous (May 2016) some branches use them | |
5013 | */ | |
5014 | #define FTM_TPK_LEN 16 | |
5015 | #define FTM_RI_RR_BUF_LEN 32 | |
5016 | #define FTM_TPK_RI_RR_LEN 13 | |
5017 | #define FTM_TPK_RI_RR_LEN_SECURE_2_0 28 | |
5018 | #define FTM_TPK_DIGEST_LEN 32 | |
5019 | #define FTM_TPK_BUFFER_LEN 128 | |
5020 | #define FTM_TPK_RI_PHY_LEN 7 | |
5021 | #define FTM_TPK_RR_PHY_LEN 7 | |
5022 | #define FTM_TPK_DATA_BUFFER_LEN 88 | |
5023 | #define FTM_TPK_LEN_SECURE_2_0 32 | |
5024 | #define FTM_TPK_RI_PHY_LEN_SECURE_2_0 14 | |
5025 | #define FTM_TPK_RR_PHY_LEN_SECURE_2_0 14 | |
5026 | ||
5027 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_vs_params { | |
5028 | uint8 id; /* DOT11_MNG_VS_ID */ | |
5029 | uint8 len; | |
5030 | uint8 oui[3]; /* Proprietary OUI, BRCM_PROP_OUI */ | |
5031 | uint8 bcm_vs_id; | |
5032 | ftm_vs_tlv_t ftm_tpk_ri_rr[1]; /* ftm_TPK_ri_rr place holder */ | |
5033 | } BWL_POST_PACKED_STRUCT; | |
5034 | typedef struct dot11_ftm_vs_params dot11_ftm_vs_tpk_ri_rr_params_t; | |
5035 | #define DOT11_FTM_VS_LEN (sizeof(dot11_ftm_vs_tpk_ri_rr_params_t) - TLV_HDR_LEN) | |
5036 | /* end *DEPRECATED* ftm definitions */ | |
5037 | ||
5038 | BWL_PRE_PACKED_STRUCT struct dot11_ftm_sync_info { | |
5039 | uint8 id; /* Extended - 255 11mc D4.3 */ | |
5040 | uint8 len; | |
5041 | uint8 id_ext; | |
5042 | uint8 tsf_sync_info[4]; | |
5043 | } BWL_POST_PACKED_STRUCT; | |
5044 | typedef struct dot11_ftm_sync_info dot11_ftm_sync_info_t; | |
5045 | ||
5046 | /* ftm tsf sync info ie len - includes id ext */ | |
5047 | #define DOT11_FTM_SYNC_INFO_IE_LEN (sizeof(dot11_ftm_sync_info_t) - TLV_HDR_LEN) | |
5048 | ||
5049 | #define DOT11_FTM_IS_SYNC_INFO_IE(_ie) (\ | |
5050 | DOT11_MNG_IE_ID_EXT_MATCH(_ie, DOT11_MNG_FTM_SYNC_INFO) && \ | |
5051 | (_ie)->len == DOT11_FTM_SYNC_INFO_IE_LEN) | |
5052 | ||
5053 | BWL_PRE_PACKED_STRUCT struct dot11_dh_param_ie { | |
5054 | uint8 id; /* OWE */ | |
5055 | uint8 len; | |
5056 | uint8 ext_id; /* EXT_MNG_OWE_DH_PARAM_ID */ | |
5057 | uint16 group; | |
5058 | uint8 pub_key[0]; | |
5059 | } BWL_POST_PACKED_STRUCT; | |
5060 | typedef struct dot11_dh_param_ie dot11_dh_param_ie_t; | |
5061 | ||
5062 | #define DOT11_DH_EXTID_OFFSET (OFFSETOF(dot11_dh_param_ie_t, ext_id)) | |
5063 | ||
5064 | #define DOT11_OWE_DH_PARAM_IE(_ie) (\ | |
5065 | DOT11_MNG_IE_ID_EXT_MATCH(_ie, EXT_MNG_OWE_DH_PARAM_ID)) | |
5066 | ||
5067 | #define DOT11_MNG_OWE_IE_ID_EXT_INIT(_ie, _id, _len) do {\ | |
5068 | (_ie)->id = DOT11_MNG_ID_EXT_ID; \ | |
5069 | (_ie)->len = _len; \ | |
5070 | (_ie)->ext_id = _id; \ | |
5071 | } while (0) | |
5072 | ||
5073 | /* 802.11u interworking access network options */ | |
5074 | #define IW_ANT_MASK 0x0f | |
5075 | #define IW_INTERNET_MASK 0x10 | |
5076 | #define IW_ASRA_MASK 0x20 | |
5077 | #define IW_ESR_MASK 0x40 | |
5078 | #define IW_UESA_MASK 0x80 | |
5079 | ||
5080 | /* 802.11u interworking access network type */ | |
5081 | #define IW_ANT_PRIVATE_NETWORK 0 | |
5082 | #define IW_ANT_PRIVATE_NETWORK_WITH_GUEST 1 | |
5083 | #define IW_ANT_CHARGEABLE_PUBLIC_NETWORK 2 | |
5084 | #define IW_ANT_FREE_PUBLIC_NETWORK 3 | |
5085 | #define IW_ANT_PERSONAL_DEVICE_NETWORK 4 | |
5086 | #define IW_ANT_EMERGENCY_SERVICES_NETWORK 5 | |
5087 | #define IW_ANT_TEST_NETWORK 14 | |
5088 | #define IW_ANT_WILDCARD_NETWORK 15 | |
5089 | ||
5090 | #define IW_ANT_LEN 1 | |
5091 | #define IW_VENUE_LEN 2 | |
5092 | #define IW_HESSID_LEN 6 | |
5093 | #define IW_HESSID_OFF (IW_ANT_LEN + IW_VENUE_LEN) | |
5094 | #define IW_MAX_LEN (IW_ANT_LEN + IW_VENUE_LEN + IW_HESSID_LEN) | |
5095 | ||
5096 | /* 802.11u advertisement protocol */ | |
5097 | #define ADVP_ANQP_PROTOCOL_ID 0 | |
5098 | #define ADVP_MIH_PROTOCOL_ID 1 | |
5099 | ||
5100 | /* 802.11u advertisement protocol masks */ | |
5101 | #define ADVP_QRL_MASK 0x7f | |
5102 | #define ADVP_PAME_BI_MASK 0x80 | |
5103 | ||
5104 | /* 802.11u advertisement protocol values */ | |
5105 | #define ADVP_QRL_REQUEST 0x00 | |
5106 | #define ADVP_QRL_RESPONSE 0x7f | |
5107 | #define ADVP_PAME_BI_DEPENDENT 0x00 | |
5108 | #define ADVP_PAME_BI_INDEPENDENT ADVP_PAME_BI_MASK | |
5109 | ||
5110 | /* 802.11u ANQP information ID */ | |
5111 | #define ANQP_ID_QUERY_LIST 256 | |
5112 | #define ANQP_ID_CAPABILITY_LIST 257 | |
5113 | #define ANQP_ID_VENUE_NAME_INFO 258 | |
5114 | #define ANQP_ID_EMERGENCY_CALL_NUMBER_INFO 259 | |
5115 | #define ANQP_ID_NETWORK_AUTHENTICATION_TYPE_INFO 260 | |
5116 | #define ANQP_ID_ROAMING_CONSORTIUM_LIST 261 | |
5117 | #define ANQP_ID_IP_ADDRESS_TYPE_AVAILABILITY_INFO 262 | |
5118 | #define ANQP_ID_NAI_REALM_LIST 263 | |
5119 | #define ANQP_ID_G3PP_CELLULAR_NETWORK_INFO 264 | |
5120 | #define ANQP_ID_AP_GEOSPATIAL_LOCATION 265 | |
5121 | #define ANQP_ID_AP_CIVIC_LOCATION 266 | |
5122 | #define ANQP_ID_AP_LOCATION_PUBLIC_ID_URI 267 | |
5123 | #define ANQP_ID_DOMAIN_NAME_LIST 268 | |
5124 | #define ANQP_ID_EMERGENCY_ALERT_ID_URI 269 | |
5125 | #define ANQP_ID_EMERGENCY_NAI 271 | |
5126 | #define ANQP_ID_NEIGHBOR_REPORT 272 | |
5127 | #define ANQP_ID_VENDOR_SPECIFIC_LIST 56797 | |
5128 | ||
5129 | /* 802.11u ANQP ID len */ | |
5130 | #define ANQP_INFORMATION_ID_LEN 2 | |
5131 | ||
5132 | /* 802.11u ANQP OUI */ | |
5133 | #define ANQP_OUI_SUBTYPE 9 | |
5134 | ||
5135 | /* 802.11u venue name */ | |
5136 | #define VENUE_LANGUAGE_CODE_SIZE 3 | |
5137 | #define VENUE_NAME_SIZE 255 | |
5138 | ||
5139 | /* 802.11u venue groups */ | |
5140 | #define VENUE_UNSPECIFIED 0 | |
5141 | #define VENUE_ASSEMBLY 1 | |
5142 | #define VENUE_BUSINESS 2 | |
5143 | #define VENUE_EDUCATIONAL 3 | |
5144 | #define VENUE_FACTORY 4 | |
5145 | #define VENUE_INSTITUTIONAL 5 | |
5146 | #define VENUE_MERCANTILE 6 | |
5147 | #define VENUE_RESIDENTIAL 7 | |
5148 | #define VENUE_STORAGE 8 | |
5149 | #define VENUE_UTILITY 9 | |
5150 | #define VENUE_VEHICULAR 10 | |
5151 | #define VENUE_OUTDOOR 11 | |
5152 | ||
5153 | /* 802.11u network authentication type indicator */ | |
5154 | #define NATI_UNSPECIFIED -1 | |
5155 | #define NATI_ACCEPTANCE_OF_TERMS_CONDITIONS 0 | |
5156 | #define NATI_ONLINE_ENROLLMENT_SUPPORTED 1 | |
5157 | #define NATI_HTTP_HTTPS_REDIRECTION 2 | |
5158 | #define NATI_DNS_REDIRECTION 3 | |
5159 | ||
5160 | /* 802.11u IP address type availability - IPv6 */ | |
5161 | #define IPA_IPV6_SHIFT 0 | |
5162 | #define IPA_IPV6_MASK (0x03 << IPA_IPV6_SHIFT) | |
5163 | #define IPA_IPV6_NOT_AVAILABLE 0x00 | |
5164 | #define IPA_IPV6_AVAILABLE 0x01 | |
5165 | #define IPA_IPV6_UNKNOWN_AVAILABILITY 0x02 | |
5166 | ||
5167 | /* 802.11u IP address type availability - IPv4 */ | |
5168 | #define IPA_IPV4_SHIFT 2 | |
5169 | #define IPA_IPV4_MASK (0x3f << IPA_IPV4_SHIFT) | |
5170 | #define IPA_IPV4_NOT_AVAILABLE 0x00 | |
5171 | #define IPA_IPV4_PUBLIC 0x01 | |
5172 | #define IPA_IPV4_PORT_RESTRICT 0x02 | |
5173 | #define IPA_IPV4_SINGLE_NAT 0x03 | |
5174 | #define IPA_IPV4_DOUBLE_NAT 0x04 | |
5175 | #define IPA_IPV4_PORT_RESTRICT_SINGLE_NAT 0x05 | |
5176 | #define IPA_IPV4_PORT_RESTRICT_DOUBLE_NAT 0x06 | |
5177 | #define IPA_IPV4_UNKNOWN_AVAILABILITY 0x07 | |
5178 | ||
5179 | /* 802.11u NAI realm encoding */ | |
5180 | #define REALM_ENCODING_RFC4282 0 | |
5181 | #define REALM_ENCODING_UTF8 1 | |
5182 | ||
5183 | /* 802.11u IANA EAP method type numbers */ | |
5184 | #define REALM_EAP_TLS 13 | |
5185 | #define REALM_EAP_LEAP 17 | |
5186 | #define REALM_EAP_SIM 18 | |
5187 | #define REALM_EAP_TTLS 21 | |
5188 | #define REALM_EAP_AKA 23 | |
5189 | #define REALM_EAP_PEAP 25 | |
5190 | #define REALM_EAP_FAST 43 | |
5191 | #define REALM_EAP_PSK 47 | |
5192 | #define REALM_EAP_AKAP 50 | |
5193 | #define REALM_EAP_EXPANDED 254 | |
5194 | ||
5195 | /* 802.11u authentication ID */ | |
5196 | #define REALM_EXPANDED_EAP 1 | |
5197 | #define REALM_NON_EAP_INNER_AUTHENTICATION 2 | |
5198 | #define REALM_INNER_AUTHENTICATION_EAP 3 | |
5199 | #define REALM_EXPANDED_INNER_EAP 4 | |
5200 | #define REALM_CREDENTIAL 5 | |
5201 | #define REALM_TUNNELED_EAP_CREDENTIAL 6 | |
5202 | #define REALM_VENDOR_SPECIFIC_EAP 221 | |
5203 | ||
5204 | /* 802.11u non-EAP inner authentication type */ | |
5205 | #define REALM_RESERVED_AUTH 0 | |
5206 | #define REALM_PAP 1 | |
5207 | #define REALM_CHAP 2 | |
5208 | #define REALM_MSCHAP 3 | |
5209 | #define REALM_MSCHAPV2 4 | |
5210 | ||
5211 | /* 802.11u credential type */ | |
5212 | #define REALM_SIM 1 | |
5213 | #define REALM_USIM 2 | |
5214 | #define REALM_NFC 3 | |
5215 | #define REALM_HARDWARE_TOKEN 4 | |
5216 | #define REALM_SOFTOKEN 5 | |
5217 | #define REALM_CERTIFICATE 6 | |
5218 | #define REALM_USERNAME_PASSWORD 7 | |
5219 | #define REALM_SERVER_SIDE 8 | |
5220 | #define REALM_RESERVED_CRED 9 | |
5221 | #define REALM_VENDOR_SPECIFIC_CRED 10 | |
5222 | ||
5223 | /* 802.11u 3GPP PLMN */ | |
5224 | #define G3PP_GUD_VERSION 0 | |
5225 | #define G3PP_PLMN_LIST_IE 0 | |
5226 | ||
5227 | /* AP Location Public ID Info encoding */ | |
5228 | #define PUBLIC_ID_URI_FQDN_SE_ID 0 | |
5229 | /* URI/FQDN Descriptor field values */ | |
5230 | #define LOCATION_ENCODING_HELD 1 | |
5231 | #define LOCATION_ENCODING_SUPL 2 | |
5232 | #define URI_FQDN_SIZE 255 | |
5233 | ||
5234 | /** hotspot2.0 indication element (vendor specific) */ | |
5235 | BWL_PRE_PACKED_STRUCT struct hs20_ie { | |
5236 | uint8 oui[3]; | |
5237 | uint8 type; | |
5238 | uint8 config; | |
5239 | } BWL_POST_PACKED_STRUCT; | |
5240 | typedef struct hs20_ie hs20_ie_t; | |
5241 | #define HS20_IE_LEN 5 /* HS20 IE length */ | |
5242 | ||
5243 | /** IEEE 802.11 Annex E */ | |
5244 | typedef enum { | |
5245 | DOT11_2GHZ_20MHZ_CLASS_12 = 81, /* Ch 1-11 */ | |
5246 | DOT11_5GHZ_20MHZ_CLASS_1 = 115, /* Ch 36-48 */ | |
5247 | DOT11_5GHZ_20MHZ_CLASS_2_DFS = 118, /* Ch 52-64 */ | |
5248 | DOT11_5GHZ_20MHZ_CLASS_3 = 124, /* Ch 149-161 */ | |
5249 | DOT11_5GHZ_20MHZ_CLASS_4_DFS = 121, /* Ch 100-140 */ | |
5250 | DOT11_5GHZ_20MHZ_CLASS_5 = 125, /* Ch 149-165 */ | |
5251 | DOT11_5GHZ_40MHZ_CLASS_22 = 116, /* Ch 36-44, lower */ | |
5252 | DOT11_5GHZ_40MHZ_CLASS_23_DFS = 119, /* Ch 52-60, lower */ | |
5253 | DOT11_5GHZ_40MHZ_CLASS_24_DFS = 122, /* Ch 100-132, lower */ | |
5254 | DOT11_5GHZ_40MHZ_CLASS_25 = 126, /* Ch 149-157, lower */ | |
5255 | DOT11_5GHZ_40MHZ_CLASS_27 = 117, /* Ch 40-48, upper */ | |
5256 | DOT11_5GHZ_40MHZ_CLASS_28_DFS = 120, /* Ch 56-64, upper */ | |
5257 | DOT11_5GHZ_40MHZ_CLASS_29_DFS = 123, /* Ch 104-136, upper */ | |
5258 | DOT11_5GHZ_40MHZ_CLASS_30 = 127, /* Ch 153-161, upper */ | |
5259 | DOT11_2GHZ_40MHZ_CLASS_32 = 83, /* Ch 1-7, lower */ | |
5260 | DOT11_2GHZ_40MHZ_CLASS_33 = 84, /* Ch 5-11, upper */ | |
5261 | } dot11_op_class_t; | |
5262 | ||
5263 | /* QoS map */ | |
5264 | #define QOS_MAP_FIXED_LENGTH (8 * 2) /* DSCP ranges fixed with 8 entries */ | |
5265 | ||
5266 | #define BCM_AIBSS_IE_TYPE 56 | |
5267 | ||
5268 | /* This marks the end of a packed structure section. */ | |
5269 | #include <packed_section_end.h> | |
5270 | ||
5271 | #endif /* _802_11_H_ */ |