1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
<table class="head">
<tr>
<td class="head-ltitle">IEEE80211(4)</td>
<td class="head-vol">Device Drivers Manual</td>
<td class="head-rtitle">IEEE80211(4)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">ieee80211</code> —
<span class="Nd">standard interface to IEEE 802.11 devices</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
<<a class="In">sys/types.h</a>></code>
<br/>
<code class="In">#include <<a class="In">sys/socket.h</a>></code>
<br/>
<code class="In">#include <<a class="In">net/if.h</a>></code>
<br/>
<code class="In">#include <<a class="In">net/ethernet.h</a>></code>
<br/>
<code class="In">#include
<<a class="In">net/if_ieee80211.h</a>></code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">This section describes the standard interface to configuration and
status information on IEEE 802.11 devices. Most devices support options not
configurable by this interface. They must be set by their respective,
specific control program. The interface is via one of the following
<a class="Xr">ioctl(2)</a> calls on a socket:</p>
<dl class="Bl-tag">
<dt id="SIOCG80211"><a class="permalink" href="#SIOCG80211"><code class="Dv">SIOCG80211</code></a></dt>
<dd>Get configuration or status information.</dd>
<dt id="SIOCS80211"><a class="permalink" href="#SIOCS80211"><code class="Dv">SIOCS80211</code></a></dt>
<dd>Set configuration information.</dd>
</dl>
<p class="Pp">These requests are made via a modified <var class="Vt">ifreq</var>
structure. This structure is defined as follows:</p>
<div class="Bd Pp Li">
<pre>struct ieee80211req {
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
uint16_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 */
};</pre>
</div>
<p class="Pp">For <code class="Dv">SIOCG80211</code> the following values of
<var class="Va">i_type</var> are valid:</p>
<dl class="Bl-tag">
<dt id="IEEE80211_IOC_SSID"><a class="permalink" href="#IEEE80211_IOC_SSID"><code class="Dv">IEEE80211_IOC_SSID</code></a></dt>
<dd>Returns the requested SSID by copying it into the buffer pointed to by
<var class="Va">i_data</var> and setting <var class="Va">i_len</var> to
the length. If <var class="Va">i_val</var> is >= 0 then the request
refers to the configured value for that slot. Generally, 0 is the only
valid value, but some interfaces support more SSIDs. If
<var class="Va">i_val</var> is -1 then the request refers to the currently
active value.</dd>
<dt id="IEEE80211_IOC_NUMSSIDS"><a class="permalink" href="#IEEE80211_IOC_NUMSSIDS"><code class="Dv">IEEE80211_IOC_NUMSSIDS</code></a></dt>
<dd>Returns the number of SSIDs this card supports. In most cases, this is 1,
but some devices such as <a class="Xr">an(4)</a> support more.</dd>
<dt id="IEEE80211_IOC_WEP"><a class="permalink" href="#IEEE80211_IOC_WEP"><code class="Dv">IEEE80211_IOC_WEP</code></a></dt>
<dd>Returns the current WEP status in <var class="Va">i_val</var>. Valid
values are <code class="Dv">IEEE80211_WEP_NOSUP</code>,
<code class="Dv">IEEE80211_WEP_ON</code>,
<code class="Dv">IEEE80211_WEP_OFF</code>, and
<code class="Dv">IEEE80211_WEP_MIXED</code>. Respectively, these values
mean unsupported, mandatory for all devices, off, and on, but not required
for all devices.</dd>
<dt id="IEEE80211_IOC_WEPKEY"><a class="permalink" href="#IEEE80211_IOC_WEPKEY"><code class="Dv">IEEE80211_IOC_WEPKEY</code></a></dt>
<dd>Returns the requested WEP key via <var class="Va">i_data</var> and its
length via <var class="Va">i_len</var>. If the device does not support
returning the WEP key or the user is not root then the key may be returned
as all zeros. Technically this is a valid key, but it is the kind of key
an idiot would put on his luggage so we use it as a special value.
Generally, only four WEP keys are allowed, but some devices support more.
If so, the first four (0-3) are the standard keys stored in volatile
storage and the others are device specific.</dd>
<dt id="IEEE80211_IOC_NUMWEPKEYS"><a class="permalink" href="#IEEE80211_IOC_NUMWEPKEYS"><code class="Dv">IEEE80211_IOC_NUMWEPKEYS</code></a></dt>
<dd>Returns the number of WEP keys supported by this device, generally 4. A
device that does not support WEP may either report 0 or simply return
<code class="Er">EINVAL</code>.</dd>
<dt id="IEEE80211_IOC_WEPTXKEY"><a class="permalink" href="#IEEE80211_IOC_WEPTXKEY"><code class="Dv">IEEE80211_IOC_WEPTXKEY</code></a></dt>
<dd>Returns the WEP key used for transmission.</dd>
<dt id="IEEE80211_IOC_AUTHMODE"><a class="permalink" href="#IEEE80211_IOC_AUTHMODE"><code class="Dv">IEEE80211_IOC_AUTHMODE</code></a></dt>
<dd>Returns the current authentication mode in <var class="Va">i_val</var>.
Valid values are <code class="Dv">IEEE80211_AUTH_NONE</code>,
<code class="Dv">IEEE80211_AUTH_OPEN</code>, and
<code class="Dv">IEEE80211_AUTH_SHARED</code>.</dd>
<dt id="IEEE80211_IOC_STATIONNAME"><a class="permalink" href="#IEEE80211_IOC_STATIONNAME"><code class="Dv">IEEE80211_IOC_STATIONNAME</code></a></dt>
<dd>Returns the station name via <var class="Va">i_data</var> and its length
via <var class="Va">i_len</var>. While all known devices seem to support
this in some way or another, they all do it differently and it appears to
not have anything to do with the actual IEEE 802.11 standard so making up
an answer may be necessary for future devices.</dd>
<dt id="IEEE80211_IOC_CHANNEL"><a class="permalink" href="#IEEE80211_IOC_CHANNEL"><code class="Dv">IEEE80211_IOC_CHANNEL</code></a></dt>
<dd>Returns the current direct sequence spread spectrum channel in use.</dd>
<dt id="IEEE80211_IOC_POWERSAVE"><a class="permalink" href="#IEEE80211_IOC_POWERSAVE"><code class="Dv">IEEE80211_IOC_POWERSAVE</code></a></dt>
<dd>Returns the current powersaving mode. Valid values are
<code class="Dv">IEEE80211_POWERSAVE_NOSUP</code>,
<code class="Dv">IEEE80211_POWERSAVE_OFF</code>,
<code class="Dv">IEEE80211_POWERSAVE_ON</code>,
<code class="Dv">IEEE80211_POWERSAVE_CAM</code>,
<code class="Dv">IEEE80211_POWERSAVE_PSP</code>, and
<code class="Dv">IEEE80211_POWERSAVE_PSP_CAM</code>. Currently,
<code class="Dv">IEEE80211_POWERSAVE_ON</code> is defined to be equal to
<code class="Dv">IEEE80211_POWERSAVE_CAM</code>, but this may be
incorrect.</dd>
<dt id="IEEE80211_IOC_POWERSAVESLEEP"><a class="permalink" href="#IEEE80211_IOC_POWERSAVESLEEP"><code class="Dv">IEEE80211_IOC_POWERSAVESLEEP</code></a></dt>
<dd>Returns the powersave sleep time in msec in
<var class="Va">i_val</var>.</dd>
</dl>
<p class="Pp">For <code class="Dv">SIOCS80211</code> the following values of
<var class="Va">i_type</var> are valid:</p>
<dl class="Bl-tag">
<dt id="IEEE80211_IOC_SSID~2"><a class="permalink" href="#IEEE80211_IOC_SSID~2"><code class="Dv">IEEE80211_IOC_SSID</code></a></dt>
<dd>Set the desired SSID for infrastructure and ad-hoc modes to value given by
<var class="Va">i_data</var> and <var class="Va">i_len</var>. The length
should be no longer than 32 characters.</dd>
<dt id="IEEE80211_IOC_WEP~2"><a class="permalink" href="#IEEE80211_IOC_WEP~2"><code class="Dv">IEEE80211_IOC_WEP</code></a></dt>
<dd>Set the current WEP mode to the value given in
<var class="Va">i_val</var>. Valid values are the same as those for this
value above. Devices which do not support all modes may choose to either
return <code class="Er">EINVAL</code> or choose a reasonable alternate
(supported) setting.</dd>
<dt id="IEEE80211_IOC_WEPKEY~2"><a class="permalink" href="#IEEE80211_IOC_WEPKEY~2"><code class="Dv">IEEE80211_IOC_WEPKEY</code></a></dt>
<dd>Set the WEP key indicated by <var class="Va">i_val</var> to the value
given by <var class="Va">i_data</var> and <var class="Va">i_len</var>.
Generally, valid values of <var class="Va">i_len</var> are 0, 5, and 13
though not all devices with WEP support have support for 13-byte
keys.</dd>
<dt id="IEEE80211_IOC_WEPTXKEY~2"><a class="permalink" href="#IEEE80211_IOC_WEPTXKEY~2"><code class="Dv">IEEE80211_IOC_WEPTXKEY</code></a></dt>
<dd>Set the WEP key used for transmission to the value in
<var class="Va">i_val</var>. Not all values which are valid for setting
keys may be valid for setting transmit keys due to strange device
interfaces.</dd>
<dt id="IEEE80211_IOC_AUTHMODE~2"><a class="permalink" href="#IEEE80211_IOC_AUTHMODE~2"><code class="Dv">IEEE80211_IOC_AUTHMODE</code></a></dt>
<dd>Set the current authorization mode to the value given in
<var class="Va">i_val</var>. Valid values are given above. Not all devices
support this.</dd>
<dt id="IEEE80211_IOC_STATIONNAME~2"><a class="permalink" href="#IEEE80211_IOC_STATIONNAME~2"><code class="Dv">IEEE80211_IOC_STATIONNAME</code></a></dt>
<dd>Set the station name to the value given by <var class="Va">i_data</var>
and <var class="Va">i_len</var>. The standard does not appear to deal with
this feature so the range of valid values may vary from device to
device.</dd>
<dt id="IEEE80211_IOC_CHANNEL~2"><a class="permalink" href="#IEEE80211_IOC_CHANNEL~2"><code class="Dv">IEEE80211_IOC_CHANNEL</code></a></dt>
<dd>Set the desired ad-hoc channel to the value given by
<var class="Va">i_val</var>. On some devices this has an impact on
infrastructure mode as well. Valid values are 1-14, but 0 should be
allowed and should return the device to the default value. Many devices
support this directly by converting any invalid value to the default
value.</dd>
<dt id="IEEE80211_IOC_POWERSAVE~2"><a class="permalink" href="#IEEE80211_IOC_POWERSAVE~2"><code class="Dv">IEEE80211_IOC_POWERSAVE</code></a></dt>
<dd>Set the current powersaving mode to the value given in
<var class="Va">i_val</var>. Valid values are the same as those for this
value above. Devices which do not support all modes may choose to either
return <code class="Er">EINVAL</code> or choose a reasonable alternate
(supported) setting. Most devices only support CAM mode.</dd>
<dt id="IEEE80211_IOC_POWERSAVESLEEP~2"><a class="permalink" href="#IEEE80211_IOC_POWERSAVESLEEP~2"><code class="Dv">IEEE80211_IOC_POWERSAVESLEEP</code></a></dt>
<dd>Set the powersave sleep time in msec to the value in
<var class="Va">i_val</var>.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">ioctl(2)</a>, <a class="Xr">an(4)</a>,
<a class="Xr">ray(4)</a>, <a class="Xr">wi(4)</a>,
<a class="Xr">ifconfig(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">ieee80211</code> manual appeared in
<span class="Ux">FreeBSD 4.3</span>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">November 29, 2025</td>
<td class="foot-os">NetBSD 10.1</td>
</tr>
</table>
|