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.
20 #include <linux/if_ether.h>
22 #define DOT11_A3_HDR_LEN 24
23 #define DOT11_A4_HDR_LEN 30
24 #define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN
25 #define DOT11_ICV_AES_LEN 8
26 #define DOT11_QOS_LEN 2
28 #define DOT11_IV_MAX_LEN 8
30 #define DOT11_DEFAULT_RTS_LEN 2347
32 #define DOT11_MIN_FRAG_LEN 256
33 #define DOT11_MAX_FRAG_LEN 2346
34 #define DOT11_DEFAULT_FRAG_LEN 2346
36 #define DOT11_MIN_BEACON_PERIOD 1
37 #define DOT11_MAX_BEACON_PERIOD 0xFFFF
39 #define DOT11_MIN_DTIM_PERIOD 1
40 #define DOT11_MAX_DTIM_PERIOD 0xFF
42 #define DOT11_OUI_LEN 3
44 #define DOT11_RTS_LEN 16
45 #define DOT11_CTS_LEN 10
46 #define DOT11_ACK_LEN 10
48 #define DOT11_BA_BITMAP_LEN 128
49 #define DOT11_BA_LEN 4
51 #define DOT11_MGMT_HDR_LEN 24
53 #define WME_OUI "\x00\x50\xf2"
56 #define WME_SUBTYPE_PARAM_IE 1
64 typedef u8 ac_bitmap_t;
66 #define AC_BITMAP_ALL 0xf
67 #define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0)
73 } __attribute__((packed));
74 typedef struct edcf_acparam edcf_acparam_t;
83 edcf_acparam_t acparam[AC_COUNT];
84 } __attribute__((packed));
85 typedef struct wme_param_ie wme_param_ie_t;
86 #define WME_PARAM_IE_LEN 24
88 #define EDCF_AIFSN_MIN 1
89 #define EDCF_AIFSN_MAX 15
90 #define EDCF_AIFSN_MASK 0x0f
91 #define EDCF_ACM_MASK 0x10
92 #define EDCF_ACI_MASK 0x60
93 #define EDCF_ACI_SHIFT 5
95 #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1)
96 #define EDCF_ECWMIN_MASK 0x0f
97 #define EDCF_ECWMAX_MASK 0xf0
98 #define EDCF_ECWMAX_SHIFT 4
100 #define EDCF_TXOP2USEC(txop) ((txop) << 5)
102 #define EDCF_AC_BE_ACI_STA 0x03
103 #define EDCF_AC_BE_ECW_STA 0xA4
104 #define EDCF_AC_BE_TXOP_STA 0x0000
105 #define EDCF_AC_BK_ACI_STA 0x27
106 #define EDCF_AC_BK_ECW_STA 0xA4
107 #define EDCF_AC_BK_TXOP_STA 0x0000
108 #define EDCF_AC_VI_ACI_STA 0x42
109 #define EDCF_AC_VI_ECW_STA 0x43
110 #define EDCF_AC_VI_TXOP_STA 0x005e
111 #define EDCF_AC_VO_ACI_STA 0x62
112 #define EDCF_AC_VO_ECW_STA 0x32
113 #define EDCF_AC_VO_TXOP_STA 0x002f
115 #define EDCF_AC_VO_TXOP_AP 0x002f
117 #define DOT11_OPEN_SYSTEM 0
118 #define DOT11_SHARED_KEY 1
120 #define SEQNUM_SHIFT 4
121 #define SEQNUM_MAX 0x1000
122 #define FRAGNUM_MASK 0xF
124 #define FC_SUBTYPE_ANY_QOS(s) ((((fc) & IEEE80211_FCTL_STYPE & (1<<7))) != 0)
126 #define FC_KIND_MASK (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)
128 #define FC_PROBE_REQ (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ)
129 #define FC_PROBE_RESP (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP)
130 #define FC_BEACON (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)
131 #define FC_PS_POLL (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL)
132 #define FC_RTS (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS)
133 #define FC_CTS (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS)
135 #define TLV_LEN_OFF 1
136 #define TLV_HDR_LEN 2
137 #define TLV_BODY_OFF 2
139 #define DOT11_MNG_RSN_ID 48
140 #define DOT11_MNG_WPA_ID 221
141 #define DOT11_MNG_VS_ID 221
143 #define DOT11_BSSTYPE_INFRASTRUCTURE 0
144 #define DOT11_BSSTYPE_ANY 2
145 #define DOT11_SCANTYPE_ACTIVE 0
147 #define PREN_PREAMBLE 24
148 #define PREN_MM_EXT 12
149 #define PREN_PREAMBLE_EXT 4
151 #define RIFS_11N_TIME 2
153 #define APHY_SLOT_TIME 9
154 #define APHY_SIFS_TIME 16
155 #define APHY_PREAMBLE_TIME 16
156 #define APHY_SIGNAL_TIME 4
157 #define APHY_SYMBOL_TIME 4
158 #define APHY_SERVICE_NBITS 16
159 #define APHY_TAIL_NBITS 6
160 #define APHY_CWMIN 15
162 #define BPHY_SLOT_TIME 20
163 #define BPHY_SIFS_TIME 10
164 #define BPHY_PLCP_TIME 192
165 #define BPHY_PLCP_SHORT_TIME 96
167 #define DOT11_OFDM_SIGNAL_EXTENSION 6
169 #define PHY_CWMAX 1023
171 #define DOT11_MAXNUMFRAGS 16
173 typedef struct d11cnt {
190 #define MCSSET_LEN 16
192 #define HT_CAP_IE_LEN 26
194 #define HT_CAP_MIMO_PS_MASK 0x000C
195 #define HT_CAP_MIMO_PS_OFF 0x0003
196 #define HT_CAP_MIMO_PS_ON 0x0000
197 #define HT_CAP_RX_STBC_MASK 0x0300
198 #define HT_CAP_RX_STBC_SHIFT 8
199 #define HT_CAP_MAX_AMSDU 0x0800
201 #define HT_CAP_RX_STBC_NO 0x0
202 #define HT_CAP_RX_STBC_ONE_STREAM 0x1
204 #define HT_PARAMS_RX_FACTOR_MASK 0x03
206 #define AMPDU_MAX_MPDU_DENSITY 7
207 #define AMPDU_RX_FACTOR_16K 1
208 #define AMPDU_RX_FACTOR_32K 2
209 #define AMPDU_RX_FACTOR_64K 3
211 #define AMPDU_DELIMITER_LEN 4
213 #define DOT11N_TXBURST 0x0008
215 #define WPA_VERSION 1
216 #define WPA_OUI "\x00\x50\xF2"
218 #define WFA_OUI "\x00\x50\xF2"
219 #define WFA_OUI_LEN 3
221 #define WFA_OUI_TYPE_WPA 1
223 #define RSN_AKM_NONE 0
224 #define RSN_AKM_UNSPECIFIED 1
225 #define RSN_AKM_PSK 2
227 #define DOT11_MAX_DEFAULT_KEYS 4
228 #define DOT11_MAX_KEY_SIZE 32
229 #define DOT11_WPA_KEY_RSC_LEN 8
231 #define BRCM_OUI "\x00\x10\x18"
233 #endif /* _802_11_H_ */