2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * Alternatively, this software may be distributed under the terms of the
18 * GNU General Public License ("GPL") version 2 as published by the Free
19 * Software Foundation.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * $Id: ieee80211_ioctl.h 3497 2008-04-09 22:25:51Z mtaylor $
34 #ifndef _NET80211_IEEE80211_IOCTL_H_
35 #define _NET80211_IEEE80211_IOCTL_H_
40 #include <net80211/_ieee80211.h>
41 #include <net80211/ieee80211.h>
42 #include <net80211/ieee80211_crypto.h>
45 * Per/node (station) statistics available when operating as an AP.
47 struct ieee80211_nodestats
{
48 u_int32_t ns_rx_data
; /* rx data frames */
49 u_int32_t ns_rx_mgmt
; /* rx management frames */
50 u_int32_t ns_rx_ctrl
; /* rx control frames */
51 u_int32_t ns_rx_ucast
; /* rx unicast frames */
52 u_int32_t ns_rx_mcast
; /* rx multi/broadcast frames */
53 u_int64_t ns_rx_bytes
; /* rx data count (bytes) */
54 u_int64_t ns_rx_beacons
; /* rx beacon frames */
55 u_int32_t ns_rx_proberesp
; /* rx probe response frames */
57 u_int32_t ns_rx_dup
; /* rx discard because it's a dup */
58 u_int32_t ns_rx_noprivacy
; /* rx w/ wep but privacy off */
59 u_int32_t ns_rx_wepfail
; /* rx wep processing failed */
60 u_int32_t ns_rx_demicfail
; /* rx demic failed */
61 u_int32_t ns_rx_hwdemicerr
; /* RX HW demic spurious failure */
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 */
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 u_int32_t ns_tx_uapsd
; /* tx on uapsd queue */
78 u_int32_t ns_tx_novlantag
; /* tx discard due to no tag */
79 u_int32_t ns_tx_vlanmismatch
; /* tx discard due to of bad tag */
81 u_int32_t ns_tx_eosplost
; /* uapsd EOSP retried out */
83 u_int32_t ns_ps_discard
; /* ps discard due to of age */
85 u_int32_t ns_uapsd_triggers
; /* uapsd triggers */
87 /* MIB-related state */
88 u_int32_t ns_tx_assoc
; /* [re]associations */
89 u_int32_t ns_tx_assoc_fail
; /* [re]association failures */
90 u_int32_t ns_tx_auth
; /* [re]authentications */
91 u_int32_t ns_tx_auth_fail
; /* [re]authentication failures*/
92 u_int32_t ns_tx_deauth
; /* deauthentications */
93 u_int32_t ns_tx_deauth_code
; /* last deauth reason */
94 u_int32_t ns_tx_disassoc
; /* disassociations */
95 u_int32_t ns_tx_disassoc_code
; /* last disassociation reason */
96 u_int32_t ns_psq_drops
; /* power save queue drops */
100 * Summary statistics.
102 struct ieee80211_stats
{
103 u_int32_t is_rx_badversion
; /* rx frame with bad version */
104 u_int32_t is_rx_tooshort
; /* rx frame too short */
105 u_int32_t is_rx_wrongbss
; /* rx from wrong bssid */
106 u_int32_t is_rx_dup
; /* rx discard due to it's a dup */
107 u_int32_t is_rx_wrongdir
; /* rx w/ wrong direction */
108 u_int32_t is_rx_mcastecho
; /* rx discard due to of mcast echo */
109 u_int32_t is_rx_mcastdisabled
; /* rx discard due to of mcast disabled */
110 u_int32_t is_rx_notassoc
; /* rx discard due to sta !assoc */
111 u_int32_t is_rx_noprivacy
; /* rx w/ wep but privacy off */
112 u_int32_t is_rx_unencrypted
; /* rx w/o wep and privacy on */
113 u_int32_t is_rx_wepfail
; /* rx wep processing failed */
114 u_int32_t is_rx_decap
; /* rx decapsulation failed */
115 u_int32_t is_rx_mgtdiscard
; /* rx discard mgt frames */
116 u_int32_t is_rx_ctl
; /* rx discard ctrl frames */
117 u_int32_t is_rx_beacon
; /* rx beacon frames */
118 u_int32_t is_rx_rstoobig
; /* rx rate set truncated */
119 u_int32_t is_rx_elem_missing
; /* rx required element missing*/
120 u_int32_t is_rx_elem_toobig
; /* rx element too big */
121 u_int32_t is_rx_elem_toosmall
; /* rx element too small */
122 u_int32_t is_rx_elem_unknown
; /* rx element unknown */
123 u_int32_t is_rx_badchan
; /* rx frame w/ invalid chan */
124 u_int32_t is_rx_chanmismatch
; /* rx frame chan mismatch */
125 u_int32_t is_rx_nodealloc
; /* rx frame dropped */
126 u_int32_t is_rx_ssidmismatch
; /* rx frame ssid mismatch */
127 u_int32_t is_rx_auth_unsupported
;/* rx w/ unsupported auth alg */
128 u_int32_t is_rx_auth_fail
; /* rx sta auth failure */
129 u_int32_t is_rx_auth_countermeasures
;/* rx auth discard due to CM */
130 u_int32_t is_rx_assoc_bss
; /* rx assoc from wrong bssid */
131 u_int32_t is_rx_assoc_notauth
; /* rx assoc w/o auth */
132 u_int32_t is_rx_assoc_capmismatch
;/* rx assoc w/ cap mismatch */
133 u_int32_t is_rx_assoc_norate
; /* rx assoc w/ no rate match */
134 u_int32_t is_rx_assoc_badwpaie
; /* rx assoc w/ bad WPA IE */
135 u_int32_t is_rx_assoc_badscie
; /* rx assoc w/ bad SC IE */
136 u_int32_t is_rx_deauth
; /* rx deauthentication */
137 u_int32_t is_rx_disassoc
; /* rx disassociation */
138 u_int32_t is_rx_badsubtype
; /* rx frame w/ unknown subtype*/
139 u_int32_t is_rx_nobuf
; /* rx failed for lack of buf */
140 u_int32_t is_rx_decryptcrc
; /* rx decrypt failed on crc */
141 u_int32_t is_rx_ahdemo_mgt
; /* rx discard ahdemo mgt frame*/
142 u_int32_t is_rx_bad_auth
; /* rx bad auth request */
143 u_int32_t is_rx_unauth
; /* rx on unauthorized port */
144 u_int32_t is_rx_badkeyid
; /* rx w/ incorrect keyid */
145 u_int32_t is_rx_ccmpreplay
; /* rx seq# violation (CCMP) */
146 u_int32_t is_rx_ccmpformat
; /* rx format bad (CCMP) */
147 u_int32_t is_rx_ccmpmic
; /* rx MIC check failed (CCMP) */
148 u_int32_t is_rx_tkipreplay
; /* rx seq# violation (TKIP) */
149 u_int32_t is_rx_tkipformat
; /* rx format bad (TKIP) */
150 u_int32_t is_rx_tkipmic
; /* rx MIC check failed (TKIP) */
151 u_int32_t is_rx_tkipicv
; /* rx ICV check failed (TKIP) */
152 u_int32_t is_rx_badcipher
; /* rx failed due to of key type */
153 u_int32_t is_rx_nocipherctx
; /* rx failed due to key !setup */
154 u_int32_t is_rx_acl
; /* rx discard due to of acl policy */
155 u_int32_t is_rx_ffcnt
; /* rx fast frames */
156 u_int32_t is_rx_badathtnl
; /* driver key alloc failed */
157 u_int32_t is_tx_nobuf
; /* tx failed for lack of buf */
158 u_int32_t is_tx_nonode
; /* tx failed for no node */
159 u_int32_t is_tx_unknownmgt
; /* tx of unknown mgt frame */
160 u_int32_t is_tx_badcipher
; /* tx failed due to of key type */
161 u_int32_t is_tx_nodefkey
; /* tx failed due to no defkey */
162 u_int32_t is_tx_noheadroom
; /* tx failed due to no space */
163 u_int32_t is_tx_ffokcnt
; /* tx fast frames sent success */
164 u_int32_t is_tx_fferrcnt
; /* tx fast frames sent success */
165 u_int32_t is_scan_active
; /* active scans started */
166 u_int32_t is_scan_passive
; /* passive scans started */
167 u_int32_t is_node_timeout
; /* nodes timed out inactivity */
168 u_int32_t is_node_fdisassoc
; /* forced node disassociation */
169 u_int32_t is_crypto_nomem
; /* no memory for crypto ctx */
170 u_int32_t is_crypto_tkip
; /* tkip crypto done in s/w */
171 u_int32_t is_crypto_tkipenmic
; /* tkip en-MIC done in s/w */
172 u_int32_t is_crypto_tkipdemic
; /* tkip de-MIC done in s/w */
173 u_int32_t is_crypto_tkipcm
; /* tkip counter measures */
174 u_int32_t is_crypto_ccmp
; /* ccmp crypto done in s/w */
175 u_int32_t is_crypto_wep
; /* wep crypto done in s/w */
176 u_int32_t is_crypto_setkey_cipher
;/* cipher rejected key */
177 u_int32_t is_crypto_setkey_nokey
;/* no key index for setkey */
178 u_int32_t is_crypto_delkey
; /* driver key delete failed */
179 u_int32_t is_crypto_badcipher
; /* unknown cipher */
180 u_int32_t is_crypto_nocipher
; /* cipher not available */
181 u_int32_t is_crypto_attachfail
; /* cipher attach failed */
182 u_int32_t is_crypto_swfallback
; /* cipher fallback to s/w */
183 u_int32_t is_crypto_keyfail
; /* driver key alloc failed */
184 u_int32_t is_crypto_enmicfail
; /* en-MIC failed */
185 u_int32_t is_ibss_capmismatch
; /* merge failed-cap mismatch */
186 u_int32_t is_ibss_norate
; /* merge failed-rate mismatch */
187 u_int32_t is_ps_unassoc
; /* ps-poll for unassoc. sta */
188 u_int32_t is_ps_badaid
; /* ps-poll w/ incorrect aid */
189 u_int32_t is_ps_qempty
; /* ps-poll w/ nothing to send */
193 * Max size of optional information elements. We artificially
194 * constrain this; it's limited only by the max frame size (and
195 * the max parameter size of the wireless extensions).
197 #define IEEE80211_MAX_OPT_IE 256
200 * WPA/RSN get/set key request. Specify the key/cipher
201 * type and whether the key is to be used for sending and/or
202 * receiving. The key index should be set only when working
203 * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
204 * Otherwise a unicast/pairwise key is specified by the bssid
205 * (on a station) or mac address (on an ap). They key length
206 * must include any MIC key data; otherwise it should be no
207 more than IEEE80211_KEYBUF_SIZE.
209 struct ieee80211req_key
{
210 u_int8_t ik_type
; /* key/cipher type */
212 ieee80211_keyix_t ik_keyix
; /* key index */
213 u_int8_t ik_keylen
; /* key length in bytes */
215 /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
216 #define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
217 u_int8_t ik_macaddr
[IEEE80211_ADDR_LEN
];
218 u_int64_t ik_keyrsc
; /* key receive sequence counter */
219 u_int64_t ik_keytsc
; /* key transmit sequence counter */
220 u_int8_t ik_keydata
[IEEE80211_KEYBUF_SIZE
+IEEE80211_MICBUF_SIZE
];
224 * Delete a key either by index or address. Set the index
225 * to IEEE80211_KEYIX_NONE when deleting a unicast key.
227 struct ieee80211req_del_key
{
228 /* NB: This is different to ieee80211_keyix_t, but this is OK as
229 * values are unique over the low order bits. */
230 u_int8_t idk_keyix
; /* key index */
231 u_int8_t idk_macaddr
[IEEE80211_ADDR_LEN
];
235 * MLME state manipulation request. IEEE80211_MLME_ASSOC
236 * only makes sense when operating as a station. The other
237 * requests can be used when operating as a station or an
238 * ap (to effect a station).
240 struct ieee80211req_mlme
{
241 u_int8_t im_op
; /* operation to perform */
242 #define IEEE80211_MLME_ASSOC 1 /* associate station */
243 #define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
244 #define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
245 #define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
246 #define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
247 #define IEEE80211_MLME_CLEAR_STATS 6 /* clear station statistic */
248 u_int8_t im_ssid_len
; /* length of optional ssid */
249 u_int16_t im_reason
; /* 802.11 reason code */
250 u_int8_t im_macaddr
[IEEE80211_ADDR_LEN
];
251 u_int8_t im_ssid
[IEEE80211_NWID_LEN
];
255 * MAC ACL operations.
258 IEEE80211_MACCMD_POLICY_OPEN
= 0, /* set policy: no ACLs */
259 IEEE80211_MACCMD_POLICY_ALLOW
= 1, /* set policy: allow traffic */
260 IEEE80211_MACCMD_POLICY_DENY
= 2, /* set policy: deny traffic */
261 IEEE80211_MACCMD_FLUSH
= 3, /* flush ACL database */
262 IEEE80211_MACCMD_DETACH
= 4, /* detach ACL policy */
266 * Set the active channel list. Note this list is
267 * intersected with the available channel list in
268 * calculating the set of channels actually used in
271 struct ieee80211req_chanlist
{
272 u_int8_t ic_channels
[IEEE80211_CHAN_BYTES
];
276 * Get the active channel list info.
278 struct ieee80211req_chaninfo
{
280 struct ieee80211_channel ic_chans
[IEEE80211_CHAN_MAX
];
284 * Retrieve the WPA/RSN information element for an associated station.
286 struct ieee80211req_wpaie
{
287 u_int8_t wpa_macaddr
[IEEE80211_ADDR_LEN
];
288 u_int8_t wpa_ie
[IEEE80211_MAX_OPT_IE
];
289 u_int8_t rsn_ie
[IEEE80211_MAX_OPT_IE
];
293 * Retrieve per-node statistics.
295 struct ieee80211req_sta_stats
{
297 /* NB: explicitly force 64-bit alignment */
298 u_int8_t macaddr
[IEEE80211_ADDR_LEN
];
301 struct ieee80211_nodestats is_stats
;
305 * Station information block; the mac address is used
306 * to retrieve other data like stats, unicast key, etc.
308 struct ieee80211req_sta_info
{
309 u_int16_t isi_len
; /* length (mult of 4) */
310 u_int16_t isi_freq
; /* MHz */
311 u_int16_t isi_flags
; /* channel flags */
312 u_int16_t isi_state
; /* state flags */
313 u_int8_t isi_authmode
; /* authentication algorithm */
315 u_int16_t isi_capinfo
; /* capabilities */
316 u_int8_t isi_athflags
; /* Atheros capabilities */
317 u_int8_t isi_erp
; /* ERP element */
318 u_int8_t isi_macaddr
[IEEE80211_ADDR_LEN
];
319 u_int8_t isi_nrates
; /* negotiated rates */
320 u_int8_t isi_rates
[IEEE80211_RATE_MAXSIZE
];
321 u_int8_t isi_txrate
; /* index to isi_rates[] */
322 u_int16_t isi_ie_len
; /* IE length */
323 u_int16_t isi_associd
; /* assoc response */
324 u_int16_t isi_txpower
; /* current tx power */
325 u_int16_t isi_vlan
; /* vlan tag */
326 u_int16_t isi_txseqs
[17]; /* seq to be transmitted */
327 u_int16_t isi_rxseqs
[17]; /* seq previous for qos frames*/
328 u_int16_t isi_inact
; /* inactivity timer */
329 u_int8_t isi_uapsd
; /* UAPSD queues */
330 u_int8_t isi_opmode
; /* sta operating mode */
332 /* XXX frag state? */
333 /* variable length IE data */
337 IEEE80211_STA_OPMODE_NORMAL
,
338 IEEE80211_STA_OPMODE_XR
342 * Retrieve per-station information; to retrieve all
343 * specify a mac address of ff:ff:ff:ff:ff:ff.
345 struct ieee80211req_sta_req
{
347 /* NB: explicitly force 64-bit alignment */
348 u_int8_t macaddr
[IEEE80211_ADDR_LEN
];
351 struct ieee80211req_sta_info info
[1]; /* variable length */
355 * Get/set per-station tx power cap.
357 struct ieee80211req_sta_txpow
{
358 u_int8_t it_macaddr
[IEEE80211_ADDR_LEN
];
363 * WME parameters are set and return using i_val and i_len.
364 * i_val holds the value itself. i_len specifies the AC
365 * and, as appropriate, then high bit specifies whether the
366 * operation is to be applied to the BSS or ourself.
368 #define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */
369 #define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */
370 #define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */
373 * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
375 struct ieee80211req_scan_result
{
376 u_int16_t isr_len
; /* length (mult of 4) */
377 u_int16_t isr_freq
; /* MHz */
378 u_int16_t isr_flags
; /* channel flags */
381 u_int8_t isr_intval
; /* beacon interval */
382 u_int16_t isr_capinfo
; /* capabilities */
383 u_int8_t isr_erp
; /* ERP element */
384 u_int8_t isr_bssid
[IEEE80211_ADDR_LEN
];
386 u_int8_t isr_rates
[IEEE80211_RATE_MAXSIZE
];
387 u_int8_t isr_ssid_len
; /* SSID length */
388 u_int8_t isr_ie_len
; /* IE length */
390 /* variable length SSID followed by IE data */
395 * FreeBSD-style ioctls.
397 /* the first member must be matched with struct ifreq */
398 struct ieee80211req
{
399 char i_name
[IFNAMSIZ
]; /* if_name, e.g. "wi0" */
400 u_int16_t i_type
; /* req type */
401 int16_t i_val
; /* Index or simple value */
402 int16_t i_len
; /* Index or simple value */
403 void *i_data
; /* Extra data */
405 #define SIOCS80211 _IOW('i', 234, struct ieee80211req)
406 #define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
407 #define SIOCG80211STATS _IOWR('i', 236, struct ifreq)
408 #define SIOC80211IFCREATE _IOWR('i', 237, struct ifreq)
409 #define SIOC80211IFDESTROY _IOW('i', 238, struct ifreq)
411 #define IEEE80211_IOC_SSID 1
412 #define IEEE80211_IOC_NUMSSIDS 2
413 #define IEEE80211_IOC_WEP 3
414 #define IEEE80211_WEP_NOSUP -1
415 #define IEEE80211_WEP_OFF 0
416 #define IEEE80211_WEP_ON 1
417 #define IEEE80211_WEP_MIXED 2
418 #define IEEE80211_IOC_WEPKEY 4
419 #define IEEE80211_IOC_NUMWEPKEYS 5
420 #define IEEE80211_IOC_WEPTXKEY 6
421 #define IEEE80211_IOC_AUTHMODE 7
422 #define IEEE80211_IOC_STATIONNAME 8
423 #define IEEE80211_IOC_CHANNEL 9
424 #define IEEE80211_IOC_POWERSAVE 10
425 #define IEEE80211_POWERSAVE_NOSUP -1
426 #define IEEE80211_POWERSAVE_OFF 0
427 #define IEEE80211_POWERSAVE_CAM 1
428 #define IEEE80211_POWERSAVE_PSP 2
429 #define IEEE80211_POWERSAVE_PSP_CAM 3
430 #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
431 #define IEEE80211_IOC_POWERSAVESLEEP 11
432 #define IEEE80211_IOC_RTSTHRESHOLD 12
433 #define IEEE80211_IOC_PROTMODE 13
434 #define IEEE80211_PROTMODE_OFF 0
435 #define IEEE80211_PROTMODE_CTS 1
436 #define IEEE80211_PROTMODE_RTSCTS 2
437 #define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */
438 #define IEEE80211_IOC_BSSID 15
439 #define IEEE80211_IOC_ROAMING 16 /* roaming mode */
440 #define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */
441 #define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */
442 #define IEEE80211_IOC_WPAKEY 19
443 #define IEEE80211_IOC_DELKEY 20
444 #define IEEE80211_IOC_MLME 21
445 #define IEEE80211_IOC_OPTIE 22 /* optional info. element */
446 #define IEEE80211_IOC_SCAN_REQ 23
447 #define IEEE80211_IOC_SCAN_RESULTS 24
448 #define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */
449 #define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */
450 #define IEEE80211_IOC_CHANLIST 27 /* channel list */
451 #define IEEE80211_IOC_WME 28 /* WME mode (on, off) */
452 #define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */
453 #define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */
454 #define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */
455 #define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */
456 #define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */
457 #define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */
458 #define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */
459 #define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */
460 #define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */
461 #define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */
462 #define IEEE80211_IOC_WPAIE 39 /* WPA information element */
463 #define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */
464 #define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */
465 #define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */
466 #define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */
467 #define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */
468 #define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */
469 #define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */
470 #define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */
471 #define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */
472 #define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */
473 #define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/
474 #define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */
475 #define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */
476 #define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */
477 #define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */
478 #define IEEE80211_IOC_FF 56 /* ATH fast frames (on, off) */
479 #define IEEE80211_IOC_TURBOP 57 /* ATH turbo' (on, off) */
480 #define IEEE80211_IOC_APPIEBUF 58 /* IE in the management frame */
481 #define IEEE80211_IOC_FILTERFRAME 59 /* management frame filter */
484 * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
486 struct ieee80211req_scan_result
{
487 u_int16_t isr_len
; /* length (mult of 4) */
488 u_int16_t isr_freq
; /* MHz */
489 u_int16_t isr_flags
; /* channel flags */
492 u_int8_t isr_intval
; /* beacon interval */
493 u_int16_t isr_capinfo
; /* capabilities */
494 u_int8_t isr_erp
; /* ERP element */
495 u_int8_t isr_bssid
[IEEE80211_ADDR_LEN
];
497 u_int8_t isr_rates
[IEEE80211_RATE_MAXSIZE
];
498 u_int8_t isr_ssid_len
; /* SSID length */
499 u_int8_t isr_ie_len
; /* IE length */
501 /* variable length SSID followed by IE data */
504 #endif /* __FreeBSD__ */
508 * Wireless Extensions API, private ioctl interfaces.
510 * NB: Even-numbered ioctl numbers have set semantics and are privileged!
511 * (regardless of the incorrect comment in wireless.h!)
514 #include <linux/if.h>
516 /* The maximum size of a iwpriv structure is IW_PRIV_SIZE_MASK, which was
517 * exceeded for some time by chaninfo ioctl. These macros change the size
518 * encoding for anything larger than IW_PRIV_SIZE_MASK from bytes to 4-byte
519 * multiples so that the padded size fits under IW_PRIV_SIZE_MASK. */
520 #define IW_PRIV_BLOB_LENGTH_ENCODING(_SIZE) \
521 (((_SIZE) == ((_SIZE) & IW_PRIV_SIZE_MASK)) ? \
523 (((_SIZE) / sizeof(uint32_t)) + \
524 (((_SIZE) == (((_SIZE) / sizeof(uint32_t)) * sizeof(int))) ? \
526 #define IW_PRIV_BLOB_TYPE_ENCODING(_SIZE) \
527 (((_SIZE) == ((_SIZE) & IW_PRIV_SIZE_MASK)) ? \
528 (IW_PRIV_TYPE_BYTE | (_SIZE)) : \
529 (IW_PRIV_TYPE_INT | IW_PRIV_BLOB_LENGTH_ENCODING((_SIZE))))
531 #define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0)
532 #define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
533 #define IEEE80211_IOCTL_SETMODE (SIOCIWFIRSTPRIV+2)
534 #define IEEE80211_IOCTL_GETMODE (SIOCIWFIRSTPRIV+3)
535 #define IEEE80211_IOCTL_SETWMMPARAMS (SIOCIWFIRSTPRIV+4)
536 #define IEEE80211_IOCTL_GETWMMPARAMS (SIOCIWFIRSTPRIV+5)
537 #define IEEE80211_IOCTL_SETCHANLIST (SIOCIWFIRSTPRIV+6)
538 #define IEEE80211_IOCTL_GETCHANLIST (SIOCIWFIRSTPRIV+7)
539 #define IEEE80211_IOCTL_CHANSWITCH (SIOCIWFIRSTPRIV+8)
540 #define IEEE80211_IOCTL_GET_APPIEBUF (SIOCIWFIRSTPRIV+9)
541 #define IEEE80211_IOCTL_SET_APPIEBUF (SIOCIWFIRSTPRIV+10)
542 #define IEEE80211_IOCTL_READREG (SIOCIWFIRSTPRIV+11)
543 #define IEEE80211_IOCTL_FILTERFRAME (SIOCIWFIRSTPRIV+12)
544 #define IEEE80211_IOCTL_GETCHANINFO (SIOCIWFIRSTPRIV+13)
545 #define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+14)
546 #define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+15)
547 #define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+16)
548 #define IEEE80211_IOCTL_RADAR (SIOCIWFIRSTPRIV+17)
549 #define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+18)
550 #define IEEE80211_IOCTL_WRITEREG (SIOCIWFIRSTPRIV+19)
551 #define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+20)
552 #define IEEE80211_IOCTL_HALMAP (SIOCIWFIRSTPRIV+21)
553 #define IEEE80211_IOCTL_ADDMAC (SIOCIWFIRSTPRIV+22)
554 #define IEEE80211_IOCTL_DELMAC (SIOCIWFIRSTPRIV+24)
555 #define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+26)
556 #define IEEE80211_IOCTL_WDSDELMAC (SIOCIWFIRSTPRIV+28)
557 #define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30)
560 IEEE80211_WMMPARAMS_CWMIN
= 1,
561 IEEE80211_WMMPARAMS_CWMAX
= 2,
562 IEEE80211_WMMPARAMS_AIFS
= 3,
563 IEEE80211_WMMPARAMS_TXOPLIMIT
= 4,
564 IEEE80211_WMMPARAMS_ACM
= 5,
565 IEEE80211_WMMPARAMS_NOACKPOLICY
= 6,
568 IEEE80211_PARAM_TURBO
= 1, /* turbo mode */
569 IEEE80211_PARAM_MODE
= 2, /* phy mode (11a, 11b, etc.) */
570 IEEE80211_PARAM_AUTHMODE
= 3, /* authentication mode */
571 IEEE80211_PARAM_PROTMODE
= 4, /* 802.11g protection */
572 IEEE80211_PARAM_MCASTCIPHER
= 5, /* multicast/default cipher */
573 IEEE80211_PARAM_MCASTKEYLEN
= 6, /* multicast key length */
574 IEEE80211_PARAM_UCASTCIPHERS
= 7, /* unicast cipher suites */
575 IEEE80211_PARAM_UCASTCIPHER
= 8, /* unicast cipher */
576 IEEE80211_PARAM_UCASTKEYLEN
= 9, /* unicast key length */
577 IEEE80211_PARAM_WPA
= 10, /* WPA mode (0,1,2) */
578 IEEE80211_PARAM_ROAMING
= 12, /* roaming mode */
579 IEEE80211_PARAM_PRIVACY
= 13, /* privacy invoked */
580 IEEE80211_PARAM_COUNTERMEASURES
= 14, /* WPA/TKIP countermeasures */
581 IEEE80211_PARAM_DROPUNENCRYPTED
= 15, /* discard unencrypted frames */
582 IEEE80211_PARAM_DRIVER_CAPS
= 16, /* driver capabilities */
583 IEEE80211_PARAM_MACCMD
= 17, /* MAC ACL operation */
584 IEEE80211_PARAM_WMM
= 18, /* WMM mode (on, off) */
585 IEEE80211_PARAM_HIDESSID
= 19, /* hide SSID mode (on, off) */
586 IEEE80211_PARAM_APBRIDGE
= 20, /* AP inter-sta bridging */
587 IEEE80211_PARAM_KEYMGTALGS
= 21, /* key management algorithms */
588 IEEE80211_PARAM_RSNCAPS
= 22, /* RSN capabilities */
589 IEEE80211_PARAM_INACT
= 23, /* station inactivity timeout */
590 IEEE80211_PARAM_INACT_AUTH
= 24, /* station auth inact timeout */
591 IEEE80211_PARAM_INACT_INIT
= 25, /* station init inact timeout */
592 IEEE80211_PARAM_ABOLT
= 26, /* Atheros Adv. Capabilities */
593 IEEE80211_PARAM_DTIM_PERIOD
= 28, /* DTIM period (beacons) */
594 IEEE80211_PARAM_BEACON_INTERVAL
= 29, /* beacon interval (ms) */
595 IEEE80211_PARAM_DOTH
= 30, /* 11.h is on/off */
596 IEEE80211_PARAM_PWRTARGET
= 31, /* Current Channel Pwr Constraint */
597 IEEE80211_PARAM_GENREASSOC
= 32, /* Generate a reassociation request */
598 IEEE80211_PARAM_COMPRESSION
= 33, /* compression */
599 IEEE80211_PARAM_FF
= 34, /* fast frames support */
600 IEEE80211_PARAM_XR
= 35, /* XR support */
601 IEEE80211_PARAM_BURST
= 36, /* burst mode */
602 IEEE80211_PARAM_PUREG
= 37, /* pure 11g (no 11b stations) */
603 IEEE80211_PARAM_AR
= 38, /* AR support */
604 IEEE80211_PARAM_WDS
= 39, /* Enable 4 address processing */
605 IEEE80211_PARAM_BGSCAN
= 40, /* bg scanning (on, off) */
606 IEEE80211_PARAM_BGSCAN_IDLE
= 41, /* bg scan idle threshold */
607 IEEE80211_PARAM_BGSCAN_INTERVAL
= 42, /* bg scan interval */
608 IEEE80211_PARAM_MCAST_RATE
= 43, /* Multicast Tx Rate */
609 IEEE80211_PARAM_COVERAGE_CLASS
= 44, /* coverage class */
610 IEEE80211_PARAM_COUNTRY_IE
= 45, /* enable country IE */
611 IEEE80211_PARAM_SCANVALID
= 46, /* scan cache valid threshold */
612 IEEE80211_PARAM_ROAM_RSSI_11A
= 47, /* rssi threshold in 11a */
613 IEEE80211_PARAM_ROAM_RSSI_11B
= 48, /* rssi threshold in 11b */
614 IEEE80211_PARAM_ROAM_RSSI_11G
= 49, /* rssi threshold in 11g */
615 IEEE80211_PARAM_ROAM_RATE_11A
= 50, /* tx rate threshold in 11a */
616 IEEE80211_PARAM_ROAM_RATE_11B
= 51, /* tx rate threshold in 11b */
617 IEEE80211_PARAM_ROAM_RATE_11G
= 52, /* tx rate threshold in 11g */
618 IEEE80211_PARAM_UAPSDINFO
= 53, /* value for qos info field */
619 IEEE80211_PARAM_SLEEP
= 54, /* force sleep/wake */
620 IEEE80211_PARAM_QOSNULL
= 55, /* force sleep/wake */
621 IEEE80211_PARAM_PSPOLL
= 56, /* force ps-poll generation (sta only) */
622 IEEE80211_PARAM_EOSPDROP
= 57, /* force uapsd EOSP drop (ap only) */
623 IEEE80211_PARAM_MARKDFS
= 58, /* mark a dfs interference channel when found */
624 IEEE80211_PARAM_REGCLASS
= 59, /* enable regclass ids in country IE */
625 IEEE80211_PARAM_DROPUNENC_EAPOL
= 60, /* drop unencrypted eapol frames */
626 IEEE80211_PARAM_SHPREAMBLE
= 61, /* Short Preamble */
627 IEEE80211_PARAM_DUMPREGS
= 62, /* Pretty printed dump of Atheros hardware registers */
628 IEEE80211_PARAM_DOTH_ALGORITHM
= 63, /* spectrum management algorithm */
629 IEEE80211_PARAM_DOTH_MINCOM
= 64, /* minimum number of common channels */
630 IEEE80211_PARAM_DOTH_SLCG
= 65, /* permil of Stations Lost per Channel Gained */
631 IEEE80211_PARAM_DOTH_SLDG
= 66, /* permil of Stations Lost per rssi Db Gained */
632 IEEE80211_PARAM_TXCONT
= 67, /* continuous transmit mode (boolean) */
633 IEEE80211_PARAM_TXCONT_RATE
= 68, /* continuous transmit mode data rate (in mbit/sec) - will use closest match from current rate table */
634 IEEE80211_PARAM_TXCONT_POWER
= 69, /* power level in units of 0.5dBm */
635 IEEE80211_PARAM_DFS_TESTMODE
= 70, /* do not perform DFS actions (i.e. markng DFS and channel change on interference), just report them via debug. */
636 IEEE80211_PARAM_DFS_CACTIME
= 71, /* how long do we wait for chan availability
638 FCC requires 60s, so that is the default. */
639 IEEE80211_PARAM_DFS_EXCLPERIOD
= 72, /* DFS no-occupancy limit - how long do we stay
640 off a channel once radar is detected?
641 FCC requires 30m, so that is the default. */
642 IEEE80211_PARAM_BEACON_MISS_THRESH
= 73, /* Beacon miss threshold (in beacons) */
643 IEEE80211_PARAM_BEACON_MISS_THRESH_MS
= 74, /* Beacon miss threshold (in ms) */
644 IEEE80211_PARAM_RSSI_EWMA
= 75,
645 IEEE80211_PARAM_DRAINTXQ
= 76, /* Drain transmit queues */
646 IEEE80211_PARAM_STOP_QUEUE
= 77, /* Stop the device queue (for testing) */
647 IEEE80211_PARAM_TXTIMEOUT
= 78, /* Simulate Transmit timeout */
648 IEEE80211_PARAM_ATHRESET
= 79, /* Force device reset */
649 IEEE80211_PARAM_RESETTXBUFS
= 80, /* Reset transmit DMA */
650 IEEE80211_PARAM_SCANBUFS
= 81, /* Heap analysis for TX DMA */
651 IEEE80211_PARAM_LEAKTXBUFS
= 82, /* Leak tx buffers */
654 #define SIOCG80211STATS (SIOCDEVPRIVATE+2)
655 /* NB: require in+out parameters so cannot use wireless extensions, yech */
656 #define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE+3)
657 #define IEEE80211_IOCTL_GETWPAIE (SIOCDEVPRIVATE+4)
658 #define IEEE80211_IOCTL_STA_STATS (SIOCDEVPRIVATE+5)
659 #define IEEE80211_IOCTL_STA_INFO (SIOCDEVPRIVATE+6)
660 #define SIOC80211IFCREATE (SIOCDEVPRIVATE+7)
661 #define SIOC80211IFDESTROY (SIOCDEVPRIVATE+8)
662 #define IEEE80211_IOCTL_SCAN_RESULTS (SIOCDEVPRIVATE+9)
664 struct ieee80211_clone_params
{
665 char icp_name
[IFNAMSIZ
]; /* device name */
666 u_int16_t icp_opmode
; /* operating mode */
667 u_int16_t icp_flags
; /* see below */
668 #define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */
669 #define IEEE80211_USE_SW_BEACON_TIMERS 0x0002 /* Do not setup the station beacon timers */
672 /* APPIEBUF related definitions */
674 /* Management frame type to which application IE is added */
676 IEEE80211_APPIE_FRAME_BEACON
= 0,
677 IEEE80211_APPIE_FRAME_PROBE_REQ
= 1,
678 IEEE80211_APPIE_FRAME_PROBE_RESP
= 2,
679 IEEE80211_APPIE_FRAME_ASSOC_REQ
= 3,
680 IEEE80211_APPIE_FRAME_ASSOC_RESP
= 4,
681 IEEE80211_APPIE_NUM_OF_FRAME
= 5
684 struct ieee80211req_getset_appiebuf
{
685 u_int32_t app_frmtype
; /* management frame type for which buffer is added */
686 u_int32_t app_buflen
; /* application-supplied buffer length */
687 u_int8_t app_buf
[0]; /* application-supplied IE(s) */
690 /* Flags ORed by application to set filter for receiving management frames */
692 IEEE80211_FILTER_TYPE_BEACON
= 1<<0,
693 IEEE80211_FILTER_TYPE_PROBE_REQ
= 1<<1,
694 IEEE80211_FILTER_TYPE_PROBE_RESP
= 1<<2,
695 IEEE80211_FILTER_TYPE_ASSOC_REQ
= 1<<3,
696 IEEE80211_FILTER_TYPE_ASSOC_RESP
= 1<<4,
697 IEEE80211_FILTER_TYPE_AUTH
= 1<<5,
698 IEEE80211_FILTER_TYPE_DEAUTH
= 1<<6,
699 IEEE80211_FILTER_TYPE_DISASSOC
= 1<<7,
700 IEEE80211_FILTER_TYPE_ALL
= 0xFF /* used to check the valid filter bits */
703 struct ieee80211req_set_filter
{
704 u_int32_t app_filterype
; /* management frame filter type */
708 #endif /* __linux__ */
710 #endif /* _NET80211_IEEE80211_IOCTL_H_ */