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