Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: chromeos/drivers/ath6kl/wlan/include/ieee80211.h

Issue 646055: Atheros AR600x driver + build glue (Closed)
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 //------------------------------------------------------------------------------
2 // <copyright file="ieee80211.h" company="Atheros">
3 // Copyright (c) 2004-2008 Atheros Corporation. All rights reserved.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License version 2 as
7 // published by the Free Software Foundation;
8 //
9 // Software distributed under the License is distributed on an "AS
10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
11 // implied. See the License for the specific language governing
12 // rights and limitations under the License.
13 //
14 //
15 //------------------------------------------------------------------------------
16 //==============================================================================
17 // Author(s): ="Atheros"
18 //==============================================================================
19 #ifndef _NET80211_IEEE80211_H_
20 #define _NET80211_IEEE80211_H_
21
22 #include "athstartpack.h"
23
24 /*
25 * 802.11 protocol definitions.
26 */
27 #define IEEE80211_WEP_KEYLEN 5 /* 40bit */
28 #define IEEE80211_WEP_IVLEN 3 /* 24bit */
29 #define IEEE80211_WEP_KIDLEN 1 /* 1 octet */
30 #define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */
31 #define IEEE80211_WEP_NKID 4 /* number of key ids */
32
33 /*
34 * 802.11i defines an extended IV for use with non-WEP ciphers.
35 * When the EXTIV bit is set in the key id byte an additional
36 * 4 bytes immediately follow the IV for TKIP. For CCMP the
37 * EXTIV bit is likewise set but the 8 bytes represent the
38 * CCMP header rather than IV+extended-IV.
39 */
40 #define IEEE80211_WEP_EXTIV 0x20
41 #define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */
42 #define IEEE80211_WEP_MICLEN 8 /* trailing MIC */
43
44 #define IEEE80211_CRC_LEN 4
45
46 #ifdef WAPI_ENABLE
47 #define IEEE80211_WAPI_EXTIVLEN 10 /* extended IV length */
48 #endif /* WAPI ENABLE */
49
50
51 #define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
52 /* is 802.11 address multicast/broadcast? */
53 #define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01)
54 #define IEEE80211_IS_BROADCAST(_a) (*(_a) == 0xFF)
55 #define WEP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN)
56 #define WEP_TRAILER IEEE80211_WEP_CRCLEN
57 #define CCMP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + \
58 IEEE80211_WEP_EXTIVLEN)
59 #define CCMP_TRAILER IEEE80211_WEP_MICLEN
60 #define TKIP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + \
61 IEEE80211_WEP_EXTIVLEN)
62 #define TKIP_TRAILER IEEE80211_WEP_CRCLEN
63 #define TKIP_MICLEN IEEE80211_WEP_MICLEN
64
65
66 #define IEEE80211_ADDR_EQ(addr1, addr2) \
67 (A_MEMCMP(addr1, addr2, IEEE80211_ADDR_LEN) == 0)
68
69 #define IEEE80211_ADDR_COPY(dst,src) A_MEMCPY(dst,src,IEEE80211_ADDR_LEN)
70
71 #define IEEE80211_KEYBUF_SIZE 16
72 #define IEEE80211_MICBUF_SIZE (8+8) /* space for both tx and rx */
73
74 /*
75 * NB: these values are ordered carefully; there are lots of
76 * of implications in any reordering. In particular beware
77 * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
78 */
79 #define IEEE80211_CIPHER_WEP 0
80 #define IEEE80211_CIPHER_TKIP 1
81 #define IEEE80211_CIPHER_AES_OCB 2
82 #define IEEE80211_CIPHER_AES_CCM 3
83 #define IEEE80211_CIPHER_CKIP 5
84 #define IEEE80211_CIPHER_CCKM_KRK 6
85 #define IEEE80211_CIPHER_NONE 7 /* pseudo value */
86
87 #define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+1)
88
89 #define IEEE80211_IS_VALID_WEP_CIPHER_LEN(len) \
90 (((len) == 5) || ((len) == 13) || ((len) == 16))
91
92
93
94 /*
95 * generic definitions for IEEE 802.11 frames
96 */
97 PREPACK struct ieee80211_frame {
98 A_UINT8 i_fc[2];
99 A_UINT8 i_dur[2];
100 A_UINT8 i_addr1[IEEE80211_ADDR_LEN];
101 A_UINT8 i_addr2[IEEE80211_ADDR_LEN];
102 A_UINT8 i_addr3[IEEE80211_ADDR_LEN];
103 A_UINT8 i_seq[2];
104 /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
105 /* see below */
106 } POSTPACK;
107
108 PREPACK struct ieee80211_qosframe {
109 A_UINT8 i_fc[2];
110 A_UINT8 i_dur[2];
111 A_UINT8 i_addr1[IEEE80211_ADDR_LEN];
112 A_UINT8 i_addr2[IEEE80211_ADDR_LEN];
113 A_UINT8 i_addr3[IEEE80211_ADDR_LEN];
114 A_UINT8 i_seq[2];
115 A_UINT8 i_qos[2];
116 } POSTPACK;
117
118 #define IEEE80211_FC0_VERSION_MASK 0x03
119 #define IEEE80211_FC0_VERSION_SHIFT 0
120 #define IEEE80211_FC0_VERSION_0 0x00
121 #define IEEE80211_FC0_TYPE_MASK 0x0c
122 #define IEEE80211_FC0_TYPE_SHIFT 2
123 #define IEEE80211_FC0_TYPE_MGT 0x00
124 #define IEEE80211_FC0_TYPE_CTL 0x04
125 #define IEEE80211_FC0_TYPE_DATA 0x08
126
127 #define IEEE80211_FC0_SUBTYPE_MASK 0xf0
128 #define IEEE80211_FC0_SUBTYPE_SHIFT 4
129 /* for TYPE_MGT */
130 #define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00
131 #define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10
132 #define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20
133 #define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30
134 #define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40
135 #define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50
136 #define IEEE80211_FC0_SUBTYPE_BEACON 0x80
137 #define IEEE80211_FC0_SUBTYPE_ATIM 0x90
138 #define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0
139 #define IEEE80211_FC0_SUBTYPE_AUTH 0xb0
140 #define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0
141 /* for TYPE_CTL */
142 #define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0
143 #define IEEE80211_FC0_SUBTYPE_RTS 0xb0
144 #define IEEE80211_FC0_SUBTYPE_CTS 0xc0
145 #define IEEE80211_FC0_SUBTYPE_ACK 0xd0
146 #define IEEE80211_FC0_SUBTYPE_CF_END 0xe0
147 #define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0
148 /* for TYPE_DATA (bit combination) */
149 #define IEEE80211_FC0_SUBTYPE_DATA 0x00
150 #define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10
151 #define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20
152 #define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30
153 #define IEEE80211_FC0_SUBTYPE_NODATA 0x40
154 #define IEEE80211_FC0_SUBTYPE_CFACK 0x50
155 #define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60
156 #define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
157 #define IEEE80211_FC0_SUBTYPE_QOS 0x80
158 #define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0
159
160 #define IEEE80211_FC1_DIR_MASK 0x03
161 #define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
162 #define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */
163 #define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */
164 #define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */
165
166 #define IEEE80211_FC1_MORE_FRAG 0x04
167 #define IEEE80211_FC1_RETRY 0x08
168 #define IEEE80211_FC1_PWR_MGT 0x10
169 #define IEEE80211_FC1_MORE_DATA 0x20
170 #define IEEE80211_FC1_WEP 0x40
171 #define IEEE80211_FC1_ORDER 0x80
172
173 #define IEEE80211_SEQ_FRAG_MASK 0x000f
174 #define IEEE80211_SEQ_FRAG_SHIFT 0
175 #define IEEE80211_SEQ_SEQ_MASK 0xfff0
176 #define IEEE80211_SEQ_SEQ_SHIFT 4
177
178 #define IEEE80211_NWID_LEN 32
179
180 /*
181 * 802.11 rate set.
182 */
183 #define IEEE80211_RATE_SIZE 8 /* 802.11 standard */
184 #define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */
185
186 #define WMM_NUM_AC 4 /* 4 AC categories */
187
188 #define WMM_PARAM_ACI_M 0x60 /* Mask for ACI field */
189 #define WMM_PARAM_ACI_S 5 /* Shift for ACI field */
190 #define WMM_PARAM_ACM_M 0x10 /* Mask for ACM bit */
191 #define WMM_PARAM_ACM_S 4 /* Shift for ACM bit */
192 #define WMM_PARAM_AIFSN_M 0x0f /* Mask for aifsn field */
193 #define WMM_PARAM_LOGCWMIN_M 0x0f /* Mask for CwMin field (in log) */
194 #define WMM_PARAM_LOGCWMAX_M 0xf0 /* Mask for CwMax field (in log) */
195 #define WMM_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */
196
197 #define WMM_AC_TO_TID(_ac) ( \
198 ((_ac) == WMM_AC_VO) ? 6 : \
199 ((_ac) == WMM_AC_VI) ? 5 : \
200 ((_ac) == WMM_AC_BK) ? 1 : \
201 0)
202
203 #define TID_TO_WMM_AC(_tid) ( \
204 ((_tid) < 1) ? WMM_AC_BE : \
205 ((_tid) < 3) ? WMM_AC_BK : \
206 ((_tid) < 6) ? WMM_AC_VI : \
207 WMM_AC_VO)
208 /*
209 * Management information element payloads.
210 */
211
212 enum {
213 IEEE80211_ELEMID_SSID = 0,
214 IEEE80211_ELEMID_RATES = 1,
215 IEEE80211_ELEMID_FHPARMS = 2,
216 IEEE80211_ELEMID_DSPARMS = 3,
217 IEEE80211_ELEMID_CFPARMS = 4,
218 IEEE80211_ELEMID_TIM = 5,
219 IEEE80211_ELEMID_IBSSPARMS = 6,
220 IEEE80211_ELEMID_COUNTRY = 7,
221 IEEE80211_ELEMID_CHALLENGE = 16,
222 /* 17-31 reserved for challenge text extension */
223 IEEE80211_ELEMID_PWRCNSTR = 32,
224 IEEE80211_ELEMID_PWRCAP = 33,
225 IEEE80211_ELEMID_TPCREQ = 34,
226 IEEE80211_ELEMID_TPCREP = 35,
227 IEEE80211_ELEMID_SUPPCHAN = 36,
228 IEEE80211_ELEMID_CHANSWITCH = 37,
229 IEEE80211_ELEMID_MEASREQ = 38,
230 IEEE80211_ELEMID_MEASREP = 39,
231 IEEE80211_ELEMID_QUIET = 40,
232 IEEE80211_ELEMID_IBSSDFS = 41,
233 IEEE80211_ELEMID_ERP = 42,
234 IEEE80211_ELEMID_HTCAP_ANA = 45, /* Address ANA, and non-ANA story, for i nterop. CL#171733 */
235 IEEE80211_ELEMID_RSN = 48,
236 IEEE80211_ELEMID_XRATES = 50,
237 IEEE80211_ELEMID_HTINFO_ANA = 61,
238 #ifdef WAPI_ENABLE
239 IEEE80211_ELEMID_WAPI = 68,
240 #endif
241 IEEE80211_ELEMID_TPC = 150,
242 IEEE80211_ELEMID_CCKM = 156,
243 IEEE80211_ELEMID_VENDOR = 221, /* vendor private */
244 };
245
246 #define ATH_OUI 0x7f0300 /* Atheros OUI */
247 #define ATH_OUI_TYPE 0x01
248 #define ATH_OUI_SUBTYPE 0x01
249 #define ATH_OUI_VERSION 0x00
250
251 #define WPA_OUI 0xf25000
252 #define WPA_OUI_TYPE 0x01
253 #define WPA_VERSION 1 /* current supported version */
254
255 #define WPA_CSE_NULL 0x00
256 #define WPA_CSE_WEP40 0x01
257 #define WPA_CSE_TKIP 0x02
258 #define WPA_CSE_CCMP 0x04
259 #define WPA_CSE_WEP104 0x05
260
261 #define WPA_ASE_NONE 0x00
262 #define WPA_ASE_8021X_UNSPEC 0x01
263 #define WPA_ASE_8021X_PSK 0x02
264
265 #define RSN_OUI 0xac0f00
266 #define RSN_VERSION 1 /* current supported version */
267
268 #define RSN_CSE_NULL 0x00
269 #define RSN_CSE_WEP40 0x01
270 #define RSN_CSE_TKIP 0x02
271 #define RSN_CSE_WRAP 0x03
272 #define RSN_CSE_CCMP 0x04
273 #define RSN_CSE_WEP104 0x05
274
275 #define RSN_ASE_NONE 0x00
276 #define RSN_ASE_8021X_UNSPEC 0x01
277 #define RSN_ASE_8021X_PSK 0x02
278
279 #define RSN_CAP_PREAUTH 0x01
280
281 #define WMM_OUI 0xf25000
282 #define WMM_OUI_TYPE 0x02
283 #define WMM_INFO_OUI_SUBTYPE 0x00
284 #define WMM_PARAM_OUI_SUBTYPE 0x01
285 #define WMM_VERSION 1
286
287 /* WMM stream classes */
288 #define WMM_NUM_AC 4
289 #define WMM_AC_BE 0 /* best effort */
290 #define WMM_AC_BK 1 /* background */
291 #define WMM_AC_VI 2 /* video */
292 #define WMM_AC_VO 3 /* voice */
293
294 /* TSPEC related */
295 #define ACTION_CATEGORY_CODE_TSPEC 17
296 #define ACTION_CODE_TSPEC_ADDTS 0
297 #define ACTION_CODE_TSPEC_ADDTS_RESP 1
298 #define ACTION_CODE_TSPEC_DELTS 2
299
300 typedef enum {
301 TSPEC_STATUS_CODE_ADMISSION_ACCEPTED = 0,
302 TSPEC_STATUS_CODE_ADDTS_INVALID_PARAMS = 0x1,
303 TSPEC_STATUS_CODE_ADDTS_REQUEST_REFUSED = 0x3,
304 TSPEC_STATUS_CODE_UNSPECIFIED_QOS_RELATED_FAILURE = 0xC8,
305 TSPEC_STATUS_CODE_REQUESTED_REFUSED_POLICY_CONFIGURATION = 0xC9,
306 TSPEC_STATUS_CODE_INSUFFCIENT_BANDWIDTH = 0xCA,
307 TSPEC_STATUS_CODE_INVALID_PARAMS = 0xCB,
308 TSPEC_STATUS_CODE_DELTS_SENT = 0x30,
309 TSPEC_STATUS_CODE_DELTS_RECV = 0x31,
310 } TSPEC_STATUS_CODE;
311
312 #define TSPEC_TSID_MASK 0xF
313 #define TSPEC_TSID_S 1
314
315 /*
316 * WMM/802.11e Tspec Element
317 */
318 typedef PREPACK struct wmm_tspec_ie_t {
319 A_UINT8 elementId;
320 A_UINT8 len;
321 A_UINT8 oui[3];
322 A_UINT8 ouiType;
323 A_UINT8 ouiSubType;
324 A_UINT8 version;
325 A_UINT16 tsInfo_info;
326 A_UINT8 tsInfo_reserved;
327 A_UINT16 nominalMSDU;
328 A_UINT16 maxMSDU;
329 A_UINT32 minServiceInt;
330 A_UINT32 maxServiceInt;
331 A_UINT32 inactivityInt;
332 A_UINT32 suspensionInt;
333 A_UINT32 serviceStartTime;
334 A_UINT32 minDataRate;
335 A_UINT32 meanDataRate;
336 A_UINT32 peakDataRate;
337 A_UINT32 maxBurstSize;
338 A_UINT32 delayBound;
339 A_UINT32 minPhyRate;
340 A_UINT16 sba;
341 A_UINT16 mediumTime;
342 } POSTPACK WMM_TSPEC_IE;
343
344
345 /*
346 * BEACON management packets
347 *
348 * octet timestamp[8]
349 * octet beacon interval[2]
350 * octet capability information[2]
351 * information element
352 * octet elemid
353 * octet length
354 * octet information[length]
355 */
356
357 #define IEEE80211_BEACON_INTERVAL(beacon) \
358 ((beacon)[8] | ((beacon)[9] << 8))
359 #define IEEE80211_BEACON_CAPABILITY(beacon) \
360 ((beacon)[10] | ((beacon)[11] << 8))
361
362 #define IEEE80211_CAPINFO_ESS 0x0001
363 #define IEEE80211_CAPINFO_IBSS 0x0002
364 #define IEEE80211_CAPINFO_CF_POLLABLE 0x0004
365 #define IEEE80211_CAPINFO_CF_POLLREQ 0x0008
366 #define IEEE80211_CAPINFO_PRIVACY 0x0010
367 #define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020
368 #define IEEE80211_CAPINFO_PBCC 0x0040
369 #define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080
370 /* bits 8-9 are reserved */
371 #define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400
372 #define IEEE80211_CAPINFO_APSD 0x0800
373 /* bit 12 is reserved */
374 #define IEEE80211_CAPINFO_DSSSOFDM 0x2000
375 /* bits 14-15 are reserved */
376
377 /*
378 * Authentication Modes
379 */
380
381 enum ieee80211_authmode {
382 IEEE80211_AUTH_NONE = 0,
383 IEEE80211_AUTH_OPEN = 1,
384 IEEE80211_AUTH_SHARED = 2,
385 IEEE80211_AUTH_8021X = 3,
386 IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */
387 /* NB: these are used only for ioctls */
388 IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x */
389 IEEE80211_AUTH_WPA_PSK = 6, /* WPA/RSN w/ PSK */
390 IEEE80211_AUTH_WPA_CCKM = 7, /* WPA/RSN IE w/ CCKM */
391 };
392
393 #define IEEE80211_PS_MAX_QUEUE 50 /*Maximum no of buffers that can be queues for PS*/
394
395 #include "athendpack.h"
396
397 #endif /* _NET80211_IEEE80211_H_ */
OLDNEW
« no previous file with comments | « chromeos/drivers/ath6kl/reorder/rcv_aggr.c ('k') | chromeos/drivers/ath6kl/wlan/include/ieee80211_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698