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