add d80211 from a recent wireless-dev checkout
[openwrt/svn-archive/archive.git] / package / d80211 / src / include / net / d80211_mgmt.h
1 /*
2 * IEEE 802.11 -- shared defines for 80211.o and hostapd
3 * Copyright 2002, Jouni Malinen <jkmaline@cc.hut.fi>
4 * Copyright 2002-2004, Instant802 Networks, Inc.
5 * Copyright 2005, Devicescape Software, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12 #ifndef D802_11_MGMT_H
13 #define D802_11_MGMT_H
14
15 #include <linux/types.h>
16
17 struct ieee80211_mgmt {
18 __le16 frame_control;
19 __le16 duration;
20 u8 da[6];
21 u8 sa[6];
22 u8 bssid[6];
23 __le16 seq_ctrl;
24 union {
25 struct {
26 __le16 auth_alg;
27 __le16 auth_transaction;
28 __le16 status_code;
29 /* possibly followed by Challenge text */
30 u8 variable[0];
31 } __attribute__ ((packed)) auth;
32 struct {
33 __le16 reason_code;
34 } __attribute__ ((packed)) deauth;
35 struct {
36 __le16 capab_info;
37 __le16 listen_interval;
38 /* followed by SSID and Supported rates */
39 u8 variable[0];
40 } __attribute__ ((packed)) assoc_req;
41 struct {
42 __le16 capab_info;
43 __le16 status_code;
44 __le16 aid;
45 /* followed by Supported rates */
46 u8 variable[0];
47 } __attribute__ ((packed)) assoc_resp, reassoc_resp;
48 struct {
49 __le16 capab_info;
50 __le16 listen_interval;
51 u8 current_ap[6];
52 /* followed by SSID and Supported rates */
53 u8 variable[0];
54 } __attribute__ ((packed)) reassoc_req;
55 struct {
56 __le16 reason_code;
57 } __attribute__ ((packed)) disassoc;
58 struct {
59 __le64 timestamp;
60 __le16 beacon_int;
61 __le16 capab_info;
62 /* followed by some of SSID, Supported rates,
63 * FH Params, DS Params, CF Params, IBSS Params, TIM */
64 u8 variable[0];
65 } __attribute__ ((packed)) beacon;
66 struct {
67 /* only variable items: SSID, Supported rates */
68 u8 variable[0];
69 } __attribute__ ((packed)) probe_req;
70 struct {
71 __le64 timestamp;
72 __le16 beacon_int;
73 __le16 capab_info;
74 /* followed by some of SSID, Supported rates,
75 * FH Params, DS Params, CF Params, IBSS Params */
76 u8 variable[0];
77 } __attribute__ ((packed)) probe_resp;
78 struct {
79 u8 category;
80 union {
81 struct {
82 u8 action_code;
83 u8 dialog_token;
84 u8 status_code;
85 u8 variable[0];
86 } __attribute__ ((packed)) wme_action;
87 struct{
88 u8 action_code;
89 u8 element_id;
90 u8 length;
91 u8 switch_mode;
92 u8 new_chan;
93 u8 switch_count;
94 } __attribute__((packed)) chan_switch;
95 } u;
96 } __attribute__ ((packed)) action;
97 } u;
98 } __attribute__ ((packed));
99
100
101 /* Authentication algorithms */
102 #define WLAN_AUTH_OPEN 0
103 #define WLAN_AUTH_SHARED_KEY 1
104 #define WLAN_AUTH_LEAP 128
105
106 #define WLAN_AUTH_CHALLENGE_LEN 128
107
108 #define WLAN_CAPABILITY_ESS BIT(0)
109 #define WLAN_CAPABILITY_IBSS BIT(1)
110 #define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
111 #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
112 #define WLAN_CAPABILITY_PRIVACY BIT(4)
113 #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
114 #define WLAN_CAPABILITY_PBCC BIT(6)
115 #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
116 /* 802.11h */
117 #define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
118 #define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
119 #define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
120
121 /* Status codes */
122 enum ieee80211_statuscode {
123 WLAN_STATUS_SUCCESS = 0,
124 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
125 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
126 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
127 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
128 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
129 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
130 WLAN_STATUS_CHALLENGE_FAIL = 15,
131 WLAN_STATUS_AUTH_TIMEOUT = 16,
132 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
133 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
134 /* 802.11b */
135 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
136 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
137 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
138 /* 802.11h */
139 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
140 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
141 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
142 /* 802.11g */
143 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
144 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
145 /* 802.11i */
146 WLAN_STATUS_INVALID_IE = 40,
147 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
148 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
149 WLAN_STATUS_INVALID_AKMP = 43,
150 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
151 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
152 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
153 };
154
155
156 /* Reason codes */
157 enum ieee80211_reasoncode {
158 WLAN_REASON_UNSPECIFIED = 1,
159 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
160 WLAN_REASON_DEAUTH_LEAVING = 3,
161 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
162 WLAN_REASON_DISASSOC_AP_BUSY = 5,
163 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
164 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
165 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
166 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
167 /* 802.11h */
168 WLAN_REASON_DISASSOC_BAD_POWER = 10,
169 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
170 /* 802.11i */
171 WLAN_REASON_INVALID_IE = 13,
172 WLAN_REASON_MIC_FAILURE = 14,
173 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
174 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
175 WLAN_REASON_IE_DIFFERENT = 17,
176 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
177 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
178 WLAN_REASON_INVALID_AKMP = 20,
179 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
180 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
181 WLAN_REASON_IEEE8021X_FAILED = 23,
182 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
183 };
184
185
186 /* Information Element IDs */
187 enum ieee80211_eid {
188 WLAN_EID_SSID = 0,
189 WLAN_EID_SUPP_RATES = 1,
190 WLAN_EID_FH_PARAMS = 2,
191 WLAN_EID_DS_PARAMS = 3,
192 WLAN_EID_CF_PARAMS = 4,
193 WLAN_EID_TIM = 5,
194 WLAN_EID_IBSS_PARAMS = 6,
195 WLAN_EID_CHALLENGE = 16,
196 /* 802.11d */
197 WLAN_EID_COUNTRY = 7,
198 WLAN_EID_HP_PARAMS = 8,
199 WLAN_EID_HP_TABLE = 9,
200 WLAN_EID_REQUEST = 10,
201 /* 802.11h */
202 WLAN_EID_PWR_CONSTRAINT = 32,
203 WLAN_EID_PWR_CAPABILITY = 33,
204 WLAN_EID_TPC_REQUEST = 34,
205 WLAN_EID_TPC_REPORT = 35,
206 WLAN_EID_SUPPORTED_CHANNELS = 36,
207 WLAN_EID_CHANNEL_SWITCH = 37,
208 WLAN_EID_MEASURE_REQUEST = 38,
209 WLAN_EID_MEASURE_REPORT = 39,
210 WLAN_EID_QUIET = 40,
211 WLAN_EID_IBSS_DFS = 41,
212 /* 802.11g */
213 WLAN_EID_ERP_INFO = 42,
214 WLAN_EID_EXT_SUPP_RATES = 50,
215 /* 802.11i */
216 WLAN_EID_RSN = 48,
217 WLAN_EID_WPA = 221,
218 WLAN_EID_GENERIC = 221,
219 WLAN_EID_VENDOR_SPECIFIC = 221,
220 WLAN_EID_QOS_PARAMETER = 222
221 };
222
223 #endif /* D802_11_MGMT_H */