156 lines
5.4 KiB
C
156 lines
5.4 KiB
C
/* $NetBSD: ieee80211_ioctl.h,v 1.5 2003/10/13 04:16:59 dyoung Exp $ */
|
|
/*-
|
|
* Copyright (c) 2001 Atsushi Onoe
|
|
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
* derived from this software without specific prior written permission.
|
|
*
|
|
* Alternatively, this software may be distributed under the terms of the
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
* Software Foundation.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
* $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.2 2003/06/27 05:13:52 sam Exp $
|
|
*/
|
|
#ifndef _NET80211_IEEE80211_IOCTL_H_
|
|
#define _NET80211_IEEE80211_IOCTL_H_
|
|
|
|
/*
|
|
* IEEE 802.11 ioctls.
|
|
*/
|
|
|
|
#ifdef __FreeBSD__
|
|
/*
|
|
* FreeBSD-style ioctls.
|
|
*/
|
|
/* the first member must be matched with struct ifreq */
|
|
struct ieee80211req {
|
|
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
|
|
u_int16_t i_type; /* req type */
|
|
int16_t i_val; /* Index or simple value */
|
|
int16_t i_len; /* Index or simple value */
|
|
void *i_data; /* Extra data */
|
|
};
|
|
#define SIOCS80211 _IOW('i', 234, struct ieee80211req)
|
|
#define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
|
|
|
|
#define IEEE80211_IOC_SSID 1
|
|
#define IEEE80211_IOC_NUMSSIDS 2
|
|
#define IEEE80211_IOC_WEP 3
|
|
#define IEEE80211_WEP_NOSUP -1
|
|
#define IEEE80211_WEP_OFF 0
|
|
#define IEEE80211_WEP_ON 1
|
|
#define IEEE80211_WEP_MIXED 2
|
|
#define IEEE80211_IOC_WEPKEY 4
|
|
#define IEEE80211_IOC_NUMWEPKEYS 5
|
|
#define IEEE80211_IOC_WEPTXKEY 6
|
|
#define IEEE80211_IOC_AUTHMODE 7
|
|
#define IEEE80211_IOC_STATIONNAME 8
|
|
#define IEEE80211_IOC_CHANNEL 9
|
|
#define IEEE80211_IOC_POWERSAVE 10
|
|
#define IEEE80211_POWERSAVE_NOSUP -1
|
|
#define IEEE80211_POWERSAVE_OFF 0
|
|
#define IEEE80211_POWERSAVE_CAM 1
|
|
#define IEEE80211_POWERSAVE_PSP 2
|
|
#define IEEE80211_POWERSAVE_PSP_CAM 3
|
|
#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
|
|
#define IEEE80211_IOC_POWERSAVESLEEP 11
|
|
#define IEEE80211_IOCT_RTSTHRESHOLD 12 /* why IOCT_ ? */
|
|
|
|
#ifndef IEEE80211_CHAN_ANY
|
|
#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
|
|
#endif
|
|
#endif /* __FreeBSD__ */
|
|
|
|
#ifdef __NetBSD__
|
|
/* nwid is pointed at by ifr.ifr_data */
|
|
struct ieee80211_nwid {
|
|
u_int8_t i_len;
|
|
u_int8_t i_nwid[IEEE80211_NWID_LEN];
|
|
};
|
|
|
|
#define SIOCS80211NWID _IOWR('i', 230, struct ifreq)
|
|
#define SIOCG80211NWID _IOWR('i', 231, struct ifreq)
|
|
|
|
/* the first member must be matched with struct ifreq */
|
|
struct ieee80211_nwkey {
|
|
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
|
|
int i_wepon; /* wep enabled flag */
|
|
int i_defkid; /* default encrypt key id */
|
|
struct {
|
|
int i_keylen;
|
|
u_int8_t *i_keydat;
|
|
} i_key[IEEE80211_WEP_NKID];
|
|
};
|
|
#define SIOCS80211NWKEY _IOW('i', 232, struct ieee80211_nwkey)
|
|
#define SIOCG80211NWKEY _IOWR('i', 233, struct ieee80211_nwkey)
|
|
/* i_wepon */
|
|
#define IEEE80211_NWKEY_OPEN 0 /* No privacy */
|
|
#define IEEE80211_NWKEY_WEP 1 /* WEP enabled */
|
|
#define IEEE80211_NWKEY_EAP 2 /* EAP enabled */
|
|
#define IEEE80211_NWKEY_PERSIST 0x100 /* designate persist keyset */
|
|
|
|
/* power management parameters */
|
|
struct ieee80211_power {
|
|
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
|
|
int i_enabled; /* 1 == on, 0 == off */
|
|
int i_maxsleep; /* max sleep in ms */
|
|
};
|
|
#define SIOCS80211POWER _IOW('i', 234, struct ieee80211_power)
|
|
#define SIOCG80211POWER _IOWR('i', 235, struct ieee80211_power)
|
|
|
|
struct ieee80211_auth {
|
|
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
|
|
int i_authtype;
|
|
};
|
|
|
|
#define IEEE80211_AUTH_NONE 0
|
|
#define IEEE80211_AUTH_OPEN 1
|
|
#define IEEE80211_AUTH_SHARED 2
|
|
|
|
#define SIOCS80211AUTH _IOW('i', 236, struct ieee80211_auth)
|
|
#define SIOCG80211AUTH _IOWR('i', 237, struct ieee80211_auth)
|
|
|
|
struct ieee80211chanreq {
|
|
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
|
|
u_int16_t i_channel;
|
|
};
|
|
|
|
#ifndef IEEE80211_CHAN_ANY
|
|
#define IEEE80211_CHAN_ANY 0xffff
|
|
#endif
|
|
|
|
#define SIOCS80211CHANNEL _IOW('i', 238, struct ieee80211chanreq)
|
|
#define SIOCG80211CHANNEL _IOWR('i', 239, struct ieee80211chanreq)
|
|
|
|
struct ieee80211_bssid {
|
|
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
|
|
u_int8_t i_bssid[IEEE80211_ADDR_LEN];
|
|
};
|
|
|
|
#define SIOCS80211BSSID _IOW('i', 240, struct ieee80211_bssid)
|
|
#define SIOCG80211BSSID _IOWR('i', 241, struct ieee80211_bssid)
|
|
#endif
|
|
|
|
#endif /* _NET80211_IEEE80211_IOCTL_H_ */
|