Initial import from FreeBSD RELENG_4:
[games.git] / share / man / man4 / ieee80211.4
1 .\" Copyright (c) 2001
2 .\"     The Aerospace Corporation.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AEROSPACE CORPORATION ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AEROSPACE CORPORATION BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD: src/share/man/man4/ieee80211.4,v 1.1.2.3 2001/07/13 09:56:16 ru Exp $
29 .\"
30 .Dd February 23, 2001
31 .Dt IEEE80211 4
32 .Os
33 .Sh NAME
34 .Nm ieee80211
35 .Nd standard interface to IEEE 802.11 devices
36 .Sh SYNOPSIS
37 .In net/if_ieee80211.h
38 .Sh DESCRIPTION
39 This section describes the interface standard interface to configuration
40 and status information on IEEE 802.11 devices.
41 Most devices support options not configurable by this interface.
42 They must be set by their respective, specific control program.
43 The interface is via one
44 of the following
45 .Xr ioctl 2
46 calls on a socket:
47 .Bl -tag -width ".Dv SIOCG80211"
48 .It Dv SIOCG80211
49 Get configuration or status information.
50 .It Dv SIOCS80211
51 Set configuration information.
52 .El
53 .Pp
54 These requests are made via a modified
55 .Vt ifreq
56 structure.
57 This structure is defined as follows:
58 .Bd -literal
59 struct ieee80211req {
60         char            i_name[IFNAMSIZ];       /* if_name, e.g. "wi0" */
61         u_int16_t       i_type;                 /* req type */
62         int16_t         i_val;                  /* Index or simple value */
63         int16_t         i_len;                  /* Index or simple value */
64         void            *i_data;                /* Extra data */
65 };
66 .Ed
67 .Pp
68 For
69 .Dv SIOCG80211
70 the following values of
71 .Va i_type
72 are valid:
73 .Bl -tag -width ".Dv IEEE80211_IOC_POWERSAVESLEEP"
74 .It Dv IEEE80211_IOC_SSID
75 Returns the requested SSID by copying it into the buffer pointed to by
76 .Va i_data
77 and setting
78 .Va i_len
79 to the length.
80 If
81 .Va i_val
82 is \(>= 0 then the request refers to the configured value for that slot.
83 Generally, 0 is the only valid value, but some interfaces support more
84 SSIDs.
85 If
86 .Va i_val
87 is \-1 then the request refers to the currently active value.
88 .It Dv IEEE80211_IOC_NUMSSIDS
89 Returns the number of SSIDs this card supports.
90 In most cases, this is
91 1, but some devices such as
92 .Xr an 4
93 support more.
94 .It Dv IEEE80211_IOC_WEP
95 Returns the current WEP status in
96 .Va i_val .
97 Valid values are
98 .Dv IEEE80211_WEP_NOSUP , IEEE80211_WEP_ON , IEEE80211_WEP_OFF ,
99 and
100 .Dv IEEE80211_WEP_MIXED .
101 Respectively, these values mean unsupported, mandatory for all devices,
102 off, and on, but not required for all devices.
103 .It Dv IEEE80211_IOC_WEPKEY
104 Returns the requested WEP key via
105 .Va i_data
106 and its length via
107 .Va i_len .
108 If the device does not support returning the WEP key or the user is not
109 root then the key may be returned as all zeros.
110 Technically this is a
111 valid key, but it's the kind of key an idiot would put on his luggage so
112 we use it as a special value.
113 Generally, only four WEP keys are allowed, but some devices support more.
114 If so, the first four (0-3) are
115 the standard keys stored in volatile storage and the others are device
116 specific.
117 .It Dv IEEE80211_IOC_NUMWEPKEYS
118 Returns the number of WEP keys supported by this device, generally 4.
119 A device that does not support WEP may either report 0 or simply return
120 .Er EINVAL .
121 .It Dv IEEE80211_IOC_WEPTXKEY
122 Returns the WEP key used for transmission.
123 .It Dv IEEE80211_IOC_AUTHMODE
124 Returns the current authentication mode in
125 .Va i_val .
126 Valid values are
127 .Dv IEEE80211_AUTH_NONE , IEEE80211_AUTH_OPEN ,
128 and
129 .Dv IEEE80211_AUTH_SHARED .
130 .It Dv IEEE80211_IOC_STATIONNAME
131 Returns the station name via
132 .Va i_data
133 and its length via
134 .Va i_len .
135 While all known devices seem to support this is some way or another,
136 they all do it differently and it appears to not have anything to do
137 with the actual IEEE 802.11 standard so making up an answer may be
138 necessary for future devices.
139 .It Dv IEEE80211_IOC_CHANNEL
140 Returns the current direct sequence spread spectrum channel in use.
141 .It Dv IEEE80211_IOC_POWERSAVE
142 Returns the current powersaving mode.
143 Valid values are
144 .Dv IEEE80211_POWERSAVE_NOSUP , IEEE80211_POWERSAVE_OFF ,
145 .Dv IEEE80211_POWERSAVE_ON , IEEE80211_POWERSAVE_CAM ,
146 .Dv IEEE80211_POWERSAVE_PSP ,
147 and
148 .Dv IEEE80211_POWERSAVE_PSP_CAM .
149 Currently,
150 .Dv IEEE80211_POWERSAVE_ON
151 is defined to be equal to
152 .Dv IEEE80211_POWERSAVE_CAM ,
153 but this may be incorrect.
154 .It Dv IEEE80211_IOC_POWERSAVESLEEP
155 Returns the powersave sleep time in msec in
156 .Va i_val .
157 .El
158 .Pp
159 For
160 .Dv SIOCS80211
161 the following values of
162 .Va i_type
163 are valid:
164 .Bl -tag -width ".Dv IEEE80211_IOC_POWERSAVESLEEP"
165 .It Dv IEEE80211_IOC_SSID
166 Set the desired SSID for infrastructure and ad-hoc modes to value given
167 by
168 .Va i_data
169 and
170 .Va i_len .
171 The length should be no longer then 32 characters.
172 .It Dv IEEE80211_IOC_WEP
173 Set the current WEP mode to the value given in
174 .Va i_val .
175 Valid values are the same as those for this value above.
176 Devices which
177 do not support all modes may choose to either return
178 .Er EINVAL
179 or choose a reasonable alternate (supported) setting.
180 .It Dv IEEE80211_IOC_WEPKEY
181 Set the WEP key indicated by
182 .Va i_val
183 to the value given by
184 .Va i_data
185 and
186 .Va i_len .
187 Generally, valid values of
188 .Va i_len
189 are 0, 5, and 13 though not all devices with WEP support have support
190 for 13-byte keys.
191 .It Dv IEEE80211_IOC_WEPTXKEY
192 Set the WEP key used for transmission to the value in
193 .Va i_val .
194 Not all values which are valid for setting keys may be valid for setting
195 transmit keys due to strange device interfaces.
196 .It Dv IEEE80211_IOC_AUTHMODE
197 Set the current authorization mode to the value given in
198 .Va i_val .
199 Valid values are given above.
200 Not all devices support this.
201 .It Dv IEEE80211_IOC_STATIONNAME
202 Set the station name to the value given by
203 .Va i_data
204 and
205 .Va i_len .
206 The standard does not appear to deal with this feature so the range of
207 valid values may vary from device to device.
208 .It Dv IEEE80211_IOC_CHANNEL
209 Set the desired ad-hoc channel to the value given by
210 .Va i_val .
211 On some devices this has an impact on infrastructure mode as well.
212 Valid values are 1-14, but 0 should be allowed and should return the
213 device to the default value.
214 May devices support this directly by
215 converting any invalid value to the default value.
216 .It Dv IEEE80211_IOC_POWERSAVE
217 Set the current powersaving mode to the value given in
218 .Va i_val .
219 Valid values are the same as those for this value above.
220 Devices which
221 do not support all modes may choose to either return
222 .Er EINVAL
223 or choose a reasonable alternate (supported) setting.
224 Most devices only
225 support CAM mode.
226 .It Dv IEEE80211_IOC_POWERSAVESLEEP
227 Set the powersave sleep time in msec to the value in
228 .Va i_val .
229 .El
230 .Sh SEE ALSO
231 .Xr ioctl 2 ,
232 .Xr an 4 ,
233 .Xr ray 4 ,
234 .Xr wi 4 ,
235 .Xr ancontrol 8 ,
236 .Xr ifconfig 8 ,
237 .Xr raycontrol 8 ,
238 .Xr wicontrol 8
239 .Sh HISTORY
240 The
241 .Nm
242 manual appeared in
243 .Fx 4.3 .