2 * Copyright (c) 2010 Broadcom Corporation
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 #ifndef _NET_ETHERNET_H_
25 #include <proto/ethernet.h>
28 #include <proto/wpa.h>
30 #include <packed_section_start.h>
32 #define DOT11_TU_TO_US 1024
34 #define DOT11_A3_HDR_LEN 24
35 #define DOT11_A4_HDR_LEN 30
36 #define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN
37 #define DOT11_FCS_LEN 4
38 #define DOT11_ICV_LEN 4
39 #define DOT11_ICV_AES_LEN 8
40 #define DOT11_QOS_LEN 2
41 #define DOT11_HTC_LEN 4
43 #define DOT11_KEY_INDEX_SHIFT 6
44 #define DOT11_IV_LEN 4
45 #define DOT11_IV_TKIP_LEN 8
46 #define DOT11_IV_AES_OCB_LEN 4
47 #define DOT11_IV_AES_CCM_LEN 8
48 #define DOT11_IV_MAX_LEN 8
50 #define DOT11_MAX_MPDU_BODY_LEN 2304
52 #define DOT11_MAX_MPDU_LEN (DOT11_A4_HDR_LEN + \
54 DOT11_IV_AES_CCM_LEN + \
55 DOT11_MAX_MPDU_BODY_LEN + \
59 #define DOT11_MAX_SSID_LEN 32
61 #define DOT11_DEFAULT_RTS_LEN 2347
62 #define DOT11_MAX_RTS_LEN 2347
64 #define DOT11_MIN_FRAG_LEN 256
65 #define DOT11_MAX_FRAG_LEN 2346
66 #define DOT11_DEFAULT_FRAG_LEN 2346
68 #define DOT11_MIN_BEACON_PERIOD 1
69 #define DOT11_MAX_BEACON_PERIOD 0xFFFF
71 #define DOT11_MIN_DTIM_PERIOD 1
72 #define DOT11_MAX_DTIM_PERIOD 0xFF
74 #define DOT11_LLC_SNAP_HDR_LEN 8
75 #define DOT11_OUI_LEN 3
76 BWL_PRE_PACKED_STRUCT
struct dot11_llc_snap_header
{
80 uint8 oui
[DOT11_OUI_LEN
];
82 } BWL_POST_PACKED_STRUCT
;
84 #define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN)
86 BWL_PRE_PACKED_STRUCT
struct dot11_header
{
94 } BWL_POST_PACKED_STRUCT
;
96 BWL_PRE_PACKED_STRUCT
struct dot11_rts_frame
{
100 struct ether_addr ta
;
101 } BWL_POST_PACKED_STRUCT
;
102 #define DOT11_RTS_LEN 16
104 BWL_PRE_PACKED_STRUCT
struct dot11_cts_frame
{
107 struct ether_addr ra
;
108 } BWL_POST_PACKED_STRUCT
;
109 #define DOT11_CTS_LEN 10
111 BWL_PRE_PACKED_STRUCT
struct dot11_ack_frame
{
114 struct ether_addr ra
;
115 } BWL_POST_PACKED_STRUCT
;
116 #define DOT11_ACK_LEN 10
118 BWL_PRE_PACKED_STRUCT
struct dot11_ps_poll_frame
{
121 struct ether_addr bssid
;
122 struct ether_addr ta
;
123 } BWL_POST_PACKED_STRUCT
;
124 #define DOT11_PS_POLL_LEN 16
126 BWL_PRE_PACKED_STRUCT
struct dot11_cf_end_frame
{
129 struct ether_addr ra
;
130 struct ether_addr bssid
;
131 } BWL_POST_PACKED_STRUCT
;
132 #define DOT11_CS_END_LEN 16
134 BWL_PRE_PACKED_STRUCT
struct dot11_action_wifi_vendor_specific
{
140 } BWL_POST_PACKED_STRUCT
;
141 typedef struct dot11_action_wifi_vendor_specific
142 dot11_action_wifi_vendor_specific_t
;
144 BWL_PRE_PACKED_STRUCT
struct dot11_action_vs_frmhdr
{
150 } BWL_POST_PACKED_STRUCT
;
151 typedef struct dot11_action_vs_frmhdr dot11_action_vs_frmhdr_t
;
152 #define DOT11_ACTION_VS_HDR_LEN 6
154 #define BCM_ACTION_OUI_BYTE0 0x00
155 #define BCM_ACTION_OUI_BYTE1 0x90
156 #define BCM_ACTION_OUI_BYTE2 0x4c
158 #define DOT11_BA_CTL_POLICY_NORMAL 0x0000
159 #define DOT11_BA_CTL_POLICY_NOACK 0x0001
160 #define DOT11_BA_CTL_POLICY_MASK 0x0001
162 #define DOT11_BA_CTL_MTID 0x0002
163 #define DOT11_BA_CTL_COMPRESSED 0x0004
165 #define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0
166 #define DOT11_BA_CTL_NUMMSDU_SHIFT 6
168 #define DOT11_BA_CTL_TID_MASK 0xF000
169 #define DOT11_BA_CTL_TID_SHIFT 12
171 BWL_PRE_PACKED_STRUCT
struct dot11_ctl_header
{
174 struct ether_addr ra
;
175 struct ether_addr ta
;
176 } BWL_POST_PACKED_STRUCT
;
177 #define DOT11_CTL_HDR_LEN 16
179 BWL_PRE_PACKED_STRUCT
struct dot11_bar
{
182 } BWL_POST_PACKED_STRUCT
;
183 #define DOT11_BAR_LEN 4
185 #define DOT11_BA_BITMAP_LEN 128
186 #define DOT11_BA_CMP_BITMAP_LEN 8
188 BWL_PRE_PACKED_STRUCT
struct dot11_ba
{
191 uint8 bitmap
[DOT11_BA_BITMAP_LEN
];
192 } BWL_POST_PACKED_STRUCT
;
193 #define DOT11_BA_LEN 4
195 BWL_PRE_PACKED_STRUCT
struct dot11_management_header
{
198 struct ether_addr da
;
199 struct ether_addr sa
;
200 struct ether_addr bssid
;
202 } BWL_POST_PACKED_STRUCT
;
203 #define DOT11_MGMT_HDR_LEN 24
205 BWL_PRE_PACKED_STRUCT
struct dot11_bcn_prb
{
207 uint16 beacon_interval
;
209 } BWL_POST_PACKED_STRUCT
;
210 #define DOT11_BCN_PRB_LEN 12
211 #define DOT11_BCN_PRB_FIXED_LEN 12
213 BWL_PRE_PACKED_STRUCT
struct dot11_auth
{
217 } BWL_POST_PACKED_STRUCT
;
218 #define DOT11_AUTH_FIXED_LEN 6
220 BWL_PRE_PACKED_STRUCT
struct dot11_assoc_req
{
223 } BWL_POST_PACKED_STRUCT
;
224 #define DOT11_ASSOC_REQ_FIXED_LEN 4
226 BWL_PRE_PACKED_STRUCT
struct dot11_reassoc_req
{
229 struct ether_addr ap
;
230 } BWL_POST_PACKED_STRUCT
;
231 #define DOT11_REASSOC_REQ_FIXED_LEN 10
233 BWL_PRE_PACKED_STRUCT
struct dot11_assoc_resp
{
237 } BWL_POST_PACKED_STRUCT
;
238 #define DOT11_ASSOC_RESP_FIXED_LEN 6
240 BWL_PRE_PACKED_STRUCT
struct dot11_action_measure
{
245 } BWL_POST_PACKED_STRUCT
;
246 #define DOT11_ACTION_MEASURE_LEN 3
248 BWL_PRE_PACKED_STRUCT
struct dot11_action_ht_ch_width
{
252 } BWL_POST_PACKED_STRUCT
;
254 BWL_PRE_PACKED_STRUCT
struct dot11_action_ht_mimops
{
258 } BWL_POST_PACKED_STRUCT
;
260 #define SM_PWRSAVE_ENABLE 1
261 #define SM_PWRSAVE_MODE 2
263 BWL_PRE_PACKED_STRUCT
struct dot11_power_cnst
{
267 } BWL_POST_PACKED_STRUCT
;
268 typedef struct dot11_power_cnst dot11_power_cnst_t
;
270 BWL_PRE_PACKED_STRUCT
struct dot11_power_cap
{
273 } BWL_POST_PACKED_STRUCT
;
274 typedef struct dot11_power_cap dot11_power_cap_t
;
276 BWL_PRE_PACKED_STRUCT
struct dot11_tpc_rep
{
281 } BWL_POST_PACKED_STRUCT
;
282 typedef struct dot11_tpc_rep dot11_tpc_rep_t
;
283 #define DOT11_MNG_IE_TPC_REPORT_LEN 2
285 BWL_PRE_PACKED_STRUCT
struct dot11_supp_channels
{
290 } BWL_POST_PACKED_STRUCT
;
291 typedef struct dot11_supp_channels dot11_supp_channels_t
;
293 BWL_PRE_PACKED_STRUCT
struct dot11_extch
{
297 } BWL_POST_PACKED_STRUCT
;
298 typedef struct dot11_extch dot11_extch_ie_t
;
300 BWL_PRE_PACKED_STRUCT
struct dot11_brcm_extch
{
306 } BWL_POST_PACKED_STRUCT
;
307 typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t
;
309 #define DOT11_EXTCH_IE_LEN 1
310 #define DOT11_EXT_CH_MASK 0x03
311 #define DOT11_EXT_CH_UPPER 0x01
312 #define DOT11_EXT_CH_LOWER 0x03
313 #define DOT11_EXT_CH_NONE 0x00
315 BWL_PRE_PACKED_STRUCT
struct dot11_action_frmhdr
{
319 } BWL_POST_PACKED_STRUCT
;
320 #define DOT11_ACTION_FRMHDR_LEN 2
322 BWL_PRE_PACKED_STRUCT
struct dot11_channel_switch
{
328 } BWL_POST_PACKED_STRUCT
;
329 typedef struct dot11_channel_switch dot11_chan_switch_ie_t
;
331 #define DOT11_SWITCH_IE_LEN 3
333 #define DOT11_CSA_MODE_ADVISORY 0
334 #define DOT11_CSA_MODE_NO_TX 1
336 BWL_PRE_PACKED_STRUCT
struct dot11_action_switch_channel
{
339 dot11_chan_switch_ie_t chan_switch_ie
;
340 dot11_brcm_extch_ie_t extch_ie
;
341 } BWL_POST_PACKED_STRUCT
;
343 BWL_PRE_PACKED_STRUCT
struct dot11_csa_body
{
348 } BWL_POST_PACKED_STRUCT
;
350 BWL_PRE_PACKED_STRUCT
struct dot11_ext_csa
{
353 struct dot11_csa_body b
;
354 } BWL_POST_PACKED_STRUCT
;
355 typedef struct dot11_ext_csa dot11_ext_csa_ie_t
;
356 #define DOT11_EXT_CSA_IE_LEN 4
358 BWL_PRE_PACKED_STRUCT
struct dot11_action_ext_csa
{
361 dot11_ext_csa_ie_t chan_switch_ie
;
362 } BWL_POST_PACKED_STRUCT
;
364 BWL_PRE_PACKED_STRUCT
struct dot11y_action_ext_csa
{
367 struct dot11_csa_body b
;
368 } BWL_POST_PACKED_STRUCT
;
370 BWL_PRE_PACKED_STRUCT
struct dot11_obss_coex
{
374 } BWL_POST_PACKED_STRUCT
;
375 typedef struct dot11_obss_coex dot11_obss_coex_t
;
376 #define DOT11_OBSS_COEXINFO_LEN 1
378 #define DOT11_OBSS_COEX_INFO_REQ 0x01
379 #define DOT11_OBSS_COEX_40MHZ_INTOLERANT 0x02
380 #define DOT11_OBSS_COEX_20MHZ_WIDTH_REQ 0x04
382 BWL_PRE_PACKED_STRUCT
struct dot11_obss_chanlist
{
387 } BWL_POST_PACKED_STRUCT
;
388 typedef struct dot11_obss_chanlist dot11_obss_chanlist_t
;
389 #define DOT11_OBSS_CHANLIST_FIXED_LEN 1
391 BWL_PRE_PACKED_STRUCT
struct dot11_extcap_ie
{
395 } BWL_POST_PACKED_STRUCT
;
396 typedef struct dot11_extcap_ie dot11_extcap_ie_t
;
397 #define DOT11_EXTCAP_LEN 1
399 #define DOT11_MEASURE_TYPE_BASIC 0
400 #define DOT11_MEASURE_TYPE_CCA 1
401 #define DOT11_MEASURE_TYPE_RPI 2
402 #define DOT11_MEASURE_TYPE_CHLOAD 3
403 #define DOT11_MEASURE_TYPE_NOISE 4
404 #define DOT11_MEASURE_TYPE_BEACON 5
405 #define DOT11_MEASURE_TYPE_FRAME 6
406 #define DOT11_MEASURE_TYPE_STATS 7
407 #define DOT11_MEASURE_TYPE_LCI 8
408 #define DOT11_MEASURE_TYPE_TXSTREAM 9
409 #define DOT11_MEASURE_TYPE_PAUSE 255
411 #define DOT11_MEASURE_MODE_PARALLEL (1<<0)
412 #define DOT11_MEASURE_MODE_ENABLE (1<<1)
413 #define DOT11_MEASURE_MODE_REQUEST (1<<2)
414 #define DOT11_MEASURE_MODE_REPORT (1<<3)
415 #define DOT11_MEASURE_MODE_DUR (1<<4)
417 #define DOT11_MEASURE_MODE_LATE (1<<0)
418 #define DOT11_MEASURE_MODE_INCAPABLE (1<<1)
419 #define DOT11_MEASURE_MODE_REFUSED (1<<2)
421 #define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0))
422 #define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1))
423 #define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2))
424 #define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3))
425 #define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4))
427 BWL_PRE_PACKED_STRUCT
struct dot11_meas_req
{
436 } BWL_POST_PACKED_STRUCT
;
437 typedef struct dot11_meas_req dot11_meas_req_t
;
438 #define DOT11_MNG_IE_MREQ_LEN 14
440 #define DOT11_MNG_IE_MREQ_FIXED_LEN 3
442 BWL_PRE_PACKED_STRUCT
struct dot11_meas_rep
{
448 BWL_PRE_PACKED_STRUCT
union {
449 BWL_PRE_PACKED_STRUCT
struct {
454 } BWL_POST_PACKED_STRUCT basic
;
456 } BWL_POST_PACKED_STRUCT rep
;
457 } BWL_POST_PACKED_STRUCT
;
458 typedef struct dot11_meas_rep dot11_meas_rep_t
;
460 #define DOT11_MNG_IE_MREP_FIXED_LEN 3
462 BWL_PRE_PACKED_STRUCT
struct dot11_meas_rep_basic
{
467 } BWL_POST_PACKED_STRUCT
;
468 typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t
;
469 #define DOT11_MEASURE_BASIC_REP_LEN 12
471 BWL_PRE_PACKED_STRUCT
struct dot11_quiet
{
478 } BWL_POST_PACKED_STRUCT
;
479 typedef struct dot11_quiet dot11_quiet_t
;
481 BWL_PRE_PACKED_STRUCT
struct chan_map_tuple
{
484 } BWL_POST_PACKED_STRUCT
;
485 typedef struct chan_map_tuple chan_map_tuple_t
;
487 BWL_PRE_PACKED_STRUCT
struct dot11_ibss_dfs
{
490 uint8 eaddr
[ETHER_ADDR_LEN
];
492 chan_map_tuple_t map
[1];
493 } BWL_POST_PACKED_STRUCT
;
494 typedef struct dot11_ibss_dfs dot11_ibss_dfs_t
;
496 #define WME_OUI "\x00\x50\xf2"
499 #define WME_SUBTYPE_IE 0
500 #define WME_SUBTYPE_PARAM_IE 1
501 #define WME_SUBTYPE_TSPEC 2
509 typedef uint8 ac_bitmap_t
;
511 #define AC_BITMAP_NONE 0x0
512 #define AC_BITMAP_ALL 0xf
513 #define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0)
514 #define AC_BITMAP_SET(ab, ac) (((ab) |= (1 << (ac))))
515 #define AC_BITMAP_RESET(ab, ac) (((ab) &= ~(1 << (ac))))
517 BWL_PRE_PACKED_STRUCT
struct wme_ie
{
523 } BWL_POST_PACKED_STRUCT
;
524 typedef struct wme_ie wme_ie_t
;
527 BWL_PRE_PACKED_STRUCT
struct edcf_acparam
{
531 } BWL_POST_PACKED_STRUCT
;
532 typedef struct edcf_acparam edcf_acparam_t
;
534 BWL_PRE_PACKED_STRUCT
struct wme_param_ie
{
541 edcf_acparam_t acparam
[AC_COUNT
];
542 } BWL_POST_PACKED_STRUCT
;
543 typedef struct wme_param_ie wme_param_ie_t
;
544 #define WME_PARAM_IE_LEN 24
546 #define WME_QI_AP_APSD_MASK 0x80
547 #define WME_QI_AP_APSD_SHIFT 7
548 #define WME_QI_AP_COUNT_MASK 0x0f
549 #define WME_QI_AP_COUNT_SHIFT 0
551 #define WME_QI_STA_MAXSPLEN_MASK 0x60
552 #define WME_QI_STA_MAXSPLEN_SHIFT 5
553 #define WME_QI_STA_APSD_ALL_MASK 0xf
554 #define WME_QI_STA_APSD_ALL_SHIFT 0
555 #define WME_QI_STA_APSD_BE_MASK 0x8
556 #define WME_QI_STA_APSD_BE_SHIFT 3
557 #define WME_QI_STA_APSD_BK_MASK 0x4
558 #define WME_QI_STA_APSD_BK_SHIFT 2
559 #define WME_QI_STA_APSD_VI_MASK 0x2
560 #define WME_QI_STA_APSD_VI_SHIFT 1
561 #define WME_QI_STA_APSD_VO_MASK 0x1
562 #define WME_QI_STA_APSD_VO_SHIFT 0
564 #define EDCF_AIFSN_MIN 1
565 #define EDCF_AIFSN_MAX 15
566 #define EDCF_AIFSN_MASK 0x0f
567 #define EDCF_ACM_MASK 0x10
568 #define EDCF_ACI_MASK 0x60
569 #define EDCF_ACI_SHIFT 5
570 #define EDCF_AIFSN_SHIFT 12
572 #define EDCF_ECW_MIN 0
573 #define EDCF_ECW_MAX 15
574 #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1)
575 #define EDCF_ECWMIN_MASK 0x0f
576 #define EDCF_ECWMAX_MASK 0xf0
577 #define EDCF_ECWMAX_SHIFT 4
579 #define EDCF_TXOP_MIN 0
580 #define EDCF_TXOP_MAX 65535
581 #define EDCF_TXOP2USEC(txop) ((txop) << 5)
583 #define NON_EDCF_AC_BE_ACI_STA 0x02
585 #define EDCF_AC_BE_ACI_STA 0x03
586 #define EDCF_AC_BE_ECW_STA 0xA4
587 #define EDCF_AC_BE_TXOP_STA 0x0000
588 #define EDCF_AC_BK_ACI_STA 0x27
589 #define EDCF_AC_BK_ECW_STA 0xA4
590 #define EDCF_AC_BK_TXOP_STA 0x0000
591 #define EDCF_AC_VI_ACI_STA 0x42
592 #define EDCF_AC_VI_ECW_STA 0x43
593 #define EDCF_AC_VI_TXOP_STA 0x005e
594 #define EDCF_AC_VO_ACI_STA 0x62
595 #define EDCF_AC_VO_ECW_STA 0x32
596 #define EDCF_AC_VO_TXOP_STA 0x002f
598 #define EDCF_AC_BE_ACI_AP 0x03
599 #define EDCF_AC_BE_ECW_AP 0x64
600 #define EDCF_AC_BE_TXOP_AP 0x0000
601 #define EDCF_AC_BK_ACI_AP 0x27
602 #define EDCF_AC_BK_ECW_AP 0xA4
603 #define EDCF_AC_BK_TXOP_AP 0x0000
604 #define EDCF_AC_VI_ACI_AP 0x41
605 #define EDCF_AC_VI_ECW_AP 0x43
606 #define EDCF_AC_VI_TXOP_AP 0x005e
607 #define EDCF_AC_VO_ACI_AP 0x61
608 #define EDCF_AC_VO_ECW_AP 0x32
609 #define EDCF_AC_VO_TXOP_AP 0x002f
611 BWL_PRE_PACKED_STRUCT
struct edca_param_ie
{
614 edcf_acparam_t acparam
[AC_COUNT
];
615 } BWL_POST_PACKED_STRUCT
;
616 typedef struct edca_param_ie edca_param_ie_t
;
617 #define EDCA_PARAM_IE_LEN 18
619 BWL_PRE_PACKED_STRUCT
struct qos_cap_ie
{
621 } BWL_POST_PACKED_STRUCT
;
622 typedef struct qos_cap_ie qos_cap_ie_t
;
624 BWL_PRE_PACKED_STRUCT
struct dot11_qbss_load_ie
{
627 uint16 station_count
;
628 uint8 channel_utilization
;
630 } BWL_POST_PACKED_STRUCT
;
631 typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t
;
633 #define FIXED_MSDU_SIZE 0x8000
634 #define MSDU_SIZE_MASK 0x7fff
636 #define INTEGER_SHIFT 13
637 #define FRACTION_MASK 0x1FFF
639 BWL_PRE_PACKED_STRUCT
struct dot11_management_notification
{
645 } BWL_POST_PACKED_STRUCT
;
646 #define DOT11_MGMT_NOTIFICATION_LEN 4
648 #define WME_ADDTS_REQUEST 0
649 #define WME_ADDTS_RESPONSE 1
650 #define WME_DELTS_REQUEST 2
652 #define WME_ADMISSION_ACCEPTED 0
653 #define WME_INVALID_PARAMETERS 1
654 #define WME_ADMISSION_REFUSED 3
656 #define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN)
658 #define DOT11_OPEN_SYSTEM 0
659 #define DOT11_SHARED_KEY 1
660 #define DOT11_OPEN_SHARED 2
661 #define DOT11_CHALLENGE_LEN 128
663 #define FC_PVER_MASK 0x3
664 #define FC_PVER_SHIFT 0
665 #define FC_TYPE_MASK 0xC
666 #define FC_TYPE_SHIFT 2
667 #define FC_SUBTYPE_MASK 0xF0
668 #define FC_SUBTYPE_SHIFT 4
669 #define FC_TODS 0x100
670 #define FC_TODS_SHIFT 8
671 #define FC_FROMDS 0x200
672 #define FC_FROMDS_SHIFT 9
673 #define FC_MOREFRAG 0x400
674 #define FC_MOREFRAG_SHIFT 10
675 #define FC_RETRY 0x800
676 #define FC_RETRY_SHIFT 11
678 #define FC_PM_SHIFT 12
679 #define FC_MOREDATA 0x2000
680 #define FC_MOREDATA_SHIFT 13
681 #define FC_WEP 0x4000
682 #define FC_WEP_SHIFT 14
683 #define FC_ORDER 0x8000
684 #define FC_ORDER_SHIFT 15
686 #define SEQNUM_SHIFT 4
687 #define SEQNUM_MAX 0x1000
688 #define FRAGNUM_MASK 0xF
690 #define FC_TYPE_MNG 0
691 #define FC_TYPE_CTL 1
692 #define FC_TYPE_DATA 2
694 #define FC_SUBTYPE_ASSOC_REQ 0
695 #define FC_SUBTYPE_ASSOC_RESP 1
696 #define FC_SUBTYPE_REASSOC_REQ 2
697 #define FC_SUBTYPE_REASSOC_RESP 3
698 #define FC_SUBTYPE_PROBE_REQ 4
699 #define FC_SUBTYPE_PROBE_RESP 5
700 #define FC_SUBTYPE_BEACON 8
701 #define FC_SUBTYPE_ATIM 9
702 #define FC_SUBTYPE_DISASSOC 10
703 #define FC_SUBTYPE_AUTH 11
704 #define FC_SUBTYPE_DEAUTH 12
705 #define FC_SUBTYPE_ACTION 13
706 #define FC_SUBTYPE_ACTION_NOACK 14
708 #define FC_SUBTYPE_CTL_WRAPPER 7
709 #define FC_SUBTYPE_BLOCKACK_REQ 8
710 #define FC_SUBTYPE_BLOCKACK 9
711 #define FC_SUBTYPE_PS_POLL 10
712 #define FC_SUBTYPE_RTS 11
713 #define FC_SUBTYPE_CTS 12
714 #define FC_SUBTYPE_ACK 13
715 #define FC_SUBTYPE_CF_END 14
716 #define FC_SUBTYPE_CF_END_ACK 15
718 #define FC_SUBTYPE_DATA 0
719 #define FC_SUBTYPE_DATA_CF_ACK 1
720 #define FC_SUBTYPE_DATA_CF_POLL 2
721 #define FC_SUBTYPE_DATA_CF_ACK_POLL 3
722 #define FC_SUBTYPE_NULL 4
723 #define FC_SUBTYPE_CF_ACK 5
724 #define FC_SUBTYPE_CF_POLL 6
725 #define FC_SUBTYPE_CF_ACK_POLL 7
726 #define FC_SUBTYPE_QOS_DATA 8
727 #define FC_SUBTYPE_QOS_DATA_CF_ACK 9
728 #define FC_SUBTYPE_QOS_DATA_CF_POLL 10
729 #define FC_SUBTYPE_QOS_DATA_CF_ACK_POLL 11
730 #define FC_SUBTYPE_QOS_NULL 12
731 #define FC_SUBTYPE_QOS_CF_POLL 14
732 #define FC_SUBTYPE_QOS_CF_ACK_POLL 15
734 #define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0)
735 #define FC_SUBTYPE_ANY_NULL(s) (((s) & 4) != 0)
736 #define FC_SUBTYPE_ANY_CF_POLL(s) (((s) & 2) != 0)
737 #define FC_SUBTYPE_ANY_CF_ACK(s) (((s) & 1) != 0)
739 #define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK)
741 #define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT))
743 #define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT)
744 #define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT)
746 #define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ)
747 #define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP)
748 #define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ)
749 #define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP)
750 #define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ)
751 #define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP)
752 #define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON)
753 #define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC)
754 #define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH)
755 #define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH)
756 #define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION)
757 #define FC_ACTION_NOACK FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION_NOACK)
759 #define FC_CTL_WRAPPER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTL_WRAPPER)
760 #define FC_BLOCKACK_REQ FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK_REQ)
761 #define FC_BLOCKACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK)
762 #define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL)
763 #define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS)
764 #define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS)
765 #define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK)
766 #define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END)
767 #define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK)
769 #define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA)
770 #define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL)
771 #define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK)
772 #define FC_QOS_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA)
773 #define FC_QOS_NULL FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL)
775 #define QOS_PRIO_SHIFT 0
776 #define QOS_PRIO_MASK 0x0007
777 #define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT)
779 #define QOS_TID_SHIFT 0
780 #define QOS_TID_MASK 0x000f
781 #define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT)
783 #define QOS_EOSP_SHIFT 4
784 #define QOS_EOSP_MASK 0x0010
785 #define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT)
787 #define QOS_ACK_NORMAL_ACK 0
788 #define QOS_ACK_NO_ACK 1
789 #define QOS_ACK_NO_EXP_ACK 2
790 #define QOS_ACK_BLOCK_ACK 3
791 #define QOS_ACK_SHIFT 5
792 #define QOS_ACK_MASK 0x0060
793 #define QOS_ACK(qos) (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT)
795 #define QOS_AMSDU_SHIFT 7
796 #define QOS_AMSDU_MASK 0x0080
798 #define DOT11_MNG_AUTH_ALGO_LEN 2
799 #define DOT11_MNG_AUTH_SEQ_LEN 2
800 #define DOT11_MNG_BEACON_INT_LEN 2
801 #define DOT11_MNG_CAP_LEN 2
802 #define DOT11_MNG_AP_ADDR_LEN 6
803 #define DOT11_MNG_LISTEN_INT_LEN 2
804 #define DOT11_MNG_REASON_LEN 2
805 #define DOT11_MNG_AID_LEN 2
806 #define DOT11_MNG_STATUS_LEN 2
807 #define DOT11_MNG_TIMESTAMP_LEN 8
809 #define DOT11_AID_MASK 0x3fff
811 #define DOT11_RC_RESERVED 0
812 #define DOT11_RC_UNSPECIFIED 1
813 #define DOT11_RC_AUTH_INVAL 2
814 #define DOT11_RC_DEAUTH_LEAVING 3
815 #define DOT11_RC_INACTIVITY 4
816 #define DOT11_RC_BUSY 5
817 #define DOT11_RC_INVAL_CLASS_2 6
818 #define DOT11_RC_INVAL_CLASS_3 7
819 #define DOT11_RC_DISASSOC_LEAVING 8
820 #define DOT11_RC_NOT_AUTH 9
821 #define DOT11_RC_BAD_PC 10
822 #define DOT11_RC_BAD_CHANNELS 11
824 #define DOT11_RC_UNSPECIFIED_QOS 32
825 #define DOT11_RC_INSUFFCIENT_BW 33
826 #define DOT11_RC_EXCESSIVE_FRAMES 34
827 #define DOT11_RC_TX_OUTSIDE_TXOP 35
828 #define DOT11_RC_LEAVING_QBSS 36
829 #define DOT11_RC_BAD_MECHANISM 37
830 #define DOT11_RC_SETUP_NEEDED 38
831 #define DOT11_RC_TIMEOUT 39
833 #define DOT11_RC_MAX 23
835 #define DOT11_SC_SUCCESS 0
836 #define DOT11_SC_FAILURE 1
837 #define DOT11_SC_CAP_MISMATCH 10
838 #define DOT11_SC_REASSOC_FAIL 11
839 #define DOT11_SC_ASSOC_FAIL 12
840 #define DOT11_SC_AUTH_MISMATCH 13
841 #define DOT11_SC_AUTH_SEQ 14
842 #define DOT11_SC_AUTH_CHALLENGE_FAIL 15
843 #define DOT11_SC_AUTH_TIMEOUT 16
844 #define DOT11_SC_ASSOC_BUSY_FAIL 17
845 #define DOT11_SC_ASSOC_RATE_MISMATCH 18
846 #define DOT11_SC_ASSOC_SHORT_REQUIRED 19
847 #define DOT11_SC_ASSOC_PBCC_REQUIRED 20
848 #define DOT11_SC_ASSOC_AGILITY_REQUIRED 21
849 #define DOT11_SC_ASSOC_SPECTRUM_REQUIRED 22
850 #define DOT11_SC_ASSOC_BAD_POWER_CAP 23
851 #define DOT11_SC_ASSOC_BAD_SUP_CHANNELS 24
852 #define DOT11_SC_ASSOC_SHORTSLOT_REQUIRED 25
853 #define DOT11_SC_ASSOC_ERPBCC_REQUIRED 26
854 #define DOT11_SC_ASSOC_DSSOFDM_REQUIRED 27
856 #define DOT11_SC_DECLINED 37
857 #define DOT11_SC_INVALID_PARAMS 38
859 #define DOT11_MNG_DS_PARAM_LEN 1
860 #define DOT11_MNG_IBSS_PARAM_LEN 2
862 #define DOT11_MNG_TIM_FIXED_LEN 3
863 #define DOT11_MNG_TIM_DTIM_COUNT 0
864 #define DOT11_MNG_TIM_DTIM_PERIOD 1
865 #define DOT11_MNG_TIM_BITMAP_CTL 2
866 #define DOT11_MNG_TIM_PVB 3
868 #define TLV_TAG_OFF 0
869 #define TLV_LEN_OFF 1
870 #define TLV_HDR_LEN 2
871 #define TLV_BODY_OFF 2
873 #define DOT11_MNG_SSID_ID 0
874 #define DOT11_MNG_RATES_ID 1
875 #define DOT11_MNG_FH_PARMS_ID 2
876 #define DOT11_MNG_DS_PARMS_ID 3
877 #define DOT11_MNG_CF_PARMS_ID 4
878 #define DOT11_MNG_TIM_ID 5
879 #define DOT11_MNG_IBSS_PARMS_ID 6
880 #define DOT11_MNG_COUNTRY_ID 7
881 #define DOT11_MNG_HOPPING_PARMS_ID 8
882 #define DOT11_MNG_HOPPING_TABLE_ID 9
883 #define DOT11_MNG_REQUEST_ID 10
884 #define DOT11_MNG_QBSS_LOAD_ID 11
885 #define DOT11_MNG_EDCA_PARAM_ID 12
886 #define DOT11_MNG_CHALLENGE_ID 16
887 #define DOT11_MNG_PWR_CONSTRAINT_ID 32
888 #define DOT11_MNG_PWR_CAP_ID 33
889 #define DOT11_MNG_TPC_REQUEST_ID 34
890 #define DOT11_MNG_TPC_REPORT_ID 35
891 #define DOT11_MNG_SUPP_CHANNELS_ID 36
892 #define DOT11_MNG_CHANNEL_SWITCH_ID 37
893 #define DOT11_MNG_MEASURE_REQUEST_ID 38
894 #define DOT11_MNG_MEASURE_REPORT_ID 39
895 #define DOT11_MNG_QUIET_ID 40
896 #define DOT11_MNG_IBSS_DFS_ID 41
897 #define DOT11_MNG_ERP_ID 42
898 #define DOT11_MNG_TS_DELAY_ID 43
899 #define DOT11_MNG_HT_CAP 45
900 #define DOT11_MNG_QOS_CAP_ID 46
901 #define DOT11_MNG_NONERP_ID 47
902 #define DOT11_MNG_RSN_ID 48
903 #define DOT11_MNG_EXT_RATES_ID 50
904 #define DOT11_MNG_AP_CHREP_ID 51
905 #define DOT11_MNG_NBR_REP_ID 52
906 #define DOT11_MNG_REGCLASS_ID 59
907 #define DOT11_MNG_EXT_CSA_ID 60
908 #define DOT11_MNG_HT_ADD 61
909 #define DOT11_MNG_EXT_CHANNEL_OFFSET 62
911 #define DOT11_MNG_RRM_CAP_ID 70
912 #define DOT11_MNG_HT_BSS_COEXINFO_ID 72
913 #define DOT11_MNG_HT_BSS_CHANNEL_REPORT_ID 73
914 #define DOT11_MNG_HT_OBSS_ID 74
915 #define DOT11_MNG_EXT_CAP 127
916 #define DOT11_MNG_WPA_ID 221
917 #define DOT11_MNG_PROPR_ID 221
919 #define DOT11_MNG_VS_ID 221
921 #define DOT11_RATE_BASIC 0x80
922 #define DOT11_RATE_MASK 0x7F
924 #define DOT11_MNG_ERP_LEN 1
925 #define DOT11_MNG_NONERP_PRESENT 0x01
926 #define DOT11_MNG_USE_PROTECTION 0x02
927 #define DOT11_MNG_BARKER_PREAMBLE 0x04
929 #define DOT11_MGN_TS_DELAY_LEN 4
930 #define TS_DELAY_FIELD_SIZE 4
932 #define DOT11_CAP_ESS 0x0001
933 #define DOT11_CAP_IBSS 0x0002
934 #define DOT11_CAP_POLLABLE 0x0004
935 #define DOT11_CAP_POLL_RQ 0x0008
936 #define DOT11_CAP_PRIVACY 0x0010
937 #define DOT11_CAP_SHORT 0x0020
938 #define DOT11_CAP_PBCC 0x0040
939 #define DOT11_CAP_AGILITY 0x0080
940 #define DOT11_CAP_SPECTRUM 0x0100
941 #define DOT11_CAP_SHORTSLOT 0x0400
942 #define DOT11_CAP_RRM 0x1000
943 #define DOT11_CAP_CCK_OFDM 0x2000
945 #define DOT11_OBSS_COEX_MNG_SUPPORT 0x01
947 #define DOT11_ACTION_HDR_LEN 2
949 #define DOT11_ACTION_CAT_ERR_MASK 0x80
950 #define DOT11_ACTION_CAT_MASK 0x7F
951 #define DOT11_ACTION_CAT_SPECT_MNG 0
952 #define DOT11_ACTION_CAT_QOS 1
953 #define DOT11_ACTION_CAT_DLS 2
954 #define DOT11_ACTION_CAT_BLOCKACK 3
955 #define DOT11_ACTION_CAT_PUBLIC 4
956 #define DOT11_ACTION_CAT_RRM 5
957 #define DOT11_ACTION_CAT_HT 7
958 #define DOT11_ACTION_NOTIFICATION 17
959 #define DOT11_ACTION_CAT_VS 127
961 #define DOT11_SM_ACTION_M_REQ 0
962 #define DOT11_SM_ACTION_M_REP 1
963 #define DOT11_SM_ACTION_TPC_REQ 2
964 #define DOT11_SM_ACTION_TPC_REP 3
965 #define DOT11_SM_ACTION_CHANNEL_SWITCH 4
966 #define DOT11_SM_ACTION_EXT_CSA 5
968 #define DOT11_ACTION_ID_HT_CH_WIDTH 0
969 #define DOT11_ACTION_ID_HT_MIMO_PS 1
971 #define DOT11_PUB_ACTION_BSS_COEX_MNG 0
972 #define DOT11_PUB_ACTION_CHANNEL_SWITCH 4
974 #define DOT11_BA_ACTION_ADDBA_REQ 0
975 #define DOT11_BA_ACTION_ADDBA_RESP 1
976 #define DOT11_BA_ACTION_DELBA 2
978 #define DOT11_ADDBA_PARAM_AMSDU_SUP 0x0001
979 #define DOT11_ADDBA_PARAM_POLICY_MASK 0x0002
980 #define DOT11_ADDBA_PARAM_POLICY_SHIFT 1
981 #define DOT11_ADDBA_PARAM_TID_MASK 0x003c
982 #define DOT11_ADDBA_PARAM_TID_SHIFT 2
983 #define DOT11_ADDBA_PARAM_BSIZE_MASK 0xffc0
984 #define DOT11_ADDBA_PARAM_BSIZE_SHIFT 6
986 #define DOT11_ADDBA_POLICY_DELAYED 0
987 #define DOT11_ADDBA_POLICY_IMMEDIATE 1
989 BWL_PRE_PACKED_STRUCT
struct dot11_addba_req
{
993 uint16 addba_param_set
;
996 } BWL_POST_PACKED_STRUCT
;
997 typedef struct dot11_addba_req dot11_addba_req_t
;
998 #define DOT11_ADDBA_REQ_LEN 9
1000 BWL_PRE_PACKED_STRUCT
struct dot11_addba_resp
{
1005 uint16 addba_param_set
;
1007 } BWL_POST_PACKED_STRUCT
;
1008 typedef struct dot11_addba_resp dot11_addba_resp_t
;
1009 #define DOT11_ADDBA_RESP_LEN 9
1011 #define DOT11_DELBA_PARAM_INIT_MASK 0x0800
1012 #define DOT11_DELBA_PARAM_INIT_SHIFT 11
1013 #define DOT11_DELBA_PARAM_TID_MASK 0xf000
1014 #define DOT11_DELBA_PARAM_TID_SHIFT 12
1016 BWL_PRE_PACKED_STRUCT
struct dot11_delba
{
1019 uint16 delba_param_set
;
1021 } BWL_POST_PACKED_STRUCT
;
1022 typedef struct dot11_delba dot11_delba_t
;
1023 #define DOT11_DELBA_LEN 6
1025 #define DOT11_RRM_CAP_LEN 5
1026 BWL_PRE_PACKED_STRUCT
struct dot11_rrm_cap_ie
{
1027 uint8 cap
[DOT11_RRM_CAP_LEN
];
1028 } BWL_POST_PACKED_STRUCT
;
1029 typedef struct dot11_rrm_cap_ie dot11_rrm_cap_ie_t
;
1031 #define DOT11_RRM_CAP_LINK 0
1032 #define DOT11_RRM_CAP_NEIGHBOR_REPORT 1
1033 #define DOT11_RRM_CAP_PARALLEL 2
1034 #define DOT11_RRM_CAP_REPEATED 3
1035 #define DOT11_RRM_CAP_BCN_PASSIVE 4
1036 #define DOT11_RRM_CAP_BCN_ACTIVE 5
1037 #define DOT11_RRM_CAP_BCN_TABLE 6
1038 #define DOT11_RRM_CAP_BCN_REP_COND 7
1039 #define DOT11_RRM_CAP_AP_CHANREP 16
1041 #define DOT11_RM_ACTION_RM_REQ 0
1042 #define DOT11_RM_ACTION_RM_REP 1
1043 #define DOT11_RM_ACTION_LM_REQ 2
1044 #define DOT11_RM_ACTION_LM_REP 3
1045 #define DOT11_RM_ACTION_NR_REQ 4
1046 #define DOT11_RM_ACTION_NR_REP 5
1048 BWL_PRE_PACKED_STRUCT
struct dot11_rm_action
{
1053 } BWL_POST_PACKED_STRUCT
;
1054 typedef struct dot11_rm_action dot11_rm_action_t
;
1055 #define DOT11_RM_ACTION_LEN 3
1057 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq
{
1062 } BWL_POST_PACKED_STRUCT
;
1063 typedef struct dot11_rmreq dot11_rmreq_t
;
1064 #define DOT11_RMREQ_LEN 5
1066 BWL_PRE_PACKED_STRUCT
struct dot11_rm_ie
{
1072 } BWL_POST_PACKED_STRUCT
;
1073 typedef struct dot11_rm_ie dot11_rm_ie_t
;
1074 #define DOT11_RM_IE_LEN 5
1076 #define DOT11_RMREQ_MODE_PARALLEL 1
1077 #define DOT11_RMREQ_MODE_ENABLE 2
1078 #define DOT11_RMREQ_MODE_REQUEST 4
1079 #define DOT11_RMREQ_MODE_REPORT 8
1080 #define DOT11_RMREQ_MODE_DURMAND 0x10
1082 #define DOT11_RMREP_MODE_LATE 1
1083 #define DOT11_RMREP_MODE_INCAPABLE 2
1084 #define DOT11_RMREP_MODE_REFUSED 4
1086 BWL_PRE_PACKED_STRUCT
struct dot11_rmreq_bcn
{
1097 struct ether_addr bssid
;
1098 } BWL_POST_PACKED_STRUCT
;
1099 typedef struct dot11_rmreq_bcn dot11_rmreq_bcn_t
;
1100 #define DOT11_RMREQ_BCN_LEN 18
1102 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_bcn
{
1105 uint32 starttime
[2];
1110 struct ether_addr bssid
;
1113 } BWL_POST_PACKED_STRUCT
;
1114 typedef struct dot11_rmrep_bcn dot11_rmrep_bcn_t
;
1115 #define DOT11_RMREP_BCN_LEN 26
1117 #define DOT11_RMREQ_BCN_PASSIVE 0
1118 #define DOT11_RMREQ_BCN_ACTIVE 1
1119 #define DOT11_RMREQ_BCN_TABLE 2
1121 #define DOT11_RMREQ_BCN_SSID_ID 0
1122 #define DOT11_RMREQ_BCN_REPINFO_ID 1
1123 #define DOT11_RMREQ_BCN_REPDET_ID 2
1124 #define DOT11_RMREQ_BCN_REQUEST_ID 10
1125 #define DOT11_RMREQ_BCN_APCHREP_ID 51
1127 #define DOT11_RMREQ_BCN_REPDET_FIXED 0
1128 #define DOT11_RMREQ_BCN_REPDET_REQUEST 1
1129 #define DOT11_RMREQ_BCN_REPDET_ALL 2
1131 #define DOT11_RMREP_BCN_FRM_BODY 1
1133 BWL_PRE_PACKED_STRUCT
struct dot11_rmrep_nbr
{
1134 struct ether_addr bssid
;
1139 } BWL_POST_PACKED_STRUCT
;
1140 typedef struct dot11_rmrep_nbr dot11_rmrep_nbr_t
;
1141 #define DOT11_RMREP_NBR_LEN 13
1143 #define DOT11_BSSTYPE_INFRASTRUCTURE 0
1144 #define DOT11_BSSTYPE_INDEPENDENT 1
1145 #define DOT11_BSSTYPE_ANY 2
1146 #define DOT11_SCANTYPE_ACTIVE 0
1147 #define DOT11_SCANTYPE_PASSIVE 1
1149 BWL_PRE_PACKED_STRUCT
struct dot11_lmreq
{
1155 } BWL_POST_PACKED_STRUCT
;
1156 typedef struct dot11_lmreq dot11_lmreq_t
;
1157 #define DOT11_LMREQ_LEN 5
1159 BWL_PRE_PACKED_STRUCT
struct dot11_lmrep
{
1163 dot11_tpc_rep_t tpc
;
1168 } BWL_POST_PACKED_STRUCT
;
1169 typedef struct dot11_lmrep dot11_lmrep_t
;
1170 #define DOT11_LMREP_LEN 11
1172 #define PREN_PREAMBLE 24
1173 #define PREN_MM_EXT 12
1174 #define PREN_PREAMBLE_EXT 4
1176 #define RIFS_11N_TIME 2
1178 #define APHY_SLOT_TIME 9
1179 #define APHY_SIFS_TIME 16
1180 #define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME))
1181 #define APHY_PREAMBLE_TIME 16
1182 #define APHY_SIGNAL_TIME 4
1183 #define APHY_SYMBOL_TIME 4
1184 #define APHY_SERVICE_NBITS 16
1185 #define APHY_TAIL_NBITS 6
1186 #define APHY_CWMIN 15
1188 #define BPHY_SLOT_TIME 20
1189 #define BPHY_SIFS_TIME 10
1190 #define BPHY_DIFS_TIME 50
1191 #define BPHY_PLCP_TIME 192
1192 #define BPHY_PLCP_SHORT_TIME 96
1193 #define BPHY_CWMIN 31
1195 #define DOT11_OFDM_SIGNAL_EXTENSION 6
1197 #define PHY_CWMAX 1023
1199 #define DOT11_MAXNUMFRAGS 16
1201 typedef struct d11cnt
{
1218 #define AB_GUARDCOUNT 10
1220 BWL_PRE_PACKED_STRUCT
struct vndr_ie
{
1225 } BWL_POST_PACKED_STRUCT
;
1226 typedef struct vndr_ie vndr_ie_t
;
1228 #define VNDR_IE_HDR_LEN 2
1229 #define VNDR_IE_MIN_LEN 3
1230 #define VNDR_IE_MAX_LEN 256
1232 #define MCSSET_LEN 16
1233 #define MAX_MCS_NUM (128)
1235 BWL_PRE_PACKED_STRUCT
struct ht_cap_ie
{
1238 uint8 supp_mcs
[MCSSET_LEN
];
1242 } BWL_POST_PACKED_STRUCT
;
1243 typedef struct ht_cap_ie ht_cap_ie_t
;
1245 #define HT_CAP_IE_LEN 26
1246 #define HT_CAP_IE_TYPE 51
1248 #define HT_CAP_LDPC_CODING 0x0001
1249 #define HT_CAP_40MHZ 0x0002
1250 #define HT_CAP_MIMO_PS_MASK 0x000C
1251 #define HT_CAP_MIMO_PS_SHIFT 0x0002
1252 #define HT_CAP_MIMO_PS_OFF 0x0003
1253 #define HT_CAP_MIMO_PS_RTS 0x0001
1254 #define HT_CAP_MIMO_PS_ON 0x0000
1255 #define HT_CAP_GF 0x0010
1256 #define HT_CAP_SHORT_GI_20 0x0020
1257 #define HT_CAP_SHORT_GI_40 0x0040
1258 #define HT_CAP_TX_STBC 0x0080
1259 #define HT_CAP_RX_STBC_MASK 0x0300
1260 #define HT_CAP_RX_STBC_SHIFT 8
1261 #define HT_CAP_DELAYED_BA 0x0400
1262 #define HT_CAP_MAX_AMSDU 0x0800
1263 #define HT_CAP_DSSS_CCK 0x1000
1264 #define HT_CAP_PSMP 0x2000
1265 #define HT_CAP_40MHZ_INTOLERANT 0x4000
1266 #define HT_CAP_LSIG_TXOP 0x8000
1268 #define HT_CAP_RX_STBC_NO 0x0
1269 #define HT_CAP_RX_STBC_ONE_STREAM 0x1
1270 #define HT_CAP_RX_STBC_TWO_STREAM 0x2
1271 #define HT_CAP_RX_STBC_THREE_STREAM 0x3
1273 #define HT_MAX_AMSDU 7935
1274 #define HT_MIN_AMSDU 3835
1276 #define HT_PARAMS_RX_FACTOR_MASK 0x03
1277 #define HT_PARAMS_DENSITY_MASK 0x1C
1278 #define HT_PARAMS_DENSITY_SHIFT 2
1280 #define AMPDU_MAX_MPDU_DENSITY 7
1281 #define AMPDU_RX_FACTOR_8K 0
1282 #define AMPDU_RX_FACTOR_16K 1
1283 #define AMPDU_RX_FACTOR_32K 2
1284 #define AMPDU_RX_FACTOR_64K 3
1285 #define AMPDU_RX_FACTOR_BASE 8*1024
1287 #define AMPDU_DELIMITER_LEN 4
1289 BWL_PRE_PACKED_STRUCT
struct ht_add_ie
{
1294 uint8 basic_mcs
[MCSSET_LEN
];
1295 } BWL_POST_PACKED_STRUCT
;
1296 typedef struct ht_add_ie ht_add_ie_t
;
1298 #define HT_ADD_IE_LEN 22
1299 #define HT_ADD_IE_TYPE 52
1301 #define HT_BW_ANY 0x04
1302 #define HT_RIFS_PERMITTED 0x08
1304 #define HT_OPMODE_MASK 0x0003
1305 #define HT_OPMODE_SHIFT 0
1306 #define HT_OPMODE_PURE 0x0000
1307 #define HT_OPMODE_OPTIONAL 0x0001
1308 #define HT_OPMODE_HT20IN40 0x0002
1309 #define HT_OPMODE_MIXED 0x0003
1310 #define HT_OPMODE_NONGF 0x0004
1311 #define DOT11N_TXBURST 0x0008
1312 #define DOT11N_OBSS_NONHT 0x0010
1314 #define HT_BASIC_STBC_MCS 0x007f
1315 #define HT_DUAL_STBC_PROT 0x0080
1316 #define HT_SECOND_BCN 0x0100
1317 #define HT_LSIG_TXOP 0x0200
1318 #define HT_PCO_ACTIVE 0x0400
1319 #define HT_PCO_PHASE 0x0800
1321 #define DOT11N_2G_TXBURST_LIMIT 6160
1322 #define DOT11N_5G_TXBURST_LIMIT 3080
1324 #define GET_HT_OPMODE(add_ie) \
1325 ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) >> HT_OPMODE_SHIFT)
1326 #define HT_MIXEDMODE_PRESENT(add_ie) \
1327 ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) == HT_OPMODE_MIXED)
1328 #define HT_HT20_PRESENT(add_ie) \
1329 ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) == HT_OPMODE_HT20IN40)
1330 #define HT_OPTIONAL_PRESENT(add_ie) \
1331 ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) == HT_OPMODE_OPTIONAL)
1332 #define HT_USE_PROTECTION(add_ie) \
1333 (HT_HT20_PRESENT((add_ie)) || HT_MIXEDMODE_PRESENT((add_ie)))
1334 #define HT_NONGF_PRESENT(add_ie) \
1335 ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_NONGF) == HT_OPMODE_NONGF)
1336 #define DOT11N_TXBURST_PRESENT(add_ie) \
1337 ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) == DOT11N_TXBURST)
1338 #define DOT11N_OBSS_NONHT_PRESENT(add_ie) \
1339 ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) == DOT11N_OBSS_NONHT)
1341 BWL_PRE_PACKED_STRUCT
struct obss_params
{
1342 uint16 passive_dwell
;
1343 uint16 active_dwell
;
1344 uint16 bss_widthscan_interval
;
1345 uint16 passive_total
;
1346 uint16 active_total
;
1347 uint16 chanwidth_transition_dly
;
1348 uint16 activity_threshold
;
1349 } BWL_POST_PACKED_STRUCT
;
1350 typedef struct obss_params obss_params_t
;
1352 BWL_PRE_PACKED_STRUCT
struct dot11_obss_ie
{
1355 obss_params_t obss_params
;
1356 } BWL_POST_PACKED_STRUCT
;
1357 typedef struct dot11_obss_ie dot11_obss_ie_t
;
1358 #define DOT11_OBSS_SCAN_IE_LEN sizeof(obss_params_t)
1360 #define HT_CTRL_LA_TRQ 0x00000002
1361 #define HT_CTRL_LA_MAI 0x0000003C
1362 #define HT_CTRL_LA_MAI_SHIFT 2
1363 #define HT_CTRL_LA_MAI_MRQ 0x00000004
1364 #define HT_CTRL_LA_MAI_MSI 0x00000038
1365 #define HT_CTRL_LA_MFSI 0x000001C0
1366 #define HT_CTRL_LA_MFSI_SHIFT 6
1367 #define HT_CTRL_LA_MFB_ASELC 0x0000FE00
1368 #define HT_CTRL_LA_MFB_ASELC_SH 9
1369 #define HT_CTRL_LA_ASELC_CMD 0x00000C00
1370 #define HT_CTRL_LA_ASELC_DATA 0x0000F000
1371 #define HT_CTRL_CAL_POS 0x00030000
1372 #define HT_CTRL_CAL_SEQ 0x000C0000
1373 #define HT_CTRL_CSI_STEERING 0x00C00000
1374 #define HT_CTRL_CSI_STEER_SHIFT 22
1375 #define HT_CTRL_CSI_STEER_NFB 0
1376 #define HT_CTRL_CSI_STEER_CSI 1
1377 #define HT_CTRL_CSI_STEER_NCOM 2
1378 #define HT_CTRL_CSI_STEER_COM 3
1379 #define HT_CTRL_NDP_ANNOUNCE 0x01000000
1380 #define HT_CTRL_AC_CONSTRAINT 0x40000000
1381 #define HT_CTRL_RDG_MOREPPDU 0x80000000
1383 #define HT_OPMODE_OPTIONAL 0x0001
1384 #define HT_OPMODE_HT20IN40 0x0002
1385 #define HT_OPMODE_MIXED 0x0003
1386 #define HT_OPMODE_NONGF 0x0004
1387 #define DOT11N_TXBURST 0x0008
1388 #define DOT11N_OBSS_NONHT 0x0010
1390 #define WPA_VERSION 1
1391 #define WPA_OUI "\x00\x50\xF2"
1393 #define WPA2_VERSION 1
1394 #define WPA2_VERSION_LEN 2
1395 #define WPA2_OUI "\x00\x0F\xAC"
1397 #define WPA_OUI_LEN 3
1399 #define WFA_OUI "\x00\x50\xF2"
1400 #define WFA_OUI_LEN 3
1402 #define WFA_OUI_TYPE_WPA 1
1403 #define WFA_OUI_TYPE_WPS 4
1404 #define WFA_OUI_TYPE_P2P 9
1406 #define RSN_AKM_NONE 0
1407 #define RSN_AKM_UNSPECIFIED 1
1408 #define RSN_AKM_PSK 2
1410 #define DOT11_MAX_DEFAULT_KEYS 4
1411 #define DOT11_MAX_KEY_SIZE 32
1412 #define DOT11_MAX_IV_SIZE 16
1413 #define DOT11_EXT_IV_FLAG (1<<5)
1414 #define DOT11_WPA_KEY_RSC_LEN 8
1416 #define WEP1_KEY_SIZE 5
1417 #define WEP1_KEY_HEX_SIZE 10
1418 #define WEP128_KEY_SIZE 13
1419 #define WEP128_KEY_HEX_SIZE 26
1420 #define TKIP_MIC_SIZE 8
1421 #define TKIP_EOM_SIZE 7
1422 #define TKIP_EOM_FLAG 0x5a
1423 #define TKIP_KEY_SIZE 32
1424 #define TKIP_MIC_AUTH_TX 16
1425 #define TKIP_MIC_AUTH_RX 24
1426 #define TKIP_MIC_SUP_RX TKIP_MIC_AUTH_TX
1427 #define TKIP_MIC_SUP_TX TKIP_MIC_AUTH_RX
1428 #define AES_KEY_SIZE 16
1429 #define AES_MIC_SIZE 8
1431 #define WCN_OUI "\x00\x50\xf2"
1434 #include <packed_section_end.h>
1436 #endif /* _802_11_H_ */