diff options
Diffstat (limited to 'drivers/net/wireless/bcm4329/include/proto')
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/802.11.h | 1433 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/802.11e.h | 131 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/802.1d.h | 49 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/bcmeth.h | 83 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/bcmevent.h | 212 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/bcmip.h | 157 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/eapol.h | 172 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/ethernet.h | 148 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/sdspi.h | 71 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/vlan.h | 63 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/include/proto/wpa.h | 159 |
11 files changed, 2678 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcm4329/include/proto/802.11.h b/drivers/net/wireless/bcm4329/include/proto/802.11.h new file mode 100644 index 00000000000..fd26317361d --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/802.11.h | |||
@@ -0,0 +1,1433 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999-2010, 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.219.4.1.4.5.6.11 2010/02/09 13:23:26 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 | BWL_PRE_PACKED_STRUCT struct dot11_action_wifi_vendor_specific { | ||
160 | uint8 category; | ||
161 | uint8 OUI[3]; | ||
162 | uint8 type; | ||
163 | uint8 subtype; | ||
164 | uint8 data[1040]; | ||
165 | struct dot11_action_wifi_vendor_specific* next_node; | ||
166 | } BWL_POST_PACKED_STRUCT; | ||
167 | |||
168 | typedef struct dot11_action_wifi_vendor_specific dot11_action_wifi_vendor_specific_t; | ||
169 | |||
170 | #define DOT11_BA_CTL_POLICY_NORMAL 0x0000 | ||
171 | #define DOT11_BA_CTL_POLICY_NOACK 0x0001 | ||
172 | #define DOT11_BA_CTL_POLICY_MASK 0x0001 | ||
173 | |||
174 | #define DOT11_BA_CTL_MTID 0x0002 | ||
175 | #define DOT11_BA_CTL_COMPRESSED 0x0004 | ||
176 | |||
177 | #define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0 | ||
178 | #define DOT11_BA_CTL_NUMMSDU_SHIFT 6 | ||
179 | |||
180 | #define DOT11_BA_CTL_TID_MASK 0xF000 | ||
181 | #define DOT11_BA_CTL_TID_SHIFT 12 | ||
182 | |||
183 | |||
184 | BWL_PRE_PACKED_STRUCT struct dot11_ctl_header { | ||
185 | uint16 fc; | ||
186 | uint16 durid; | ||
187 | struct ether_addr ra; | ||
188 | struct ether_addr ta; | ||
189 | } BWL_POST_PACKED_STRUCT; | ||
190 | #define DOT11_CTL_HDR_LEN 16 | ||
191 | |||
192 | |||
193 | BWL_PRE_PACKED_STRUCT struct dot11_bar { | ||
194 | uint16 bar_control; | ||
195 | uint16 seqnum; | ||
196 | } BWL_POST_PACKED_STRUCT; | ||
197 | #define DOT11_BAR_LEN 4 | ||
198 | |||
199 | #define DOT11_BA_BITMAP_LEN 128 | ||
200 | #define DOT11_BA_CMP_BITMAP_LEN 8 | ||
201 | |||
202 | BWL_PRE_PACKED_STRUCT struct dot11_ba { | ||
203 | uint16 ba_control; | ||
204 | uint16 seqnum; | ||
205 | uint8 bitmap[DOT11_BA_BITMAP_LEN]; | ||
206 | } BWL_POST_PACKED_STRUCT; | ||
207 | #define DOT11_BA_LEN 4 | ||
208 | |||
209 | |||
210 | BWL_PRE_PACKED_STRUCT struct dot11_management_header { | ||
211 | uint16 fc; | ||
212 | uint16 durid; | ||
213 | struct ether_addr da; | ||
214 | struct ether_addr sa; | ||
215 | struct ether_addr bssid; | ||
216 | uint16 seq; | ||
217 | } BWL_POST_PACKED_STRUCT; | ||
218 | #define DOT11_MGMT_HDR_LEN 24 | ||
219 | |||
220 | |||
221 | |||
222 | BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb { | ||
223 | uint32 timestamp[2]; | ||
224 | uint16 beacon_interval; | ||
225 | uint16 capability; | ||
226 | } BWL_POST_PACKED_STRUCT; | ||
227 | #define DOT11_BCN_PRB_LEN 12 | ||
228 | |||
229 | BWL_PRE_PACKED_STRUCT struct dot11_auth { | ||
230 | uint16 alg; | ||
231 | uint16 seq; | ||
232 | uint16 status; | ||
233 | } BWL_POST_PACKED_STRUCT; | ||
234 | #define DOT11_AUTH_FIXED_LEN 6 | ||
235 | |||
236 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_req { | ||
237 | uint16 capability; | ||
238 | uint16 listen; | ||
239 | } BWL_POST_PACKED_STRUCT; | ||
240 | #define DOT11_ASSOC_REQ_FIXED_LEN 4 | ||
241 | |||
242 | BWL_PRE_PACKED_STRUCT struct dot11_reassoc_req { | ||
243 | uint16 capability; | ||
244 | uint16 listen; | ||
245 | struct ether_addr ap; | ||
246 | } BWL_POST_PACKED_STRUCT; | ||
247 | #define DOT11_REASSOC_REQ_FIXED_LEN 10 | ||
248 | |||
249 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_resp { | ||
250 | uint16 capability; | ||
251 | uint16 status; | ||
252 | uint16 aid; | ||
253 | } BWL_POST_PACKED_STRUCT; | ||
254 | #define DOT11_ASSOC_RESP_FIXED_LEN 6 | ||
255 | |||
256 | BWL_PRE_PACKED_STRUCT struct dot11_action_measure { | ||
257 | uint8 category; | ||
258 | uint8 action; | ||
259 | uint8 token; | ||
260 | uint8 data[1]; | ||
261 | } BWL_POST_PACKED_STRUCT; | ||
262 | #define DOT11_ACTION_MEASURE_LEN 3 | ||
263 | |||
264 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_ch_width { | ||
265 | uint8 category; | ||
266 | uint8 action; | ||
267 | uint8 ch_width; | ||
268 | } BWL_POST_PACKED_STRUCT; | ||
269 | |||
270 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_mimops { | ||
271 | uint8 category; | ||
272 | uint8 action; | ||
273 | uint8 control; | ||
274 | } BWL_POST_PACKED_STRUCT; | ||
275 | |||
276 | #define SM_PWRSAVE_ENABLE 1 | ||
277 | #define SM_PWRSAVE_MODE 2 | ||
278 | |||
279 | |||
280 | BWL_PRE_PACKED_STRUCT struct dot11_power_cnst { | ||
281 | uint8 id; | ||
282 | uint8 len; | ||
283 | uint8 power; | ||
284 | } BWL_POST_PACKED_STRUCT; | ||
285 | typedef struct dot11_power_cnst dot11_power_cnst_t; | ||
286 | |||
287 | BWL_PRE_PACKED_STRUCT struct dot11_power_cap { | ||
288 | uint8 min; | ||
289 | uint8 max; | ||
290 | } BWL_POST_PACKED_STRUCT; | ||
291 | typedef struct dot11_power_cap dot11_power_cap_t; | ||
292 | |||
293 | BWL_PRE_PACKED_STRUCT struct dot11_tpc_rep { | ||
294 | uint8 id; | ||
295 | uint8 len; | ||
296 | uint8 tx_pwr; | ||
297 | uint8 margin; | ||
298 | } BWL_POST_PACKED_STRUCT; | ||
299 | typedef struct dot11_tpc_rep dot11_tpc_rep_t; | ||
300 | #define DOT11_MNG_IE_TPC_REPORT_LEN 2 | ||
301 | |||
302 | BWL_PRE_PACKED_STRUCT struct dot11_supp_channels { | ||
303 | uint8 id; | ||
304 | uint8 len; | ||
305 | uint8 first_channel; | ||
306 | uint8 num_channels; | ||
307 | } BWL_POST_PACKED_STRUCT; | ||
308 | typedef struct dot11_supp_channels dot11_supp_channels_t; | ||
309 | |||
310 | |||
311 | BWL_PRE_PACKED_STRUCT struct dot11_extch { | ||
312 | uint8 id; | ||
313 | uint8 len; | ||
314 | uint8 extch; | ||
315 | } BWL_POST_PACKED_STRUCT; | ||
316 | typedef struct dot11_extch dot11_extch_ie_t; | ||
317 | |||
318 | BWL_PRE_PACKED_STRUCT struct dot11_brcm_extch { | ||
319 | uint8 id; | ||
320 | uint8 len; | ||
321 | uint8 oui[3]; | ||
322 | uint8 type; | ||
323 | uint8 extch; | ||
324 | } BWL_POST_PACKED_STRUCT; | ||
325 | typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t; | ||
326 | |||
327 | #define BRCM_EXTCH_IE_LEN 5 | ||
328 | #define BRCM_EXTCH_IE_TYPE 53 | ||
329 | #define DOT11_EXTCH_IE_LEN 1 | ||
330 | #define DOT11_EXT_CH_MASK 0x03 | ||
331 | #define DOT11_EXT_CH_UPPER 0x01 | ||
332 | #define DOT11_EXT_CH_LOWER 0x03 | ||
333 | #define DOT11_EXT_CH_NONE 0x00 | ||
334 | |||
335 | BWL_PRE_PACKED_STRUCT struct dot11_action_frmhdr { | ||
336 | uint8 category; | ||
337 | uint8 action; | ||
338 | uint8 data[1]; | ||
339 | } BWL_POST_PACKED_STRUCT; | ||
340 | #define DOT11_ACTION_FRMHDR_LEN 2 | ||
341 | |||
342 | |||
343 | BWL_PRE_PACKED_STRUCT struct dot11_channel_switch { | ||
344 | uint8 id; | ||
345 | uint8 len; | ||
346 | uint8 mode; | ||
347 | uint8 channel; | ||
348 | uint8 count; | ||
349 | } BWL_POST_PACKED_STRUCT; | ||
350 | typedef struct dot11_channel_switch dot11_chan_switch_ie_t; | ||
351 | |||
352 | #define DOT11_SWITCH_IE_LEN 3 | ||
353 | |||
354 | #define DOT11_CSA_MODE_ADVISORY 0 | ||
355 | #define DOT11_CSA_MODE_NO_TX 1 | ||
356 | |||
357 | BWL_PRE_PACKED_STRUCT struct dot11_action_switch_channel { | ||
358 | uint8 category; | ||
359 | uint8 action; | ||
360 | dot11_chan_switch_ie_t chan_switch_ie; | ||
361 | dot11_brcm_extch_ie_t extch_ie; | ||
362 | } BWL_POST_PACKED_STRUCT; | ||
363 | |||
364 | BWL_PRE_PACKED_STRUCT struct dot11_csa_body { | ||
365 | uint8 mode; | ||
366 | uint8 reg; | ||
367 | uint8 channel; | ||
368 | uint8 count; | ||
369 | } BWL_POST_PACKED_STRUCT; | ||
370 | |||
371 | |||
372 | BWL_PRE_PACKED_STRUCT struct dot11_ext_csa { | ||
373 | uint8 id; | ||
374 | uint8 len; | ||
375 | struct dot11_csa_body b; | ||
376 | } BWL_POST_PACKED_STRUCT; | ||
377 | |||
378 | BWL_PRE_PACKED_STRUCT struct dot11y_action_ext_csa { | ||
379 | uint8 category; | ||
380 | uint8 action; | ||
381 | struct dot11_csa_body b; | ||
382 | } BWL_POST_PACKED_STRUCT; | ||
383 | typedef struct dot11_ext_csa dot11_ext_csa_ie_t; | ||
384 | #define DOT11_EXT_CSA_IE_LEN 4 | ||
385 | |||
386 | BWL_PRE_PACKED_STRUCT struct dot11_action_ext_csa { | ||
387 | uint8 category; | ||
388 | uint8 action; | ||
389 | dot11_ext_csa_ie_t chan_switch_ie; | ||
390 | } BWL_POST_PACKED_STRUCT; | ||
391 | |||
392 | BWL_PRE_PACKED_STRUCT struct dot11_obss_coex { | ||
393 | uint8 id; | ||
394 | uint8 len; | ||
395 | uint8 info; | ||
396 | } BWL_POST_PACKED_STRUCT; | ||
397 | typedef struct dot11_obss_coex dot11_obss_coex_t; | ||
398 | #define DOT11_OBSS_COEXINFO_LEN 1 | ||
399 | |||
400 | #define DOT11_OBSS_COEX_INFO_REQ 0x01 | ||
401 | #define DOT11_OBSS_COEX_40MHZ_INTOLERANT 0x02 | ||
402 | #define DOT11_OBSS_COEX_20MHZ_WIDTH_REQ 0x04 | ||
403 | |||
404 | BWL_PRE_PACKED_STRUCT struct dot11_obss_chanlist { | ||
405 | uint8 id; | ||
406 | uint8 len; | ||
407 | uint8 regclass; | ||
408 | uint8 chanlist[1]; | ||
409 | } BWL_POST_PACKED_STRUCT; | ||
410 | typedef struct dot11_obss_chanlist dot11_obss_chanlist_t; | ||
411 | #define DOT11_OBSS_CHANLIST_FIXED_LEN 1 | ||
412 | |||
413 | BWL_PRE_PACKED_STRUCT struct dot11_extcap_ie { | ||
414 | uint8 id; | ||
415 | uint8 len; | ||
416 | uint8 cap; | ||
417 | } BWL_POST_PACKED_STRUCT; | ||
418 | typedef struct dot11_extcap_ie dot11_extcap_ie_t; | ||
419 | #define DOT11_EXTCAP_LEN 1 | ||
420 | |||
421 | |||
422 | |||
423 | #define DOT11_MEASURE_TYPE_BASIC 0 | ||
424 | #define DOT11_MEASURE_TYPE_CCA 1 | ||
425 | #define DOT11_MEASURE_TYPE_RPI 2 | ||
426 | |||
427 | |||
428 | #define DOT11_MEASURE_MODE_ENABLE (1<<1) | ||
429 | #define DOT11_MEASURE_MODE_REQUEST (1<<2) | ||
430 | #define DOT11_MEASURE_MODE_REPORT (1<<3) | ||
431 | |||
432 | #define DOT11_MEASURE_MODE_LATE (1<<0) | ||
433 | #define DOT11_MEASURE_MODE_INCAPABLE (1<<1) | ||
434 | #define DOT11_MEASURE_MODE_REFUSED (1<<2) | ||
435 | |||
436 | #define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0)) | ||
437 | #define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1)) | ||
438 | #define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2)) | ||
439 | #define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3)) | ||
440 | #define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4)) | ||
441 | |||
442 | BWL_PRE_PACKED_STRUCT struct dot11_meas_req { | ||
443 | uint8 id; | ||
444 | uint8 len; | ||
445 | uint8 token; | ||
446 | uint8 mode; | ||
447 | uint8 type; | ||
448 | uint8 channel; | ||
449 | uint8 start_time[8]; | ||
450 | uint16 duration; | ||
451 | } BWL_POST_PACKED_STRUCT; | ||
452 | typedef struct dot11_meas_req dot11_meas_req_t; | ||
453 | #define DOT11_MNG_IE_MREQ_LEN 14 | ||
454 | |||
455 | #define DOT11_MNG_IE_MREQ_FIXED_LEN 3 | ||
456 | |||
457 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep { | ||
458 | uint8 id; | ||
459 | uint8 len; | ||
460 | uint8 token; | ||
461 | uint8 mode; | ||
462 | uint8 type; | ||
463 | BWL_PRE_PACKED_STRUCT union | ||
464 | { | ||
465 | BWL_PRE_PACKED_STRUCT struct { | ||
466 | uint8 channel; | ||
467 | uint8 start_time[8]; | ||
468 | uint16 duration; | ||
469 | uint8 map; | ||
470 | } BWL_POST_PACKED_STRUCT basic; | ||
471 | uint8 data[1]; | ||
472 | } BWL_POST_PACKED_STRUCT rep; | ||
473 | } BWL_POST_PACKED_STRUCT; | ||
474 | typedef struct dot11_meas_rep dot11_meas_rep_t; | ||
475 | |||
476 | |||
477 | #define DOT11_MNG_IE_MREP_FIXED_LEN 3 | ||
478 | |||
479 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep_basic { | ||
480 | uint8 channel; | ||
481 | uint8 start_time[8]; | ||
482 | uint16 duration; | ||
483 | uint8 map; | ||
484 | } BWL_POST_PACKED_STRUCT; | ||
485 | typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t; | ||
486 | #define DOT11_MEASURE_BASIC_REP_LEN 12 | ||
487 | |||
488 | BWL_PRE_PACKED_STRUCT struct dot11_quiet { | ||
489 | uint8 id; | ||
490 | uint8 len; | ||
491 | uint8 count; | ||
492 | uint8 period; | ||
493 | uint16 duration; | ||
494 | uint16 offset; | ||
495 | } BWL_POST_PACKED_STRUCT; | ||
496 | typedef struct dot11_quiet dot11_quiet_t; | ||
497 | |||
498 | BWL_PRE_PACKED_STRUCT struct chan_map_tuple { | ||
499 | uint8 channel; | ||
500 | uint8 map; | ||
501 | } BWL_POST_PACKED_STRUCT; | ||
502 | typedef struct chan_map_tuple chan_map_tuple_t; | ||
503 | |||
504 | BWL_PRE_PACKED_STRUCT struct dot11_ibss_dfs { | ||
505 | uint8 id; | ||
506 | uint8 len; | ||
507 | uint8 eaddr[ETHER_ADDR_LEN]; | ||
508 | uint8 interval; | ||
509 | chan_map_tuple_t map[1]; | ||
510 | } BWL_POST_PACKED_STRUCT; | ||
511 | typedef struct dot11_ibss_dfs dot11_ibss_dfs_t; | ||
512 | |||
513 | |||
514 | #define WME_OUI "\x00\x50\xf2" | ||
515 | #define WME_VER 1 | ||
516 | #define WME_TYPE 2 | ||
517 | #define WME_SUBTYPE_IE 0 | ||
518 | #define WME_SUBTYPE_PARAM_IE 1 | ||
519 | #define WME_SUBTYPE_TSPEC 2 | ||
520 | |||
521 | |||
522 | #define AC_BE 0 | ||
523 | #define AC_BK 1 | ||
524 | #define AC_VI 2 | ||
525 | #define AC_VO 3 | ||
526 | #define AC_COUNT 4 | ||
527 | |||
528 | typedef uint8 ac_bitmap_t; | ||
529 | |||
530 | #define AC_BITMAP_NONE 0x0 | ||
531 | #define AC_BITMAP_ALL 0xf | ||
532 | #define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0) | ||
533 | #define AC_BITMAP_SET(ab, ac) (((ab) |= (1 << (ac)))) | ||
534 | #define AC_BITMAP_RESET(ab, ac) (((ab) &= ~(1 << (ac)))) | ||
535 | |||
536 | |||
537 | BWL_PRE_PACKED_STRUCT struct wme_ie { | ||
538 | uint8 oui[3]; | ||
539 | uint8 type; | ||
540 | uint8 subtype; | ||
541 | uint8 version; | ||
542 | uint8 qosinfo; | ||
543 | } BWL_POST_PACKED_STRUCT; | ||
544 | typedef struct wme_ie wme_ie_t; | ||
545 | #define WME_IE_LEN 7 | ||
546 | |||
547 | BWL_PRE_PACKED_STRUCT struct edcf_acparam { | ||
548 | uint8 ACI; | ||
549 | uint8 ECW; | ||
550 | uint16 TXOP; | ||
551 | } BWL_POST_PACKED_STRUCT; | ||
552 | typedef struct edcf_acparam edcf_acparam_t; | ||
553 | |||
554 | |||
555 | BWL_PRE_PACKED_STRUCT struct wme_param_ie { | ||
556 | uint8 oui[3]; | ||
557 | uint8 type; | ||
558 | uint8 subtype; | ||
559 | uint8 version; | ||
560 | uint8 qosinfo; | ||
561 | uint8 rsvd; | ||
562 | edcf_acparam_t acparam[AC_COUNT]; | ||
563 | } BWL_POST_PACKED_STRUCT; | ||
564 | typedef struct wme_param_ie wme_param_ie_t; | ||
565 | #define WME_PARAM_IE_LEN 24 | ||
566 | |||
567 | |||
568 | #define WME_QI_AP_APSD_MASK 0x80 | ||
569 | #define WME_QI_AP_APSD_SHIFT 7 | ||
570 | #define WME_QI_AP_COUNT_MASK 0x0f | ||
571 | #define WME_QI_AP_COUNT_SHIFT 0 | ||
572 | |||
573 | |||
574 | #define WME_QI_STA_MAXSPLEN_MASK 0x60 | ||
575 | #define WME_QI_STA_MAXSPLEN_SHIFT 5 | ||
576 | #define WME_QI_STA_APSD_ALL_MASK 0xf | ||
577 | #define WME_QI_STA_APSD_ALL_SHIFT 0 | ||
578 | #define WME_QI_STA_APSD_BE_MASK 0x8 | ||
579 | #define WME_QI_STA_APSD_BE_SHIFT 3 | ||
580 | #define WME_QI_STA_APSD_BK_MASK 0x4 | ||
581 | #define WME_QI_STA_APSD_BK_SHIFT 2 | ||
582 | #define WME_QI_STA_APSD_VI_MASK 0x2 | ||
583 | #define WME_QI_STA_APSD_VI_SHIFT 1 | ||
584 | #define WME_QI_STA_APSD_VO_MASK 0x1 | ||
585 | #define WME_QI_STA_APSD_VO_SHIFT 0 | ||
586 | |||
587 | |||
588 | #define EDCF_AIFSN_MIN 1 | ||
589 | #define EDCF_AIFSN_MAX 15 | ||
590 | #define EDCF_AIFSN_MASK 0x0f | ||
591 | #define EDCF_ACM_MASK 0x10 | ||
592 | #define EDCF_ACI_MASK 0x60 | ||
593 | #define EDCF_ACI_SHIFT 5 | ||
594 | #define EDCF_AIFSN_SHIFT 12 | ||
595 | |||
596 | |||
597 | #define EDCF_ECW_MIN 0 | ||
598 | #define EDCF_ECW_MAX 15 | ||
599 | #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1) | ||
600 | #define EDCF_ECWMIN_MASK 0x0f | ||
601 | #define EDCF_ECWMAX_MASK 0xf0 | ||
602 | #define EDCF_ECWMAX_SHIFT 4 | ||
603 | |||
604 | |||
605 | #define EDCF_TXOP_MIN 0 | ||
606 | #define EDCF_TXOP_MAX 65535 | ||
607 | #define EDCF_TXOP2USEC(txop) ((txop) << 5) | ||
608 | |||
609 | |||
610 | #define NON_EDCF_AC_BE_ACI_STA 0x02 | ||
611 | |||
612 | |||
613 | #define EDCF_AC_BE_ACI_STA 0x03 | ||
614 | #define EDCF_AC_BE_ECW_STA 0xA4 | ||
615 | #define EDCF_AC_BE_TXOP_STA 0x0000 | ||
616 | #define EDCF_AC_BK_ACI_STA 0x27 | ||
617 | #define EDCF_AC_BK_ECW_STA 0xA4 | ||
618 | #define EDCF_AC_BK_TXOP_STA 0x0000 | ||
619 | #define EDCF_AC_VI_ACI_STA 0x42 | ||
620 | #define EDCF_AC_VI_ECW_STA 0x43 | ||
621 | #define EDCF_AC_VI_TXOP_STA 0x005e | ||
622 | #define EDCF_AC_VO_ACI_STA 0x62 | ||
623 | #define EDCF_AC_VO_ECW_STA 0x32 | ||
624 | #define EDCF_AC_VO_TXOP_STA 0x002f | ||
625 | |||
626 | |||
627 | #define EDCF_AC_BE_ACI_AP 0x03 | ||
628 | #define EDCF_AC_BE_ECW_AP 0x64 | ||
629 | #define EDCF_AC_BE_TXOP_AP 0x0000 | ||
630 | #define EDCF_AC_BK_ACI_AP 0x27 | ||
631 | #define EDCF_AC_BK_ECW_AP 0xA4 | ||
632 | #define EDCF_AC_BK_TXOP_AP 0x0000 | ||
633 | #define EDCF_AC_VI_ACI_AP 0x41 | ||
634 | #define EDCF_AC_VI_ECW_AP 0x43 | ||
635 | #define EDCF_AC_VI_TXOP_AP 0x005e | ||
636 | #define EDCF_AC_VO_ACI_AP 0x61 | ||
637 | #define EDCF_AC_VO_ECW_AP 0x32 | ||
638 | #define EDCF_AC_VO_TXOP_AP 0x002f | ||
639 | |||
640 | |||
641 | BWL_PRE_PACKED_STRUCT struct edca_param_ie { | ||
642 | uint8 qosinfo; | ||
643 | uint8 rsvd; | ||
644 | edcf_acparam_t acparam[AC_COUNT]; | ||
645 | } BWL_POST_PACKED_STRUCT; | ||
646 | typedef struct edca_param_ie edca_param_ie_t; | ||
647 | #define EDCA_PARAM_IE_LEN 18 | ||
648 | |||
649 | |||
650 | BWL_PRE_PACKED_STRUCT struct qos_cap_ie { | ||
651 | uint8 qosinfo; | ||
652 | } BWL_POST_PACKED_STRUCT; | ||
653 | typedef struct qos_cap_ie qos_cap_ie_t; | ||
654 | |||
655 | BWL_PRE_PACKED_STRUCT struct dot11_qbss_load_ie { | ||
656 | uint8 id; | ||
657 | uint8 length; | ||
658 | uint16 station_count; | ||
659 | uint8 channel_utilization; | ||
660 | uint16 aac; | ||
661 | } BWL_POST_PACKED_STRUCT; | ||
662 | typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t; | ||
663 | |||
664 | |||
665 | #define FIXED_MSDU_SIZE 0x8000 | ||
666 | #define MSDU_SIZE_MASK 0x7fff | ||
667 | |||
668 | |||
669 | |||
670 | #define INTEGER_SHIFT 13 | ||
671 | #define FRACTION_MASK 0x1FFF | ||
672 | |||
673 | |||
674 | BWL_PRE_PACKED_STRUCT struct dot11_management_notification { | ||
675 | uint8 category; | ||
676 | uint8 action; | ||
677 | uint8 token; | ||
678 | uint8 status; | ||
679 | uint8 data[1]; | ||
680 | } BWL_POST_PACKED_STRUCT; | ||
681 | #define DOT11_MGMT_NOTIFICATION_LEN 4 | ||
682 | |||
683 | |||
684 | #define WME_ADDTS_REQUEST 0 | ||
685 | #define WME_ADDTS_RESPONSE 1 | ||
686 | #define WME_DELTS_REQUEST 2 | ||
687 | |||
688 | |||
689 | #define WME_ADMISSION_ACCEPTED 0 | ||
690 | #define WME_INVALID_PARAMETERS 1 | ||
691 | #define WME_ADMISSION_REFUSED 3 | ||
692 | |||
693 | |||
694 | #define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN) | ||
695 | |||
696 | |||
697 | #define DOT11_OPEN_SYSTEM 0 | ||
698 | #define DOT11_SHARED_KEY 1 | ||
699 | |||
700 | #define DOT11_OPEN_SHARED 2 | ||
701 | #define DOT11_CHALLENGE_LEN 128 | ||
702 | |||
703 | |||
704 | #define FC_PVER_MASK 0x3 | ||
705 | #define FC_PVER_SHIFT 0 | ||
706 | #define FC_TYPE_MASK 0xC | ||
707 | #define FC_TYPE_SHIFT 2 | ||
708 | #define FC_SUBTYPE_MASK 0xF0 | ||
709 | #define FC_SUBTYPE_SHIFT 4 | ||
710 | #define FC_TODS 0x100 | ||
711 | #define FC_TODS_SHIFT 8 | ||
712 | #define FC_FROMDS 0x200 | ||
713 | #define FC_FROMDS_SHIFT 9 | ||
714 | #define FC_MOREFRAG 0x400 | ||
715 | #define FC_MOREFRAG_SHIFT 10 | ||
716 | #define FC_RETRY 0x800 | ||
717 | #define FC_RETRY_SHIFT 11 | ||
718 | #define FC_PM 0x1000 | ||
719 | #define FC_PM_SHIFT 12 | ||
720 | #define FC_MOREDATA 0x2000 | ||
721 | #define FC_MOREDATA_SHIFT 13 | ||
722 | #define FC_WEP 0x4000 | ||
723 | #define FC_WEP_SHIFT 14 | ||
724 | #define FC_ORDER 0x8000 | ||
725 | #define FC_ORDER_SHIFT 15 | ||
726 | |||
727 | |||
728 | #define SEQNUM_SHIFT 4 | ||
729 | #define SEQNUM_MAX 0x1000 | ||
730 | #define FRAGNUM_MASK 0xF | ||
731 | |||
732 | |||
733 | |||
734 | |||
735 | #define FC_TYPE_MNG 0 | ||
736 | #define FC_TYPE_CTL 1 | ||
737 | #define FC_TYPE_DATA 2 | ||
738 | |||
739 | |||
740 | #define FC_SUBTYPE_ASSOC_REQ 0 | ||
741 | #define FC_SUBTYPE_ASSOC_RESP 1 | ||
742 | #define FC_SUBTYPE_REASSOC_REQ 2 | ||
743 | #define FC_SUBTYPE_REASSOC_RESP 3 | ||
744 | #define FC_SUBTYPE_PROBE_REQ 4 | ||
745 | #define FC_SUBTYPE_PROBE_RESP 5 | ||
746 | #define FC_SUBTYPE_BEACON 8 | ||
747 | #define FC_SUBTYPE_ATIM 9 | ||
748 | #define FC_SUBTYPE_DISASSOC 10 | ||
749 | #define FC_SUBTYPE_AUTH 11 | ||
750 | #define FC_SUBTYPE_DEAUTH 12 | ||
751 | #define FC_SUBTYPE_ACTION 13 | ||
752 | #define FC_SUBTYPE_ACTION_NOACK 14 | ||
753 | |||
754 | |||
755 | #define FC_SUBTYPE_CTL_WRAPPER 7 | ||
756 | #define FC_SUBTYPE_BLOCKACK_REQ 8 | ||
757 | #define FC_SUBTYPE_BLOCKACK 9 | ||
758 | #define FC_SUBTYPE_PS_POLL 10 | ||
759 | #define FC_SUBTYPE_RTS 11 | ||
760 | #define FC_SUBTYPE_CTS 12 | ||
761 | #define FC_SUBTYPE_ACK 13 | ||
762 | #define FC_SUBTYPE_CF_END 14 | ||
763 | #define FC_SUBTYPE_CF_END_ACK 15 | ||
764 | |||
765 | |||
766 | #define FC_SUBTYPE_DATA 0 | ||
767 | #define FC_SUBTYPE_DATA_CF_ACK 1 | ||
768 | #define FC_SUBTYPE_DATA_CF_POLL 2 | ||
769 | #define FC_SUBTYPE_DATA_CF_ACK_POLL 3 | ||
770 | #define FC_SUBTYPE_NULL 4 | ||
771 | #define FC_SUBTYPE_CF_ACK 5 | ||
772 | #define FC_SUBTYPE_CF_POLL 6 | ||
773 | #define FC_SUBTYPE_CF_ACK_POLL 7 | ||
774 | #define FC_SUBTYPE_QOS_DATA 8 | ||
775 | #define FC_SUBTYPE_QOS_DATA_CF_ACK 9 | ||
776 | #define FC_SUBTYPE_QOS_DATA_CF_POLL 10 | ||
777 | #define FC_SUBTYPE_QOS_DATA_CF_ACK_POLL 11 | ||
778 | #define FC_SUBTYPE_QOS_NULL 12 | ||
779 | #define FC_SUBTYPE_QOS_CF_POLL 14 | ||
780 | #define FC_SUBTYPE_QOS_CF_ACK_POLL 15 | ||
781 | |||
782 | |||
783 | #define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0) | ||
784 | #define FC_SUBTYPE_ANY_NULL(s) (((s) & 4) != 0) | ||
785 | #define FC_SUBTYPE_ANY_CF_POLL(s) (((s) & 2) != 0) | ||
786 | #define FC_SUBTYPE_ANY_CF_ACK(s) (((s) & 1) != 0) | ||
787 | |||
788 | |||
789 | #define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK) | ||
790 | |||
791 | #define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT)) | ||
792 | |||
793 | #define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT) | ||
794 | #define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT) | ||
795 | |||
796 | #define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ) | ||
797 | #define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP) | ||
798 | #define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ) | ||
799 | #define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP) | ||
800 | #define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ) | ||
801 | #define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP) | ||
802 | #define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON) | ||
803 | #define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC) | ||
804 | #define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH) | ||
805 | #define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH) | ||
806 | #define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION) | ||
807 | #define FC_ACTION_NOACK FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION_NOACK) | ||
808 | |||
809 | #define FC_CTL_WRAPPER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTL_WRAPPER) | ||
810 | #define FC_BLOCKACK_REQ FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK_REQ) | ||
811 | #define FC_BLOCKACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK) | ||
812 | #define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL) | ||
813 | #define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS) | ||
814 | #define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS) | ||
815 | #define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK) | ||
816 | #define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END) | ||
817 | #define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK) | ||
818 | |||
819 | #define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA) | ||
820 | #define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL) | ||
821 | #define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK) | ||
822 | #define FC_QOS_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA) | ||
823 | #define FC_QOS_NULL FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL) | ||
824 | |||
825 | |||
826 | |||
827 | |||
828 | #define QOS_PRIO_SHIFT 0 | ||
829 | #define QOS_PRIO_MASK 0x0007 | ||
830 | #define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT) | ||
831 | |||
832 | |||
833 | #define QOS_TID_SHIFT 0 | ||
834 | #define QOS_TID_MASK 0x000f | ||
835 | #define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT) | ||
836 | |||
837 | |||
838 | #define QOS_EOSP_SHIFT 4 | ||
839 | #define QOS_EOSP_MASK 0x0010 | ||
840 | #define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT) | ||
841 | |||
842 | |||
843 | #define QOS_ACK_NORMAL_ACK 0 | ||
844 | #define QOS_ACK_NO_ACK 1 | ||
845 | #define QOS_ACK_NO_EXP_ACK 2 | ||
846 | #define QOS_ACK_BLOCK_ACK 3 | ||
847 | #define QOS_ACK_SHIFT 5 | ||
848 | #define QOS_ACK_MASK 0x0060 | ||
849 | #define QOS_ACK(qos) (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT) | ||
850 | |||
851 | |||
852 | #define QOS_AMSDU_SHIFT 7 | ||
853 | #define QOS_AMSDU_MASK 0x0080 | ||
854 | |||
855 | |||
856 | |||
857 | |||
858 | |||
859 | |||
860 | #define DOT11_MNG_AUTH_ALGO_LEN 2 | ||
861 | #define DOT11_MNG_AUTH_SEQ_LEN 2 | ||
862 | #define DOT11_MNG_BEACON_INT_LEN 2 | ||
863 | #define DOT11_MNG_CAP_LEN 2 | ||
864 | #define DOT11_MNG_AP_ADDR_LEN 6 | ||
865 | #define DOT11_MNG_LISTEN_INT_LEN 2 | ||
866 | #define DOT11_MNG_REASON_LEN 2 | ||
867 | #define DOT11_MNG_AID_LEN 2 | ||
868 | #define DOT11_MNG_STATUS_LEN 2 | ||
869 | #define DOT11_MNG_TIMESTAMP_LEN 8 | ||
870 | |||
871 | |||
872 | #define DOT11_AID_MASK 0x3fff | ||
873 | |||
874 | |||
875 | #define DOT11_RC_RESERVED 0 | ||
876 | #define DOT11_RC_UNSPECIFIED 1 | ||
877 | #define DOT11_RC_AUTH_INVAL 2 | ||
878 | #define DOT11_RC_DEAUTH_LEAVING 3 | ||
879 | #define DOT11_RC_INACTIVITY 4 | ||
880 | #define DOT11_RC_BUSY 5 | ||
881 | #define DOT11_RC_INVAL_CLASS_2 6 | ||
882 | #define DOT11_RC_INVAL_CLASS_3 7 | ||
883 | #define DOT11_RC_DISASSOC_LEAVING 8 | ||
884 | #define DOT11_RC_NOT_AUTH 9 | ||
885 | #define DOT11_RC_BAD_PC 10 | ||
886 | #define DOT11_RC_BAD_CHANNELS 11 | ||
887 | |||
888 | |||
889 | |||
890 | #define DOT11_RC_UNSPECIFIED_QOS 32 | ||
891 | #define DOT11_RC_INSUFFCIENT_BW 33 | ||
892 | #define DOT11_RC_EXCESSIVE_FRAMES 34 | ||
893 | #define DOT11_RC_TX_OUTSIDE_TXOP 35 | ||
894 | #define DOT11_RC_LEAVING_QBSS 36 | ||
895 | #define DOT11_RC_BAD_MECHANISM 37 | ||
896 | #define DOT11_RC_SETUP_NEEDED 38 | ||
897 | #define DOT11_RC_TIMEOUT 39 | ||
898 | |||
899 | #define DOT11_RC_MAX 23 | ||
900 | |||
901 | |||
902 | #define DOT11_SC_SUCCESS 0 | ||
903 | #define DOT11_SC_FAILURE 1 | ||
904 | #define DOT11_SC_CAP_MISMATCH 10 | ||
905 | #define DOT11_SC_REASSOC_FAIL 11 | ||
906 | #define DOT11_SC_ASSOC_FAIL 12 | ||
907 | #define DOT11_SC_AUTH_MISMATCH 13 | ||
908 | #define DOT11_SC_AUTH_SEQ 14 | ||
909 | #define DOT11_SC_AUTH_CHALLENGE_FAIL 15 | ||
910 | #define DOT11_SC_AUTH_TIMEOUT 16 | ||
911 | #define DOT11_SC_ASSOC_BUSY_FAIL 17 | ||
912 | #define DOT11_SC_ASSOC_RATE_MISMATCH 18 | ||
913 | #define DOT11_SC_ASSOC_SHORT_REQUIRED 19 | ||
914 | #define DOT11_SC_ASSOC_PBCC_REQUIRED 20 | ||
915 | #define DOT11_SC_ASSOC_AGILITY_REQUIRED 21 | ||
916 | #define DOT11_SC_ASSOC_SPECTRUM_REQUIRED 22 | ||
917 | #define DOT11_SC_ASSOC_BAD_POWER_CAP 23 | ||
918 | #define DOT11_SC_ASSOC_BAD_SUP_CHANNELS 24 | ||
919 | #define DOT11_SC_ASSOC_SHORTSLOT_REQUIRED 25 | ||
920 | #define DOT11_SC_ASSOC_ERPBCC_REQUIRED 26 | ||
921 | #define DOT11_SC_ASSOC_DSSOFDM_REQUIRED 27 | ||
922 | |||
923 | #define DOT11_SC_DECLINED 37 | ||
924 | #define DOT11_SC_INVALID_PARAMS 38 | ||
925 | |||
926 | |||
927 | #define DOT11_MNG_DS_PARAM_LEN 1 | ||
928 | #define DOT11_MNG_IBSS_PARAM_LEN 2 | ||
929 | |||
930 | |||
931 | #define DOT11_MNG_TIM_FIXED_LEN 3 | ||
932 | #define DOT11_MNG_TIM_DTIM_COUNT 0 | ||
933 | #define DOT11_MNG_TIM_DTIM_PERIOD 1 | ||
934 | #define DOT11_MNG_TIM_BITMAP_CTL 2 | ||
935 | #define DOT11_MNG_TIM_PVB 3 | ||
936 | |||
937 | |||
938 | #define TLV_TAG_OFF 0 | ||
939 | #define TLV_LEN_OFF 1 | ||
940 | #define TLV_HDR_LEN 2 | ||
941 | #define TLV_BODY_OFF 2 | ||
942 | |||
943 | |||
944 | #define DOT11_MNG_SSID_ID 0 | ||
945 | #define DOT11_MNG_RATES_ID 1 | ||
946 | #define DOT11_MNG_FH_PARMS_ID 2 | ||
947 | #define DOT11_MNG_DS_PARMS_ID 3 | ||
948 | #define DOT11_MNG_CF_PARMS_ID 4 | ||
949 | #define DOT11_MNG_TIM_ID 5 | ||
950 | #define DOT11_MNG_IBSS_PARMS_ID 6 | ||
951 | #define DOT11_MNG_COUNTRY_ID 7 | ||
952 | #define DOT11_MNG_HOPPING_PARMS_ID 8 | ||
953 | #define DOT11_MNG_HOPPING_TABLE_ID 9 | ||
954 | #define DOT11_MNG_REQUEST_ID 10 | ||
955 | #define DOT11_MNG_QBSS_LOAD_ID 11 | ||
956 | #define DOT11_MNG_EDCA_PARAM_ID 12 | ||
957 | #define DOT11_MNG_CHALLENGE_ID 16 | ||
958 | #define DOT11_MNG_PWR_CONSTRAINT_ID 32 | ||
959 | #define DOT11_MNG_PWR_CAP_ID 33 | ||
960 | #define DOT11_MNG_TPC_REQUEST_ID 34 | ||
961 | #define DOT11_MNG_TPC_REPORT_ID 35 | ||
962 | #define DOT11_MNG_SUPP_CHANNELS_ID 36 | ||
963 | #define DOT11_MNG_CHANNEL_SWITCH_ID 37 | ||
964 | #define DOT11_MNG_MEASURE_REQUEST_ID 38 | ||
965 | #define DOT11_MNG_MEASURE_REPORT_ID 39 | ||
966 | #define DOT11_MNG_QUIET_ID 40 | ||
967 | #define DOT11_MNG_IBSS_DFS_ID 41 | ||
968 | #define DOT11_MNG_ERP_ID 42 | ||
969 | #define DOT11_MNG_TS_DELAY_ID 43 | ||
970 | #define DOT11_MNG_HT_CAP 45 | ||
971 | #define DOT11_MNG_QOS_CAP_ID 46 | ||
972 | #define DOT11_MNG_NONERP_ID 47 | ||
973 | #define DOT11_MNG_RSN_ID 48 | ||
974 | #define DOT11_MNG_EXT_RATES_ID 50 | ||
975 | #define DOT11_MNG_REGCLASS_ID 59 | ||
976 | #define DOT11_MNG_EXT_CSA_ID 60 | ||
977 | #define DOT11_MNG_HT_ADD 61 | ||
978 | #define DOT11_MNG_EXT_CHANNEL_OFFSET 62 | ||
979 | #define DOT11_MNG_WAPI_ID 68 | ||
980 | #define DOT11_MNG_HT_BSS_COEXINFO_ID 72 | ||
981 | #define DOT11_MNG_HT_BSS_CHANNEL_REPORT_ID 73 | ||
982 | #define DOT11_MNG_HT_OBSS_ID 74 | ||
983 | #define DOT11_MNG_EXT_CAP 127 | ||
984 | #define DOT11_MNG_WPA_ID 221 | ||
985 | #define DOT11_MNG_PROPR_ID 221 | ||
986 | |||
987 | |||
988 | #define DOT11_RATE_BASIC 0x80 | ||
989 | #define DOT11_RATE_MASK 0x7F | ||
990 | |||
991 | |||
992 | #define DOT11_MNG_ERP_LEN 1 | ||
993 | #define DOT11_MNG_NONERP_PRESENT 0x01 | ||
994 | #define DOT11_MNG_USE_PROTECTION 0x02 | ||
995 | #define DOT11_MNG_BARKER_PREAMBLE 0x04 | ||
996 | |||
997 | #define DOT11_MGN_TS_DELAY_LEN 4 | ||
998 | #define TS_DELAY_FIELD_SIZE 4 | ||
999 | |||
1000 | |||
1001 | #define DOT11_CAP_ESS 0x0001 | ||
1002 | #define DOT11_CAP_IBSS 0x0002 | ||
1003 | #define DOT11_CAP_POLLABLE 0x0004 | ||
1004 | #define DOT11_CAP_POLL_RQ 0x0008 | ||
1005 | #define DOT11_CAP_PRIVACY 0x0010 | ||
1006 | #define DOT11_CAP_SHORT 0x0020 | ||
1007 | #define DOT11_CAP_PBCC 0x0040 | ||
1008 | #define DOT11_CAP_AGILITY 0x0080 | ||
1009 | #define DOT11_CAP_SPECTRUM 0x0100 | ||
1010 | #define DOT11_CAP_SHORTSLOT 0x0400 | ||
1011 | #define DOT11_CAP_CCK_OFDM 0x2000 | ||
1012 | |||
1013 | |||
1014 | #define DOT11_OBSS_COEX_MNG_SUPPORT 0x01 | ||
1015 | |||
1016 | |||
1017 | #define DOT11_ACTION_HDR_LEN 2 | ||
1018 | #define DOT11_ACTION_CAT_ERR_MASK 0x80 | ||
1019 | #define DOT11_ACTION_CAT_MASK 0x7F | ||
1020 | #define DOT11_ACTION_CAT_SPECT_MNG 0 | ||
1021 | #define DOT11_ACTION_CAT_BLOCKACK 3 | ||
1022 | #define DOT11_ACTION_CAT_PUBLIC 4 | ||
1023 | #define DOT11_ACTION_CAT_HT 7 | ||
1024 | #define DOT11_ACTION_CAT_VS 127 | ||
1025 | #define DOT11_ACTION_NOTIFICATION 0x11 | ||
1026 | |||
1027 | #define DOT11_ACTION_ID_M_REQ 0 | ||
1028 | #define DOT11_ACTION_ID_M_REP 1 | ||
1029 | #define DOT11_ACTION_ID_TPC_REQ 2 | ||
1030 | #define DOT11_ACTION_ID_TPC_REP 3 | ||
1031 | #define DOT11_ACTION_ID_CHANNEL_SWITCH 4 | ||
1032 | #define DOT11_ACTION_ID_EXT_CSA 5 | ||
1033 | |||
1034 | |||
1035 | #define DOT11_ACTION_ID_HT_CH_WIDTH 0 | ||
1036 | #define DOT11_ACTION_ID_HT_MIMO_PS 1 | ||
1037 | |||
1038 | |||
1039 | #define DOT11_PUB_ACTION_BSS_COEX_MNG 0 | ||
1040 | #define DOT11_PUB_ACTION_CHANNEL_SWITCH 4 | ||
1041 | |||
1042 | |||
1043 | #define DOT11_BA_ACTION_ADDBA_REQ 0 | ||
1044 | #define DOT11_BA_ACTION_ADDBA_RESP 1 | ||
1045 | #define DOT11_BA_ACTION_DELBA 2 | ||
1046 | |||
1047 | |||
1048 | #define DOT11_ADDBA_PARAM_AMSDU_SUP 0x0001 | ||
1049 | #define DOT11_ADDBA_PARAM_POLICY_MASK 0x0002 | ||
1050 | #define DOT11_ADDBA_PARAM_POLICY_SHIFT 1 | ||
1051 | #define DOT11_ADDBA_PARAM_TID_MASK 0x003c | ||
1052 | #define DOT11_ADDBA_PARAM_TID_SHIFT 2 | ||
1053 | #define DOT11_ADDBA_PARAM_BSIZE_MASK 0xffc0 | ||
1054 | #define DOT11_ADDBA_PARAM_BSIZE_SHIFT 6 | ||
1055 | |||
1056 | #define DOT11_ADDBA_POLICY_DELAYED 0 | ||
1057 | #define DOT11_ADDBA_POLICY_IMMEDIATE 1 | ||
1058 | |||
1059 | BWL_PRE_PACKED_STRUCT struct dot11_addba_req { | ||
1060 | uint8 category; | ||
1061 | uint8 action; | ||
1062 | uint8 token; | ||
1063 | uint16 addba_param_set; | ||
1064 | uint16 timeout; | ||
1065 | uint16 start_seqnum; | ||
1066 | } BWL_POST_PACKED_STRUCT; | ||
1067 | typedef struct dot11_addba_req dot11_addba_req_t; | ||
1068 | #define DOT11_ADDBA_REQ_LEN 9 | ||
1069 | |||
1070 | BWL_PRE_PACKED_STRUCT struct dot11_addba_resp { | ||
1071 | uint8 category; | ||
1072 | uint8 action; | ||
1073 | uint8 token; | ||
1074 | uint16 status; | ||
1075 | uint16 addba_param_set; | ||
1076 | uint16 timeout; | ||
1077 | } BWL_POST_PACKED_STRUCT; | ||
1078 | typedef struct dot11_addba_resp dot11_addba_resp_t; | ||
1079 | #define DOT11_ADDBA_RESP_LEN 9 | ||
1080 | |||
1081 | |||
1082 | #define DOT11_DELBA_PARAM_INIT_MASK 0x0800 | ||
1083 | #define DOT11_DELBA_PARAM_INIT_SHIFT 11 | ||
1084 | #define DOT11_DELBA_PARAM_TID_MASK 0xf000 | ||
1085 | #define DOT11_DELBA_PARAM_TID_SHIFT 12 | ||
1086 | |||
1087 | BWL_PRE_PACKED_STRUCT struct dot11_delba { | ||
1088 | uint8 category; | ||
1089 | uint8 action; | ||
1090 | uint16 delba_param_set; | ||
1091 | uint16 reason; | ||
1092 | } BWL_POST_PACKED_STRUCT; | ||
1093 | typedef struct dot11_delba dot11_delba_t; | ||
1094 | #define DOT11_DELBA_LEN 6 | ||
1095 | |||
1096 | |||
1097 | #define DOT11_BSSTYPE_INFRASTRUCTURE 0 | ||
1098 | #define DOT11_BSSTYPE_INDEPENDENT 1 | ||
1099 | #define DOT11_BSSTYPE_ANY 2 | ||
1100 | #define DOT11_SCANTYPE_ACTIVE 0 | ||
1101 | #define DOT11_SCANTYPE_PASSIVE 1 | ||
1102 | |||
1103 | |||
1104 | #define PREN_PREAMBLE 24 | ||
1105 | #define PREN_MM_EXT 8 | ||
1106 | #define PREN_PREAMBLE_EXT 4 | ||
1107 | |||
1108 | |||
1109 | #define NPHY_RIFS_TIME 2 | ||
1110 | |||
1111 | |||
1112 | #define APHY_SLOT_TIME 9 | ||
1113 | #define APHY_SIFS_TIME 16 | ||
1114 | #define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME)) | ||
1115 | #define APHY_PREAMBLE_TIME 16 | ||
1116 | #define APHY_SIGNAL_TIME 4 | ||
1117 | #define APHY_SYMBOL_TIME 4 | ||
1118 | #define APHY_SERVICE_NBITS 16 | ||
1119 | #define APHY_TAIL_NBITS 6 | ||
1120 | #define APHY_CWMIN 15 | ||
1121 | |||
1122 | |||
1123 | #define BPHY_SLOT_TIME 20 | ||
1124 | #define BPHY_SIFS_TIME 10 | ||
1125 | #define BPHY_DIFS_TIME 50 | ||
1126 | #define BPHY_PLCP_TIME 192 | ||
1127 | #define BPHY_PLCP_SHORT_TIME 96 | ||
1128 | #define BPHY_CWMIN 31 | ||
1129 | |||
1130 | |||
1131 | #define DOT11_OFDM_SIGNAL_EXTENSION 6 | ||
1132 | |||
1133 | #define PHY_CWMAX 1023 | ||
1134 | |||
1135 | #define DOT11_MAXNUMFRAGS 16 | ||
1136 | |||
1137 | |||
1138 | typedef struct d11cnt { | ||
1139 | uint32 txfrag; | ||
1140 | uint32 txmulti; | ||
1141 | uint32 txfail; | ||
1142 | uint32 txretry; | ||
1143 | uint32 txretrie; | ||
1144 | uint32 rxdup; | ||
1145 | uint32 txrts; | ||
1146 | uint32 txnocts; | ||
1147 | uint32 txnoack; | ||
1148 | uint32 rxfrag; | ||
1149 | uint32 rxmulti; | ||
1150 | uint32 rxcrc; | ||
1151 | uint32 txfrmsnt; | ||
1152 | uint32 rxundec; | ||
1153 | } d11cnt_t; | ||
1154 | |||
1155 | |||
1156 | #define BRCM_PROP_OUI "\x00\x90\x4C" | ||
1157 | |||
1158 | |||
1159 | |||
1160 | |||
1161 | BWL_PRE_PACKED_STRUCT struct brcm_prop_ie_s { | ||
1162 | uint8 id; | ||
1163 | uint8 len; | ||
1164 | uint8 oui[3]; | ||
1165 | uint8 type; | ||
1166 | uint16 cap; | ||
1167 | } BWL_POST_PACKED_STRUCT; | ||
1168 | typedef struct brcm_prop_ie_s brcm_prop_ie_t; | ||
1169 | |||
1170 | #define BRCM_PROP_IE_LEN 6 | ||
1171 | |||
1172 | #define DPT_IE_TYPE 2 | ||
1173 | |||
1174 | |||
1175 | #define BRCM_OUI "\x00\x10\x18" | ||
1176 | |||
1177 | |||
1178 | BWL_PRE_PACKED_STRUCT struct brcm_ie { | ||
1179 | uint8 id; | ||
1180 | uint8 len; | ||
1181 | uint8 oui[3]; | ||
1182 | uint8 ver; | ||
1183 | uint8 assoc; | ||
1184 | uint8 flags; | ||
1185 | uint8 flags1; | ||
1186 | uint16 amsdu_mtu_pref; | ||
1187 | } BWL_POST_PACKED_STRUCT; | ||
1188 | typedef struct brcm_ie brcm_ie_t; | ||
1189 | #define BRCM_IE_LEN 11 | ||
1190 | #define BRCM_IE_VER 2 | ||
1191 | #define BRCM_IE_LEGACY_AES_VER 1 | ||
1192 | |||
1193 | |||
1194 | #ifdef WLAFTERBURNER | ||
1195 | #define BRF_ABCAP 0x1 | ||
1196 | #define BRF_ABRQRD 0x2 | ||
1197 | #define BRF_ABCOUNTER_MASK 0xf0 | ||
1198 | #define BRF_ABCOUNTER_SHIFT 4 | ||
1199 | #endif | ||
1200 | #define BRF_LZWDS 0x4 | ||
1201 | #define BRF_BLOCKACK 0x8 | ||
1202 | |||
1203 | |||
1204 | #define BRF1_AMSDU 0x1 | ||
1205 | #define BRF1_WMEPS 0x4 | ||
1206 | #define BRF1_PSOFIX 0x8 | ||
1207 | |||
1208 | #ifdef WLAFTERBURNER | ||
1209 | #define AB_WDS_TIMEOUT_MAX 15 | ||
1210 | #define AB_WDS_TIMEOUT_MIN 1 | ||
1211 | #endif | ||
1212 | |||
1213 | #define AB_GUARDCOUNT 10 | ||
1214 | |||
1215 | #define MCSSET_LEN 16 | ||
1216 | #define MAX_MCS_NUM (128) | ||
1217 | |||
1218 | BWL_PRE_PACKED_STRUCT struct ht_cap_ie { | ||
1219 | uint16 cap; | ||
1220 | uint8 params; | ||
1221 | uint8 supp_mcs[MCSSET_LEN]; | ||
1222 | uint16 ext_htcap; | ||
1223 | uint32 txbf_cap; | ||
1224 | uint8 as_cap; | ||
1225 | } BWL_POST_PACKED_STRUCT; | ||
1226 | typedef struct ht_cap_ie ht_cap_ie_t; | ||
1227 | |||
1228 | |||
1229 | |||
1230 | BWL_PRE_PACKED_STRUCT struct ht_prop_cap_ie { | ||
1231 | uint8 id; | ||
1232 | uint8 len; | ||
1233 | uint8 oui[3]; | ||
1234 | uint8 type; | ||
1235 | ht_cap_ie_t cap_ie; | ||
1236 | } BWL_POST_PACKED_STRUCT; | ||
1237 | typedef struct ht_prop_cap_ie ht_prop_cap_ie_t; | ||
1238 | #define HT_PROP_IE_OVERHEAD 4 | ||
1239 | #define HT_CAP_IE_LEN 26 | ||
1240 | #define HT_CAP_IE_TYPE 51 | ||
1241 | |||
1242 | #define HT_CAP_LDPC_CODING 0x0001 | ||
1243 | #define HT_CAP_40MHZ 0x0002 | ||
1244 | #define HT_CAP_MIMO_PS_MASK 0x000C | ||
1245 | #define HT_CAP_MIMO_PS_SHIFT 0x0002 | ||
1246 | #define HT_CAP_MIMO_PS_OFF 0x0003 | ||
1247 | #define HT_CAP_MIMO_PS_RTS 0x0001 | ||
1248 | #define HT_CAP_MIMO_PS_ON 0x0000 | ||
1249 | #define HT_CAP_GF 0x0010 | ||
1250 | #define HT_CAP_SHORT_GI_20 0x0020 | ||
1251 | #define HT_CAP_SHORT_GI_40 0x0040 | ||
1252 | #define HT_CAP_TX_STBC 0x0080 | ||
1253 | #define HT_CAP_RX_STBC_MASK 0x0300 | ||
1254 | #define HT_CAP_RX_STBC_SHIFT 8 | ||
1255 | #define HT_CAP_DELAYED_BA 0x0400 | ||
1256 | #define HT_CAP_MAX_AMSDU 0x0800 | ||
1257 | #define HT_CAP_DSSS_CCK 0x1000 | ||
1258 | #define HT_CAP_PSMP 0x2000 | ||
1259 | #define HT_CAP_40MHZ_INTOLERANT 0x4000 | ||
1260 | #define HT_CAP_LSIG_TXOP 0x8000 | ||
1261 | |||
1262 | #define HT_CAP_RX_STBC_NO 0x0 | ||
1263 | #define HT_CAP_RX_STBC_ONE_STREAM 0x1 | ||
1264 | #define HT_CAP_RX_STBC_TWO_STREAM 0x2 | ||
1265 | #define HT_CAP_RX_STBC_THREE_STREAM 0x3 | ||
1266 | |||
1267 | #define HT_MAX_AMSDU 7935 | ||
1268 | #define HT_MIN_AMSDU 3835 | ||
1269 | |||
1270 | #define HT_PARAMS_RX_FACTOR_MASK 0x03 | ||
1271 | #define HT_PARAMS_DENSITY_MASK 0x1C | ||
1272 | #define HT_PARAMS_DENSITY_SHIFT 2 | ||
1273 | |||
1274 | |||
1275 | #define AMPDU_MAX_MPDU_DENSITY 7 | ||
1276 | #define AMPDU_RX_FACTOR_64K 3 | ||
1277 | #define AMPDU_RX_FACTOR_BASE 8*1024 | ||
1278 | #define AMPDU_DELIMITER_LEN 4 | ||
1279 | |||
1280 | #define HT_CAP_EXT_PCO 0x0001 | ||
1281 | #define HT_CAP_EXT_PCO_TTIME_MASK 0x0006 | ||
1282 | #define HT_CAP_EXT_PCO_TTIME_SHIFT 1 | ||
1283 | #define HT_CAP_EXT_MCS_FEEDBACK_MASK 0x0300 | ||
1284 | #define HT_CAP_EXT_MCS_FEEDBACK_SHIFT 8 | ||
1285 | #define HT_CAP_EXT_HTC 0x0400 | ||
1286 | #define HT_CAP_EXT_RD_RESP 0x0800 | ||
1287 | |||
1288 | BWL_PRE_PACKED_STRUCT struct ht_add_ie { | ||
1289 | uint8 ctl_ch; | ||
1290 | uint8 byte1; | ||
1291 | uint16 opmode; | ||
1292 | uint16 misc_bits; | ||
1293 | uint8 basic_mcs[MCSSET_LEN]; | ||
1294 | } BWL_POST_PACKED_STRUCT; | ||
1295 | typedef struct ht_add_ie ht_add_ie_t; | ||
1296 | |||
1297 | |||
1298 | |||
1299 | BWL_PRE_PACKED_STRUCT struct ht_prop_add_ie { | ||
1300 | uint8 id; | ||
1301 | uint8 len; | ||
1302 | uint8 oui[3]; | ||
1303 | uint8 type; | ||
1304 | ht_add_ie_t add_ie; | ||
1305 | } BWL_POST_PACKED_STRUCT; | ||
1306 | typedef struct ht_prop_add_ie ht_prop_add_ie_t; | ||
1307 | |||
1308 | #define HT_ADD_IE_LEN 22 | ||
1309 | #define HT_ADD_IE_TYPE 52 | ||
1310 | |||
1311 | |||
1312 | #define HT_BW_ANY 0x04 | ||
1313 | #define HT_RIFS_PERMITTED 0x08 | ||
1314 | |||
1315 | |||
1316 | #define HT_OPMODE_MASK 0x0003 | ||
1317 | #define HT_OPMODE_SHIFT 0 | ||
1318 | #define HT_OPMODE_PURE 0x0000 | ||
1319 | #define HT_OPMODE_OPTIONAL 0x0001 | ||
1320 | #define HT_OPMODE_HT20IN40 0x0002 | ||
1321 | #define HT_OPMODE_MIXED 0x0003 | ||
1322 | #define HT_OPMODE_NONGF 0x0004 | ||
1323 | #define DOT11N_TXBURST 0x0008 | ||
1324 | #define DOT11N_OBSS_NONHT 0x0010 | ||
1325 | |||
1326 | |||
1327 | #define HT_BASIC_STBC_MCS 0x007f | ||
1328 | #define HT_DUAL_STBC_PROT 0x0080 | ||
1329 | #define HT_SECOND_BCN 0x0100 | ||
1330 | #define HT_LSIG_TXOP 0x0200 | ||
1331 | #define HT_PCO_ACTIVE 0x0400 | ||
1332 | #define HT_PCO_PHASE 0x0800 | ||
1333 | #define HT_DUALCTS_PROTECTION 0x0080 | ||
1334 | |||
1335 | |||
1336 | #define DOT11N_2G_TXBURST_LIMIT 6160 | ||
1337 | #define DOT11N_5G_TXBURST_LIMIT 3080 | ||
1338 | |||
1339 | |||
1340 | #define GET_HT_OPMODE(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
1341 | >> HT_OPMODE_SHIFT) | ||
1342 | #define HT_MIXEDMODE_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
1343 | == HT_OPMODE_MIXED) | ||
1344 | #define HT_HT20_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
1345 | == HT_OPMODE_HT20IN40) | ||
1346 | #define HT_OPTIONAL_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
1347 | == HT_OPMODE_OPTIONAL) | ||
1348 | #define HT_USE_PROTECTION(add_ie) (HT_HT20_PRESENT((add_ie)) || \ | ||
1349 | HT_MIXEDMODE_PRESENT((add_ie))) | ||
1350 | #define HT_NONGF_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_NONGF) \ | ||
1351 | == HT_OPMODE_NONGF) | ||
1352 | #define DOT11N_TXBURST_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) \ | ||
1353 | == DOT11N_TXBURST) | ||
1354 | #define DOT11N_OBSS_NONHT_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) \ | ||
1355 | == DOT11N_OBSS_NONHT) | ||
1356 | |||
1357 | BWL_PRE_PACKED_STRUCT struct obss_params { | ||
1358 | uint16 passive_dwell; | ||
1359 | uint16 active_dwell; | ||
1360 | uint16 bss_widthscan_interval; | ||
1361 | uint16 passive_total; | ||
1362 | uint16 active_total; | ||
1363 | uint16 chanwidth_transition_dly; | ||
1364 | uint16 activity_threshold; | ||
1365 | } BWL_POST_PACKED_STRUCT; | ||
1366 | typedef struct obss_params obss_params_t; | ||
1367 | |||
1368 | BWL_PRE_PACKED_STRUCT struct dot11_obss_ie { | ||
1369 | uint8 id; | ||
1370 | uint8 len; | ||
1371 | obss_params_t obss_params; | ||
1372 | } BWL_POST_PACKED_STRUCT; | ||
1373 | typedef struct dot11_obss_ie dot11_obss_ie_t; | ||
1374 | #define DOT11_OBSS_SCAN_IE_LEN sizeof(obss_params_t) | ||
1375 | |||
1376 | |||
1377 | BWL_PRE_PACKED_STRUCT struct vndr_ie { | ||
1378 | uchar id; | ||
1379 | uchar len; | ||
1380 | uchar oui [3]; | ||
1381 | uchar data [1]; | ||
1382 | } BWL_POST_PACKED_STRUCT; | ||
1383 | typedef struct vndr_ie vndr_ie_t; | ||
1384 | |||
1385 | #define VNDR_IE_HDR_LEN 2 | ||
1386 | #define VNDR_IE_MIN_LEN 3 | ||
1387 | #define VNDR_IE_MAX_LEN 256 | ||
1388 | |||
1389 | |||
1390 | #define WPA_VERSION 1 | ||
1391 | #define WPA_OUI "\x00\x50\xF2" | ||
1392 | |||
1393 | #define WPA2_VERSION 1 | ||
1394 | #define WPA2_VERSION_LEN 2 | ||
1395 | #define WPA2_OUI "\x00\x0F\xAC" | ||
1396 | |||
1397 | #define WPA_OUI_LEN 3 | ||
1398 | |||
1399 | |||
1400 | #define RSN_AKM_NONE 0 | ||
1401 | #define RSN_AKM_UNSPECIFIED 1 | ||
1402 | #define RSN_AKM_PSK 2 | ||
1403 | |||
1404 | |||
1405 | #define DOT11_MAX_DEFAULT_KEYS 4 | ||
1406 | #define DOT11_MAX_KEY_SIZE 32 | ||
1407 | #define DOT11_MAX_IV_SIZE 16 | ||
1408 | #define DOT11_EXT_IV_FLAG (1<<5) | ||
1409 | #define DOT11_WPA_KEY_RSC_LEN 8 | ||
1410 | |||
1411 | #define WEP1_KEY_SIZE 5 | ||
1412 | #define WEP1_KEY_HEX_SIZE 10 | ||
1413 | #define WEP128_KEY_SIZE 13 | ||
1414 | #define WEP128_KEY_HEX_SIZE 26 | ||
1415 | #define TKIP_MIC_SIZE 8 | ||
1416 | #define TKIP_EOM_SIZE 7 | ||
1417 | #define TKIP_EOM_FLAG 0x5a | ||
1418 | #define TKIP_KEY_SIZE 32 | ||
1419 | #define TKIP_MIC_AUTH_TX 16 | ||
1420 | #define TKIP_MIC_AUTH_RX 24 | ||
1421 | #define TKIP_MIC_SUP_RX TKIP_MIC_AUTH_TX | ||
1422 | #define TKIP_MIC_SUP_TX TKIP_MIC_AUTH_RX | ||
1423 | #define AES_KEY_SIZE 16 | ||
1424 | #define AES_MIC_SIZE 8 | ||
1425 | |||
1426 | #define SMS4_KEY_LEN 16 | ||
1427 | #define SMS4_WPI_CBC_MAC_LEN 16 | ||
1428 | |||
1429 | |||
1430 | #include <packed_section_end.h> | ||
1431 | |||
1432 | |||
1433 | #endif | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/802.11e.h b/drivers/net/wireless/bcm4329/include/proto/802.11e.h new file mode 100644 index 00000000000..1dd6f45b1ed --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/802.11e.h | |||
@@ -0,0 +1,131 @@ | |||
1 | /* | ||
2 | * 802.11e protocol header file | ||
3 | * | ||
4 | * Copyright (C) 1999-2010, Broadcom Corporation | ||
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 | * $Id: 802.11e.h,v 1.5.56.1 2008/11/20 00:51:18 Exp $ | ||
25 | */ | ||
26 | |||
27 | #ifndef _802_11e_H_ | ||
28 | #define _802_11e_H_ | ||
29 | |||
30 | #ifndef _TYPEDEFS_H_ | ||
31 | #include <typedefs.h> | ||
32 | #endif | ||
33 | |||
34 | /* This marks the start of a packed structure section. */ | ||
35 | #include <packed_section_start.h> | ||
36 | |||
37 | |||
38 | /* WME Traffic Specification (TSPEC) element */ | ||
39 | #define WME_TSPEC_HDR_LEN 2 /* WME TSPEC header length */ | ||
40 | #define WME_TSPEC_BODY_OFF 2 /* WME TSPEC body offset */ | ||
41 | |||
42 | #define WME_CATEGORY_CODE_OFFSET 0 /* WME Category code offset */ | ||
43 | #define WME_ACTION_CODE_OFFSET 1 /* WME Action code offset */ | ||
44 | #define WME_TOKEN_CODE_OFFSET 2 /* WME Token code offset */ | ||
45 | #define WME_STATUS_CODE_OFFSET 3 /* WME Status code offset */ | ||
46 | |||
47 | BWL_PRE_PACKED_STRUCT struct tsinfo { | ||
48 | uint8 octets[3]; | ||
49 | } BWL_POST_PACKED_STRUCT; | ||
50 | |||
51 | typedef struct tsinfo tsinfo_t; | ||
52 | |||
53 | /* 802.11e TSPEC IE */ | ||
54 | typedef BWL_PRE_PACKED_STRUCT struct tspec { | ||
55 | uint8 oui[DOT11_OUI_LEN]; /* WME_OUI */ | ||
56 | uint8 type; /* WME_TYPE */ | ||
57 | uint8 subtype; /* WME_SUBTYPE_TSPEC */ | ||
58 | uint8 version; /* WME_VERSION */ | ||
59 | tsinfo_t tsinfo; /* TS Info bit field */ | ||
60 | uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */ | ||
61 | uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */ | ||
62 | uint32 min_srv_interval; /* Minimum Service Interval (us) */ | ||
63 | uint32 max_srv_interval; /* Maximum Service Interval (us) */ | ||
64 | uint32 inactivity_interval; /* Inactivity Interval (us) */ | ||
65 | uint32 suspension_interval; /* Suspension Interval (us) */ | ||
66 | uint32 srv_start_time; /* Service Start Time (us) */ | ||
67 | uint32 min_data_rate; /* Minimum Data Rate (bps) */ | ||
68 | uint32 mean_data_rate; /* Mean Data Rate (bps) */ | ||
69 | uint32 peak_data_rate; /* Peak Data Rate (bps) */ | ||
70 | uint32 max_burst_size; /* Maximum Burst Size (bytes) */ | ||
71 | uint32 delay_bound; /* Delay Bound (us) */ | ||
72 | uint32 min_phy_rate; /* Minimum PHY Rate (bps) */ | ||
73 | uint16 surplus_bw; /* Surplus Bandwidth Allowance (range 1.0-8.0) */ | ||
74 | uint16 medium_time; /* Medium Time (32 us/s periods) */ | ||
75 | } BWL_POST_PACKED_STRUCT tspec_t; | ||
76 | |||
77 | #define WME_TSPEC_LEN (sizeof(tspec_t)) /* not including 2-bytes of header */ | ||
78 | |||
79 | /* ts_info */ | ||
80 | /* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */ | ||
81 | #define TS_INFO_TID_SHIFT 1 /* TS info. TID shift */ | ||
82 | #define TS_INFO_TID_MASK (0xf << TS_INFO_TID_SHIFT) /* TS info. TID mask */ | ||
83 | #define TS_INFO_CONTENTION_SHIFT 7 /* TS info. contention shift */ | ||
84 | #define TS_INFO_CONTENTION_MASK (0x1 << TS_INFO_CONTENTION_SHIFT) /* TS info. contention mask */ | ||
85 | #define TS_INFO_DIRECTION_SHIFT 5 /* TS info. direction shift */ | ||
86 | #define TS_INFO_DIRECTION_MASK (0x3 << TS_INFO_DIRECTION_SHIFT) /* TS info. direction mask */ | ||
87 | #define TS_INFO_PSB_SHIFT 2 /* TS info. PSB bit Shift */ | ||
88 | #define TS_INFO_PSB_MASK (1 << TS_INFO_PSB_SHIFT) /* TS info. PSB mask */ | ||
89 | #define TS_INFO_UPLINK (0 << TS_INFO_DIRECTION_SHIFT) /* TS info. uplink */ | ||
90 | #define TS_INFO_DOWNLINK (1 << TS_INFO_DIRECTION_SHIFT) /* TS info. downlink */ | ||
91 | #define TS_INFO_BIDIRECTIONAL (3 << TS_INFO_DIRECTION_SHIFT) /* TS info. bidirectional */ | ||
92 | #define TS_INFO_USER_PRIO_SHIFT 3 /* TS info. user priority shift */ | ||
93 | /* TS info. user priority mask */ | ||
94 | #define TS_INFO_USER_PRIO_MASK (0x7 << TS_INFO_USER_PRIO_SHIFT) | ||
95 | |||
96 | /* Macro to get/set bit(s) field in TSINFO */ | ||
97 | #define WLC_CAC_GET_TID(pt) ((((pt).octets[0]) & TS_INFO_TID_MASK) >> TS_INFO_TID_SHIFT) | ||
98 | #define WLC_CAC_GET_DIR(pt) ((((pt).octets[0]) & \ | ||
99 | TS_INFO_DIRECTION_MASK) >> TS_INFO_DIRECTION_SHIFT) | ||
100 | #define WLC_CAC_GET_PSB(pt) ((((pt).octets[1]) & TS_INFO_PSB_MASK) >> TS_INFO_PSB_SHIFT) | ||
101 | #define WLC_CAC_GET_USER_PRIO(pt) ((((pt).octets[1]) & \ | ||
102 | TS_INFO_USER_PRIO_MASK) >> TS_INFO_USER_PRIO_SHIFT) | ||
103 | |||
104 | #define WLC_CAC_SET_TID(pt, id) ((((pt).octets[0]) & (~TS_INFO_TID_MASK)) | \ | ||
105 | ((id) << TS_INFO_TID_SHIFT)) | ||
106 | #define WLC_CAC_SET_USER_PRIO(pt, prio) ((((pt).octets[0]) & (~TS_INFO_USER_PRIO_MASK)) | \ | ||
107 | ((prio) << TS_INFO_USER_PRIO_SHIFT)) | ||
108 | |||
109 | /* 802.11e QBSS Load IE */ | ||
110 | #define QBSS_LOAD_IE_LEN 5 /* QBSS Load IE length */ | ||
111 | #define QBSS_LOAD_AAC_OFF 3 /* AAC offset in IE */ | ||
112 | |||
113 | #define CAC_ADDTS_RESP_TIMEOUT 300 /* default ADDTS response timeout in ms */ | ||
114 | |||
115 | /* 802.11e ADDTS status code */ | ||
116 | #define DOT11E_STATUS_ADMISSION_ACCEPTED 0 /* TSPEC Admission accepted status */ | ||
117 | #define DOT11E_STATUS_ADDTS_INVALID_PARAM 1 /* TSPEC invalid parameter status */ | ||
118 | #define DOT11E_STATUS_ADDTS_REFUSED_NSBW 3 /* ADDTS refused (non-sufficient BW) */ | ||
119 | #define DOT11E_STATUS_ADDTS_REFUSED_AWHILE 47 /* ADDTS refused but could retry later */ | ||
120 | |||
121 | /* 802.11e DELTS status code */ | ||
122 | #define DOT11E_STATUS_QSTA_LEAVE_QBSS 36 /* STA leave QBSS */ | ||
123 | #define DOT11E_STATUS_END_TS 37 /* END TS */ | ||
124 | #define DOT11E_STATUS_UNKNOWN_TS 38 /* UNKNOWN TS */ | ||
125 | #define DOT11E_STATUS_QSTA_REQ_TIMEOUT 39 /* STA ADDTS request timeout */ | ||
126 | |||
127 | |||
128 | /* This marks the end of a packed structure section. */ | ||
129 | #include <packed_section_end.h> | ||
130 | |||
131 | #endif /* _802_11e_CAC_H_ */ | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/802.1d.h b/drivers/net/wireless/bcm4329/include/proto/802.1d.h new file mode 100644 index 00000000000..45c728bc297 --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/802.1d.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999-2010, 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.1D | ||
23 | * | ||
24 | * $Id: 802.1d.h,v 9.3 2007/04/10 21:33:06 Exp $ | ||
25 | */ | ||
26 | |||
27 | |||
28 | #ifndef _802_1_D_ | ||
29 | #define _802_1_D_ | ||
30 | |||
31 | |||
32 | #define PRIO_8021D_NONE 2 | ||
33 | #define PRIO_8021D_BK 1 | ||
34 | #define PRIO_8021D_BE 0 | ||
35 | #define PRIO_8021D_EE 3 | ||
36 | #define PRIO_8021D_CL 4 | ||
37 | #define PRIO_8021D_VI 5 | ||
38 | #define PRIO_8021D_VO 6 | ||
39 | #define PRIO_8021D_NC 7 | ||
40 | #define MAXPRIO 7 | ||
41 | #define NUMPRIO (MAXPRIO + 1) | ||
42 | |||
43 | #define ALLPRIO -1 | ||
44 | |||
45 | |||
46 | #define PRIO2PREC(prio) \ | ||
47 | (((prio) == PRIO_8021D_NONE || (prio) == PRIO_8021D_BE) ? ((prio^2)) : (prio)) | ||
48 | |||
49 | #endif | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/bcmeth.h b/drivers/net/wireless/bcm4329/include/proto/bcmeth.h new file mode 100644 index 00000000000..fdb5a2a5648 --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/bcmeth.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Broadcom Ethernettype protocol definitions | ||
3 | * | ||
4 | * Copyright (C) 1999-2010, Broadcom Corporation | ||
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 | * $Id: bcmeth.h,v 9.9.46.1 2008/11/20 00:51:20 Exp $ | ||
25 | */ | ||
26 | |||
27 | |||
28 | |||
29 | |||
30 | #ifndef _BCMETH_H_ | ||
31 | #define _BCMETH_H_ | ||
32 | |||
33 | #ifndef _TYPEDEFS_H_ | ||
34 | #include <typedefs.h> | ||
35 | #endif | ||
36 | |||
37 | |||
38 | #include <packed_section_start.h> | ||
39 | |||
40 | |||
41 | |||
42 | |||
43 | |||
44 | |||
45 | |||
46 | #define BCMILCP_SUBTYPE_RATE 1 | ||
47 | #define BCMILCP_SUBTYPE_LINK 2 | ||
48 | #define BCMILCP_SUBTYPE_CSA 3 | ||
49 | #define BCMILCP_SUBTYPE_LARQ 4 | ||
50 | #define BCMILCP_SUBTYPE_VENDOR 5 | ||
51 | #define BCMILCP_SUBTYPE_FLH 17 | ||
52 | |||
53 | #define BCMILCP_SUBTYPE_VENDOR_LONG 32769 | ||
54 | #define BCMILCP_SUBTYPE_CERT 32770 | ||
55 | #define BCMILCP_SUBTYPE_SES 32771 | ||
56 | |||
57 | |||
58 | #define BCMILCP_BCM_SUBTYPE_RESERVED 0 | ||
59 | #define BCMILCP_BCM_SUBTYPE_EVENT 1 | ||
60 | #define BCMILCP_BCM_SUBTYPE_SES 2 | ||
61 | |||
62 | |||
63 | #define BCMILCP_BCM_SUBTYPE_DPT 4 | ||
64 | |||
65 | #define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8 | ||
66 | #define BCMILCP_BCM_SUBTYPEHDR_VERSION 0 | ||
67 | |||
68 | |||
69 | typedef BWL_PRE_PACKED_STRUCT struct bcmeth_hdr | ||
70 | { | ||
71 | uint16 subtype; | ||
72 | uint16 length; | ||
73 | uint8 version; | ||
74 | uint8 oui[3]; | ||
75 | |||
76 | uint16 usr_subtype; | ||
77 | } BWL_POST_PACKED_STRUCT bcmeth_hdr_t; | ||
78 | |||
79 | |||
80 | |||
81 | #include <packed_section_end.h> | ||
82 | |||
83 | #endif | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/bcmevent.h b/drivers/net/wireless/bcm4329/include/proto/bcmevent.h new file mode 100644 index 00000000000..1f8ecb14d97 --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/bcmevent.h | |||
@@ -0,0 +1,212 @@ | |||
1 | /* | ||
2 | * Broadcom Event protocol definitions | ||
3 | * | ||
4 | * Copyright (C) 1999-2010, Broadcom Corporation | ||
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 | * Dependencies: proto/bcmeth.h | ||
26 | * | ||
27 | * $Id: bcmevent.h,v 9.34.4.1.20.16.64.1 2010/11/08 21:57:03 Exp $ | ||
28 | * | ||
29 | */ | ||
30 | |||
31 | |||
32 | |||
33 | |||
34 | #ifndef _BCMEVENT_H_ | ||
35 | #define _BCMEVENT_H_ | ||
36 | |||
37 | #ifndef _TYPEDEFS_H_ | ||
38 | #include <typedefs.h> | ||
39 | #endif | ||
40 | |||
41 | |||
42 | #include <packed_section_start.h> | ||
43 | |||
44 | #define BCM_EVENT_MSG_VERSION 1 | ||
45 | #define BCM_MSG_IFNAME_MAX 16 | ||
46 | |||
47 | |||
48 | #define WLC_EVENT_MSG_LINK 0x01 | ||
49 | #define WLC_EVENT_MSG_FLUSHTXQ 0x02 | ||
50 | #define WLC_EVENT_MSG_GROUP 0x04 | ||
51 | |||
52 | |||
53 | typedef BWL_PRE_PACKED_STRUCT struct | ||
54 | { | ||
55 | uint16 version; | ||
56 | uint16 flags; | ||
57 | uint32 event_type; | ||
58 | uint32 status; | ||
59 | uint32 reason; | ||
60 | uint32 auth_type; | ||
61 | uint32 datalen; | ||
62 | struct ether_addr addr; | ||
63 | char ifname[BCM_MSG_IFNAME_MAX]; | ||
64 | } BWL_POST_PACKED_STRUCT wl_event_msg_t; | ||
65 | |||
66 | |||
67 | typedef BWL_PRE_PACKED_STRUCT struct bcm_event { | ||
68 | struct ether_header eth; | ||
69 | bcmeth_hdr_t bcm_hdr; | ||
70 | wl_event_msg_t event; | ||
71 | |||
72 | } BWL_POST_PACKED_STRUCT bcm_event_t; | ||
73 | |||
74 | #define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header)) | ||
75 | |||
76 | |||
77 | #define WLC_E_SET_SSID 0 | ||
78 | #define WLC_E_JOIN 1 | ||
79 | #define WLC_E_START 2 | ||
80 | #define WLC_E_AUTH 3 | ||
81 | #define WLC_E_AUTH_IND 4 | ||
82 | #define WLC_E_DEAUTH 5 | ||
83 | #define WLC_E_DEAUTH_IND 6 | ||
84 | #define WLC_E_ASSOC 7 | ||
85 | #define WLC_E_ASSOC_IND 8 | ||
86 | #define WLC_E_REASSOC 9 | ||
87 | #define WLC_E_REASSOC_IND 10 | ||
88 | #define WLC_E_DISASSOC 11 | ||
89 | #define WLC_E_DISASSOC_IND 12 | ||
90 | #define WLC_E_QUIET_START 13 | ||
91 | #define WLC_E_QUIET_END 14 | ||
92 | #define WLC_E_BEACON_RX 15 | ||
93 | #define WLC_E_LINK 16 | ||
94 | #define WLC_E_MIC_ERROR 17 | ||
95 | #define WLC_E_NDIS_LINK 18 | ||
96 | #define WLC_E_ROAM 19 | ||
97 | #define WLC_E_TXFAIL 20 | ||
98 | #define WLC_E_PMKID_CACHE 21 | ||
99 | #define WLC_E_RETROGRADE_TSF 22 | ||
100 | #define WLC_E_PRUNE 23 | ||
101 | #define WLC_E_AUTOAUTH 24 | ||
102 | #define WLC_E_EAPOL_MSG 25 | ||
103 | #define WLC_E_SCAN_COMPLETE 26 | ||
104 | #define WLC_E_ADDTS_IND 27 | ||
105 | #define WLC_E_DELTS_IND 28 | ||
106 | #define WLC_E_BCNSENT_IND 29 | ||
107 | #define WLC_E_BCNRX_MSG 30 | ||
108 | #define WLC_E_BCNLOST_MSG 31 | ||
109 | #define WLC_E_ROAM_PREP 32 | ||
110 | #define WLC_E_PFN_NET_FOUND 33 | ||
111 | #define WLC_E_PFN_NET_LOST 34 | ||
112 | #define WLC_E_RESET_COMPLETE 35 | ||
113 | #define WLC_E_JOIN_START 36 | ||
114 | #define WLC_E_ROAM_START 37 | ||
115 | #define WLC_E_ASSOC_START 38 | ||
116 | #define WLC_E_IBSS_ASSOC 39 | ||
117 | #define WLC_E_RADIO 40 | ||
118 | #define WLC_E_PSM_WATCHDOG 41 | ||
119 | #define WLC_E_PROBREQ_MSG 44 | ||
120 | #define WLC_E_SCAN_CONFIRM_IND 45 | ||
121 | #define WLC_E_PSK_SUP 46 | ||
122 | #define WLC_E_COUNTRY_CODE_CHANGED 47 | ||
123 | #define WLC_E_EXCEEDED_MEDIUM_TIME 48 | ||
124 | #define WLC_E_ICV_ERROR 49 | ||
125 | #define WLC_E_UNICAST_DECODE_ERROR 50 | ||
126 | #define WLC_E_MULTICAST_DECODE_ERROR 51 | ||
127 | #define WLC_E_TRACE 52 | ||
128 | #define WLC_E_IF 54 | ||
129 | #define WLC_E_RSSI 56 | ||
130 | #define WLC_E_PFN_SCAN_COMPLETE 57 | ||
131 | #define WLC_E_ACTION_FRAME 58 | ||
132 | #define WLC_E_ACTION_FRAME_COMPLETE 59 | ||
133 | |||
134 | #define WLC_E_ESCAN_RESULT 69 | ||
135 | #define WLC_E_WAKE_EVENT 70 | ||
136 | #define WLC_E_RELOAD 71 | ||
137 | #define WLC_E_LAST 72 | ||
138 | |||
139 | |||
140 | |||
141 | #define WLC_E_STATUS_SUCCESS 0 | ||
142 | #define WLC_E_STATUS_FAIL 1 | ||
143 | #define WLC_E_STATUS_TIMEOUT 2 | ||
144 | #define WLC_E_STATUS_NO_NETWORKS 3 | ||
145 | #define WLC_E_STATUS_ABORT 4 | ||
146 | #define WLC_E_STATUS_NO_ACK 5 | ||
147 | #define WLC_E_STATUS_UNSOLICITED 6 | ||
148 | #define WLC_E_STATUS_ATTEMPT 7 | ||
149 | #define WLC_E_STATUS_PARTIAL 8 | ||
150 | #define WLC_E_STATUS_NEWSCAN 9 | ||
151 | #define WLC_E_STATUS_NEWASSOC 10 | ||
152 | #define WLC_E_STATUS_11HQUIET 11 | ||
153 | #define WLC_E_STATUS_SUPPRESS 12 | ||
154 | #define WLC_E_STATUS_NOCHANS 13 | ||
155 | #define WLC_E_STATUS_CCXFASTRM 14 | ||
156 | #define WLC_E_STATUS_CS_ABORT 15 | ||
157 | |||
158 | |||
159 | #define WLC_E_REASON_INITIAL_ASSOC 0 | ||
160 | #define WLC_E_REASON_LOW_RSSI 1 | ||
161 | #define WLC_E_REASON_DEAUTH 2 | ||
162 | #define WLC_E_REASON_DISASSOC 3 | ||
163 | #define WLC_E_REASON_BCNS_LOST 4 | ||
164 | #define WLC_E_REASON_FAST_ROAM_FAILED 5 | ||
165 | #define WLC_E_REASON_DIRECTED_ROAM 6 | ||
166 | #define WLC_E_REASON_TSPEC_REJECTED 7 | ||
167 | #define WLC_E_REASON_BETTER_AP 8 | ||
168 | |||
169 | |||
170 | #define WLC_E_PRUNE_ENCR_MISMATCH 1 | ||
171 | #define WLC_E_PRUNE_BCAST_BSSID 2 | ||
172 | #define WLC_E_PRUNE_MAC_DENY 3 | ||
173 | #define WLC_E_PRUNE_MAC_NA 4 | ||
174 | #define WLC_E_PRUNE_REG_PASSV 5 | ||
175 | #define WLC_E_PRUNE_SPCT_MGMT 6 | ||
176 | #define WLC_E_PRUNE_RADAR 7 | ||
177 | #define WLC_E_RSN_MISMATCH 8 | ||
178 | #define WLC_E_PRUNE_NO_COMMON_RATES 9 | ||
179 | #define WLC_E_PRUNE_BASIC_RATES 10 | ||
180 | #define WLC_E_PRUNE_CIPHER_NA 12 | ||
181 | #define WLC_E_PRUNE_KNOWN_STA 13 | ||
182 | #define WLC_E_PRUNE_WDS_PEER 15 | ||
183 | #define WLC_E_PRUNE_QBSS_LOAD 16 | ||
184 | #define WLC_E_PRUNE_HOME_AP 17 | ||
185 | |||
186 | |||
187 | #define WLC_E_SUP_OTHER 0 | ||
188 | #define WLC_E_SUP_DECRYPT_KEY_DATA 1 | ||
189 | #define WLC_E_SUP_BAD_UCAST_WEP128 2 | ||
190 | #define WLC_E_SUP_BAD_UCAST_WEP40 3 | ||
191 | #define WLC_E_SUP_UNSUP_KEY_LEN 4 | ||
192 | #define WLC_E_SUP_PW_KEY_CIPHER 5 | ||
193 | #define WLC_E_SUP_MSG3_TOO_MANY_IE 6 | ||
194 | #define WLC_E_SUP_MSG3_IE_MISMATCH 7 | ||
195 | #define WLC_E_SUP_NO_INSTALL_FLAG 8 | ||
196 | #define WLC_E_SUP_MSG3_NO_GTK 9 | ||
197 | #define WLC_E_SUP_GRP_KEY_CIPHER 10 | ||
198 | #define WLC_E_SUP_GRP_MSG1_NO_GTK 11 | ||
199 | #define WLC_E_SUP_GTK_DECRYPT_FAIL 12 | ||
200 | #define WLC_E_SUP_SEND_FAIL 13 | ||
201 | #define WLC_E_SUP_DEAUTH 14 | ||
202 | #define WLC_E_SUP_WPA_PSK_TMO 15 | ||
203 | |||
204 | |||
205 | #define WLC_E_IF_ADD 1 | ||
206 | #define WLC_E_IF_DEL 2 | ||
207 | |||
208 | #define WLC_E_RELOAD_STATUS1 1 | ||
209 | |||
210 | #include <packed_section_end.h> | ||
211 | |||
212 | #endif | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/bcmip.h b/drivers/net/wireless/bcm4329/include/proto/bcmip.h new file mode 100644 index 00000000000..9d2fd6fba48 --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/bcmip.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999-2010, 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 constants relating to IP Protocol | ||
23 | * | ||
24 | * $Id: bcmip.h,v 9.16.186.4 2009/01/27 04:25:25 Exp $ | ||
25 | */ | ||
26 | |||
27 | |||
28 | #ifndef _bcmip_h_ | ||
29 | #define _bcmip_h_ | ||
30 | |||
31 | #ifndef _TYPEDEFS_H_ | ||
32 | #include <typedefs.h> | ||
33 | #endif | ||
34 | |||
35 | |||
36 | #include <packed_section_start.h> | ||
37 | |||
38 | |||
39 | |||
40 | #define IP_VER_OFFSET 0x0 | ||
41 | #define IP_VER_MASK 0xf0 | ||
42 | #define IP_VER_SHIFT 4 | ||
43 | #define IP_VER_4 4 | ||
44 | #define IP_VER_6 6 | ||
45 | |||
46 | #define IP_VER(ip_body) \ | ||
47 | ((((uint8 *)(ip_body))[IP_VER_OFFSET] & IP_VER_MASK) >> IP_VER_SHIFT) | ||
48 | |||
49 | #define IP_PROT_ICMP 0x1 | ||
50 | #define IP_PROT_TCP 0x6 | ||
51 | #define IP_PROT_UDP 0x11 | ||
52 | |||
53 | |||
54 | #define IPV4_VER_HL_OFFSET 0 | ||
55 | #define IPV4_TOS_OFFSET 1 | ||
56 | #define IPV4_PKTLEN_OFFSET 2 | ||
57 | #define IPV4_PKTFLAG_OFFSET 6 | ||
58 | #define IPV4_PROT_OFFSET 9 | ||
59 | #define IPV4_CHKSUM_OFFSET 10 | ||
60 | #define IPV4_SRC_IP_OFFSET 12 | ||
61 | #define IPV4_DEST_IP_OFFSET 16 | ||
62 | #define IPV4_OPTIONS_OFFSET 20 | ||
63 | |||
64 | |||
65 | #define IPV4_VER_MASK 0xf0 | ||
66 | #define IPV4_VER_SHIFT 4 | ||
67 | |||
68 | #define IPV4_HLEN_MASK 0x0f | ||
69 | #define IPV4_HLEN(ipv4_body) (4 * (((uint8 *)(ipv4_body))[IPV4_VER_HL_OFFSET] & IPV4_HLEN_MASK)) | ||
70 | |||
71 | #define IPV4_ADDR_LEN 4 | ||
72 | |||
73 | #define IPV4_ADDR_NULL(a) ((((uint8 *)(a))[0] | ((uint8 *)(a))[1] | \ | ||
74 | ((uint8 *)(a))[2] | ((uint8 *)(a))[3]) == 0) | ||
75 | |||
76 | #define IPV4_ADDR_BCAST(a) ((((uint8 *)(a))[0] & ((uint8 *)(a))[1] & \ | ||
77 | ((uint8 *)(a))[2] & ((uint8 *)(a))[3]) == 0xff) | ||
78 | |||
79 | #define IPV4_TOS_DSCP_MASK 0xfc | ||
80 | #define IPV4_TOS_DSCP_SHIFT 2 | ||
81 | |||
82 | #define IPV4_TOS(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_TOS_OFFSET]) | ||
83 | |||
84 | #define IPV4_TOS_PREC_MASK 0xe0 | ||
85 | #define IPV4_TOS_PREC_SHIFT 5 | ||
86 | |||
87 | #define IPV4_TOS_LOWDELAY 0x10 | ||
88 | #define IPV4_TOS_THROUGHPUT 0x8 | ||
89 | #define IPV4_TOS_RELIABILITY 0x4 | ||
90 | |||
91 | #define IPV4_PROT(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_PROT_OFFSET]) | ||
92 | |||
93 | #define IPV4_FRAG_RESV 0x8000 | ||
94 | #define IPV4_FRAG_DONT 0x4000 | ||
95 | #define IPV4_FRAG_MORE 0x2000 | ||
96 | #define IPV4_FRAG_OFFSET_MASK 0x1fff | ||
97 | |||
98 | #define IPV4_ADDR_STR_LEN 16 | ||
99 | |||
100 | |||
101 | BWL_PRE_PACKED_STRUCT struct ipv4_addr { | ||
102 | uint8 addr[IPV4_ADDR_LEN]; | ||
103 | } BWL_POST_PACKED_STRUCT; | ||
104 | |||
105 | BWL_PRE_PACKED_STRUCT struct ipv4_hdr { | ||
106 | uint8 version_ihl; | ||
107 | uint8 tos; | ||
108 | uint16 tot_len; | ||
109 | uint16 id; | ||
110 | uint16 frag; | ||
111 | uint8 ttl; | ||
112 | uint8 prot; | ||
113 | uint16 hdr_chksum; | ||
114 | uint8 src_ip[IPV4_ADDR_LEN]; | ||
115 | uint8 dst_ip[IPV4_ADDR_LEN]; | ||
116 | } BWL_POST_PACKED_STRUCT; | ||
117 | |||
118 | |||
119 | #define IPV6_PAYLOAD_LEN_OFFSET 4 | ||
120 | #define IPV6_NEXT_HDR_OFFSET 6 | ||
121 | #define IPV6_HOP_LIMIT_OFFSET 7 | ||
122 | #define IPV6_SRC_IP_OFFSET 8 | ||
123 | #define IPV6_DEST_IP_OFFSET 24 | ||
124 | |||
125 | |||
126 | #define IPV6_TRAFFIC_CLASS(ipv6_body) \ | ||
127 | (((((uint8 *)(ipv6_body))[0] & 0x0f) << 4) | \ | ||
128 | ((((uint8 *)(ipv6_body))[1] & 0xf0) >> 4)) | ||
129 | |||
130 | #define IPV6_FLOW_LABEL(ipv6_body) \ | ||
131 | (((((uint8 *)(ipv6_body))[1] & 0x0f) << 16) | \ | ||
132 | (((uint8 *)(ipv6_body))[2] << 8) | \ | ||
133 | (((uint8 *)(ipv6_body))[3])) | ||
134 | |||
135 | #define IPV6_PAYLOAD_LEN(ipv6_body) \ | ||
136 | ((((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 0] << 8) | \ | ||
137 | ((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 1]) | ||
138 | |||
139 | #define IPV6_NEXT_HDR(ipv6_body) \ | ||
140 | (((uint8 *)(ipv6_body))[IPV6_NEXT_HDR_OFFSET]) | ||
141 | |||
142 | #define IPV6_PROT(ipv6_body) IPV6_NEXT_HDR(ipv6_body) | ||
143 | |||
144 | #define IPV6_ADDR_LEN 16 | ||
145 | |||
146 | |||
147 | #ifndef IP_TOS | ||
148 | #define IP_TOS(ip_body) \ | ||
149 | (IP_VER(ip_body) == IP_VER_4 ? IPV4_TOS(ip_body) : \ | ||
150 | IP_VER(ip_body) == IP_VER_6 ? IPV6_TRAFFIC_CLASS(ip_body) : 0) | ||
151 | #endif | ||
152 | |||
153 | |||
154 | |||
155 | #include <packed_section_end.h> | ||
156 | |||
157 | #endif | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/eapol.h b/drivers/net/wireless/bcm4329/include/proto/eapol.h new file mode 100644 index 00000000000..95e76ff18c6 --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/eapol.h | |||
@@ -0,0 +1,172 @@ | |||
1 | /* | ||
2 | * 802.1x EAPOL definitions | ||
3 | * | ||
4 | * See | ||
5 | * IEEE Std 802.1X-2001 | ||
6 | * IEEE 802.1X RADIUS Usage Guidelines | ||
7 | * | ||
8 | * Copyright (C) 2002 Broadcom Corporation | ||
9 | * | ||
10 | * $Id: eapol.h,v 9.18.260.1.2.1.6.6 2009/04/08 05:00:08 Exp $ | ||
11 | */ | ||
12 | |||
13 | #ifndef _eapol_h_ | ||
14 | #define _eapol_h_ | ||
15 | |||
16 | #ifndef _TYPEDEFS_H_ | ||
17 | #include <typedefs.h> | ||
18 | #endif | ||
19 | |||
20 | /* This marks the start of a packed structure section. */ | ||
21 | #include <packed_section_start.h> | ||
22 | |||
23 | #define AKW_BLOCK_LEN 8 /* The only def we need here */ | ||
24 | |||
25 | /* EAPOL for 802.3/Ethernet */ | ||
26 | typedef struct { | ||
27 | struct ether_header eth; /* 802.3/Ethernet header */ | ||
28 | unsigned char version; /* EAPOL protocol version */ | ||
29 | unsigned char type; /* EAPOL type */ | ||
30 | unsigned short length; /* Length of body */ | ||
31 | unsigned char body[1]; /* Body (optional) */ | ||
32 | } eapol_header_t; | ||
33 | |||
34 | #define EAPOL_HEADER_LEN 18 | ||
35 | |||
36 | /* EAPOL version */ | ||
37 | #define WPA2_EAPOL_VERSION 2 | ||
38 | #define WPA_EAPOL_VERSION 1 | ||
39 | #define LEAP_EAPOL_VERSION 1 | ||
40 | #define SES_EAPOL_VERSION 1 | ||
41 | |||
42 | /* EAPOL types */ | ||
43 | #define EAP_PACKET 0 | ||
44 | #define EAPOL_START 1 | ||
45 | #define EAPOL_LOGOFF 2 | ||
46 | #define EAPOL_KEY 3 | ||
47 | #define EAPOL_ASF 4 | ||
48 | |||
49 | /* EAPOL-Key types */ | ||
50 | #define EAPOL_RC4_KEY 1 | ||
51 | #define EAPOL_WPA2_KEY 2 /* 802.11i/WPA2 */ | ||
52 | #define EAPOL_WPA_KEY 254 /* WPA */ | ||
53 | |||
54 | /* RC4 EAPOL-Key header field sizes */ | ||
55 | #define EAPOL_KEY_REPLAY_LEN 8 | ||
56 | #define EAPOL_KEY_IV_LEN 16 | ||
57 | #define EAPOL_KEY_SIG_LEN 16 | ||
58 | |||
59 | /* RC4 EAPOL-Key */ | ||
60 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
61 | unsigned char type; /* Key Descriptor Type */ | ||
62 | unsigned short length; /* Key Length (unaligned) */ | ||
63 | unsigned char replay[EAPOL_KEY_REPLAY_LEN]; /* Replay Counter */ | ||
64 | unsigned char iv[EAPOL_KEY_IV_LEN]; /* Key IV */ | ||
65 | unsigned char index; /* Key Flags & Index */ | ||
66 | unsigned char signature[EAPOL_KEY_SIG_LEN]; /* Key Signature */ | ||
67 | unsigned char key[1]; /* Key (optional) */ | ||
68 | } BWL_POST_PACKED_STRUCT eapol_key_header_t; | ||
69 | |||
70 | #define EAPOL_KEY_HEADER_LEN 44 | ||
71 | |||
72 | /* RC4 EAPOL-Key flags */ | ||
73 | #define EAPOL_KEY_FLAGS_MASK 0x80 | ||
74 | #define EAPOL_KEY_BROADCAST 0 | ||
75 | #define EAPOL_KEY_UNICAST 0x80 | ||
76 | |||
77 | /* RC4 EAPOL-Key index */ | ||
78 | #define EAPOL_KEY_INDEX_MASK 0x7f | ||
79 | |||
80 | /* WPA/802.11i/WPA2 EAPOL-Key header field sizes */ | ||
81 | #define EAPOL_WPA_KEY_REPLAY_LEN 8 | ||
82 | #define EAPOL_WPA_KEY_NONCE_LEN 32 | ||
83 | #define EAPOL_WPA_KEY_IV_LEN 16 | ||
84 | #define EAPOL_WPA_KEY_ID_LEN 8 | ||
85 | #define EAPOL_WPA_KEY_RSC_LEN 8 | ||
86 | #define EAPOL_WPA_KEY_MIC_LEN 16 | ||
87 | #define EAPOL_WPA_KEY_DATA_LEN (EAPOL_WPA_MAX_KEY_SIZE + AKW_BLOCK_LEN) | ||
88 | #define EAPOL_WPA_MAX_KEY_SIZE 32 | ||
89 | |||
90 | /* WPA EAPOL-Key */ | ||
91 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
92 | unsigned char type; /* Key Descriptor Type */ | ||
93 | unsigned short key_info; /* Key Information (unaligned) */ | ||
94 | unsigned short key_len; /* Key Length (unaligned) */ | ||
95 | unsigned char replay[EAPOL_WPA_KEY_REPLAY_LEN]; /* Replay Counter */ | ||
96 | unsigned char nonce[EAPOL_WPA_KEY_NONCE_LEN]; /* Nonce */ | ||
97 | unsigned char iv[EAPOL_WPA_KEY_IV_LEN]; /* Key IV */ | ||
98 | unsigned char rsc[EAPOL_WPA_KEY_RSC_LEN]; /* Key RSC */ | ||
99 | unsigned char id[EAPOL_WPA_KEY_ID_LEN]; /* WPA:Key ID, 802.11i/WPA2: Reserved */ | ||
100 | unsigned char mic[EAPOL_WPA_KEY_MIC_LEN]; /* Key MIC */ | ||
101 | unsigned short data_len; /* Key Data Length */ | ||
102 | unsigned char data[EAPOL_WPA_KEY_DATA_LEN]; /* Key data */ | ||
103 | } BWL_POST_PACKED_STRUCT eapol_wpa_key_header_t; | ||
104 | |||
105 | #define EAPOL_WPA_KEY_LEN 95 | ||
106 | |||
107 | /* WPA/802.11i/WPA2 KEY KEY_INFO bits */ | ||
108 | #define WPA_KEY_DESC_V1 0x01 | ||
109 | #define WPA_KEY_DESC_V2 0x02 | ||
110 | #define WPA_KEY_PAIRWISE 0x08 | ||
111 | #define WPA_KEY_INSTALL 0x40 | ||
112 | #define WPA_KEY_ACK 0x80 | ||
113 | #define WPA_KEY_MIC 0x100 | ||
114 | #define WPA_KEY_SECURE 0x200 | ||
115 | #define WPA_KEY_ERROR 0x400 | ||
116 | #define WPA_KEY_REQ 0x800 | ||
117 | |||
118 | /* WPA-only KEY KEY_INFO bits */ | ||
119 | #define WPA_KEY_INDEX_0 0x00 | ||
120 | #define WPA_KEY_INDEX_1 0x10 | ||
121 | #define WPA_KEY_INDEX_2 0x20 | ||
122 | #define WPA_KEY_INDEX_3 0x30 | ||
123 | #define WPA_KEY_INDEX_MASK 0x30 | ||
124 | #define WPA_KEY_INDEX_SHIFT 0x04 | ||
125 | |||
126 | /* 802.11i/WPA2-only KEY KEY_INFO bits */ | ||
127 | #define WPA_KEY_ENCRYPTED_DATA 0x1000 | ||
128 | |||
129 | /* Key Data encapsulation */ | ||
130 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
131 | uint8 type; | ||
132 | uint8 length; | ||
133 | uint8 oui[3]; | ||
134 | uint8 subtype; | ||
135 | uint8 data[1]; | ||
136 | } BWL_POST_PACKED_STRUCT eapol_wpa2_encap_data_t; | ||
137 | |||
138 | #define EAPOL_WPA2_ENCAP_DATA_HDR_LEN 6 | ||
139 | |||
140 | #define WPA2_KEY_DATA_SUBTYPE_GTK 1 | ||
141 | #define WPA2_KEY_DATA_SUBTYPE_STAKEY 2 | ||
142 | #define WPA2_KEY_DATA_SUBTYPE_MAC 3 | ||
143 | #define WPA2_KEY_DATA_SUBTYPE_PMKID 4 | ||
144 | |||
145 | /* GTK encapsulation */ | ||
146 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
147 | uint8 flags; | ||
148 | uint8 reserved; | ||
149 | uint8 gtk[EAPOL_WPA_MAX_KEY_SIZE]; | ||
150 | } BWL_POST_PACKED_STRUCT eapol_wpa2_key_gtk_encap_t; | ||
151 | |||
152 | #define EAPOL_WPA2_KEY_GTK_ENCAP_HDR_LEN 2 | ||
153 | |||
154 | #define WPA2_GTK_INDEX_MASK 0x03 | ||
155 | #define WPA2_GTK_INDEX_SHIFT 0x00 | ||
156 | |||
157 | #define WPA2_GTK_TRANSMIT 0x04 | ||
158 | |||
159 | /* STAKey encapsulation */ | ||
160 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
161 | uint8 reserved[2]; | ||
162 | uint8 mac[ETHER_ADDR_LEN]; | ||
163 | uint8 stakey[EAPOL_WPA_MAX_KEY_SIZE]; | ||
164 | } BWL_POST_PACKED_STRUCT eapol_wpa2_key_stakey_encap_t; | ||
165 | |||
166 | #define WPA2_KEY_DATA_PAD 0xdd | ||
167 | |||
168 | |||
169 | /* This marks the end of a packed structure section. */ | ||
170 | #include <packed_section_end.h> | ||
171 | |||
172 | #endif /* _eapol_h_ */ | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/ethernet.h b/drivers/net/wireless/bcm4329/include/proto/ethernet.h new file mode 100644 index 00000000000..9ad2ea0c70f --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/ethernet.h | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | * From FreeBSD 2.2.7: Fundamental constants relating to ethernet. | ||
3 | * | ||
4 | * Copyright (C) 1999-2010, Broadcom Corporation | ||
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 | * $Id: ethernet.h,v 9.45.56.5 2010/02/22 22:04:36 Exp $ | ||
25 | */ | ||
26 | |||
27 | |||
28 | #ifndef _NET_ETHERNET_H_ | ||
29 | #define _NET_ETHERNET_H_ | ||
30 | |||
31 | #ifndef _TYPEDEFS_H_ | ||
32 | #include "typedefs.h" | ||
33 | #endif | ||
34 | |||
35 | |||
36 | #include <packed_section_start.h> | ||
37 | |||
38 | |||
39 | |||
40 | #define ETHER_ADDR_LEN 6 | ||
41 | |||
42 | |||
43 | #define ETHER_TYPE_LEN 2 | ||
44 | |||
45 | |||
46 | #define ETHER_CRC_LEN 4 | ||
47 | |||
48 | |||
49 | #define ETHER_HDR_LEN (ETHER_ADDR_LEN * 2 + ETHER_TYPE_LEN) | ||
50 | |||
51 | |||
52 | #define ETHER_MIN_LEN 64 | ||
53 | |||
54 | |||
55 | #define ETHER_MIN_DATA 46 | ||
56 | |||
57 | |||
58 | #define ETHER_MAX_LEN 1518 | ||
59 | |||
60 | |||
61 | #define ETHER_MAX_DATA 1500 | ||
62 | |||
63 | |||
64 | #define ETHER_TYPE_MIN 0x0600 | ||
65 | #define ETHER_TYPE_IP 0x0800 | ||
66 | #define ETHER_TYPE_ARP 0x0806 | ||
67 | #define ETHER_TYPE_8021Q 0x8100 | ||
68 | #define ETHER_TYPE_BRCM 0x886c | ||
69 | #define ETHER_TYPE_802_1X 0x888e | ||
70 | #define ETHER_TYPE_WAI 0x88b4 | ||
71 | #ifdef BCMWPA2 | ||
72 | #define ETHER_TYPE_802_1X_PREAUTH 0x88c7 | ||
73 | #endif | ||
74 | |||
75 | |||
76 | #define ETHER_BRCM_SUBTYPE_LEN 4 | ||
77 | #define ETHER_BRCM_CRAM 1 | ||
78 | |||
79 | |||
80 | #define ETHER_DEST_OFFSET (0 * ETHER_ADDR_LEN) | ||
81 | #define ETHER_SRC_OFFSET (1 * ETHER_ADDR_LEN) | ||
82 | #define ETHER_TYPE_OFFSET (2 * ETHER_ADDR_LEN) | ||
83 | |||
84 | |||
85 | #define ETHER_IS_VALID_LEN(foo) \ | ||
86 | ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN) | ||
87 | |||
88 | |||
89 | #ifndef __INCif_etherh | ||
90 | |||
91 | BWL_PRE_PACKED_STRUCT struct ether_header { | ||
92 | uint8 ether_dhost[ETHER_ADDR_LEN]; | ||
93 | uint8 ether_shost[ETHER_ADDR_LEN]; | ||
94 | uint16 ether_type; | ||
95 | } BWL_POST_PACKED_STRUCT; | ||
96 | |||
97 | |||
98 | BWL_PRE_PACKED_STRUCT struct ether_addr { | ||
99 | uint8 octet[ETHER_ADDR_LEN]; | ||
100 | } BWL_POST_PACKED_STRUCT; | ||
101 | #endif | ||
102 | |||
103 | |||
104 | #define ETHER_SET_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] | 2)) | ||
105 | #define ETHER_IS_LOCALADDR(ea) (((uint8 *)(ea))[0] & 2) | ||
106 | #define ETHER_CLR_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & 0xd)) | ||
107 | #define ETHER_TOGGLE_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] ^ 2)) | ||
108 | |||
109 | |||
110 | #define ETHER_SET_UNICAST(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & ~1)) | ||
111 | |||
112 | |||
113 | #define ETHER_ISMULTI(ea) (((const uint8 *)(ea))[0] & 1) | ||
114 | |||
115 | |||
116 | |||
117 | #define ether_cmp(a, b) (!(((short*)a)[0] == ((short*)b)[0]) | \ | ||
118 | !(((short*)a)[1] == ((short*)b)[1]) | \ | ||
119 | !(((short*)a)[2] == ((short*)b)[2])) | ||
120 | |||
121 | |||
122 | #define ether_copy(s, d) { \ | ||
123 | ((short*)d)[0] = ((short*)s)[0]; \ | ||
124 | ((short*)d)[1] = ((short*)s)[1]; \ | ||
125 | ((short*)d)[2] = ((short*)s)[2]; } | ||
126 | |||
127 | |||
128 | static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}}; | ||
129 | static const struct ether_addr ether_null = {{0, 0, 0, 0, 0, 0}}; | ||
130 | |||
131 | #define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] & \ | ||
132 | ((uint8 *)(ea))[1] & \ | ||
133 | ((uint8 *)(ea))[2] & \ | ||
134 | ((uint8 *)(ea))[3] & \ | ||
135 | ((uint8 *)(ea))[4] & \ | ||
136 | ((uint8 *)(ea))[5]) == 0xff) | ||
137 | #define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] | \ | ||
138 | ((uint8 *)(ea))[1] | \ | ||
139 | ((uint8 *)(ea))[2] | \ | ||
140 | ((uint8 *)(ea))[3] | \ | ||
141 | ((uint8 *)(ea))[4] | \ | ||
142 | ((uint8 *)(ea))[5]) == 0) | ||
143 | |||
144 | |||
145 | |||
146 | #include <packed_section_end.h> | ||
147 | |||
148 | #endif | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/sdspi.h b/drivers/net/wireless/bcm4329/include/proto/sdspi.h new file mode 100644 index 00000000000..7739e68a244 --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/sdspi.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * SD-SPI Protocol Standard | ||
3 | * | ||
4 | * Copyright (C) 1999-2010, Broadcom Corporation | ||
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 | * $Id: sdspi.h,v 9.1.20.1 2008/05/06 22:59:19 Exp $ | ||
25 | */ | ||
26 | |||
27 | #define SPI_START_M BITFIELD_MASK(1) /* Bit [31] - Start Bit */ | ||
28 | #define SPI_START_S 31 | ||
29 | #define SPI_DIR_M BITFIELD_MASK(1) /* Bit [30] - Direction */ | ||
30 | #define SPI_DIR_S 30 | ||
31 | #define SPI_CMD_INDEX_M BITFIELD_MASK(6) /* Bits [29:24] - Command number */ | ||
32 | #define SPI_CMD_INDEX_S 24 | ||
33 | #define SPI_RW_M BITFIELD_MASK(1) /* Bit [23] - Read=0, Write=1 */ | ||
34 | #define SPI_RW_S 23 | ||
35 | #define SPI_FUNC_M BITFIELD_MASK(3) /* Bits [22:20] - Function Number */ | ||
36 | #define SPI_FUNC_S 20 | ||
37 | #define SPI_RAW_M BITFIELD_MASK(1) /* Bit [19] - Read After Wr */ | ||
38 | #define SPI_RAW_S 19 | ||
39 | #define SPI_STUFF_M BITFIELD_MASK(1) /* Bit [18] - Stuff bit */ | ||
40 | #define SPI_STUFF_S 18 | ||
41 | #define SPI_BLKMODE_M BITFIELD_MASK(1) /* Bit [19] - Blockmode 1=blk */ | ||
42 | #define SPI_BLKMODE_S 19 | ||
43 | #define SPI_OPCODE_M BITFIELD_MASK(1) /* Bit [18] - OP Code */ | ||
44 | #define SPI_OPCODE_S 18 | ||
45 | #define SPI_ADDR_M BITFIELD_MASK(17) /* Bits [17:1] - Address */ | ||
46 | #define SPI_ADDR_S 1 | ||
47 | #define SPI_STUFF0_M BITFIELD_MASK(1) /* Bit [0] - Stuff bit */ | ||
48 | #define SPI_STUFF0_S 0 | ||
49 | |||
50 | #define SPI_RSP_START_M BITFIELD_MASK(1) /* Bit [7] - Start Bit (always 0) */ | ||
51 | #define SPI_RSP_START_S 7 | ||
52 | #define SPI_RSP_PARAM_ERR_M BITFIELD_MASK(1) /* Bit [6] - Parameter Error */ | ||
53 | #define SPI_RSP_PARAM_ERR_S 6 | ||
54 | #define SPI_RSP_RFU5_M BITFIELD_MASK(1) /* Bit [5] - RFU (Always 0) */ | ||
55 | #define SPI_RSP_RFU5_S 5 | ||
56 | #define SPI_RSP_FUNC_ERR_M BITFIELD_MASK(1) /* Bit [4] - Function number error */ | ||
57 | #define SPI_RSP_FUNC_ERR_S 4 | ||
58 | #define SPI_RSP_CRC_ERR_M BITFIELD_MASK(1) /* Bit [3] - COM CRC Error */ | ||
59 | #define SPI_RSP_CRC_ERR_S 3 | ||
60 | #define SPI_RSP_ILL_CMD_M BITFIELD_MASK(1) /* Bit [2] - Illegal Command error */ | ||
61 | #define SPI_RSP_ILL_CMD_S 2 | ||
62 | #define SPI_RSP_RFU1_M BITFIELD_MASK(1) /* Bit [1] - RFU (Always 0) */ | ||
63 | #define SPI_RSP_RFU1_S 1 | ||
64 | #define SPI_RSP_IDLE_M BITFIELD_MASK(1) /* Bit [0] - In idle state */ | ||
65 | #define SPI_RSP_IDLE_S 0 | ||
66 | |||
67 | /* SD-SPI Protocol Definitions */ | ||
68 | #define SDSPI_COMMAND_LEN 6 /* Number of bytes in an SD command */ | ||
69 | #define SDSPI_START_BLOCK 0xFE /* SD Start Block Token */ | ||
70 | #define SDSPI_IDLE_PAD 0xFF /* SD-SPI idle value for MOSI */ | ||
71 | #define SDSPI_START_BIT_MASK 0x80 | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/vlan.h b/drivers/net/wireless/bcm4329/include/proto/vlan.h new file mode 100644 index 00000000000..670bc44c6bd --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/vlan.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * 802.1Q VLAN protocol definitions | ||
3 | * | ||
4 | * Copyright (C) 1999-2010, Broadcom Corporation | ||
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 | * $Id: vlan.h,v 9.4.196.2 2008/12/07 21:19:20 Exp $ | ||
25 | */ | ||
26 | |||
27 | |||
28 | #ifndef _vlan_h_ | ||
29 | #define _vlan_h_ | ||
30 | |||
31 | #ifndef _TYPEDEFS_H_ | ||
32 | #include <typedefs.h> | ||
33 | #endif | ||
34 | |||
35 | |||
36 | #include <packed_section_start.h> | ||
37 | |||
38 | #define VLAN_VID_MASK 0xfff | ||
39 | #define VLAN_CFI_SHIFT 12 | ||
40 | #define VLAN_PRI_SHIFT 13 | ||
41 | |||
42 | #define VLAN_PRI_MASK 7 | ||
43 | |||
44 | #define VLAN_TAG_LEN 4 | ||
45 | #define VLAN_TAG_OFFSET (2 * ETHER_ADDR_LEN) | ||
46 | |||
47 | #define VLAN_TPID 0x8100 | ||
48 | |||
49 | struct ethervlan_header { | ||
50 | uint8 ether_dhost[ETHER_ADDR_LEN]; | ||
51 | uint8 ether_shost[ETHER_ADDR_LEN]; | ||
52 | uint16 vlan_type; | ||
53 | uint16 vlan_tag; | ||
54 | uint16 ether_type; | ||
55 | }; | ||
56 | |||
57 | #define ETHERVLAN_HDR_LEN (ETHER_HDR_LEN + VLAN_TAG_LEN) | ||
58 | |||
59 | |||
60 | |||
61 | #include <packed_section_end.h> | ||
62 | |||
63 | #endif | ||
diff --git a/drivers/net/wireless/bcm4329/include/proto/wpa.h b/drivers/net/wireless/bcm4329/include/proto/wpa.h new file mode 100644 index 00000000000..f5d0cd53977 --- /dev/null +++ b/drivers/net/wireless/bcm4329/include/proto/wpa.h | |||
@@ -0,0 +1,159 @@ | |||
1 | /* | ||
2 | * Fundamental types and constants relating to WPA | ||
3 | * | ||
4 | * Copyright (C) 1999-2010, Broadcom Corporation | ||
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 | * $Id: wpa.h,v 1.16.166.1.20.1 2008/11/20 00:51:31 Exp $ | ||
25 | */ | ||
26 | |||
27 | |||
28 | #ifndef _proto_wpa_h_ | ||
29 | #define _proto_wpa_h_ | ||
30 | |||
31 | #include <typedefs.h> | ||
32 | #include <proto/ethernet.h> | ||
33 | |||
34 | |||
35 | |||
36 | #include <packed_section_start.h> | ||
37 | |||
38 | |||
39 | |||
40 | |||
41 | #define DOT11_RC_INVALID_WPA_IE 13 | ||
42 | #define DOT11_RC_MIC_FAILURE 14 | ||
43 | #define DOT11_RC_4WH_TIMEOUT 15 | ||
44 | #define DOT11_RC_GTK_UPDATE_TIMEOUT 16 | ||
45 | #define DOT11_RC_WPA_IE_MISMATCH 17 | ||
46 | #define DOT11_RC_INVALID_MC_CIPHER 18 | ||
47 | #define DOT11_RC_INVALID_UC_CIPHER 19 | ||
48 | #define DOT11_RC_INVALID_AKMP 20 | ||
49 | #define DOT11_RC_BAD_WPA_VERSION 21 | ||
50 | #define DOT11_RC_INVALID_WPA_CAP 22 | ||
51 | #define DOT11_RC_8021X_AUTH_FAIL 23 | ||
52 | |||
53 | #define WPA2_PMKID_LEN 16 | ||
54 | |||
55 | |||
56 | typedef BWL_PRE_PACKED_STRUCT struct | ||
57 | { | ||
58 | uint8 tag; | ||
59 | uint8 length; | ||
60 | uint8 oui[3]; | ||
61 | uint8 oui_type; | ||
62 | BWL_PRE_PACKED_STRUCT struct { | ||
63 | uint8 low; | ||
64 | uint8 high; | ||
65 | } BWL_POST_PACKED_STRUCT version; | ||
66 | } BWL_POST_PACKED_STRUCT wpa_ie_fixed_t; | ||
67 | #define WPA_IE_OUITYPE_LEN 4 | ||
68 | #define WPA_IE_FIXED_LEN 8 | ||
69 | #define WPA_IE_TAG_FIXED_LEN 6 | ||
70 | |||
71 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
72 | uint8 tag; | ||
73 | uint8 length; | ||
74 | BWL_PRE_PACKED_STRUCT struct { | ||
75 | uint8 low; | ||
76 | uint8 high; | ||
77 | } BWL_POST_PACKED_STRUCT version; | ||
78 | } BWL_POST_PACKED_STRUCT wpa_rsn_ie_fixed_t; | ||
79 | #define WPA_RSN_IE_FIXED_LEN 4 | ||
80 | #define WPA_RSN_IE_TAG_FIXED_LEN 2 | ||
81 | typedef uint8 wpa_pmkid_t[WPA2_PMKID_LEN]; | ||
82 | |||
83 | |||
84 | typedef BWL_PRE_PACKED_STRUCT struct | ||
85 | { | ||
86 | uint8 oui[3]; | ||
87 | uint8 type; | ||
88 | } BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t; | ||
89 | #define WPA_SUITE_LEN 4 | ||
90 | |||
91 | |||
92 | typedef BWL_PRE_PACKED_STRUCT struct | ||
93 | { | ||
94 | BWL_PRE_PACKED_STRUCT struct { | ||
95 | uint8 low; | ||
96 | uint8 high; | ||
97 | } BWL_POST_PACKED_STRUCT count; | ||
98 | wpa_suite_t list[1]; | ||
99 | } BWL_POST_PACKED_STRUCT wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t; | ||
100 | #define WPA_IE_SUITE_COUNT_LEN 2 | ||
101 | typedef BWL_PRE_PACKED_STRUCT struct | ||
102 | { | ||
103 | BWL_PRE_PACKED_STRUCT struct { | ||
104 | uint8 low; | ||
105 | uint8 high; | ||
106 | } BWL_POST_PACKED_STRUCT count; | ||
107 | wpa_pmkid_t list[1]; | ||
108 | } BWL_POST_PACKED_STRUCT wpa_pmkid_list_t; | ||
109 | |||
110 | |||
111 | #define WPA_CIPHER_NONE 0 | ||
112 | #define WPA_CIPHER_WEP_40 1 | ||
113 | #define WPA_CIPHER_TKIP 2 | ||
114 | #define WPA_CIPHER_AES_OCB 3 | ||
115 | #define WPA_CIPHER_AES_CCM 4 | ||
116 | #define WPA_CIPHER_WEP_104 5 | ||
117 | |||
118 | #define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \ | ||
119 | (cipher) == WPA_CIPHER_WEP_40 || \ | ||
120 | (cipher) == WPA_CIPHER_WEP_104 || \ | ||
121 | (cipher) == WPA_CIPHER_TKIP || \ | ||
122 | (cipher) == WPA_CIPHER_AES_OCB || \ | ||
123 | (cipher) == WPA_CIPHER_AES_CCM) | ||
124 | |||
125 | |||
126 | #define WPA_TKIP_CM_DETECT 60 | ||
127 | #define WPA_TKIP_CM_BLOCK 60 | ||
128 | |||
129 | |||
130 | #define RSN_CAP_LEN 2 | ||
131 | |||
132 | |||
133 | #define RSN_CAP_PREAUTH 0x0001 | ||
134 | #define RSN_CAP_NOPAIRWISE 0x0002 | ||
135 | #define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C | ||
136 | #define RSN_CAP_PTK_REPLAY_CNTR_SHIFT 2 | ||
137 | #define RSN_CAP_GTK_REPLAY_CNTR_MASK 0x0030 | ||
138 | #define RSN_CAP_GTK_REPLAY_CNTR_SHIFT 4 | ||
139 | #define RSN_CAP_1_REPLAY_CNTR 0 | ||
140 | #define RSN_CAP_2_REPLAY_CNTRS 1 | ||
141 | #define RSN_CAP_4_REPLAY_CNTRS 2 | ||
142 | #define RSN_CAP_16_REPLAY_CNTRS 3 | ||
143 | |||
144 | |||
145 | #define WPA_CAP_4_REPLAY_CNTRS RSN_CAP_4_REPLAY_CNTRS | ||
146 | #define WPA_CAP_16_REPLAY_CNTRS RSN_CAP_16_REPLAY_CNTRS | ||
147 | #define WPA_CAP_REPLAY_CNTR_SHIFT RSN_CAP_PTK_REPLAY_CNTR_SHIFT | ||
148 | #define WPA_CAP_REPLAY_CNTR_MASK RSN_CAP_PTK_REPLAY_CNTR_MASK | ||
149 | |||
150 | |||
151 | #define WPA_CAP_LEN RSN_CAP_LEN | ||
152 | |||
153 | #define WPA_CAP_WPA2_PREAUTH RSN_CAP_PREAUTH | ||
154 | |||
155 | |||
156 | |||
157 | #include <packed_section_end.h> | ||
158 | |||
159 | #endif | ||