2 * Copyright (C) 1999-2010, Broadcom Corporation
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:
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.
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.
22 * Fundamental types and constants relating to 802.11
24 * $Id: 802.11.h,v 9.219.4.1.4.5.6.11 2010/02/09 13:23:26 Exp $
35 #ifndef _NET_ETHERNET_H_
36 #include <proto/ethernet.h>
39 #include <proto/wpa.h>
42 #include <packed_section_start.h>
45 #define DOT11_TU_TO_US 1024
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
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
65 #define DOT11_MAX_MPDU_BODY_LEN 2304
67 #define DOT11_MAX_MPDU_LEN (DOT11_A4_HDR_LEN + \
69 DOT11_IV_AES_CCM_LEN + \
70 DOT11_MAX_MPDU_BODY_LEN + \
74 #define DOT11_MAX_SSID_LEN 32
77 #define DOT11_DEFAULT_RTS_LEN 2347
78 #define DOT11_MAX_RTS_LEN 2347
81 #define DOT11_MIN_FRAG_LEN 256
82 #define DOT11_MAX_FRAG_LEN 2346
83 #define DOT11_DEFAULT_FRAG_LEN 2346
86 #define DOT11_MIN_BEACON_PERIOD 1
87 #define DOT11_MAX_BEACON_PERIOD 0xFFFF
90 #define DOT11_MIN_DTIM_PERIOD 1
91 #define DOT11_MAX_DTIM_PERIOD 0xFF
94 #define DOT11_LLC_SNAP_HDR_LEN 8
95 #define DOT11_OUI_LEN 3
96 BWL_PRE_PACKED_STRUCT struct dot11_llc_snap_header {
100 uint8 oui[DOT11_OUI_LEN];
102 } BWL_POST_PACKED_STRUCT;
105 #define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN)
109 BWL_PRE_PACKED_STRUCT struct dot11_header {
112 struct ether_addr a1;
113 struct ether_addr a2;
114 struct ether_addr a3;
116 struct ether_addr a4;
117 } BWL_POST_PACKED_STRUCT;
121 BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
124 struct ether_addr ra;
125 struct ether_addr ta;
126 } BWL_POST_PACKED_STRUCT;
127 #define DOT11_RTS_LEN 16
129 BWL_PRE_PACKED_STRUCT struct dot11_cts_frame {
132 struct ether_addr ra;
133 } BWL_POST_PACKED_STRUCT;
134 #define DOT11_CTS_LEN 10
136 BWL_PRE_PACKED_STRUCT struct dot11_ack_frame {
139 struct ether_addr ra;
140 } BWL_POST_PACKED_STRUCT;
141 #define DOT11_ACK_LEN 10
143 BWL_PRE_PACKED_STRUCT struct dot11_ps_poll_frame {
146 struct ether_addr bssid;
147 struct ether_addr ta;
148 } BWL_POST_PACKED_STRUCT;
149 #define DOT11_PS_POLL_LEN 16
151 BWL_PRE_PACKED_STRUCT struct dot11_cf_end_frame {
154 struct ether_addr ra;
155 struct ether_addr bssid;
156 } BWL_POST_PACKED_STRUCT;
157 #define DOT11_CS_END_LEN 16
159 BWL_PRE_PACKED_STRUCT struct dot11_action_wifi_vendor_specific {
165 struct dot11_action_wifi_vendor_specific* next_node;
166 } BWL_POST_PACKED_STRUCT;
168 typedef struct dot11_action_wifi_vendor_specific dot11_action_wifi_vendor_specific_t;
170 #define DOT11_BA_CTL_POLICY_NORMAL 0x0000
171 #define DOT11_BA_CTL_POLICY_NOACK 0x0001
172 #define DOT11_BA_CTL_POLICY_MASK 0x0001
174 #define DOT11_BA_CTL_MTID 0x0002
175 #define DOT11_BA_CTL_COMPRESSED 0x0004
177 #define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0
178 #define DOT11_BA_CTL_NUMMSDU_SHIFT 6
180 #define DOT11_BA_CTL_TID_MASK 0xF000
181 #define DOT11_BA_CTL_TID_SHIFT 12
184 BWL_PRE_PACKED_STRUCT struct dot11_ctl_header {
187 struct ether_addr ra;
188 struct ether_addr ta;
189 } BWL_POST_PACKED_STRUCT;
190 #define DOT11_CTL_HDR_LEN 16
193 BWL_PRE_PACKED_STRUCT struct dot11_bar {
196 } BWL_POST_PACKED_STRUCT;
197 #define DOT11_BAR_LEN 4
199 #define DOT11_BA_BITMAP_LEN 128
200 #define DOT11_BA_CMP_BITMAP_LEN 8
202 BWL_PRE_PACKED_STRUCT struct dot11_ba {
205 uint8 bitmap[DOT11_BA_BITMAP_LEN];
206 } BWL_POST_PACKED_STRUCT;
207 #define DOT11_BA_LEN 4
210 BWL_PRE_PACKED_STRUCT struct dot11_management_header {
213 struct ether_addr da;
214 struct ether_addr sa;
215 struct ether_addr bssid;
217 } BWL_POST_PACKED_STRUCT;
218 #define DOT11_MGMT_HDR_LEN 24
222 BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb {
224 uint16 beacon_interval;
226 } BWL_POST_PACKED_STRUCT;
227 #define DOT11_BCN_PRB_LEN 12
229 BWL_PRE_PACKED_STRUCT struct dot11_auth {
233 } BWL_POST_PACKED_STRUCT;
234 #define DOT11_AUTH_FIXED_LEN 6
236 BWL_PRE_PACKED_STRUCT struct dot11_assoc_req {
239 } BWL_POST_PACKED_STRUCT;
240 #define DOT11_ASSOC_REQ_FIXED_LEN 4
242 BWL_PRE_PACKED_STRUCT struct dot11_reassoc_req {
245 struct ether_addr ap;
246 } BWL_POST_PACKED_STRUCT;
247 #define DOT11_REASSOC_REQ_FIXED_LEN 10
249 BWL_PRE_PACKED_STRUCT struct dot11_assoc_resp {
253 } BWL_POST_PACKED_STRUCT;
254 #define DOT11_ASSOC_RESP_FIXED_LEN 6
256 BWL_PRE_PACKED_STRUCT struct dot11_action_measure {
261 } BWL_POST_PACKED_STRUCT;
262 #define DOT11_ACTION_MEASURE_LEN 3
264 BWL_PRE_PACKED_STRUCT struct dot11_action_ht_ch_width {
268 } BWL_POST_PACKED_STRUCT;
270 BWL_PRE_PACKED_STRUCT struct dot11_action_ht_mimops {
274 } BWL_POST_PACKED_STRUCT;
276 #define SM_PWRSAVE_ENABLE 1
277 #define SM_PWRSAVE_MODE 2
280 BWL_PRE_PACKED_STRUCT struct dot11_power_cnst {
284 } BWL_POST_PACKED_STRUCT;
285 typedef struct dot11_power_cnst dot11_power_cnst_t;
287 BWL_PRE_PACKED_STRUCT struct dot11_power_cap {
290 } BWL_POST_PACKED_STRUCT;
291 typedef struct dot11_power_cap dot11_power_cap_t;
293 BWL_PRE_PACKED_STRUCT struct dot11_tpc_rep {
298 } BWL_POST_PACKED_STRUCT;
299 typedef struct dot11_tpc_rep dot11_tpc_rep_t;
300 #define DOT11_MNG_IE_TPC_REPORT_LEN 2
302 BWL_PRE_PACKED_STRUCT struct dot11_supp_channels {
307 } BWL_POST_PACKED_STRUCT;
308 typedef struct dot11_supp_channels dot11_supp_channels_t;
311 BWL_PRE_PACKED_STRUCT struct dot11_extch {
315 } BWL_POST_PACKED_STRUCT;
316 typedef struct dot11_extch dot11_extch_ie_t;
318 BWL_PRE_PACKED_STRUCT struct dot11_brcm_extch {
324 } BWL_POST_PACKED_STRUCT;
325 typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t;
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
335 BWL_PRE_PACKED_STRUCT struct dot11_action_frmhdr {
339 } BWL_POST_PACKED_STRUCT;
340 #define DOT11_ACTION_FRMHDR_LEN 2
343 BWL_PRE_PACKED_STRUCT struct dot11_channel_switch {
349 } BWL_POST_PACKED_STRUCT;
350 typedef struct dot11_channel_switch dot11_chan_switch_ie_t;
352 #define DOT11_SWITCH_IE_LEN 3
354 #define DOT11_CSA_MODE_ADVISORY 0
355 #define DOT11_CSA_MODE_NO_TX 1
357 BWL_PRE_PACKED_STRUCT struct dot11_action_switch_channel {
360 dot11_chan_switch_ie_t chan_switch_ie;
361 dot11_brcm_extch_ie_t extch_ie;
362 } BWL_POST_PACKED_STRUCT;
364 BWL_PRE_PACKED_STRUCT struct dot11_csa_body {
369 } BWL_POST_PACKED_STRUCT;
372 BWL_PRE_PACKED_STRUCT struct dot11_ext_csa {
375 struct dot11_csa_body b;
376 } BWL_POST_PACKED_STRUCT;
378 BWL_PRE_PACKED_STRUCT struct dot11y_action_ext_csa {
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
386 BWL_PRE_PACKED_STRUCT struct dot11_action_ext_csa {
389 dot11_ext_csa_ie_t chan_switch_ie;
390 } BWL_POST_PACKED_STRUCT;
392 BWL_PRE_PACKED_STRUCT struct dot11_obss_coex {
396 } BWL_POST_PACKED_STRUCT;
397 typedef struct dot11_obss_coex dot11_obss_coex_t;
398 #define DOT11_OBSS_COEXINFO_LEN 1
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
404 BWL_PRE_PACKED_STRUCT struct dot11_obss_chanlist {
409 } BWL_POST_PACKED_STRUCT;
410 typedef struct dot11_obss_chanlist dot11_obss_chanlist_t;
411 #define DOT11_OBSS_CHANLIST_FIXED_LEN 1
413 BWL_PRE_PACKED_STRUCT struct dot11_extcap_ie {
417 } BWL_POST_PACKED_STRUCT;
418 typedef struct dot11_extcap_ie dot11_extcap_ie_t;
419 #define DOT11_EXTCAP_LEN 1
423 #define DOT11_MEASURE_TYPE_BASIC 0
424 #define DOT11_MEASURE_TYPE_CCA 1
425 #define DOT11_MEASURE_TYPE_RPI 2
428 #define DOT11_MEASURE_MODE_ENABLE (1<<1)
429 #define DOT11_MEASURE_MODE_REQUEST (1<<2)
430 #define DOT11_MEASURE_MODE_REPORT (1<<3)
432 #define DOT11_MEASURE_MODE_LATE (1<<0)
433 #define DOT11_MEASURE_MODE_INCAPABLE (1<<1)
434 #define DOT11_MEASURE_MODE_REFUSED (1<<2)
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))
442 BWL_PRE_PACKED_STRUCT struct dot11_meas_req {
451 } BWL_POST_PACKED_STRUCT;
452 typedef struct dot11_meas_req dot11_meas_req_t;
453 #define DOT11_MNG_IE_MREQ_LEN 14
455 #define DOT11_MNG_IE_MREQ_FIXED_LEN 3
457 BWL_PRE_PACKED_STRUCT struct dot11_meas_rep {
463 BWL_PRE_PACKED_STRUCT union
465 BWL_PRE_PACKED_STRUCT struct {
470 } BWL_POST_PACKED_STRUCT basic;
472 } BWL_POST_PACKED_STRUCT rep;
473 } BWL_POST_PACKED_STRUCT;
474 typedef struct dot11_meas_rep dot11_meas_rep_t;
477 #define DOT11_MNG_IE_MREP_FIXED_LEN 3
479 BWL_PRE_PACKED_STRUCT struct dot11_meas_rep_basic {
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
488 BWL_PRE_PACKED_STRUCT struct dot11_quiet {
495 } BWL_POST_PACKED_STRUCT;
496 typedef struct dot11_quiet dot11_quiet_t;
498 BWL_PRE_PACKED_STRUCT struct chan_map_tuple {
501 } BWL_POST_PACKED_STRUCT;
502 typedef struct chan_map_tuple chan_map_tuple_t;
504 BWL_PRE_PACKED_STRUCT struct dot11_ibss_dfs {
507 uint8 eaddr[ETHER_ADDR_LEN];
509 chan_map_tuple_t map[1];
510 } BWL_POST_PACKED_STRUCT;
511 typedef struct dot11_ibss_dfs dot11_ibss_dfs_t;
514 #define WME_OUI "\x00\x50\xf2"
517 #define WME_SUBTYPE_IE 0
518 #define WME_SUBTYPE_PARAM_IE 1
519 #define WME_SUBTYPE_TSPEC 2
528 typedef uint8 ac_bitmap_t;
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))))
537 BWL_PRE_PACKED_STRUCT struct wme_ie {
543 } BWL_POST_PACKED_STRUCT;
544 typedef struct wme_ie wme_ie_t;
547 BWL_PRE_PACKED_STRUCT struct edcf_acparam {
551 } BWL_POST_PACKED_STRUCT;
552 typedef struct edcf_acparam edcf_acparam_t;
555 BWL_PRE_PACKED_STRUCT struct wme_param_ie {
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
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
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
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
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
605 #define EDCF_TXOP_MIN 0
606 #define EDCF_TXOP_MAX 65535
607 #define EDCF_TXOP2USEC(txop) ((txop) << 5)
610 #define NON_EDCF_AC_BE_ACI_STA 0x02
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
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
641 BWL_PRE_PACKED_STRUCT struct edca_param_ie {
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
650 BWL_PRE_PACKED_STRUCT struct qos_cap_ie {
652 } BWL_POST_PACKED_STRUCT;
653 typedef struct qos_cap_ie qos_cap_ie_t;
655 BWL_PRE_PACKED_STRUCT struct dot11_qbss_load_ie {
658 uint16 station_count;
659 uint8 channel_utilization;
661 } BWL_POST_PACKED_STRUCT;
662 typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t;
665 #define FIXED_MSDU_SIZE 0x8000
666 #define MSDU_SIZE_MASK 0x7fff
670 #define INTEGER_SHIFT 13
671 #define FRACTION_MASK 0x1FFF
674 BWL_PRE_PACKED_STRUCT struct dot11_management_notification {
680 } BWL_POST_PACKED_STRUCT;
681 #define DOT11_MGMT_NOTIFICATION_LEN 4
684 #define WME_ADDTS_REQUEST 0
685 #define WME_ADDTS_RESPONSE 1
686 #define WME_DELTS_REQUEST 2
689 #define WME_ADMISSION_ACCEPTED 0
690 #define WME_INVALID_PARAMETERS 1
691 #define WME_ADMISSION_REFUSED 3
694 #define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN)
697 #define DOT11_OPEN_SYSTEM 0
698 #define DOT11_SHARED_KEY 1
700 #define DOT11_OPEN_SHARED 2
701 #define DOT11_CHALLENGE_LEN 128
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
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
728 #define SEQNUM_SHIFT 4
729 #define SEQNUM_MAX 0x1000
730 #define FRAGNUM_MASK 0xF
735 #define FC_TYPE_MNG 0
736 #define FC_TYPE_CTL 1
737 #define FC_TYPE_DATA 2
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
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
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
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)
789 #define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK)
791 #define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT))
793 #define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT)
794 #define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT)
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)
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)
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)
828 #define QOS_PRIO_SHIFT 0
829 #define QOS_PRIO_MASK 0x0007
830 #define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT)
833 #define QOS_TID_SHIFT 0
834 #define QOS_TID_MASK 0x000f
835 #define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT)
838 #define QOS_EOSP_SHIFT 4
839 #define QOS_EOSP_MASK 0x0010
840 #define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT)
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)
852 #define QOS_AMSDU_SHIFT 7
853 #define QOS_AMSDU_MASK 0x0080
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
872 #define DOT11_AID_MASK 0x3fff
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
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
899 #define DOT11_RC_MAX 23
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
923 #define DOT11_SC_DECLINED 37
924 #define DOT11_SC_INVALID_PARAMS 38
927 #define DOT11_MNG_DS_PARAM_LEN 1
928 #define DOT11_MNG_IBSS_PARAM_LEN 2
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
938 #define TLV_TAG_OFF 0
939 #define TLV_LEN_OFF 1
940 #define TLV_HDR_LEN 2
941 #define TLV_BODY_OFF 2
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
988 #define DOT11_RATE_BASIC 0x80
989 #define DOT11_RATE_MASK 0x7F
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
997 #define DOT11_MGN_TS_DELAY_LEN 4
998 #define TS_DELAY_FIELD_SIZE 4
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
1014 #define DOT11_OBSS_COEX_MNG_SUPPORT 0x01
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
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
1035 #define DOT11_ACTION_ID_HT_CH_WIDTH 0
1036 #define DOT11_ACTION_ID_HT_MIMO_PS 1
1039 #define DOT11_PUB_ACTION_BSS_COEX_MNG 0
1040 #define DOT11_PUB_ACTION_CHANNEL_SWITCH 4
1043 #define DOT11_BA_ACTION_ADDBA_REQ 0
1044 #define DOT11_BA_ACTION_ADDBA_RESP 1
1045 #define DOT11_BA_ACTION_DELBA 2
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
1056 #define DOT11_ADDBA_POLICY_DELAYED 0
1057 #define DOT11_ADDBA_POLICY_IMMEDIATE 1
1059 BWL_PRE_PACKED_STRUCT struct dot11_addba_req {
1063 uint16 addba_param_set;
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
1070 BWL_PRE_PACKED_STRUCT struct dot11_addba_resp {
1075 uint16 addba_param_set;
1077 } BWL_POST_PACKED_STRUCT;
1078 typedef struct dot11_addba_resp dot11_addba_resp_t;
1079 #define DOT11_ADDBA_RESP_LEN 9
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
1087 BWL_PRE_PACKED_STRUCT struct dot11_delba {
1090 uint16 delba_param_set;
1092 } BWL_POST_PACKED_STRUCT;
1093 typedef struct dot11_delba dot11_delba_t;
1094 #define DOT11_DELBA_LEN 6
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
1104 #define PREN_PREAMBLE 24
1105 #define PREN_MM_EXT 8
1106 #define PREN_PREAMBLE_EXT 4
1109 #define NPHY_RIFS_TIME 2
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
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
1131 #define DOT11_OFDM_SIGNAL_EXTENSION 6
1133 #define PHY_CWMAX 1023
1135 #define DOT11_MAXNUMFRAGS 16
1138 typedef struct d11cnt {
1156 #define BRCM_PROP_OUI "\x00\x90\x4C"
1161 BWL_PRE_PACKED_STRUCT struct brcm_prop_ie_s {
1167 } BWL_POST_PACKED_STRUCT;
1168 typedef struct brcm_prop_ie_s brcm_prop_ie_t;
1170 #define BRCM_PROP_IE_LEN 6
1172 #define DPT_IE_TYPE 2
1175 #define BRCM_OUI "\x00\x10\x18"
1178 BWL_PRE_PACKED_STRUCT struct brcm_ie {
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
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
1200 #define BRF_LZWDS 0x4
1201 #define BRF_BLOCKACK 0x8
1204 #define BRF1_AMSDU 0x1
1205 #define BRF1_WMEPS 0x4
1206 #define BRF1_PSOFIX 0x8
1208 #ifdef WLAFTERBURNER
1209 #define AB_WDS_TIMEOUT_MAX 15
1210 #define AB_WDS_TIMEOUT_MIN 1
1213 #define AB_GUARDCOUNT 10
1215 #define MCSSET_LEN 16
1216 #define MAX_MCS_NUM (128)
1218 BWL_PRE_PACKED_STRUCT struct ht_cap_ie {
1221 uint8 supp_mcs[MCSSET_LEN];
1225 } BWL_POST_PACKED_STRUCT;
1226 typedef struct ht_cap_ie ht_cap_ie_t;
1230 BWL_PRE_PACKED_STRUCT struct ht_prop_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
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
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
1267 #define HT_MAX_AMSDU 7935
1268 #define HT_MIN_AMSDU 3835
1270 #define HT_PARAMS_RX_FACTOR_MASK 0x03
1271 #define HT_PARAMS_DENSITY_MASK 0x1C
1272 #define HT_PARAMS_DENSITY_SHIFT 2
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
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
1288 BWL_PRE_PACKED_STRUCT struct ht_add_ie {
1293 uint8 basic_mcs[MCSSET_LEN];
1294 } BWL_POST_PACKED_STRUCT;
1295 typedef struct ht_add_ie ht_add_ie_t;
1299 BWL_PRE_PACKED_STRUCT struct ht_prop_add_ie {
1305 } BWL_POST_PACKED_STRUCT;
1306 typedef struct ht_prop_add_ie ht_prop_add_ie_t;
1308 #define HT_ADD_IE_LEN 22
1309 #define HT_ADD_IE_TYPE 52
1312 #define HT_BW_ANY 0x04
1313 #define HT_RIFS_PERMITTED 0x08
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
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
1336 #define DOT11N_2G_TXBURST_LIMIT 6160
1337 #define DOT11N_5G_TXBURST_LIMIT 3080
1340 #define GET_HT_OPMODE(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
1342 #define HT_MIXEDMODE_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
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) \
1352 #define DOT11N_TXBURST_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) \
1354 #define DOT11N_OBSS_NONHT_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) \
1355 == DOT11N_OBSS_NONHT)
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;
1368 BWL_PRE_PACKED_STRUCT struct dot11_obss_ie {
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)
1377 BWL_PRE_PACKED_STRUCT struct vndr_ie {
1382 } BWL_POST_PACKED_STRUCT;
1383 typedef struct vndr_ie vndr_ie_t;
1385 #define VNDR_IE_HDR_LEN 2
1386 #define VNDR_IE_MIN_LEN 3
1387 #define VNDR_IE_MAX_LEN 256
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
1400 #define RSN_AKM_NONE 0
1401 #define RSN_AKM_UNSPECIFIED 1
1402 #define RSN_AKM_PSK 2
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
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
1426 #define SMS4_KEY_LEN 16
1427 #define SMS4_WPI_CBC_MAC_LEN 16
1430 #include <packed_section_end.h>