ieee80211_ioctl.h revision 1.10 1 /* $NetBSD: ieee80211_ioctl.h,v 1.10 2005/07/26 22:52:48 dyoung Exp $ */
2 /*-
3 * Copyright (c) 2001 Atsushi Onoe
4 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * Alternatively, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") version 2 as published by the Free
20 * Software Foundation.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.10 2005/07/06 15:38:27 sam Exp $
34 */
35 #ifndef _NET80211_IEEE80211_IOCTL_H_
36 #define _NET80211_IEEE80211_IOCTL_H_
37
38 /*
39 * IEEE 802.11 ioctls.
40 */
41 #include <net80211/_ieee80211.h>
42 #include <net80211/ieee80211.h>
43 #include <net80211/ieee80211_crypto.h>
44
45 /*
46 * Per/node (station) statistics available when operating as an AP.
47 */
48 struct ieee80211_nodestats {
49 u_int32_t ns_rx_data; /* rx data frames */
50 u_int32_t ns_rx_mgmt; /* rx management frames */
51 u_int32_t ns_rx_ctrl; /* rx control frames */
52 u_int32_t ns_rx_ucast; /* rx unicast frames */
53 u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */
54 u_int64_t ns_rx_bytes; /* rx data count (bytes) */
55 u_int64_t ns_rx_beacons; /* rx beacon frames */
56 u_int32_t ns_rx_proberesp; /* rx probe response frames */
57
58 u_int32_t ns_rx_dup; /* rx discard 'cuz dup */
59 u_int32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */
60 u_int32_t ns_rx_wepfail; /* rx wep processing failed */
61 u_int32_t ns_rx_demicfail; /* rx demic failed */
62 u_int32_t ns_rx_decap; /* rx decapsulation failed */
63 u_int32_t ns_rx_defrag; /* rx defragmentation failed */
64 u_int32_t ns_rx_disassoc; /* rx disassociation */
65 u_int32_t ns_rx_deauth; /* rx deauthentication */
66 u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */
67 u_int32_t ns_rx_unauth; /* rx on unauthorized port */
68 u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */
69
70 u_int32_t ns_tx_data; /* tx data frames */
71 u_int32_t ns_tx_mgmt; /* tx management frames */
72 u_int32_t ns_tx_ucast; /* tx unicast frames */
73 u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */
74 u_int64_t ns_tx_bytes; /* tx data count (bytes) */
75 u_int32_t ns_tx_probereq; /* tx probe request frames */
76
77 u_int32_t ns_tx_novlantag; /* tx discard 'cuz no tag */
78 u_int32_t ns_tx_vlanmismatch; /* tx discard 'cuz bad tag */
79
80 u_int32_t ns_ps_discard; /* ps discard 'cuz of age */
81
82 /* MIB-related state */
83 u_int32_t ns_tx_assoc; /* [re]associations */
84 u_int32_t ns_tx_assoc_fail; /* [re]association failures */
85 u_int32_t ns_tx_auth; /* [re]authentications */
86 u_int32_t ns_tx_auth_fail; /* [re]authentication failures*/
87 u_int32_t ns_tx_deauth; /* deauthentications */
88 u_int32_t ns_tx_deauth_code; /* last deauth reason */
89 u_int32_t ns_tx_disassoc; /* disassociations */
90 u_int32_t ns_tx_disassoc_code; /* last disassociation reason */
91 };
92
93 /*
94 * Summary statistics.
95 */
96 struct ieee80211_stats {
97 u_int32_t is_rx_badversion; /* rx frame with bad version */
98 u_int32_t is_rx_tooshort; /* rx frame too short */
99 u_int32_t is_rx_wrongbss; /* rx from wrong bssid */
100 u_int32_t is_rx_dup; /* rx discard 'cuz dup */
101 u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */
102 u_int32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */
103 u_int32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */
104 u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */
105 u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */
106 u_int32_t is_rx_wepfail; /* rx wep processing failed */
107 u_int32_t is_rx_decap; /* rx decapsulation failed */
108 u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */
109 u_int32_t is_rx_ctl; /* rx discard ctrl frames */
110 u_int32_t is_rx_beacon; /* rx beacon frames */
111 u_int32_t is_rx_rstoobig; /* rx rate set truncated */
112 u_int32_t is_rx_elem_missing; /* rx required element missing*/
113 u_int32_t is_rx_elem_toobig; /* rx element too big */
114 u_int32_t is_rx_elem_toosmall; /* rx element too small */
115 u_int32_t is_rx_elem_unknown; /* rx element unknown */
116 u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */
117 u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */
118 u_int32_t is_rx_nodealloc; /* rx frame dropped */
119 u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */
120 u_int32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */
121 u_int32_t is_rx_auth_fail; /* rx sta auth failure */
122 u_int32_t is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */
123 u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */
124 u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */
125 u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
126 u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
127 u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */
128 u_int32_t is_rx_deauth; /* rx deauthentication */
129 u_int32_t is_rx_disassoc; /* rx disassociation */
130 u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
131 u_int32_t is_rx_nobuf; /* rx failed for lack of buf */
132 u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */
133 u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/
134 u_int32_t is_rx_bad_auth; /* rx bad auth request */
135 u_int32_t is_rx_unauth; /* rx on unauthorized port */
136 u_int32_t is_rx_badkeyid; /* rx w/ incorrect keyid */
137 u_int32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */
138 u_int32_t is_rx_ccmpformat; /* rx format bad (CCMP) */
139 u_int32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */
140 u_int32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */
141 u_int32_t is_rx_tkipformat; /* rx format bad (TKIP) */
142 u_int32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */
143 u_int32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */
144 u_int32_t is_rx_badcipher; /* rx failed 'cuz key type */
145 u_int32_t is_rx_nocipherctx; /* rx failed 'cuz key !setup */
146 u_int32_t is_rx_acl; /* rx discard 'cuz acl policy */
147 u_int32_t is_tx_nobuf; /* tx failed for lack of buf */
148 u_int32_t is_tx_nonode; /* tx failed for no node */
149 u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */
150 u_int32_t is_tx_badcipher; /* tx failed 'cuz key type */
151 u_int32_t is_tx_nodefkey; /* tx failed 'cuz no defkey */
152 u_int32_t is_tx_noheadroom; /* tx failed 'cuz no space */
153 u_int32_t is_scan_active; /* active scans started */
154 u_int32_t is_scan_passive; /* passive scans started */
155 u_int32_t is_node_timeout; /* nodes timed out inactivity */
156 u_int32_t is_crypto_nomem; /* no memory for crypto ctx */
157 u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */
158 u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */
159 u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */
160 u_int32_t is_crypto_tkipcm; /* tkip counter measures */
161 u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */
162 u_int32_t is_crypto_wep; /* wep crypto done in s/w */
163 u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */
164 u_int32_t is_crypto_setkey_nokey; /* no key index for setkey */
165 u_int32_t is_crypto_delkey; /* driver key delete failed */
166 u_int32_t is_crypto_badcipher; /* unknown cipher */
167 u_int32_t is_crypto_nocipher; /* cipher not available */
168 u_int32_t is_crypto_attachfail; /* cipher attach failed */
169 u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */
170 u_int32_t is_crypto_keyfail; /* driver key alloc failed */
171 u_int32_t is_crypto_enmicfail; /* en-MIC failed */
172 u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */
173 u_int32_t is_ibss_norate; /* merge failed-rate mismatch */
174 u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */
175 u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */
176 u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */
177 };
178
179 /*
180 * Max size of optional information elements. We artificially
181 * constrain this; it's limited only by the max frame size (and
182 * the max parameter size of the wireless extensions).
183 */
184 #define IEEE80211_MAX_OPT_IE 256
185
186 /*
187 * WPA/RSN get/set key request. Specify the key/cipher
188 * type and whether the key is to be used for sending and/or
189 * receiving. The key index should be set only when working
190 * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
191 * Otherwise a unicast/pairwise key is specified by the bssid
192 * (on a station) or mac address (on an ap). They key length
193 * must include any MIC key data; otherwise it should be no
194 more than IEEE80211_KEYBUF_SIZE.
195 */
196 struct ieee80211req_key {
197 u_int8_t ik_type; /* key/cipher type */
198 u_int8_t ik_pad;
199 u_int16_t ik_keyix; /* key index */
200 u_int8_t ik_keylen; /* key length in bytes */
201 u_int8_t ik_flags;
202 /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
203 #define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
204 u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
205 u_int64_t ik_keyrsc; /* key receive sequence counter */
206 u_int64_t ik_keytsc; /* key transmit sequence counter */
207 u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
208 };
209
210 /*
211 * Delete a key either by index or address. Set the index
212 * to IEEE80211_KEYIX_NONE when deleting a unicast key.
213 */
214 struct ieee80211req_del_key {
215 u_int8_t idk_keyix; /* key index */
216 u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];
217 };
218
219 /*
220 * MLME state manipulation request. IEEE80211_MLME_ASSOC
221 * only makes sense when operating as a station. The other
222 * requests can be used when operating as a station or an
223 * ap (to effect a station).
224 */
225 struct ieee80211req_mlme {
226 u_int8_t im_op; /* operation to perform */
227 #define IEEE80211_MLME_ASSOC 1 /* associate station */
228 #define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
229 #define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
230 #define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
231 #define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
232 u_int8_t im_ssid_len; /* length of optional ssid */
233 u_int16_t im_reason; /* 802.11 reason code */
234 u_int8_t im_macaddr[IEEE80211_ADDR_LEN];
235 u_int8_t im_ssid[IEEE80211_NWID_LEN];
236 };
237
238 /*
239 * MAC ACL operations.
240 */
241 enum {
242 IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */
243 IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */
244 IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */
245 IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */
246 IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */
247 };
248
249 /*
250 * Set the active channel list. Note this list is
251 * intersected with the available channel list in
252 * calculating the set of channels actually used in
253 * scanning.
254 */
255 struct ieee80211req_chanlist {
256 u_int8_t ic_channels[IEEE80211_CHAN_BYTES];
257 };
258
259 /*
260 * Get the active channel list info.
261 */
262 struct ieee80211req_chaninfo {
263 u_int ic_nchans;
264 struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
265 };
266
267 /*
268 * Retrieve the WPA/RSN information element for an associated station.
269 */
270 struct ieee80211req_wpaie {
271 u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN];
272 u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE];
273 };
274
275 /*
276 * Retrieve per-node statistics.
277 */
278 struct ieee80211req_sta_stats {
279 union {
280 /* NB: explicitly force 64-bit alignment */
281 u_int8_t macaddr[IEEE80211_ADDR_LEN];
282 u_int64_t pad;
283 } is_u;
284 struct ieee80211_nodestats is_stats;
285 };
286
287 /*
288 * Station information block; the mac address is used
289 * to retrieve other data like stats, unicast key, etc.
290 */
291 struct ieee80211req_sta_info {
292 u_int16_t isi_len; /* length (mult of 4) */
293 u_int16_t isi_freq; /* MHz */
294 u_int16_t isi_flags; /* channel flags */
295 u_int16_t isi_state; /* state flags */
296 u_int8_t isi_authmode; /* authentication algorithm */
297 u_int8_t isi_rssi;
298 u_int8_t isi_capinfo; /* capabilities */
299 u_int8_t isi_erp; /* ERP element */
300 u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
301 u_int8_t isi_nrates;
302 /* negotiated rates */
303 u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
304 u_int8_t isi_txrate; /* index to isi_rates[] */
305 u_int16_t isi_ie_len; /* IE length */
306 u_int16_t isi_associd; /* assoc response */
307 u_int16_t isi_txpower; /* current tx power */
308 u_int16_t isi_vlan; /* vlan tag */
309 u_int16_t isi_txseqs[17]; /* seq to be transmitted */
310 u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/
311 u_int16_t isi_inact; /* inactivity timer */
312 /* XXX frag state? */
313 /* variable length IE data */
314 };
315
316 /*
317 * Retrieve per-station information; to retrieve all
318 * specify a mac address of ff:ff:ff:ff:ff:ff.
319 */
320 struct ieee80211req_sta_req {
321 union {
322 /* NB: explicitly force 64-bit alignment */
323 u_int8_t macaddr[IEEE80211_ADDR_LEN];
324 u_int64_t pad;
325 } is_u;
326 struct ieee80211req_sta_info info[1]; /* variable length */
327 };
328
329 /*
330 * Get/set per-station tx power cap.
331 */
332 struct ieee80211req_sta_txpow {
333 u_int8_t it_macaddr[IEEE80211_ADDR_LEN];
334 u_int8_t it_txpow;
335 };
336
337 /*
338 * WME parameters are set and return using i_val and i_len.
339 * i_val holds the value itself. i_len specifies the AC
340 * and, as appropriate, then high bit specifies whether the
341 * operation is to be applied to the BSS or ourself.
342 */
343 #define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */
344 #define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */
345 #define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */
346
347 /*
348 * FreeBSD-style ioctls.
349 */
350 /* the first member must be matched with struct ifreq */
351 struct ieee80211req {
352 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
353 u_int16_t i_type; /* req type */
354 int16_t i_val; /* Index or simple value */
355 int16_t i_len; /* Index or simple value */
356 void *i_data; /* Extra data */
357 };
358
359 #ifdef __FreeBSD__
360 #define SIOCS80211 _IOW('i', 234, struct ieee80211req)
361 #define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
362 #define SIOCG80211STATS _IOWR('i', 236, struct ifreq)
363 #endif /* __FreeBSD__ */
364
365 #define IEEE80211_IOC_SSID 1
366 #define IEEE80211_IOC_NUMSSIDS 2
367 #define IEEE80211_IOC_WEP 3
368 #define IEEE80211_WEP_NOSUP -1
369 #define IEEE80211_WEP_OFF 0
370 #define IEEE80211_WEP_ON 1
371 #define IEEE80211_WEP_MIXED 2
372 #define IEEE80211_IOC_WEPKEY 4
373 #define IEEE80211_IOC_NUMWEPKEYS 5
374 #define IEEE80211_IOC_WEPTXKEY 6
375 #define IEEE80211_IOC_AUTHMODE 7
376 #define IEEE80211_IOC_STATIONNAME 8
377 #define IEEE80211_IOC_CHANNEL 9
378 #define IEEE80211_IOC_POWERSAVE 10
379 #define IEEE80211_POWERSAVE_NOSUP -1
380 #define IEEE80211_POWERSAVE_OFF 0
381 #define IEEE80211_POWERSAVE_CAM 1
382 #define IEEE80211_POWERSAVE_PSP 2
383 #define IEEE80211_POWERSAVE_PSP_CAM 3
384 #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
385 #define IEEE80211_IOC_POWERSAVESLEEP 11
386 #define IEEE80211_IOC_RTSTHRESHOLD 12
387 #define IEEE80211_IOC_PROTMODE 13
388 #define IEEE80211_PROTMODE_OFF 0
389 #define IEEE80211_PROTMODE_CTS 1
390 #define IEEE80211_PROTMODE_RTSCTS 2
391 #define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */
392 #define IEEE80211_IOC_BSSID 15
393 #define IEEE80211_IOC_ROAMING 16 /* roaming mode */
394 #define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */
395 #define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */
396 #define IEEE80211_IOC_WPAKEY 19
397 #define IEEE80211_IOC_DELKEY 20
398 #define IEEE80211_IOC_MLME 21
399 #define IEEE80211_IOC_OPTIE 22 /* optional info. element */
400 #define IEEE80211_IOC_SCAN_REQ 23
401 #define IEEE80211_IOC_SCAN_RESULTS 24
402 #define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */
403 #define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */
404 #define IEEE80211_IOC_CHANLIST 27 /* channel list */
405 #define IEEE80211_IOC_WME 28 /* WME mode (on, off) */
406 #define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */
407 #define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */
408 #define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */
409 #define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */
410 #define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */
411 #define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */
412 #define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */
413 #define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */
414 #define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */
415 #define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */
416 #define IEEE80211_IOC_WPAIE 39 /* WPA information element */
417 #define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */
418 #define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */
419 #define IEEE80211_IOC_CHANINFO 42 /* channel info list */
420 #define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */
421 #define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */
422 #define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */
423 #define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */
424 #define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */
425 #define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */
426 #define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */
427 #define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */
428 #define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/
429 #define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */
430 #define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */
431 #define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */
432 #define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */
433 #define IEEE80211_IOC_PUREG 56 /* pure 11g (no 11b stations) */
434
435 /*
436 * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
437 */
438 struct ieee80211req_scan_result {
439 u_int16_t isr_len; /* length (mult of 4) */
440 u_int16_t isr_freq; /* MHz */
441 u_int16_t isr_flags; /* channel flags */
442 u_int8_t isr_noise;
443 u_int8_t isr_rssi;
444 u_int8_t isr_intval; /* beacon interval */
445 u_int8_t isr_capinfo; /* capabilities */
446 u_int8_t isr_erp; /* ERP element */
447 u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
448 u_int8_t isr_nrates;
449 u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
450 u_int8_t isr_ssid_len; /* SSID length */
451 u_int8_t isr_ie_len; /* IE length */
452 u_int8_t isr_pad[5];
453 /* variable length SSID followed by IE data */
454 };
455
456 #ifdef __NetBSD__
457 /* nwid is pointed at by ifr.ifr_data */
458 struct ieee80211_nwid {
459 u_int8_t i_len;
460 u_int8_t i_nwid[IEEE80211_NWID_LEN];
461 };
462
463 #define SIOCS80211NWID _IOWR('i', 230, struct ifreq)
464 #define SIOCG80211NWID _IOWR('i', 231, struct ifreq)
465
466 /* the first member must be matched with struct ifreq */
467 struct ieee80211_nwkey {
468 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
469 int i_wepon; /* wep enabled flag */
470 int i_defkid; /* default encrypt key id */
471 struct {
472 int i_keylen;
473 u_int8_t *i_keydat;
474 } i_key[IEEE80211_WEP_NKID];
475 };
476 #define SIOCS80211NWKEY _IOW('i', 232, struct ieee80211_nwkey)
477 #define SIOCG80211NWKEY _IOWR('i', 233, struct ieee80211_nwkey)
478 /* i_wepon */
479 #define IEEE80211_NWKEY_OPEN 0 /* No privacy */
480 #define IEEE80211_NWKEY_WEP 1 /* WEP enabled */
481 #define IEEE80211_NWKEY_EAP 2 /* EAP enabled */
482 #define IEEE80211_NWKEY_PERSIST 0x100 /* designate persist keyset */
483
484 /* power management parameters */
485 struct ieee80211_power {
486 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
487 int i_enabled; /* 1 == on, 0 == off */
488 int i_maxsleep; /* max sleep in ms */
489 };
490 #define SIOCS80211POWER _IOW('i', 234, struct ieee80211_power)
491 #define SIOCG80211POWER _IOWR('i', 235, struct ieee80211_power)
492
493 struct ieee80211_auth {
494 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
495 int i_authtype;
496 };
497
498 #define IEEE80211_AUTH_NONE 0
499 #define IEEE80211_AUTH_OPEN 1
500 #define IEEE80211_AUTH_SHARED 2
501
502 #define SIOCS80211AUTH _IOW('i', 236, struct ieee80211_auth)
503 #define SIOCG80211AUTH _IOWR('i', 237, struct ieee80211_auth)
504
505 struct ieee80211chanreq {
506 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
507 u_int16_t i_channel;
508 };
509
510 #ifndef IEEE80211_CHAN_ANY
511 #define IEEE80211_CHAN_ANY 0xffff
512 #endif
513
514 #define SIOCS80211CHANNEL _IOW('i', 238, struct ieee80211chanreq)
515 #define SIOCG80211CHANNEL _IOWR('i', 239, struct ieee80211chanreq)
516
517 struct ieee80211_bssid {
518 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
519 u_int8_t i_bssid[IEEE80211_ADDR_LEN];
520 };
521
522 #define SIOCS80211BSSID _IOW('i', 240, struct ieee80211_bssid)
523 #define SIOCG80211BSSID _IOWR('i', 241, struct ieee80211_bssid)
524
525 #define SIOCG80211STATS _IOWR('i', 242, struct ifreq)
526 #define SIOCG80211ZSTATS _IOWR('i', 243, struct ifreq)
527 #define SIOCS80211 _IOW('i', 244, struct ieee80211req)
528 #define SIOCG80211 _IOWR('i', 245, struct ieee80211req)
529 #endif
530
531 #endif /* _NET80211_IEEE80211_IOCTL_H_ */
532