ieee80211_ioctl.h revision 1.7.2.2 1 1.7.2.2 skrll /* $NetBSD: ieee80211_ioctl.h,v 1.7.2.2 2004/08/03 10:54:21 skrll Exp $ */
2 1.7.2.2 skrll /*-
3 1.7.2.2 skrll * Copyright (c) 2001 Atsushi Onoe
4 1.7.2.2 skrll * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
5 1.7.2.2 skrll * All rights reserved.
6 1.7.2.2 skrll *
7 1.7.2.2 skrll * Redistribution and use in source and binary forms, with or without
8 1.7.2.2 skrll * modification, are permitted provided that the following conditions
9 1.7.2.2 skrll * are met:
10 1.7.2.2 skrll * 1. Redistributions of source code must retain the above copyright
11 1.7.2.2 skrll * notice, this list of conditions and the following disclaimer.
12 1.7.2.2 skrll * 2. Redistributions in binary form must reproduce the above copyright
13 1.7.2.2 skrll * notice, this list of conditions and the following disclaimer in the
14 1.7.2.2 skrll * documentation and/or other materials provided with the distribution.
15 1.7.2.2 skrll * 3. The name of the author may not be used to endorse or promote products
16 1.7.2.2 skrll * derived from this software without specific prior written permission.
17 1.7.2.2 skrll *
18 1.7.2.2 skrll * Alternatively, this software may be distributed under the terms of the
19 1.7.2.2 skrll * GNU General Public License ("GPL") version 2 as published by the Free
20 1.7.2.2 skrll * Software Foundation.
21 1.7.2.2 skrll *
22 1.7.2.2 skrll * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 1.7.2.2 skrll * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.7.2.2 skrll * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.7.2.2 skrll * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 1.7.2.2 skrll * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 1.7.2.2 skrll * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.7.2.2 skrll * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.7.2.2 skrll * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.7.2.2 skrll * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 1.7.2.2 skrll * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.7.2.2 skrll *
33 1.7.2.2 skrll * $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.5 2004/03/30 22:57:57 sam Exp $
34 1.7.2.2 skrll */
35 1.7.2.2 skrll #ifndef _NET80211_IEEE80211_IOCTL_H_
36 1.7.2.2 skrll #define _NET80211_IEEE80211_IOCTL_H_
37 1.7.2.2 skrll
38 1.7.2.2 skrll /*
39 1.7.2.2 skrll * IEEE 802.11 ioctls.
40 1.7.2.2 skrll */
41 1.7.2.2 skrll
42 1.7.2.2 skrll struct ieee80211_stats {
43 1.7.2.2 skrll u_int32_t is_rx_badversion; /* rx frame with bad version */
44 1.7.2.2 skrll u_int32_t is_rx_tooshort; /* rx frame too short */
45 1.7.2.2 skrll u_int32_t is_rx_wrongbss; /* rx from wrong bssid */
46 1.7.2.2 skrll u_int32_t is_rx_dup; /* rx discard 'cuz dup */
47 1.7.2.2 skrll u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */
48 1.7.2.2 skrll u_int32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */
49 1.7.2.2 skrll u_int32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */
50 1.7.2.2 skrll u_int32_t is_rx_nowep; /* rx w/ wep but wep !config */
51 1.7.2.2 skrll u_int32_t is_rx_wepfail; /* rx wep processing failed */
52 1.7.2.2 skrll u_int32_t is_rx_decap; /* rx decapsulation failed */
53 1.7.2.2 skrll u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */
54 1.7.2.2 skrll u_int32_t is_rx_ctl; /* rx discard ctrl frames */
55 1.7.2.2 skrll u_int32_t is_rx_rstoobig; /* rx rate set truncated */
56 1.7.2.2 skrll u_int32_t is_rx_elem_missing; /* rx required element missing*/
57 1.7.2.2 skrll u_int32_t is_rx_elem_toobig; /* rx element too big */
58 1.7.2.2 skrll u_int32_t is_rx_elem_toosmall; /* rx element too small */
59 1.7.2.2 skrll u_int32_t is_rx_elem_unknown; /* rx element unknown */
60 1.7.2.2 skrll u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */
61 1.7.2.2 skrll u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */
62 1.7.2.2 skrll u_int32_t is_rx_nodealloc; /* rx frame dropped */
63 1.7.2.2 skrll u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */
64 1.7.2.2 skrll u_int32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */
65 1.7.2.2 skrll u_int32_t is_rx_auth_fail; /* rx sta auth failure */
66 1.7.2.2 skrll u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */
67 1.7.2.2 skrll u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */
68 1.7.2.2 skrll u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
69 1.7.2.2 skrll u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
70 1.7.2.2 skrll u_int32_t is_rx_deauth; /* rx deauthentication */
71 1.7.2.2 skrll u_int32_t is_rx_disassoc; /* rx disassociation */
72 1.7.2.2 skrll u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
73 1.7.2.2 skrll u_int32_t is_rx_nombuf; /* rx failed for lack of mbuf */
74 1.7.2.2 skrll u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */
75 1.7.2.2 skrll u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/
76 1.7.2.2 skrll u_int32_t is_rx_bad_auth; /* rx bad auth request */
77 1.7.2.2 skrll u_int32_t is_tx_nombuf; /* tx failed for lack of mbuf */
78 1.7.2.2 skrll u_int32_t is_tx_nonode; /* tx failed for no node */
79 1.7.2.2 skrll u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */
80 1.7.2.2 skrll u_int32_t is_scan_active; /* active scans started */
81 1.7.2.2 skrll u_int32_t is_scan_passive; /* passive scans started */
82 1.7.2.2 skrll u_int32_t is_node_timeout; /* nodes timed out inactivity */
83 1.7.2.2 skrll u_int32_t is_crypto_nomem; /* no memory for crypto ctx */
84 1.7.2.2 skrll };
85 1.7.2.2 skrll
86 1.7.2.2 skrll #ifdef __FreeBSD__
87 1.7.2.2 skrll /*
88 1.7.2.2 skrll * FreeBSD-style ioctls.
89 1.7.2.2 skrll */
90 1.7.2.2 skrll /* the first member must be matched with struct ifreq */
91 1.7.2.2 skrll struct ieee80211req {
92 1.7.2.2 skrll char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
93 1.7.2.2 skrll u_int16_t i_type; /* req type */
94 1.7.2.2 skrll int16_t i_val; /* Index or simple value */
95 1.7.2.2 skrll int16_t i_len; /* Index or simple value */
96 1.7.2.2 skrll void *i_data; /* Extra data */
97 1.7.2.2 skrll };
98 1.7.2.2 skrll #define SIOCS80211 _IOW('i', 234, struct ieee80211req)
99 1.7.2.2 skrll #define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
100 1.7.2.2 skrll
101 1.7.2.2 skrll #define IEEE80211_IOC_SSID 1
102 1.7.2.2 skrll #define IEEE80211_IOC_NUMSSIDS 2
103 1.7.2.2 skrll #define IEEE80211_IOC_WEP 3
104 1.7.2.2 skrll #define IEEE80211_WEP_NOSUP -1
105 1.7.2.2 skrll #define IEEE80211_WEP_OFF 0
106 1.7.2.2 skrll #define IEEE80211_WEP_ON 1
107 1.7.2.2 skrll #define IEEE80211_WEP_MIXED 2
108 1.7.2.2 skrll #define IEEE80211_IOC_WEPKEY 4
109 1.7.2.2 skrll #define IEEE80211_IOC_NUMWEPKEYS 5
110 1.7.2.2 skrll #define IEEE80211_IOC_WEPTXKEY 6
111 1.7.2.2 skrll #define IEEE80211_IOC_AUTHMODE 7
112 1.7.2.2 skrll #define IEEE80211_IOC_STATIONNAME 8
113 1.7.2.2 skrll #define IEEE80211_IOC_CHANNEL 9
114 1.7.2.2 skrll #define IEEE80211_IOC_POWERSAVE 10
115 1.7.2.2 skrll #define IEEE80211_POWERSAVE_NOSUP -1
116 1.7.2.2 skrll #define IEEE80211_POWERSAVE_OFF 0
117 1.7.2.2 skrll #define IEEE80211_POWERSAVE_CAM 1
118 1.7.2.2 skrll #define IEEE80211_POWERSAVE_PSP 2
119 1.7.2.2 skrll #define IEEE80211_POWERSAVE_PSP_CAM 3
120 1.7.2.2 skrll #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
121 1.7.2.2 skrll #define IEEE80211_IOC_POWERSAVESLEEP 11
122 1.7.2.2 skrll #define IEEE80211_IOC_RTSTHRESHOLD 12
123 1.7.2.2 skrll #define IEEE80211_IOC_PROTMODE 13
124 1.7.2.2 skrll #define IEEE80211_PROTMODE_OFF 0
125 1.7.2.2 skrll #define IEEE80211_PROTMODE_CTS 1
126 1.7.2.2 skrll #define IEEE80211_PROTMODE_RTSCTS 2
127 1.7.2.2 skrll #define IEEE80211_IOC_TXPOWER 14
128 1.7.2.2 skrll
129 1.7.2.2 skrll #ifndef IEEE80211_CHAN_ANY
130 1.7.2.2 skrll #define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
131 1.7.2.2 skrll #endif
132 1.7.2.2 skrll
133 1.7.2.2 skrll #define SIOCG80211STATS _IOWR('i', 236, struct ifreq)
134 1.7.2.2 skrll #endif /* __FreeBSD__ */
135 1.7.2.2 skrll
136 1.7.2.2 skrll #ifdef __NetBSD__
137 1.7.2.2 skrll /* nwid is pointed at by ifr.ifr_data */
138 1.7.2.2 skrll struct ieee80211_nwid {
139 1.7.2.2 skrll u_int8_t i_len;
140 1.7.2.2 skrll u_int8_t i_nwid[IEEE80211_NWID_LEN];
141 1.7.2.2 skrll };
142 1.7.2.2 skrll
143 1.7.2.2 skrll #define SIOCS80211NWID _IOWR('i', 230, struct ifreq)
144 1.7.2.2 skrll #define SIOCG80211NWID _IOWR('i', 231, struct ifreq)
145 1.7.2.2 skrll
146 1.7.2.2 skrll /* the first member must be matched with struct ifreq */
147 1.7.2.2 skrll struct ieee80211_nwkey {
148 1.7.2.2 skrll char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
149 1.7.2.2 skrll int i_wepon; /* wep enabled flag */
150 1.7.2.2 skrll int i_defkid; /* default encrypt key id */
151 1.7.2.2 skrll struct {
152 1.7.2.2 skrll int i_keylen;
153 1.7.2.2 skrll u_int8_t *i_keydat;
154 1.7.2.2 skrll } i_key[IEEE80211_WEP_NKID];
155 1.7.2.2 skrll };
156 1.7.2.2 skrll #define SIOCS80211NWKEY _IOW('i', 232, struct ieee80211_nwkey)
157 1.7.2.2 skrll #define SIOCG80211NWKEY _IOWR('i', 233, struct ieee80211_nwkey)
158 1.7.2.2 skrll /* i_wepon */
159 1.7.2.2 skrll #define IEEE80211_NWKEY_OPEN 0 /* No privacy */
160 1.7.2.2 skrll #define IEEE80211_NWKEY_WEP 1 /* WEP enabled */
161 1.7.2.2 skrll #define IEEE80211_NWKEY_EAP 2 /* EAP enabled */
162 1.7.2.2 skrll #define IEEE80211_NWKEY_PERSIST 0x100 /* designate persist keyset */
163 1.7.2.2 skrll
164 1.7.2.2 skrll /* power management parameters */
165 1.7.2.2 skrll struct ieee80211_power {
166 1.7.2.2 skrll char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
167 1.7.2.2 skrll int i_enabled; /* 1 == on, 0 == off */
168 1.7.2.2 skrll int i_maxsleep; /* max sleep in ms */
169 1.7.2.2 skrll };
170 1.7.2.2 skrll #define SIOCS80211POWER _IOW('i', 234, struct ieee80211_power)
171 1.7.2.2 skrll #define SIOCG80211POWER _IOWR('i', 235, struct ieee80211_power)
172 1.7.2.2 skrll
173 1.7.2.2 skrll struct ieee80211_auth {
174 1.7.2.2 skrll char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
175 1.7.2.2 skrll int i_authtype;
176 1.7.2.2 skrll };
177 1.7.2.2 skrll
178 1.7.2.2 skrll #define IEEE80211_AUTH_NONE 0
179 1.7.2.2 skrll #define IEEE80211_AUTH_OPEN 1
180 1.7.2.2 skrll #define IEEE80211_AUTH_SHARED 2
181 1.7.2.2 skrll
182 1.7.2.2 skrll #define SIOCS80211AUTH _IOW('i', 236, struct ieee80211_auth)
183 1.7.2.2 skrll #define SIOCG80211AUTH _IOWR('i', 237, struct ieee80211_auth)
184 1.7.2.2 skrll
185 1.7.2.2 skrll struct ieee80211chanreq {
186 1.7.2.2 skrll char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
187 1.7.2.2 skrll u_int16_t i_channel;
188 1.7.2.2 skrll };
189 1.7.2.2 skrll
190 1.7.2.2 skrll #ifndef IEEE80211_CHAN_ANY
191 1.7.2.2 skrll #define IEEE80211_CHAN_ANY 0xffff
192 1.7.2.2 skrll #endif
193 1.7.2.2 skrll
194 1.7.2.2 skrll #define SIOCS80211CHANNEL _IOW('i', 238, struct ieee80211chanreq)
195 1.7.2.2 skrll #define SIOCG80211CHANNEL _IOWR('i', 239, struct ieee80211chanreq)
196 1.7.2.2 skrll
197 1.7.2.2 skrll struct ieee80211_bssid {
198 1.7.2.2 skrll char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
199 1.7.2.2 skrll u_int8_t i_bssid[IEEE80211_ADDR_LEN];
200 1.7.2.2 skrll };
201 1.7.2.2 skrll
202 1.7.2.2 skrll #define SIOCS80211BSSID _IOW('i', 240, struct ieee80211_bssid)
203 1.7.2.2 skrll #define SIOCG80211BSSID _IOWR('i', 241, struct ieee80211_bssid)
204 1.7.2.2 skrll
205 1.7.2.2 skrll #define SIOCG80211STATS _IOWR('i', 242, struct ifreq)
206 1.7.2.2 skrll #endif
207 1.7.2.2 skrll
208 1.7.2.2 skrll #endif /* _NET80211_IEEE80211_IOCTL_H_ */
209