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