brcm47xx-2.6 cleanup, fix the kernel config
[openwrt.git] / package / d80211 / src / include / linux / ieee80211.h
1 /*
2 * IEEE 802.11 defines
3 *
4 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
5 * <jkmaline@cc.hut.fi>
6 * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
7 * Copyright (c) 2005, Devicescape Software, Inc.
8 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15 #ifndef IEEE80211_H
16 #define IEEE80211_H
17
18 #include <linux/types.h>
19
20 #define FCS_LEN 4
21
22 #define IEEE80211_FCTL_VERS 0x0003
23 #define IEEE80211_FCTL_FTYPE 0x000c
24 #define IEEE80211_FCTL_STYPE 0x00f0
25 #define IEEE80211_FCTL_TODS 0x0100
26 #define IEEE80211_FCTL_FROMDS 0x0200
27 #define IEEE80211_FCTL_MOREFRAGS 0x0400
28 #define IEEE80211_FCTL_RETRY 0x0800
29 #define IEEE80211_FCTL_PM 0x1000
30 #define IEEE80211_FCTL_MOREDATA 0x2000
31 #define IEEE80211_FCTL_PROTECTED 0x4000
32 #define IEEE80211_FCTL_ORDER 0x8000
33
34 #define IEEE80211_SCTL_FRAG 0x000F
35 #define IEEE80211_SCTL_SEQ 0xFFF0
36
37 #define IEEE80211_FTYPE_MGMT 0x0000
38 #define IEEE80211_FTYPE_CTL 0x0004
39 #define IEEE80211_FTYPE_DATA 0x0008
40
41 /* management */
42 #define IEEE80211_STYPE_ASSOC_REQ 0x0000
43 #define IEEE80211_STYPE_ASSOC_RESP 0x0010
44 #define IEEE80211_STYPE_REASSOC_REQ 0x0020
45 #define IEEE80211_STYPE_REASSOC_RESP 0x0030
46 #define IEEE80211_STYPE_PROBE_REQ 0x0040
47 #define IEEE80211_STYPE_PROBE_RESP 0x0050
48 #define IEEE80211_STYPE_BEACON 0x0080
49 #define IEEE80211_STYPE_ATIM 0x0090
50 #define IEEE80211_STYPE_DISASSOC 0x00A0
51 #define IEEE80211_STYPE_AUTH 0x00B0
52 #define IEEE80211_STYPE_DEAUTH 0x00C0
53 #define IEEE80211_STYPE_ACTION 0x00D0
54
55 /* control */
56 #define IEEE80211_STYPE_PSPOLL 0x00A0
57 #define IEEE80211_STYPE_RTS 0x00B0
58 #define IEEE80211_STYPE_CTS 0x00C0
59 #define IEEE80211_STYPE_ACK 0x00D0
60 #define IEEE80211_STYPE_CFEND 0x00E0
61 #define IEEE80211_STYPE_CFENDACK 0x00F0
62
63 /* data */
64 #define IEEE80211_STYPE_DATA 0x0000
65 #define IEEE80211_STYPE_DATA_CFACK 0x0010
66 #define IEEE80211_STYPE_DATA_CFPOLL 0x0020
67 #define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030
68 #define IEEE80211_STYPE_NULLFUNC 0x0040
69 #define IEEE80211_STYPE_CFACK 0x0050
70 #define IEEE80211_STYPE_CFPOLL 0x0060
71 #define IEEE80211_STYPE_CFACKPOLL 0x0070
72 #define IEEE80211_STYPE_QOS_DATA 0x0080
73 #define IEEE80211_STYPE_QOS_DATA_CFACK 0x0090
74 #define IEEE80211_STYPE_QOS_DATA_CFPOLL 0x00A0
75 #define IEEE80211_STYPE_QOS_DATA_CFACKPOLL 0x00B0
76 #define IEEE80211_STYPE_QOS_NULLFUNC 0x00C0
77 #define IEEE80211_STYPE_QOS_CFACK 0x00D0
78 #define IEEE80211_STYPE_QOS_CFPOLL 0x00E0
79 #define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0
80
81
82 /* miscellaneous IEEE 802.11 constants */
83 #define IEEE80211_MAX_FRAG_THRESHOLD 2346
84 #define IEEE80211_MAX_RTS_THRESHOLD 2347
85 #define IEEE80211_MAX_AID 2007
86 #define IEEE80211_MAX_TIM_LEN 251
87 #define IEEE80211_MAX_DATA_LEN 2304
88 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
89 6.2.1.1.2.
90
91 The figure in section 7.1.2 suggests a body size of up to 2312
92 bytes is allowed, which is a bit confusing, I suspect this
93 represents the 2304 bytes of real data, plus a possible 8 bytes of
94 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
95
96
97 struct ieee80211_hdr {
98 __le16 frame_control;
99 __le16 duration_id;
100 __u8 addr1[6];
101 __u8 addr2[6];
102 __u8 addr3[6];
103 __le16 seq_ctrl;
104 __u8 addr4[6];
105 } __attribute__ ((packed));
106
107
108 struct ieee80211_mgmt {
109 __le16 frame_control;
110 __le16 duration;
111 __u8 da[6];
112 __u8 sa[6];
113 __u8 bssid[6];
114 __le16 seq_ctrl;
115 union {
116 struct {
117 __le16 auth_alg;
118 __le16 auth_transaction;
119 __le16 status_code;
120 /* possibly followed by Challenge text */
121 __u8 variable[0];
122 } __attribute__ ((packed)) auth;
123 struct {
124 __le16 reason_code;
125 } __attribute__ ((packed)) deauth;
126 struct {
127 __le16 capab_info;
128 __le16 listen_interval;
129 /* followed by SSID and Supported rates */
130 u8 variable[0];
131 } __attribute__ ((packed)) assoc_req;
132 struct {
133 __le16 capab_info;
134 __le16 status_code;
135 __le16 aid;
136 /* followed by Supported rates */
137 __u8 variable[0];
138 } __attribute__ ((packed)) assoc_resp, reassoc_resp;
139 struct {
140 __le16 capab_info;
141 __le16 listen_interval;
142 __u8 current_ap[6];
143 /* followed by SSID and Supported rates */
144 __u8 variable[0];
145 } __attribute__ ((packed)) reassoc_req;
146 struct {
147 __le16 reason_code;
148 } __attribute__ ((packed)) disassoc;
149 struct {
150 __le64 timestamp;
151 __le16 beacon_int;
152 __le16 capab_info;
153 /* followed by some of SSID, Supported rates,
154 * FH Params, DS Params, CF Params, IBSS Params, TIM */
155 __u8 variable[0];
156 } __attribute__ ((packed)) beacon;
157 struct {
158 /* only variable items: SSID, Supported rates */
159 __u8 variable[0];
160 } __attribute__ ((packed)) probe_req;
161 struct {
162 __le64 timestamp;
163 __le16 beacon_int;
164 __le16 capab_info;
165 /* followed by some of SSID, Supported rates,
166 * FH Params, DS Params, CF Params, IBSS Params */
167 __u8 variable[0];
168 } __attribute__ ((packed)) probe_resp;
169 struct {
170 __u8 category;
171 union {
172 struct {
173 __u8 action_code;
174 __u8 dialog_token;
175 __u8 status_code;
176 __u8 variable[0];
177 } __attribute__ ((packed)) wme_action;
178 struct{
179 __u8 action_code;
180 __u8 element_id;
181 __u8 length;
182 __u8 switch_mode;
183 __u8 new_chan;
184 __u8 switch_count;
185 } __attribute__((packed)) chan_switch;
186 } u;
187 } __attribute__ ((packed)) action;
188 } u;
189 } __attribute__ ((packed));
190
191
192 /* Authentication algorithms */
193 #define WLAN_AUTH_OPEN 0
194 #define WLAN_AUTH_SHARED_KEY 1
195 #define WLAN_AUTH_LEAP 128
196
197 #define WLAN_AUTH_CHALLENGE_LEN 128
198
199 #define WLAN_CAPABILITY_ESS (1<<0)
200 #define WLAN_CAPABILITY_IBSS (1<<1)
201 #define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
202 #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
203 #define WLAN_CAPABILITY_PRIVACY (1<<4)
204 #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
205 #define WLAN_CAPABILITY_PBCC (1<<6)
206 #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
207 /* 802.11h */
208 #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
209 #define WLAN_CAPABILITY_QOS (1<<9)
210 #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
211 #define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
212
213 /* Status codes */
214 enum ieee80211_statuscode {
215 WLAN_STATUS_SUCCESS = 0,
216 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
217 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
218 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
219 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
220 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
221 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
222 WLAN_STATUS_CHALLENGE_FAIL = 15,
223 WLAN_STATUS_AUTH_TIMEOUT = 16,
224 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
225 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
226 /* 802.11b */
227 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
228 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
229 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
230 /* 802.11h */
231 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
232 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
233 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
234 /* 802.11g */
235 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
236 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
237 /* 802.11i */
238 WLAN_STATUS_INVALID_IE = 40,
239 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
240 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
241 WLAN_STATUS_INVALID_AKMP = 43,
242 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
243 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
244 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
245 };
246
247
248 /* Reason codes */
249 enum ieee80211_reasoncode {
250 WLAN_REASON_UNSPECIFIED = 1,
251 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
252 WLAN_REASON_DEAUTH_LEAVING = 3,
253 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
254 WLAN_REASON_DISASSOC_AP_BUSY = 5,
255 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
256 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
257 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
258 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
259 /* 802.11h */
260 WLAN_REASON_DISASSOC_BAD_POWER = 10,
261 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
262 /* 802.11i */
263 WLAN_REASON_INVALID_IE = 13,
264 WLAN_REASON_MIC_FAILURE = 14,
265 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
266 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
267 WLAN_REASON_IE_DIFFERENT = 17,
268 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
269 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
270 WLAN_REASON_INVALID_AKMP = 20,
271 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
272 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
273 WLAN_REASON_IEEE8021X_FAILED = 23,
274 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
275 };
276
277
278 /* Information Element IDs */
279 enum ieee80211_eid {
280 WLAN_EID_SSID = 0,
281 WLAN_EID_SUPP_RATES = 1,
282 WLAN_EID_FH_PARAMS = 2,
283 WLAN_EID_DS_PARAMS = 3,
284 WLAN_EID_CF_PARAMS = 4,
285 WLAN_EID_TIM = 5,
286 WLAN_EID_IBSS_PARAMS = 6,
287 WLAN_EID_CHALLENGE = 16,
288 /* 802.11d */
289 WLAN_EID_COUNTRY = 7,
290 WLAN_EID_HP_PARAMS = 8,
291 WLAN_EID_HP_TABLE = 9,
292 WLAN_EID_REQUEST = 10,
293 /* 802.11h */
294 WLAN_EID_PWR_CONSTRAINT = 32,
295 WLAN_EID_PWR_CAPABILITY = 33,
296 WLAN_EID_TPC_REQUEST = 34,
297 WLAN_EID_TPC_REPORT = 35,
298 WLAN_EID_SUPPORTED_CHANNELS = 36,
299 WLAN_EID_CHANNEL_SWITCH = 37,
300 WLAN_EID_MEASURE_REQUEST = 38,
301 WLAN_EID_MEASURE_REPORT = 39,
302 WLAN_EID_QUIET = 40,
303 WLAN_EID_IBSS_DFS = 41,
304 /* 802.11g */
305 WLAN_EID_ERP_INFO = 42,
306 WLAN_EID_EXT_SUPP_RATES = 50,
307 /* 802.11i */
308 WLAN_EID_RSN = 48,
309 WLAN_EID_WPA = 221,
310 WLAN_EID_GENERIC = 221,
311 WLAN_EID_VENDOR_SPECIFIC = 221,
312 WLAN_EID_QOS_PARAMETER = 222
313 };
314
315 #endif /* IEEE80211_H */
This page took 0.055521 seconds and 5 git commands to generate.