add common functions for the new config file format
[openwrt/svn-archive/archive.git] / openwrt / target / linux / package / ieee80211-dscape / src / include / net / ieee80211_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 IEEE802_11_MGMT_H
13 #define IEEE802_11_MGMT_H
14
15
16 struct ieee80211_mgmt {
17 u16 frame_control;
18 u16 duration;
19 u8 da[6];
20 u8 sa[6];
21 u8 bssid[6];
22 u16 seq_ctrl;
23 union {
24 struct {
25 u16 auth_alg;
26 u16 auth_transaction;
27 u16 status_code;
28 /* possibly followed by Challenge text */
29 u8 variable[0];
30 } __attribute__ ((packed)) auth;
31 struct {
32 u16 reason_code;
33 } __attribute__ ((packed)) deauth;
34 struct {
35 u16 capab_info;
36 u16 listen_interval;
37 /* followed by SSID and Supported rates */
38 u8 variable[0];
39 } __attribute__ ((packed)) assoc_req;
40 struct {
41 u16 capab_info;
42 u16 status_code;
43 u16 aid;
44 /* followed by Supported rates */
45 u8 variable[0];
46 } __attribute__ ((packed)) assoc_resp, reassoc_resp;
47 struct {
48 u16 capab_info;
49 u16 listen_interval;
50 u8 current_ap[6];
51 /* followed by SSID and Supported rates */
52 u8 variable[0];
53 } __attribute__ ((packed)) reassoc_req;
54 struct {
55 u16 reason_code;
56 } __attribute__ ((packed)) disassoc;
57 struct {
58 u8 timestamp[8];
59 u16 beacon_int;
60 u16 capab_info;
61 /* followed by some of SSID, Supported rates,
62 * FH Params, DS Params, CF Params, IBSS Params, TIM */
63 u8 variable[0];
64 } __attribute__ ((packed)) beacon;
65 struct {
66 /* only variable items: SSID, Supported rates */
67 u8 variable[0];
68 } __attribute__ ((packed)) probe_req;
69 struct {
70 u8 timestamp[8];
71 u16 beacon_int;
72 u16 capab_info;
73 /* followed by some of SSID, Supported rates,
74 * FH Params, DS Params, CF Params, IBSS Params */
75 u8 variable[0];
76 } __attribute__ ((packed)) probe_resp;
77 struct {
78 u8 category;
79 union {
80 struct {
81 u8 action_code;
82 u8 dialog_token;
83 u8 status_code;
84 u8 variable[0];
85 } __attribute__ ((packed)) wme_action;
86 struct{
87 u8 action_code;
88 u8 element_id;
89 u8 length;
90 u8 switch_mode;
91 u8 new_chan;
92 u8 switch_count;
93 } __attribute__((packed)) chan_switch;
94 } u;
95 } __attribute__ ((packed)) action;
96 } u;
97 } __attribute__ ((packed));
98
99
100 /* Authentication algorithms */
101 #define WLAN_AUTH_OPEN 0
102 #define WLAN_AUTH_SHARED_KEY 1
103 #define WLAN_AUTH_LEAP 128
104
105 #define WLAN_AUTH_CHALLENGE_LEN 128
106
107 #define WLAN_CAPABILITY_ESS BIT(0)
108 #define WLAN_CAPABILITY_IBSS BIT(1)
109 #define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
110 #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
111 #define WLAN_CAPABILITY_PRIVACY BIT(4)
112 #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
113 #define WLAN_CAPABILITY_PBCC BIT(6)
114 #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
115 /* 802.11h */
116 #define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
117 #define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
118 #define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
119
120 /* Status codes */
121 #define WLAN_STATUS_SUCCESS 0
122 #define WLAN_STATUS_UNSPECIFIED_FAILURE 1
123 #define WLAN_STATUS_CAPS_UNSUPPORTED 10
124 #define WLAN_STATUS_REASSOC_NO_ASSOC 11
125 #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
126 #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
127 #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
128 #define WLAN_STATUS_CHALLENGE_FAIL 15
129 #define WLAN_STATUS_AUTH_TIMEOUT 16
130 #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
131 #define WLAN_STATUS_ASSOC_DENIED_RATES 18
132 /* 802.11b */
133 #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
134 #define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
135 #define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
136 /* 802.11h */
137 #define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
138 #define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
139 #define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
140 /* 802.11g */
141 #define WLAN_STATUS_ASSOC_DENOED_NO_SHORT_SLOT_TIME 25
142 #define WLAN_STATUS_ASSOC_DENOED_NO_ER_PBCC 26
143 #define WLAN_STATUS_ASSOC_DENOED_NO_DSSS_OFDM 27
144
145
146 /* Reason codes */
147 #define WLAN_REASON_UNSPECIFIED 1
148 #define WLAN_REASON_PREV_AUTH_NOT_VALID 2
149 #define WLAN_REASON_DEAUTH_LEAVING 3
150 #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
151 #define WLAN_REASON_DISASSOC_AP_BUSY 5
152 #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
153 #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
154 #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
155 #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
156 /* 802.11h */
157 #define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
158 #define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
159
160 #define WLAN_REASON_MIC_FAILURE 14
161
162
163 /* Information Element IDs */
164 #define WLAN_EID_SSID 0
165 #define WLAN_EID_SUPP_RATES 1
166 #define WLAN_EID_FH_PARAMS 2
167 #define WLAN_EID_DS_PARAMS 3
168 #define WLAN_EID_CF_PARAMS 4
169 #define WLAN_EID_TIM 5
170 #define WLAN_EID_IBSS_PARAMS 6
171 #define WLAN_EID_COUNTRY 7
172 #define WLAN_EID_CHALLENGE 16
173 /* EIDs defined as part fo 11h - starts */
174 #define WLAN_EID_PWR_CONSTRAINT 32
175 #define WLAN_EID_PWR_CAPABILITY 33
176 #define WLAN_EID_TPC_REQUEST 34
177 #define WLAN_EID_TPC_REPORT 35
178 #define WLAN_EID_SUPPORTED_CHANNELS 36
179 #define WLAN_EID_CHANNEL_SWITCH 37
180 #define WLAN_EID_MEASURE_REQUEST 38
181 #define WLAN_EID_MEASURE_REPORT 39
182 #define WLAN_EID_QUITE 40
183 #define WLAN_EID_IBSS_DFS 41
184 /* EIDs defined as part fo 11h - ends */
185 #define WLAN_EID_ERP_INFO 42
186 #define WLAN_EID_RSN 48
187 #define WLAN_EID_EXT_SUPP_RATES 50
188 #define WLAN_EID_WPA 221
189 #define WLAN_EID_GENERIC 221
190 #define WLAN_EID_VENDOR_SPECIFIC 221
191
192
193
194 #define ATHEROS_INFO_USEXR BIT(3)
195
196 #endif /* IEEE802_11_MGMT_H */