Fix typo
[openwrt/svn-archive/archive.git] / package / mac80211 / src / include / linux / nl80211.h
1 #ifndef __LINUX_NL80211_H
2 #define __LINUX_NL80211_H
3 /*
4 * 802.11 netlink interface public header
5 *
6 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
7 */
8
9 /**
10 * DOC: Station handling
11 *
12 * Stations are added per interface, but a special case exists with VLAN
13 * interfaces. When a station is bound to an AP interface, it may be moved
14 * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
15 * The station is still assumed to belong to the AP interface it was added
16 * to.
17 *
18 * TODO: need more info?
19 */
20
21 /**
22 * enum nl80211_commands - supported nl80211 commands
23 *
24 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
25 *
26 * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
27 * to get a list of all present wiphys.
28 * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and
29 * %NL80211_ATTR_WIPHY_NAME.
30 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
31 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
32 * %NL80211_ATTR_WIPHY_NAME.
33 * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
34 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
35 *
36 * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
37 * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
38 * on an %NL80211_ATTR_IFINDEX is supported.
39 * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
40 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
41 * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
42 * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
43 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
44 * be sent from userspace to request creation of a new virtual interface,
45 * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
46 * %NL80211_ATTR_IFNAME.
47 * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
48 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
49 * userspace to request deletion of a virtual interface, then requires
50 * attribute %NL80211_ATTR_IFINDEX.
51 *
52 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
53 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
54 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or
55 * %NL80211_ATTR_KEY_THRESHOLD.
56 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
57 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
58 * attributes.
59 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
60 * or %NL80211_ATTR_MAC.
61 *
62 * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a
63 * %NL80222_CMD_NEW_BEACON message)
64 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
65 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
66 * %NL80211_BEACON_HEAD and %NL80211_BEACON_TAIL attributes.
67 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
68 * parameters are like for %NL80211_CMD_SET_BEACON.
69 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
70 *
71 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
72 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
73 * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
74 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
75 * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
76 * the interface identified by %NL80211_ATTR_IFINDEX.
77 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
78 * or, if no MAC address given, all stations, on the interface identified
79 * by %NL80211_ATTR_IFINDEX.
80 *
81 * @NL80211_CMD_MAX: highest used command number
82 * @__NL80211_CMD_AFTER_LAST: internal use
83 */
84 enum nl80211_commands {
85 /* don't change the order or add anything inbetween, this is ABI! */
86 NL80211_CMD_UNSPEC,
87
88 NL80211_CMD_GET_WIPHY, /* can dump */
89 NL80211_CMD_SET_WIPHY,
90 NL80211_CMD_NEW_WIPHY,
91 NL80211_CMD_DEL_WIPHY,
92
93 NL80211_CMD_GET_INTERFACE, /* can dump */
94 NL80211_CMD_SET_INTERFACE,
95 NL80211_CMD_NEW_INTERFACE,
96 NL80211_CMD_DEL_INTERFACE,
97
98 NL80211_CMD_GET_KEY,
99 NL80211_CMD_SET_KEY,
100 NL80211_CMD_NEW_KEY,
101 NL80211_CMD_DEL_KEY,
102
103 NL80211_CMD_GET_BEACON,
104 NL80211_CMD_SET_BEACON,
105 NL80211_CMD_NEW_BEACON,
106 NL80211_CMD_DEL_BEACON,
107
108 NL80211_CMD_GET_STATION,
109 NL80211_CMD_SET_STATION,
110 NL80211_CMD_NEW_STATION,
111 NL80211_CMD_DEL_STATION,
112
113 /* add commands here */
114
115 /* used to define NL80211_CMD_MAX below */
116 __NL80211_CMD_AFTER_LAST,
117 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
118 };
119
120
121 /**
122 * enum nl80211_attrs - nl80211 netlink attributes
123 *
124 * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
125 *
126 * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
127 * /sys/class/ieee80211/<phyname>/index
128 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
129 *
130 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
131 * @NL80211_ATTR_IFNAME: network interface name
132 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
133 *
134 * @NL80211_ATTR_MAC: MAC address (various uses)
135 *
136 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
137 * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
138 * keys
139 * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
140 * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
141 * section 7.3.2.25.1, e.g. 0x000FAC04)
142 * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
143 * CCMP keys, each six bytes in little endian
144 *
145 * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
146 * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
147 * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
148 * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
149 *
150 * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
151 * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
152 * &enum nl80211_sta_flags.
153 * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
154 * IEEE 802.11 7.3.1.6 (u16).
155 * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
156 * rates as defined by IEEE 802.11 7.3.2.2 but without the length
157 * restriction (at most %NL80211_MAX_SUPP_RATES).
158 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
159 * to, or the AP interface the station was originally added to to.
160 * @NL80211_ATTR_STA_STATS: statistics for a station, part of station info
161 * given for %NL80211_CMD_GET_STATION, nested attribute containing
162 * info as possible, see &enum nl80211_sta_stats.
163 *
164 * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
165 * consisting of a nested array.
166 *
167 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
168 * &enum nl80211_mntr_flags.
169 *
170 * @NL80211_ATTR_MAX: highest attribute number currently defined
171 * @__NL80211_ATTR_AFTER_LAST: internal use
172 */
173 enum nl80211_attrs {
174 /* don't change the order or add anything inbetween, this is ABI! */
175 NL80211_ATTR_UNSPEC,
176
177 NL80211_ATTR_WIPHY,
178 NL80211_ATTR_WIPHY_NAME,
179
180 NL80211_ATTR_IFINDEX,
181 NL80211_ATTR_IFNAME,
182 NL80211_ATTR_IFTYPE,
183
184 NL80211_ATTR_MAC,
185
186 NL80211_ATTR_KEY_DATA,
187 NL80211_ATTR_KEY_IDX,
188 NL80211_ATTR_KEY_CIPHER,
189 NL80211_ATTR_KEY_SEQ,
190 NL80211_ATTR_KEY_DEFAULT,
191
192 NL80211_ATTR_BEACON_INTERVAL,
193 NL80211_ATTR_DTIM_PERIOD,
194 NL80211_ATTR_BEACON_HEAD,
195 NL80211_ATTR_BEACON_TAIL,
196
197 NL80211_ATTR_STA_AID,
198 NL80211_ATTR_STA_FLAGS,
199 NL80211_ATTR_STA_LISTEN_INTERVAL,
200 NL80211_ATTR_STA_SUPPORTED_RATES,
201 NL80211_ATTR_STA_VLAN,
202 NL80211_ATTR_STA_STATS,
203
204 NL80211_ATTR_WIPHY_BANDS,
205
206 NL80211_ATTR_MNTR_FLAGS,
207
208 /* add attributes here, update the policy in nl80211.c */
209
210 __NL80211_ATTR_AFTER_LAST,
211 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
212 };
213
214 #define NL80211_MAX_SUPP_RATES 32
215
216 /**
217 * enum nl80211_iftype - (virtual) interface types
218 *
219 * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
220 * @NL80211_IFTYPE_ADHOC: independent BSS member
221 * @NL80211_IFTYPE_STATION: managed BSS member
222 * @NL80211_IFTYPE_AP: access point
223 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
224 * @NL80211_IFTYPE_WDS: wireless distribution interface
225 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
226 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
227 * @__NL80211_IFTYPE_AFTER_LAST: internal use
228 *
229 * These values are used with the %NL80211_ATTR_IFTYPE
230 * to set the type of an interface.
231 *
232 */
233 enum nl80211_iftype {
234 NL80211_IFTYPE_UNSPECIFIED,
235 NL80211_IFTYPE_ADHOC,
236 NL80211_IFTYPE_STATION,
237 NL80211_IFTYPE_AP,
238 NL80211_IFTYPE_AP_VLAN,
239 NL80211_IFTYPE_WDS,
240 NL80211_IFTYPE_MONITOR,
241
242 /* keep last */
243 __NL80211_IFTYPE_AFTER_LAST,
244 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
245 };
246
247 /**
248 * enum nl80211_sta_flags - station flags
249 *
250 * Station flags. When a station is added to an AP interface, it is
251 * assumed to be already associated (and hence authenticated.)
252 *
253 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
254 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
255 * with short barker preamble
256 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
257 */
258 enum nl80211_sta_flags {
259 __NL80211_STA_FLAG_INVALID,
260 NL80211_STA_FLAG_AUTHORIZED,
261 NL80211_STA_FLAG_SHORT_PREAMBLE,
262 NL80211_STA_FLAG_WME,
263
264 /* keep last */
265 __NL80211_STA_FLAG_AFTER_LAST,
266 NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
267 };
268
269 /**
270 * enum nl80211_sta_stats - station statistics
271 *
272 * These attribute types are used with %NL80211_ATTR_STA_STATS
273 * when getting information about a station.
274 *
275 * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved
276 * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs)
277 * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station)
278 * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station)
279 * @__NL80211_STA_STAT_AFTER_LAST: internal
280 * @NL80211_STA_STAT_MAX: highest possible station stats attribute
281 */
282 enum nl80211_sta_stats {
283 __NL80211_STA_STAT_INVALID,
284 NL80211_STA_STAT_INACTIVE_TIME,
285 NL80211_STA_STAT_RX_BYTES,
286 NL80211_STA_STAT_TX_BYTES,
287
288 /* keep last */
289 __NL80211_STA_STAT_AFTER_LAST,
290 NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
291 };
292
293 /**
294 * enum nl80211_band_attr - band attributes
295 * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
296 * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
297 * an array of nested frequency attributes
298 * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
299 * an array of nested bitrate attributes
300 */
301 enum nl80211_band_attr {
302 __NL80211_BAND_ATTR_INVALID,
303 NL80211_BAND_ATTR_FREQS,
304 NL80211_BAND_ATTR_RATES,
305
306 /* keep last */
307 __NL80211_BAND_ATTR_AFTER_LAST,
308 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
309 };
310
311 /**
312 * enum nl80211_frequency_attr - frequency attributes
313 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
314 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
315 * regulatory domain.
316 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
317 * permitted on this channel in current regulatory domain.
318 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
319 * on this channel in current regulatory domain.
320 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
321 * on this channel in current regulatory domain.
322 */
323 enum nl80211_frequency_attr {
324 __NL80211_FREQUENCY_ATTR_INVALID,
325 NL80211_FREQUENCY_ATTR_FREQ,
326 NL80211_FREQUENCY_ATTR_DISABLED,
327 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
328 NL80211_FREQUENCY_ATTR_NO_IBSS,
329 NL80211_FREQUENCY_ATTR_RADAR,
330
331 /* keep last */
332 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
333 NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
334 };
335
336 /**
337 * enum nl80211_bitrate_attr - bitrate attributes
338 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
339 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
340 * in 2.4 GHz band.
341 */
342 enum nl80211_bitrate_attr {
343 __NL80211_BITRATE_ATTR_INVALID,
344 NL80211_BITRATE_ATTR_RATE,
345 NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
346
347 /* keep last */
348 __NL80211_BITRATE_ATTR_AFTER_LAST,
349 NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
350 };
351
352 /**
353 * enum nl80211_mntr_flags - monitor configuration flags
354 *
355 * Monitor configuration flags.
356 *
357 * @__NL80211_MNTR_FLAG_INVALID: reserved
358 *
359 * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
360 * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
361 * @NL80211_MNTR_FLAG_CONTROL: pass control frames
362 * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
363 * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
364 * overrides all other flags.
365 *
366 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
367 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
368 */
369 enum nl80211_mntr_flags {
370 __NL80211_MNTR_FLAG_INVALID,
371 NL80211_MNTR_FLAG_FCSFAIL,
372 NL80211_MNTR_FLAG_PLCPFAIL,
373 NL80211_MNTR_FLAG_CONTROL,
374 NL80211_MNTR_FLAG_OTHER_BSS,
375 NL80211_MNTR_FLAG_COOK_FRAMES,
376
377 /* keep last */
378 __NL80211_MNTR_FLAG_AFTER_LAST,
379 NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
380 };
381
382 #endif /* __LINUX_NL80211_H */