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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
|
<table class="head">
<tr>
<td class="head-ltitle">IEEE80211(9)</td>
<td class="head-vol">Kernel Developer's Manual</td>
<td class="head-rtitle">IEEE80211(9)</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">802.11
network layer</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">net80211/ieee80211_var.h</a>></code></p>
<p class="Pp"><var class="Ft">void</var>
<br/>
<code class="Fn">ieee80211_ifattach</code>(<var class="Fa" style="white-space: nowrap;">struct
ieee80211com *ic</var>);</p>
<p class="Pp"><var class="Ft">void</var>
<br/>
<code class="Fn">ieee80211_ifdetach</code>(<var class="Fa" style="white-space: nowrap;">struct
ieee80211com *ic</var>);</p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">ieee80211_mhz2ieee</code>(<var class="Fa" style="white-space: nowrap;">u_int
freq</var>, <var class="Fa" style="white-space: nowrap;">u_int
flags</var>);</p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">ieee80211_chan2ieee</code>(<var class="Fa" style="white-space: nowrap;">struct
ieee80211com *ic</var>, <var class="Fa" style="white-space: nowrap;">const
struct ieee80211_channel *c</var>);</p>
<p class="Pp"><var class="Ft">u_int</var>
<br/>
<code class="Fn">ieee80211_ieee2mhz</code>(<var class="Fa" style="white-space: nowrap;">u_int
chan</var>, <var class="Fa" style="white-space: nowrap;">u_int
flags</var>);</p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">ieee80211_media_change</code>(<var class="Fa" style="white-space: nowrap;">struct
ifnet *ifp</var>);</p>
<p class="Pp"><var class="Ft">void</var>
<br/>
<code class="Fn">ieee80211_media_status</code>(<var class="Fa" style="white-space: nowrap;">struct
ifnet *ifp</var>, <var class="Fa" style="white-space: nowrap;">struct
ifmediareq *imr</var>);</p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">ieee80211_setmode</code>(<var class="Fa" style="white-space: nowrap;">struct
ieee80211com *ic</var>, <var class="Fa" style="white-space: nowrap;">enum
ieee80211_phymode mode</var>);</p>
<p class="Pp"><var class="Ft">enum ieee80211_phymode</var>
<br/>
<code class="Fn">ieee80211_chan2mode</code>(<var class="Fa">const struct
ieee80211_channel *chan</var>);</p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">ieee80211_rate2media</code>(<var class="Fa">struct
ieee80211com *ic</var>, <var class="Fa">int rate</var>, <var class="Fa">enum
ieee80211_phymode mode</var>);</p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">ieee80211_media2rate</code>(<var class="Fa" style="white-space: nowrap;">int
mword</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">IEEE 802.11 device drivers are written to use the infrastructure
provided by the <code class="Nm">IEEE80211</code> software layer. This
software provides a support framework for drivers that includes ifnet
cloning, state management, and a user management API by which applications
interact with 802.11 devices. Most drivers depend on the
<code class="Nm">IEEE80211</code> layer for protocol services but devices
that off-load functionality may bypass the layer to connect directly to the
device.</p>
<p class="Pp">A <code class="Nm">IEEE80211</code> device driver implements a
virtual radio API that is exported to users through network interfaces (aka
vaps) that are cloned from the underlying device. These interfaces have an
operating mode (station, adhoc, hostap, wds, monitor, etc.) that is fixed
for the lifetime of the interface. Devices that can support multiple
concurrent interfaces allow multiple vaps to be cloned. This enables
construction of interesting applications such as an AP vap and one or more
WDS vaps or multiple AP vaps, each with a different security model. The
<code class="Nm">IEEE80211</code> layer virtualizes most 802.11 state and
coordinates vap state changes including scheduling multiple vaps. State that
is not virtualized includes the current channel and WME/WMM parameters.
Protocol processing is typically handled entirely in the
<code class="Nm">IEEE80211</code> layer with drivers responsible purely for
moving data between the host and device. Similarly,
<code class="Nm">IEEE80211</code> handles most <a class="Xr">ioctl(2)</a>
requests without entering the driver; instead drivers are notified of state
changes that require their involvement.</p>
<p class="Pp">The virtual radio interface defined by the
<code class="Nm">IEEE80211</code> layer means that drivers must be
structured to follow specific rules. Drivers that support only a single
interface at any time must still follow these rules.</p>
<p class="Pp">Most of these functions require that attachment to the stack is
performed before calling.</p>
<p class="Pp" id="ieee80211_ifattach">The
<a class="permalink" href="#ieee80211_ifattach"><code class="Fn">ieee80211_ifattach</code></a>()
function attaches the wireless network interface <var class="Fa">ic</var> to
the 802.11 network stack layer. This function must be called before using
any of the <code class="Nm">IEEE80211</code> functions which need to store
driver state across invocations.</p>
<p class="Pp" id="ieee80211_ifdetach">The
<a class="permalink" href="#ieee80211_ifdetach"><code class="Fn">ieee80211_ifdetach</code></a>()
function frees any <code class="Nm">IEEE80211</code> structures associated
with the driver, and performs Ethernet and BPF detachment on behalf of the
caller.</p>
<p class="Pp" id="ieee80211_mhz2ieee">The
<a class="permalink" href="#ieee80211_mhz2ieee"><code class="Fn">ieee80211_mhz2ieee</code></a>()
utility function converts the frequency <var class="Fa">freq</var>
(specified in MHz) to an IEEE 802.11 channel number. The
<var class="Fa">flags</var> argument is a hint which specifies whether the
frequency is in the 2GHz ISM band
(<var class="Vt">IEEE80211_CHAN_2GHZ</var>) or the 5GHz band
(<var class="Vt">IEEE80211_CHAN_5GHZ</var>); appropriate clipping of the
result is then performed.</p>
<p class="Pp" id="ieee80211_chan2ieee">The
<a class="permalink" href="#ieee80211_chan2ieee"><code class="Fn">ieee80211_chan2ieee</code></a>()
function converts the channel specified in <var class="Fa">*c</var> to an
IEEE channel number for the driver <var class="Fa">ic</var>. If the
conversion would be invalid, an error message is printed to the system
console. This function REQUIRES that the driver is hooked up to the
<code class="Nm">IEEE80211</code> subsystem.</p>
<p class="Pp" id="ieee80211_ieee2mhz">The
<a class="permalink" href="#ieee80211_ieee2mhz"><code class="Fn">ieee80211_ieee2mhz</code></a>()
utility function converts the IEEE channel number <var class="Ft">chan</var>
to a frequency (in MHz). The <var class="Fa">flags</var> argument is a hint
which specifies whether the frequency is in the 2GHz ISM band
(<var class="Vt">IEEE80211_CHAN_2GHZ</var>) or the 5GHz band
(<var class="Vt">IEEE80211_CHAN_5GHZ</var>); appropriate clipping of the
result is then performed.</p>
<p class="Pp" id="ieee80211_media_status">The
<a class="permalink" href="#ieee80211_media_status"><code class="Fn">ieee80211_media_status</code></a>()
and
<a class="permalink" href="#ieee80211_media_change"><code class="Fn" id="ieee80211_media_change">ieee80211_media_change</code></a>()
functions are device-independent handlers for <var class="Vt">ifmedia</var>
commands and are not intended to be called directly.</p>
<p class="Pp" id="ieee80211_setmode">The
<a class="permalink" href="#ieee80211_setmode"><code class="Fn">ieee80211_setmode</code></a>()
function is called from within the 802.11 stack to change the mode of the
driver's PHY; it is not intended to be called directly.</p>
<p class="Pp" id="ieee80211_chan2mode">The
<a class="permalink" href="#ieee80211_chan2mode"><code class="Fn">ieee80211_chan2mode</code></a>()
function returns the PHY mode required for use with the channel
<var class="Fa">chan</var>. This is typically used when selecting a rate
set, to be advertised in beacons, for example.</p>
<p class="Pp" id="ieee80211_rate2media">The
<a class="permalink" href="#ieee80211_rate2media"><code class="Fn">ieee80211_rate2media</code></a>()
function converts the bit rate <var class="Fa">rate</var> (measured in units
of 0.5Mbps) to an <var class="Vt">ifmedia</var> sub-type, for the device
<var class="Fa">ic</var> running in PHY mode <var class="Fa">mode</var>. The
<a class="permalink" href="#ieee80211_media2rate"><code class="Fn" id="ieee80211_media2rate">ieee80211_media2rate</code></a>()
performs the reverse of this conversion, returning the bit rate (in 0.5Mbps
units) corresponding to an <var class="Vt">ifmedia</var> sub-type.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DATA_STRUCTURES"><a class="permalink" href="#DATA_STRUCTURES">DATA
STRUCTURES</a></h1>
<p class="Pp">The virtual radio architecture splits state between a single
per-device <var class="Vt">ieee80211com</var> structure and one or more
<var class="Vt">ieee80211vap</var> structures. Drivers are expected to setup
various shared state in these structures at device attach and during vap
creation but otherwise should treat them as read-only. The
<var class="Vt">ieee80211com</var> structure is allocated by the
<code class="Nm">IEEE80211</code> layer as adjunct data to a device's
<var class="Vt">ifnet</var>; it is accessed through the
<var class="Vt">if_l2com</var> structure member. The
<var class="Vt">ieee80211vap</var> structure is allocated by the driver in
the “vap create” method and should be extended with any
driver-private state. This technique of giving the driver control to
allocate data structures is used for other <code class="Nm">IEEE80211</code>
data structures and should be exploited to maintain driver-private state
together with public <code class="Nm">IEEE80211</code> state.</p>
<p class="Pp">The other main data structures are the station, or node, table
that tracks peers in the local BSS, and the channel table that defines the
current set of available radio channels. Both tables are bound to the
<var class="Vt">ieee80211com</var> structure and shared by all vaps.
Long-lasting references to a node are counted to guard against premature
reclamation. In particular every packet sent/received holds a node reference
(either explicitly for transmit or implicitly on receive).</p>
<p class="Pp">The <var class="Vt">ieee80211com</var> and
<var class="Vt">ieee80211vap</var> structures also hold a collection of
method pointers that drivers fill-in and/or override to take control of
certain operations. These methods are the primary way drivers are bound to
the <code class="Nm">IEEE80211</code> layer and are described below.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DRIVER_ATTACH/DETACH"><a class="permalink" href="#DRIVER_ATTACH/DETACH">DRIVER
ATTACH/DETACH</a></h1>
<p class="Pp">Drivers attach to the <code class="Nm">IEEE80211</code> layer with
the
<a class="permalink" href="#ieee80211_ifattach~2"><code class="Fn" id="ieee80211_ifattach~2">ieee80211_ifattach</code></a>()
function. The driver is expected to allocate and setup any device-private
data structures before passing control. The
<var class="Vt">ieee80211com</var> structure must be pre-initialized with
state required to setup the <code class="Nm">IEEE80211</code> layer:</p>
<dl class="Bl-tag">
<dt id="ic_ifp"><a class="permalink" href="#ic_ifp"><code class="Dv">ic_ifp</code></a></dt>
<dd>Backpointer to the physical device's ifnet.</dd>
<dt id="ic_caps"><a class="permalink" href="#ic_caps"><code class="Dv">ic_caps</code></a></dt>
<dd>Device/driver capabilities; see below for a complete description.</dd>
<dt id="ic_channels"><a class="permalink" href="#ic_channels"><code class="Dv">ic_channels</code></a></dt>
<dd>Table of channels the device is capable of operating on. This is initially
provided by the driver but may be changed through calls that change the
regulatory state.</dd>
<dt id="ic_nchan"><a class="permalink" href="#ic_nchan"><code class="Dv">ic_nchan</code></a></dt>
<dd>Number of entries in <code class="Dv">ic_channels</code>.</dd>
</dl>
<p class="Pp" id="ieee80211_ifattach~3">On return from
<a class="permalink" href="#ieee80211_ifattach~3"><code class="Fn">ieee80211_ifattach</code></a>()
the driver is expected to override default callback functions in the
<var class="Vt">ieee80211com</var> structure to register it's private
routines. Methods marked with a “*” must be provided by the
driver.</p>
<dl class="Bl-tag">
<dt id="ic_vap_create*"><a class="permalink" href="#ic_vap_create*"><code class="Dv">ic_vap_create*</code></a></dt>
<dd>Create a vap instance of the specified type (operating mode). Any fixed
BSSID and/or MAC address is provided. Drivers that support multi-bssid
operation may honor the requested BSSID or assign their own.</dd>
<dt id="ic_vap_delete*"><a class="permalink" href="#ic_vap_delete*"><code class="Dv">ic_vap_delete*</code></a></dt>
<dd>Destroy a vap instance created with
<code class="Dv">ic_vap_create</code>.</dd>
<dt id="ic_getradiocaps"><a class="permalink" href="#ic_getradiocaps"><code class="Dv">ic_getradiocaps</code></a></dt>
<dd>Return the list of calibrated channels for the radio. The default method
returns the current list of channels (space permitting).</dd>
<dt id="ic_setregdomain"><a class="permalink" href="#ic_setregdomain"><code class="Dv">ic_setregdomain</code></a></dt>
<dd>Process a request to change regulatory state. The routine may reject a
request or constrain changes (e.g. reduce transmit power caps). The
default method accepts all proposed changes.</dd>
<dt id="ic_send_mgmt"><a class="permalink" href="#ic_send_mgmt"><code class="Dv">ic_send_mgmt</code></a></dt>
<dd>Send an 802.11 management frame. The default method fabricates the frame
using <code class="Nm">IEEE80211</code> state and passes it to the driver
through the <code class="Dv">ic_raw_xmit</code> method.</dd>
<dt id="ic_raw_xmit"><a class="permalink" href="#ic_raw_xmit"><code class="Dv">ic_raw_xmit</code></a></dt>
<dd>Transmit a raw 802.11 frame. The default method drops the frame and
generates a message on the console.</dd>
<dt id="ic_updateslot"><a class="permalink" href="#ic_updateslot"><code class="Dv">ic_updateslot</code></a></dt>
<dd>Update hardware state after an 802.11 IFS slot time change. There is no
default method; the pointer may be NULL in which case it will not be
used.</dd>
<dt id="ic_update_mcast"><a class="permalink" href="#ic_update_mcast"><code class="Dv">ic_update_mcast</code></a></dt>
<dd>Update hardware for a change in the multicast packet filter. The default
method prints a console message.</dd>
<dt id="ic_update_promisc"><a class="permalink" href="#ic_update_promisc"><code class="Dv">ic_update_promisc</code></a></dt>
<dd>Update hardware for a change in the promiscuous mode setting. The default
method prints a console message.</dd>
<dt id="ic_newassoc"><a class="permalink" href="#ic_newassoc"><code class="Dv">ic_newassoc</code></a></dt>
<dd>Update driver/device state for association to a new AP (in station mode)
or when a new station associates (e.g. in AP mode). There is no default
method; the pointer may be NULL in which case it will not be used.</dd>
<dt id="ic_node_alloc"><a class="permalink" href="#ic_node_alloc"><code class="Dv">ic_node_alloc</code></a></dt>
<dd>Allocate and initialize a <var class="Vt">ieee80211_node</var> structure.
This method cannot sleep. The default method allocates zero'd memory using
<a class="Xr">malloc(9)</a>. Drivers should override this method to
allocate extended storage for their own needs. Memory allocated by the
driver must be tagged with <code class="Dv">M_80211_NODE</code> to balance
the memory allocation statistics.</dd>
<dt id="ic_node_free"><a class="permalink" href="#ic_node_free"><code class="Dv">ic_node_free</code></a></dt>
<dd>Reclaim storage of a node allocated by
<code class="Dv">ic_node_alloc</code>. Drivers are expected to
<a class="permalink" href="#interpose"><i class="Em" id="interpose">interpose</i></a>
their own method to cleanup private state but must call through this
method to allow <code class="Nm">IEEE80211</code> to reclaim it's private
state.</dd>
<dt id="ic_node_cleanup"><a class="permalink" href="#ic_node_cleanup"><code class="Dv">ic_node_cleanup</code></a></dt>
<dd>Cleanup state in a <var class="Vt">ieee80211_node</var> created by
<code class="Dv">ic_node_alloc</code>. This operation is distinguished
from <code class="Dv">ic_node_free</code> in that it may be called long
before the node is actually reclaimed to cleanup adjunct state. This can
happen, for example, when a node must not be reclaimed due to references
held by packets in the transmit queue. Drivers typically interpose
<code class="Dv">ic_node_cleanup</code> instead of
<code class="Dv">ic_node_free</code>.</dd>
<dt id="ic_node_age"><a class="permalink" href="#ic_node_age"><code class="Dv">ic_node_age</code></a></dt>
<dd>Age, and potentially reclaim, resources associated with a node. The
default method ages frames on the power-save queue (in AP mode) and
pending frames in the receive reorder queues (for stations using
A-MPDU).</dd>
<dt id="ic_node_drain"><a class="permalink" href="#ic_node_drain"><code class="Dv">ic_node_drain</code></a></dt>
<dd>Reclaim all optional resources associated with a node. This call is used
to free up resources when they are in short supply.</dd>
<dt id="ic_node_getrssi"><a class="permalink" href="#ic_node_getrssi"><code class="Dv">ic_node_getrssi</code></a></dt>
<dd>Return the Receive Signal Strength Indication (RSSI) in .5 dBm units for
the specified node. This interface returns a subset of the information
returned by <code class="Dv">ic_node_getsignal</code>. The default method
calculates a filtered average over the last ten samples passed in to
<a class="Xr">ieee80211_input(9)</a> or
<a class="Xr">ieee80211_input_all(9)</a>.</dd>
<dt id="ic_node_getsignal"><a class="permalink" href="#ic_node_getsignal"><code class="Dv">ic_node_getsignal</code></a></dt>
<dd>Return the RSSI and noise floor (in .5 dBm units) for a station. The
default method calculates RSSI as described above; the noise floor
returned is the last value supplied to
<a class="Xr">ieee80211_input(9)</a> or
<a class="Xr">ieee80211_input_all(9)</a>.</dd>
<dt id="ic_node_getmimoinfo"><a class="permalink" href="#ic_node_getmimoinfo"><code class="Dv">ic_node_getmimoinfo</code></a></dt>
<dd>Return MIMO radio state for a station in support of the
<code class="Dv">IEEE80211_IOC_STA_INFO</code> ioctl request. The default
method returns nothing.</dd>
<dt id="ic_scan_start*"><a class="permalink" href="#ic_scan_start*"><code class="Dv">ic_scan_start*</code></a></dt>
<dd>Prepare driver/hardware state for scanning. This callback is done in a
sleepable context.</dd>
<dt id="ic_scan_end*"><a class="permalink" href="#ic_scan_end*"><code class="Dv">ic_scan_end*</code></a></dt>
<dd>Restore driver/hardware state after scanning completes. This callback is
done in a sleepable context.</dd>
<dt id="ic_set_channel*"><a class="permalink" href="#ic_set_channel*"><code class="Dv">ic_set_channel*</code></a></dt>
<dd>Set the current radio channel using <var class="Vt">ic_curchan</var>. This
callback is done in a sleepable context.</dd>
<dt id="ic_scan_curchan"><a class="permalink" href="#ic_scan_curchan"><code class="Dv">ic_scan_curchan</code></a></dt>
<dd>Start scanning on a channel. This method is called immediately after each
channel change and must initiate the work to scan a channel and schedule a
timer to advance to the next channel in the scan list. This callback is
done in a sleepable context. The default method handles active scan work
(e.g. sending ProbeRequest frames), and schedules a call to
<a class="Xr">ieee80211_scan_next(9)</a> according to the maximum dwell
time for the channel. Drivers that off-load scan work to firmware
typically use this method to trigger per-channel scan activity.</dd>
<dt id="ic_scan_mindwell"><a class="permalink" href="#ic_scan_mindwell"><code class="Dv">ic_scan_mindwell</code></a></dt>
<dd>Handle reaching the minimum dwell time on a channel when scanning. This
event is triggered when one or more stations have been found on a channel
and the minimum dwell time has been reached. This callback is done in a
sleepable context. The default method signals the scan machinery to
advance to the next channel as soon as possible. Drivers can use this
method to preempt further work (e.g. if scanning is handled by firmware)
or ignore the request to force maximum dwell time on a channel.</dd>
<dt id="ic_recv_action"><a class="permalink" href="#ic_recv_action"><code class="Dv">ic_recv_action</code></a></dt>
<dd>Process a received Action frame. The default method points to
<a class="Xr">ieee80211_recv_action(9)</a> which provides a mechanism for
setting up handlers for each Action frame class.</dd>
<dt id="ic_send_action"><a class="permalink" href="#ic_send_action"><code class="Dv">ic_send_action</code></a></dt>
<dd>Transmit an Action frame. The default method points to
<a class="Xr">ieee80211_send_action(9)</a> which provides a mechanism for
setting up handlers for each Action frame class.</dd>
<dt id="ic_ampdu_enable"><a class="permalink" href="#ic_ampdu_enable"><code class="Dv">ic_ampdu_enable</code></a></dt>
<dd>Check if transmit A-MPDU should be enabled for the specified station and
AC. The default method checks a per-AC traffic rate against a per-vap
threshold to decide if A-MPDU should be enabled. This method also
rate-limits ADDBA requests so that requests are not made too frequently
when a receiver has limited resources.</dd>
<dt id="ic_addba_request"><a class="permalink" href="#ic_addba_request"><code class="Dv">ic_addba_request</code></a></dt>
<dd>Request A-MPDU transmit aggregation. The default method sets up local
state and issues an ADDBA Request Action frame. Drivers may interpose this
method if they need to setup private state for handling transmit
A-MPDU.</dd>
<dt id="ic_addb_response"><a class="permalink" href="#ic_addb_response"><code class="Dv">ic_addb_response</code></a></dt>
<dd>Process a received ADDBA Response Action frame and setup resources as
needed for doing transmit A-MPDU.</dd>
<dt id="ic_addb_stop"><a class="permalink" href="#ic_addb_stop"><code class="Dv">ic_addb_stop</code></a></dt>
<dd>Shutdown an A-MPDU transmit stream for the specified station and AC. The
default method reclaims local state after sending a DelBA Action
frame.</dd>
<dt id="ic_bar_response"><a class="permalink" href="#ic_bar_response"><code class="Dv">ic_bar_response</code></a></dt>
<dd>Process a response to a transmitted BAR control frame.</dd>
<dt id="ic_ampdu_rx_start"><a class="permalink" href="#ic_ampdu_rx_start"><code class="Dv">ic_ampdu_rx_start</code></a></dt>
<dd>Prepare to receive A-MPDU data from the specified station for the
TID.</dd>
<dt id="ic_ampdu_rx_stop"><a class="permalink" href="#ic_ampdu_rx_stop"><code class="Dv">ic_ampdu_rx_stop</code></a></dt>
<dd>Terminate receipt of A-MPDU data from the specified station for the
TID.</dd>
</dl>
<p class="Pp">Once the <code class="Nm">IEEE80211</code> layer is attached to a
driver there are two more steps typically done to complete the work:</p>
<ol class="Bl-enum">
<li>Setup “radiotap support” for capturing raw 802.11 packets
that pass through the device. This is done with a call to
<a class="Xr">ieee80211_radiotap_attach(9)</a>.</li>
<li>Do any final device setup like enabling interrupts.</li>
</ol>
<p class="Pp" id="ieee80211_ifdetach~2">State is torn down and reclaimed with a
call to
<a class="permalink" href="#ieee80211_ifdetach~2"><code class="Fn">ieee80211_ifdetach</code></a>().
Note this call may result in multiple callbacks into the driver so it should
be done before any critical driver state is reclaimed. On return from
<code class="Fn">ieee80211_ifdetach</code>() all associated vaps and ifnet
structures are reclaimed or inaccessible to user applications so it is safe
to teardown driver state without worry about being re-entered. The driver is
responsible for calling <a class="Xr">if_free(9)</a> on the ifnet it
allocated for the physical device.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DRIVER_CAPABILITIES"><a class="permalink" href="#DRIVER_CAPABILITIES">DRIVER
CAPABILITIES</a></h1>
<p class="Pp">Driver/device capabilities are specified using several sets of
flags in the <var class="Vt">ieee80211com</var> structure. General
capabilities are specified by <var class="Vt">ic_caps</var>. Hardware
cryptographic capabilities are specified by
<var class="Vt">ic_cryptocaps</var>. Software cryptographic capabilities are
specified by <var class="Vt">ic_sw_cryptocaps</var>. 802.11n capabilities,
if any, are specified by <var class="Vt">ic_htcaps</var>. The
<code class="Nm">IEEE80211</code> layer propagates a subset of these
capabilities to each vap through the equivalent fields:
<var class="Vt">iv_caps</var>, <var class="Vt">iv_cryptocaps</var>, and
<var class="Vt">iv_htcaps</var>. The following general capabilities are
defined:</p>
<dl class="Bl-tag">
<dt id="IEEE80211_C_STA"><a class="permalink" href="#IEEE80211_C_STA"><code class="Dv">IEEE80211_C_STA</code></a></dt>
<dd>Device is capable of operating in station (aka Infrastructure) mode.</dd>
<dt id="IEEE80211_C_8023ENCAP"><a class="permalink" href="#IEEE80211_C_8023ENCAP"><code class="Dv">IEEE80211_C_8023ENCAP</code></a></dt>
<dd>Device requires 802.3-encapsulated frames be passed for transmit. By
default <code class="Nm">IEEE80211</code> will encapsulate all outbound
frames as 802.11 frames (without a PLCP header).</dd>
<dt id="IEEE80211_C_FF"><a class="permalink" href="#IEEE80211_C_FF"><code class="Dv">IEEE80211_C_FF</code></a></dt>
<dd>Device supports Atheros Fast-Frames.</dd>
<dt id="IEEE80211_C_TURBOP"><a class="permalink" href="#IEEE80211_C_TURBOP"><code class="Dv">IEEE80211_C_TURBOP</code></a></dt>
<dd>Device supports Atheros Dynamic Turbo mode.</dd>
<dt id="IEEE80211_C_IBSS"><a class="permalink" href="#IEEE80211_C_IBSS"><code class="Dv">IEEE80211_C_IBSS</code></a></dt>
<dd>Device is capable of operating in adhoc/IBSS mode.</dd>
<dt id="IEEE80211_C_PMGT"><a class="permalink" href="#IEEE80211_C_PMGT"><code class="Dv">IEEE80211_C_PMGT</code></a></dt>
<dd>Device supports dynamic power-management (aka power save) in station
mode.</dd>
<dt id="IEEE80211_C_HOSTAP"><a class="permalink" href="#IEEE80211_C_HOSTAP"><code class="Dv">IEEE80211_C_HOSTAP</code></a></dt>
<dd>Device is capable of operating as an Access Point in Infrastructure
mode.</dd>
<dt id="IEEE80211_C_AHDEMO"><a class="permalink" href="#IEEE80211_C_AHDEMO"><code class="Dv">IEEE80211_C_AHDEMO</code></a></dt>
<dd>Device is capable of operating in Adhoc Demo mode. In this mode the device
is used purely to send/receive raw 802.11 frames.</dd>
<dt id="IEEE80211_C_SWRETRY"><a class="permalink" href="#IEEE80211_C_SWRETRY"><code class="Dv">IEEE80211_C_SWRETRY</code></a></dt>
<dd>Device supports software retry of transmitted frames.</dd>
<dt id="IEEE80211_C_TXPMGT"><a class="permalink" href="#IEEE80211_C_TXPMGT"><code class="Dv">IEEE80211_C_TXPMGT</code></a></dt>
<dd>Device support dynamic transmit power changes on transmitted frames; also
known as Transmit Power Control (TPC).</dd>
<dt id="IEEE80211_C_SHSLOT"><a class="permalink" href="#IEEE80211_C_SHSLOT"><code class="Dv">IEEE80211_C_SHSLOT</code></a></dt>
<dd>Device supports short slot time operation (for 802.11g).</dd>
<dt id="IEEE80211_C_SHPREAMBLE"><a class="permalink" href="#IEEE80211_C_SHPREAMBLE"><code class="Dv">IEEE80211_C_SHPREAMBLE</code></a></dt>
<dd>Device supports short preamble operation (for 802.11g).</dd>
<dt id="IEEE80211_C_MONITOR"><a class="permalink" href="#IEEE80211_C_MONITOR"><code class="Dv">IEEE80211_C_MONITOR</code></a></dt>
<dd>Device is capable of operating in monitor mode.</dd>
<dt id="IEEE80211_C_DFS"><a class="permalink" href="#IEEE80211_C_DFS"><code class="Dv">IEEE80211_C_DFS</code></a></dt>
<dd>Device supports radar detection and/or DFS. DFS protocol support can be
handled by <code class="Nm">IEEE80211</code> but the device must be
capable of detecting radar events.</dd>
<dt id="IEEE80211_C_MBSS"><a class="permalink" href="#IEEE80211_C_MBSS"><code class="Dv">IEEE80211_C_MBSS</code></a></dt>
<dd>Device is capable of operating in MeshBSS (MBSS) mode (as defined by
802.11s Draft 3.0).</dd>
<dt id="IEEE80211_C_WPA1"><a class="permalink" href="#IEEE80211_C_WPA1"><code class="Dv">IEEE80211_C_WPA1</code></a></dt>
<dd>Device supports WPA1 operation.</dd>
<dt id="IEEE80211_C_WPA2"><a class="permalink" href="#IEEE80211_C_WPA2"><code class="Dv">IEEE80211_C_WPA2</code></a></dt>
<dd>Device supports WPA2/802.11i operation.</dd>
<dt id="IEEE80211_C_BURST"><a class="permalink" href="#IEEE80211_C_BURST"><code class="Dv">IEEE80211_C_BURST</code></a></dt>
<dd>Device supports frame bursting.</dd>
<dt id="IEEE80211_C_WME"><a class="permalink" href="#IEEE80211_C_WME"><code class="Dv">IEEE80211_C_WME</code></a></dt>
<dd>Device supports WME/WMM operation (at the moment this is mostly support
for sending and receiving QoS frames with EDCF).</dd>
<dt id="IEEE80211_C_WDS"><a class="permalink" href="#IEEE80211_C_WDS"><code class="Dv">IEEE80211_C_WDS</code></a></dt>
<dd>Device supports transmit/receive of 4-address frames.</dd>
<dt id="IEEE80211_C_BGSCAN"><a class="permalink" href="#IEEE80211_C_BGSCAN"><code class="Dv">IEEE80211_C_BGSCAN</code></a></dt>
<dd>Device supports background scanning.</dd>
<dt id="IEEE80211_C_TXFRAG"><a class="permalink" href="#IEEE80211_C_TXFRAG"><code class="Dv">IEEE80211_C_TXFRAG</code></a></dt>
<dd>Device supports transmit of fragmented 802.11 frames.</dd>
<dt id="IEEE80211_C_TDMA"><a class="permalink" href="#IEEE80211_C_TDMA"><code class="Dv">IEEE80211_C_TDMA</code></a></dt>
<dd>Device is capable of operating in TDMA mode.</dd>
</dl>
<p class="Pp">The follow general crypto capabilities are defined. In general
<code class="Nm">IEEE80211</code> will fall-back to software support when a
device is not capable of hardware acceleration of a cipher. This can be done
on a per-key basis. <code class="Nm">IEEE80211</code> can also handle
software <code class="Dv">Michael</code> calculation combined with hardware
<code class="Dv">AES</code> acceleration.</p>
<dl class="Bl-tag">
<dt id="IEEE80211_CRYPTO_WEP"><a class="permalink" href="#IEEE80211_CRYPTO_WEP"><code class="Dv">IEEE80211_CRYPTO_WEP</code></a></dt>
<dd>Device supports hardware WEP cipher.</dd>
<dt id="IEEE80211_CRYPTO_TKIP"><a class="permalink" href="#IEEE80211_CRYPTO_TKIP"><code class="Dv">IEEE80211_CRYPTO_TKIP</code></a></dt>
<dd>Device supports hardware TKIP cipher.</dd>
<dt id="IEEE80211_CRYPTO_AES_OCB"><a class="permalink" href="#IEEE80211_CRYPTO_AES_OCB"><code class="Dv">IEEE80211_CRYPTO_AES_OCB</code></a></dt>
<dd>Device supports hardware AES-OCB cipher.</dd>
<dt id="IEEE80211_CRYPTO_AES_CCM"><a class="permalink" href="#IEEE80211_CRYPTO_AES_CCM"><code class="Dv">IEEE80211_CRYPTO_AES_CCM</code></a></dt>
<dd>Device supports hardware AES-CCM cipher.</dd>
<dt id="IEEE80211_CRYPTO_TKIPMIC"><a class="permalink" href="#IEEE80211_CRYPTO_TKIPMIC"><code class="Dv">IEEE80211_CRYPTO_TKIPMIC</code></a></dt>
<dd>Device supports hardware Michael for use with TKIP.</dd>
<dt id="IEEE80211_CRYPTO_CKIP"><a class="permalink" href="#IEEE80211_CRYPTO_CKIP"><code class="Dv">IEEE80211_CRYPTO_CKIP</code></a></dt>
<dd>Devices supports hardware CKIP cipher.</dd>
</dl>
<p class="Pp">The follow general 802.11n capabilities are defined. The first
capabilities are defined exactly as they appear in the 802.11n
specification. Capabilities beginning with IEEE80211_HTC_AMPDU are used
solely by the <code class="Nm">IEEE80211</code> layer.</p>
<dl class="Bl-tag">
<dt id="IEEE80211_HTCAP_CHWIDTH40"><a class="permalink" href="#IEEE80211_HTCAP_CHWIDTH40"><code class="Dv">IEEE80211_HTCAP_CHWIDTH40</code></a></dt>
<dd>Device supports 20/40 channel width operation.</dd>
<dt id="IEEE80211_HTCAP_SMPS_DYNAMIC"><a class="permalink" href="#IEEE80211_HTCAP_SMPS_DYNAMIC"><code class="Dv">IEEE80211_HTCAP_SMPS_DYNAMIC</code></a></dt>
<dd>Device supports dynamic SM power save operation.</dd>
<dt id="IEEE80211_HTCAP_SMPS_ENA"><a class="permalink" href="#IEEE80211_HTCAP_SMPS_ENA"><code class="Dv">IEEE80211_HTCAP_SMPS_ENA</code></a></dt>
<dd>Device supports static SM power save operation.</dd>
<dt id="IEEE80211_HTCAP_GREENFIELD"><a class="permalink" href="#IEEE80211_HTCAP_GREENFIELD"><code class="Dv">IEEE80211_HTCAP_GREENFIELD</code></a></dt>
<dd>Device supports Greenfield preamble.</dd>
<dt id="IEEE80211_HTCAP_SHORTGI20"><a class="permalink" href="#IEEE80211_HTCAP_SHORTGI20"><code class="Dv">IEEE80211_HTCAP_SHORTGI20</code></a></dt>
<dd>Device supports Short Guard Interval on 20MHz channels.</dd>
<dt id="IEEE80211_HTCAP_SHORTGI40"><a class="permalink" href="#IEEE80211_HTCAP_SHORTGI40"><code class="Dv">IEEE80211_HTCAP_SHORTGI40</code></a></dt>
<dd>Device supports Short Guard Interval on 40MHz channels.</dd>
<dt id="IEEE80211_HTCAP_TXSTBC"><a class="permalink" href="#IEEE80211_HTCAP_TXSTBC"><code class="Dv">IEEE80211_HTCAP_TXSTBC</code></a></dt>
<dd>Device supports Space Time Block Convolution (STBC) for transmit.</dd>
<dt id="IEEE80211_HTCAP_RXSTBC_1STREAM"><a class="permalink" href="#IEEE80211_HTCAP_RXSTBC_1STREAM"><code class="Dv">IEEE80211_HTCAP_RXSTBC_1STREAM</code></a></dt>
<dd>Device supports 1 spatial stream for STBC receive.</dd>
<dt id="IEEE80211_HTCAP_RXSTBC_2STREAM"><a class="permalink" href="#IEEE80211_HTCAP_RXSTBC_2STREAM"><code class="Dv">IEEE80211_HTCAP_RXSTBC_2STREAM</code></a></dt>
<dd>Device supports 1-2 spatial streams for STBC receive.</dd>
<dt id="IEEE80211_HTCAP_RXSTBC_3STREAM"><a class="permalink" href="#IEEE80211_HTCAP_RXSTBC_3STREAM"><code class="Dv">IEEE80211_HTCAP_RXSTBC_3STREAM</code></a></dt>
<dd>Device supports 1-3 spatial streams for STBC receive.</dd>
<dt id="IEEE80211_HTCAP_MAXAMSDU_7935"><a class="permalink" href="#IEEE80211_HTCAP_MAXAMSDU_7935"><code class="Dv">IEEE80211_HTCAP_MAXAMSDU_7935</code></a></dt>
<dd>Device supports A-MSDU frames up to 7935 octets.</dd>
<dt id="IEEE80211_HTCAP_MAXAMSDU_3839"><a class="permalink" href="#IEEE80211_HTCAP_MAXAMSDU_3839"><code class="Dv">IEEE80211_HTCAP_MAXAMSDU_3839</code></a></dt>
<dd>Device supports A-MSDU frames up to 3839 octets.</dd>
<dt id="IEEE80211_HTCAP_DSSSCCK40"><a class="permalink" href="#IEEE80211_HTCAP_DSSSCCK40"><code class="Dv">IEEE80211_HTCAP_DSSSCCK40</code></a></dt>
<dd>Device supports use of DSSS/CCK on 40MHz channels.</dd>
<dt id="IEEE80211_HTCAP_PSMP"><a class="permalink" href="#IEEE80211_HTCAP_PSMP"><code class="Dv">IEEE80211_HTCAP_PSMP</code></a></dt>
<dd>Device supports PSMP.</dd>
<dt id="IEEE80211_HTCAP_40INTOLERANT"><a class="permalink" href="#IEEE80211_HTCAP_40INTOLERANT"><code class="Dv">IEEE80211_HTCAP_40INTOLERANT</code></a></dt>
<dd>Device is intolerant of 40MHz wide channel use.</dd>
<dt id="IEEE80211_HTCAP_LSIGTXOPPROT"><a class="permalink" href="#IEEE80211_HTCAP_LSIGTXOPPROT"><code class="Dv">IEEE80211_HTCAP_LSIGTXOPPROT</code></a></dt>
<dd>Device supports L-SIG TXOP protection.</dd>
<dt id="IEEE80211_HTC_AMPDU"><a class="permalink" href="#IEEE80211_HTC_AMPDU"><code class="Dv">IEEE80211_HTC_AMPDU</code></a></dt>
<dd>Device supports A-MPDU aggregation. Note that any 802.11n compliant device
must support A-MPDU receive so this implicitly means support for
<i class="Em">transmit</i> of A-MPDU frames.</dd>
<dt id="IEEE80211_HTC_AMSDU"><a class="permalink" href="#IEEE80211_HTC_AMSDU"><code class="Dv">IEEE80211_HTC_AMSDU</code></a></dt>
<dd>Device supports A-MSDU aggregation. Note that any 802.11n compliant device
must support A-MSDU receive so this implicitly means support for
<i class="Em">transmit</i> of A-MSDU frames.</dd>
<dt id="IEEE80211_HTC_HT"><a class="permalink" href="#IEEE80211_HTC_HT"><code class="Dv">IEEE80211_HTC_HT</code></a></dt>
<dd>Device supports High Throughput (HT) operation. This capability must be
set to enable 802.11n functionality in
<code class="Nm">IEEE80211</code>.</dd>
<dt id="IEEE80211_HTC_SMPS"><a class="permalink" href="#IEEE80211_HTC_SMPS"><code class="Dv">IEEE80211_HTC_SMPS</code></a></dt>
<dd>Device supports MIMO Power Save operation.</dd>
<dt id="IEEE80211_HTC_RIFS"><a class="permalink" href="#IEEE80211_HTC_RIFS"><code class="Dv">IEEE80211_HTC_RIFS</code></a></dt>
<dd>Device supports Reduced Inter Frame Spacing (RIFS).</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">ieee80211_amrr(9)</a>,
<a class="Xr">ieee80211_beacon(9)</a>, <a class="Xr">ieee80211_bmiss(9)</a>,
<a class="Xr">ieee80211_crypto(9)</a>, <a class="Xr">ieee80211_ddb(9)</a>,
<a class="Xr">ieee80211_input(9)</a>, <a class="Xr">ieee80211_node(9)</a>,
<a class="Xr">ieee80211_output(9)</a>, <a class="Xr">ieee80211_proto(9)</a>,
<a class="Xr">ieee80211_radiotap(9)</a>,
<a class="Xr">ieee80211_regdomain(9)</a>,
<a class="Xr">ieee80211_scan(9)</a>, <a class="Xr">ieee80211_vap(9)</a>,
<a class="Xr">ifnet(9)</a>, <a class="Xr">malloc(9)</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> series of functions first
appeared in <span class="Ux">NetBSD 1.5</span>, and were later ported to
<span class="Ux">FreeBSD 4.6</span>. This man page was updated with the
information from <span class="Ux">NetBSD</span>
<code class="Nm">IEEE80211</code> man page.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">The original <span class="Ux">NetBSD</span>
<code class="Nm">IEEE80211</code> man page was written by
<span class="An">Bruce M. Simpson</span>
<<a class="Mt" href="mailto:bms@FreeBSD.org">bms@FreeBSD.org</a>> and
<span class="An">Darron Broad</span>
<<a class="Mt" href="mailto:darron@kewl.org">darron@kewl.org</a>>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">April 24, 2024</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|