Home | History | Annotate | Line # | Download | only in net80211
ieee80211_ioctl.h revision 1.6
      1  1.6  dyoung /*	$NetBSD: ieee80211_ioctl.h,v 1.6 2003/12/14 09:56:53 dyoung Exp $	*/
      2  1.1  dyoung /*-
      3  1.1  dyoung  * Copyright (c) 2001 Atsushi Onoe
      4  1.1  dyoung  * Copyright (c) 2002, 2003 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.6  dyoung  * $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.4 2003/10/17 23:15:30 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.1  dyoung 
     42  1.6  dyoung struct ieee80211_stats {
     43  1.6  dyoung 	u_int32_t	is_rx_badversion;	/* rx frame with bad version */
     44  1.6  dyoung 	u_int32_t	is_rx_tooshort;		/* rx frame too short */
     45  1.6  dyoung 	u_int32_t	is_rx_wrongbss;		/* rx from wrong bssid */
     46  1.6  dyoung 	u_int32_t	is_rx_dup;		/* rx discard 'cuz dup */
     47  1.6  dyoung 	u_int32_t	is_rx_wrongdir;		/* rx w/ wrong direction */
     48  1.6  dyoung 	u_int32_t	is_rx_mcastecho;	/* rx discard 'cuz mcast echo */
     49  1.6  dyoung 	u_int32_t	is_rx_notassoc;		/* rx discard 'cuz sta !assoc */
     50  1.6  dyoung 	u_int32_t	is_rx_nowep;		/* rx w/ wep but wep !config */
     51  1.6  dyoung 	u_int32_t	is_rx_wepfail;		/* rx wep processing failed */
     52  1.6  dyoung 	u_int32_t	is_rx_decap;		/* rx decapsulation failed */
     53  1.6  dyoung 	u_int32_t	is_rx_mgtdiscard;	/* rx discard mgt frames */
     54  1.6  dyoung 	u_int32_t	is_rx_ctl;		/* rx discard ctrl frames */
     55  1.6  dyoung 	u_int32_t	is_rx_rstoobig;		/* rx rate set truncated */
     56  1.6  dyoung 	u_int32_t	is_rx_elem_missing;	/* rx required element missing*/
     57  1.6  dyoung 	u_int32_t	is_rx_elem_toobig;	/* rx element too big */
     58  1.6  dyoung 	u_int32_t	is_rx_elem_toosmall;	/* rx element too small */
     59  1.6  dyoung 	u_int32_t	is_rx_elem_unknown;	/* rx element unknown */
     60  1.6  dyoung 	u_int32_t	is_rx_badchan;		/* rx frame w/ invalid chan */
     61  1.6  dyoung 	u_int32_t	is_rx_chanmismatch;	/* rx frame chan mismatch */
     62  1.6  dyoung 	u_int32_t	is_rx_nodealloc;	/* rx frame dropped */
     63  1.6  dyoung 	u_int32_t	is_rx_ssidmismatch;	/* rx frame ssid mismatch  */
     64  1.6  dyoung 	u_int32_t	is_rx_auth_unsupported;	/* rx w/ unsupported auth alg */
     65  1.6  dyoung 	u_int32_t	is_rx_auth_fail;	/* rx sta auth failure */
     66  1.6  dyoung 	u_int32_t	is_rx_assoc_bss;	/* rx assoc from wrong bssid */
     67  1.6  dyoung 	u_int32_t	is_rx_assoc_notauth;	/* rx assoc w/o auth */
     68  1.6  dyoung 	u_int32_t	is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
     69  1.6  dyoung 	u_int32_t	is_rx_assoc_norate;	/* rx assoc w/ no rate match */
     70  1.6  dyoung 	u_int32_t	is_rx_deauth;		/* rx deauthentication */
     71  1.6  dyoung 	u_int32_t	is_rx_disassoc;		/* rx disassociation */
     72  1.6  dyoung 	u_int32_t	is_rx_badsubtype;	/* rx frame w/ unknown subtype*/
     73  1.6  dyoung 	u_int32_t	is_rx_nombuf;		/* rx failed for lack of mbuf */
     74  1.6  dyoung 	u_int32_t	is_rx_decryptcrc;	/* rx decrypt failed on crc */
     75  1.6  dyoung 	u_int32_t	is_rx_ahdemo_mgt;	/* rx discard ahdemo mgt frame*/
     76  1.6  dyoung 	u_int32_t	is_rx_bad_auth;		/* rx bad auth request */
     77  1.6  dyoung 	u_int32_t	is_tx_nombuf;		/* tx failed for lack of mbuf */
     78  1.6  dyoung 	u_int32_t	is_tx_nonode;		/* tx failed for no node */
     79  1.6  dyoung 	u_int32_t	is_tx_unknownmgt;	/* tx of unknown mgt frame */
     80  1.6  dyoung 	u_int32_t	is_scan_active;		/* active scans started */
     81  1.6  dyoung 	u_int32_t	is_scan_passive;	/* passive scans started */
     82  1.6  dyoung 	u_int32_t	is_node_timeout;	/* nodes timed out inactivity */
     83  1.6  dyoung 	u_int32_t	is_crypto_nomem;	/* no memory for crypto ctx */
     84  1.6  dyoung };
     85  1.6  dyoung 
     86  1.1  dyoung #ifdef __FreeBSD__
     87  1.1  dyoung /*
     88  1.1  dyoung  * FreeBSD-style ioctls.
     89  1.1  dyoung  */
     90  1.1  dyoung /* the first member must be matched with struct ifreq */
     91  1.1  dyoung struct ieee80211req {
     92  1.1  dyoung 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
     93  1.1  dyoung 	u_int16_t	i_type;			/* req type */
     94  1.1  dyoung 	int16_t		i_val;			/* Index or simple value */
     95  1.1  dyoung 	int16_t		i_len;			/* Index or simple value */
     96  1.1  dyoung 	void		*i_data;		/* Extra data */
     97  1.1  dyoung };
     98  1.1  dyoung #define	SIOCS80211		 _IOW('i', 234, struct ieee80211req)
     99  1.1  dyoung #define	SIOCG80211		_IOWR('i', 235, struct ieee80211req)
    100  1.1  dyoung 
    101  1.1  dyoung #define IEEE80211_IOC_SSID		1
    102  1.1  dyoung #define IEEE80211_IOC_NUMSSIDS		2
    103  1.1  dyoung #define IEEE80211_IOC_WEP		3
    104  1.1  dyoung #define 	IEEE80211_WEP_NOSUP	-1
    105  1.1  dyoung #define 	IEEE80211_WEP_OFF	0
    106  1.1  dyoung #define 	IEEE80211_WEP_ON	1
    107  1.1  dyoung #define 	IEEE80211_WEP_MIXED	2
    108  1.1  dyoung #define IEEE80211_IOC_WEPKEY		4
    109  1.1  dyoung #define IEEE80211_IOC_NUMWEPKEYS	5
    110  1.1  dyoung #define IEEE80211_IOC_WEPTXKEY		6
    111  1.1  dyoung #define IEEE80211_IOC_AUTHMODE		7
    112  1.1  dyoung #define IEEE80211_IOC_STATIONNAME	8
    113  1.1  dyoung #define IEEE80211_IOC_CHANNEL		9
    114  1.1  dyoung #define IEEE80211_IOC_POWERSAVE		10
    115  1.1  dyoung #define 	IEEE80211_POWERSAVE_NOSUP	-1
    116  1.1  dyoung #define 	IEEE80211_POWERSAVE_OFF		0
    117  1.1  dyoung #define 	IEEE80211_POWERSAVE_CAM		1
    118  1.1  dyoung #define 	IEEE80211_POWERSAVE_PSP		2
    119  1.1  dyoung #define 	IEEE80211_POWERSAVE_PSP_CAM	3
    120  1.1  dyoung #define 	IEEE80211_POWERSAVE_ON		IEEE80211_POWERSAVE_CAM
    121  1.1  dyoung #define IEEE80211_IOC_POWERSAVESLEEP	11
    122  1.6  dyoung #define	IEEE80211_IOC_RTSTHRESHOLD	12
    123  1.1  dyoung 
    124  1.1  dyoung #ifndef IEEE80211_CHAN_ANY
    125  1.1  dyoung #define	IEEE80211_CHAN_ANY	0xffff		/* token for ``any channel'' */
    126  1.1  dyoung #endif
    127  1.6  dyoung 
    128  1.6  dyoung #define	SIOCG80211STATS		_IOWR('i', 236, struct ifreq)
    129  1.1  dyoung #endif /* __FreeBSD__ */
    130  1.2  dyoung 
    131  1.2  dyoung #ifdef __NetBSD__
    132  1.2  dyoung /* nwid is pointed at by ifr.ifr_data */
    133  1.2  dyoung struct ieee80211_nwid {
    134  1.2  dyoung 	u_int8_t	i_len;
    135  1.2  dyoung 	u_int8_t	i_nwid[IEEE80211_NWID_LEN];
    136  1.2  dyoung };
    137  1.2  dyoung 
    138  1.2  dyoung #define	SIOCS80211NWID		_IOWR('i', 230, struct ifreq)
    139  1.2  dyoung #define	SIOCG80211NWID		_IOWR('i', 231, struct ifreq)
    140  1.2  dyoung 
    141  1.2  dyoung /* the first member must be matched with struct ifreq */
    142  1.2  dyoung struct ieee80211_nwkey {
    143  1.2  dyoung 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    144  1.2  dyoung 	int		i_wepon;		/* wep enabled flag */
    145  1.2  dyoung 	int		i_defkid;		/* default encrypt key id */
    146  1.2  dyoung 	struct {
    147  1.2  dyoung 		int		i_keylen;
    148  1.2  dyoung 		u_int8_t	*i_keydat;
    149  1.2  dyoung 	}		i_key[IEEE80211_WEP_NKID];
    150  1.2  dyoung };
    151  1.2  dyoung #define	SIOCS80211NWKEY		 _IOW('i', 232, struct ieee80211_nwkey)
    152  1.2  dyoung #define	SIOCG80211NWKEY		_IOWR('i', 233, struct ieee80211_nwkey)
    153  1.2  dyoung /* i_wepon */
    154  1.2  dyoung #define	IEEE80211_NWKEY_OPEN	0		/* No privacy */
    155  1.2  dyoung #define	IEEE80211_NWKEY_WEP	1		/* WEP enabled */
    156  1.2  dyoung #define	IEEE80211_NWKEY_EAP	2		/* EAP enabled */
    157  1.2  dyoung #define	IEEE80211_NWKEY_PERSIST	0x100		/* designate persist keyset */
    158  1.2  dyoung 
    159  1.2  dyoung /* power management parameters */
    160  1.2  dyoung struct ieee80211_power {
    161  1.2  dyoung 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    162  1.2  dyoung 	int		i_enabled;		/* 1 == on, 0 == off */
    163  1.2  dyoung 	int		i_maxsleep;		/* max sleep in ms */
    164  1.2  dyoung };
    165  1.2  dyoung #define	SIOCS80211POWER		 _IOW('i', 234, struct ieee80211_power)
    166  1.2  dyoung #define	SIOCG80211POWER		_IOWR('i', 235, struct ieee80211_power)
    167  1.2  dyoung 
    168  1.2  dyoung struct ieee80211_auth {
    169  1.2  dyoung 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    170  1.2  dyoung 	int		i_authtype;
    171  1.2  dyoung };
    172  1.2  dyoung 
    173  1.2  dyoung #define	IEEE80211_AUTH_NONE	0
    174  1.2  dyoung #define	IEEE80211_AUTH_OPEN	1
    175  1.2  dyoung #define	IEEE80211_AUTH_SHARED	2
    176  1.2  dyoung 
    177  1.2  dyoung #define	SIOCS80211AUTH		 _IOW('i', 236, struct ieee80211_auth)
    178  1.2  dyoung #define	SIOCG80211AUTH		_IOWR('i', 237, struct ieee80211_auth)
    179  1.2  dyoung 
    180  1.4  dyoung struct ieee80211chanreq {
    181  1.2  dyoung 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    182  1.2  dyoung 	u_int16_t	i_channel;
    183  1.2  dyoung };
    184  1.2  dyoung 
    185  1.5  dyoung #ifndef IEEE80211_CHAN_ANY
    186  1.2  dyoung #define	IEEE80211_CHAN_ANY	0xffff
    187  1.4  dyoung #endif
    188  1.2  dyoung 
    189  1.4  dyoung #define	SIOCS80211CHANNEL	 _IOW('i', 238, struct ieee80211chanreq)
    190  1.4  dyoung #define	SIOCG80211CHANNEL	_IOWR('i', 239, struct ieee80211chanreq)
    191  1.2  dyoung 
    192  1.2  dyoung struct ieee80211_bssid {
    193  1.2  dyoung 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    194  1.2  dyoung 	u_int8_t	i_bssid[IEEE80211_ADDR_LEN];
    195  1.2  dyoung };
    196  1.2  dyoung 
    197  1.2  dyoung #define	SIOCS80211BSSID		 _IOW('i', 240, struct ieee80211_bssid)
    198  1.2  dyoung #define	SIOCG80211BSSID		_IOWR('i', 241, struct ieee80211_bssid)
    199  1.6  dyoung 
    200  1.6  dyoung #define	SIOCG80211STATS		_IOWR('i', 242, struct ifreq)
    201  1.2  dyoung #endif
    202  1.1  dyoung 
    203  1.1  dyoung #endif /* _NET80211_IEEE80211_IOCTL_H_ */
    204