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