Home | History | Annotate | Line # | Download | only in net80211
ieee80211_ioctl.h revision 1.4
      1 /*	$NetBSD: ieee80211_ioctl.h,v 1.4 2003/09/28 02:40:14 dyoung Exp $	*/
      2 /*-
      3  * Copyright (c) 2001 Atsushi Onoe
      4  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. The name of the author may not be used to endorse or promote products
     16  *    derived from this software without specific prior written permission.
     17  *
     18  * Alternatively, this software may be distributed under the terms of the
     19  * GNU General Public License ("GPL") version 2 as published by the Free
     20  * Software Foundation.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     27  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  *
     33  * $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.2 2003/06/27 05:13:52 sam Exp $
     34  */
     35 #ifndef _NET80211_IEEE80211_IOCTL_H_
     36 #define _NET80211_IEEE80211_IOCTL_H_
     37 
     38 /*
     39  * IEEE 802.11 ioctls.
     40  */
     41 
     42 #ifdef __FreeBSD__
     43 /*
     44  * FreeBSD-style ioctls.
     45  */
     46 /* the first member must be matched with struct ifreq */
     47 struct ieee80211req {
     48 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
     49 	u_int16_t	i_type;			/* req type */
     50 	int16_t		i_val;			/* Index or simple value */
     51 	int16_t		i_len;			/* Index or simple value */
     52 	void		*i_data;		/* Extra data */
     53 };
     54 #define	SIOCS80211		 _IOW('i', 234, struct ieee80211req)
     55 #define	SIOCG80211		_IOWR('i', 235, struct ieee80211req)
     56 
     57 #define IEEE80211_IOC_SSID		1
     58 #define IEEE80211_IOC_NUMSSIDS		2
     59 #define IEEE80211_IOC_WEP		3
     60 #define 	IEEE80211_WEP_NOSUP	-1
     61 #define 	IEEE80211_WEP_OFF	0
     62 #define 	IEEE80211_WEP_ON	1
     63 #define 	IEEE80211_WEP_MIXED	2
     64 #define IEEE80211_IOC_WEPKEY		4
     65 #define IEEE80211_IOC_NUMWEPKEYS	5
     66 #define IEEE80211_IOC_WEPTXKEY		6
     67 #define IEEE80211_IOC_AUTHMODE		7
     68 #define IEEE80211_IOC_STATIONNAME	8
     69 #define IEEE80211_IOC_CHANNEL		9
     70 #define IEEE80211_IOC_POWERSAVE		10
     71 #define 	IEEE80211_POWERSAVE_NOSUP	-1
     72 #define 	IEEE80211_POWERSAVE_OFF		0
     73 #define 	IEEE80211_POWERSAVE_CAM		1
     74 #define 	IEEE80211_POWERSAVE_PSP		2
     75 #define 	IEEE80211_POWERSAVE_PSP_CAM	3
     76 #define 	IEEE80211_POWERSAVE_ON		IEEE80211_POWERSAVE_CAM
     77 #define IEEE80211_IOC_POWERSAVESLEEP	11
     78 #define	IEEE80211_IOCT_RTSTHRESHOLD	12	/* why IOCT_ ? */
     79 
     80 #ifndef IEEE80211_CHAN_ANY
     81 #define	IEEE80211_CHAN_ANY	0xffff		/* token for ``any channel'' */
     82 #endif
     83 #endif /* __FreeBSD__ */
     84 
     85 #ifdef __NetBSD__
     86 /* nwid is pointed at by ifr.ifr_data */
     87 struct ieee80211_nwid {
     88 	u_int8_t	i_len;
     89 	u_int8_t	i_nwid[IEEE80211_NWID_LEN];
     90 };
     91 
     92 #define	SIOCS80211NWID		_IOWR('i', 230, struct ifreq)
     93 #define	SIOCG80211NWID		_IOWR('i', 231, struct ifreq)
     94 
     95 /* the first member must be matched with struct ifreq */
     96 struct ieee80211_nwkey {
     97 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
     98 	int		i_wepon;		/* wep enabled flag */
     99 	int		i_defkid;		/* default encrypt key id */
    100 	struct {
    101 		int		i_keylen;
    102 		u_int8_t	*i_keydat;
    103 	}		i_key[IEEE80211_WEP_NKID];
    104 };
    105 #define	SIOCS80211NWKEY		 _IOW('i', 232, struct ieee80211_nwkey)
    106 #define	SIOCG80211NWKEY		_IOWR('i', 233, struct ieee80211_nwkey)
    107 /* i_wepon */
    108 #define	IEEE80211_NWKEY_OPEN	0		/* No privacy */
    109 #define	IEEE80211_NWKEY_WEP	1		/* WEP enabled */
    110 #define	IEEE80211_NWKEY_EAP	2		/* EAP enabled */
    111 #define	IEEE80211_NWKEY_PERSIST	0x100		/* designate persist keyset */
    112 
    113 /* power management parameters */
    114 struct ieee80211_power {
    115 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    116 	int		i_enabled;		/* 1 == on, 0 == off */
    117 	int		i_maxsleep;		/* max sleep in ms */
    118 };
    119 #define	SIOCS80211POWER		 _IOW('i', 234, struct ieee80211_power)
    120 #define	SIOCG80211POWER		_IOWR('i', 235, struct ieee80211_power)
    121 
    122 struct ieee80211_auth {
    123 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    124 	int		i_authtype;
    125 };
    126 
    127 #define	IEEE80211_AUTH_NONE	0
    128 #define	IEEE80211_AUTH_OPEN	1
    129 #define	IEEE80211_AUTH_SHARED	2
    130 
    131 #define	SIOCS80211AUTH		 _IOW('i', 236, struct ieee80211_auth)
    132 #define	SIOCG80211AUTH		_IOWR('i', 237, struct ieee80211_auth)
    133 
    134 struct ieee80211chanreq {
    135 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    136 	u_int16_t	i_channel;
    137 };
    138 
    139 #if 0
    140 #define	IEEE80211_CHAN_ANY	0xffff
    141 #define	IEEE80211_CHAN_ANYC	IEEE80211_CHAN_ANY /* XXX make NULL */
    142 #endif
    143 
    144 #define	SIOCS80211CHANNEL	 _IOW('i', 238, struct ieee80211chanreq)
    145 #define	SIOCG80211CHANNEL	_IOWR('i', 239, struct ieee80211chanreq)
    146 
    147 struct ieee80211_bssid {
    148 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
    149 	u_int8_t	i_bssid[IEEE80211_ADDR_LEN];
    150 };
    151 
    152 #define	SIOCS80211BSSID		 _IOW('i', 240, struct ieee80211_bssid)
    153 #define	SIOCG80211BSSID		_IOWR('i', 241, struct ieee80211_bssid)
    154 #endif
    155 
    156 #endif /* _NET80211_IEEE80211_IOCTL_H_ */
    157