1 .\" $NetBSD: ieee80211.9,v 1.3 2006/09/12 11:05:23 pooka Exp $
4 .\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org>
5 .\" Copyright (c) 2004 Darron Broad <darron@kewl.org>
6 .\" All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" $FreeBSD: src/share/man/man9/ieee80211.9,v 1.3 2004/07/07 12:59:39 ru Exp $
31 .Dd September 12, 2006
35 .Nm ieee80211_ifattach , ieee80211_ifdetach ,
36 .Nm ieee80211_mhz2ieee , ieee80211_chan2ieee , ieee80211_ieee2mhz ,
37 .Nm ieee80211_media_init , ieee80211_media_change , ieee80211_media_status ,
38 .Nm ieee80211_watchdog ,
39 .Nm ieee80211_setmode , ieee80211_chan2mode ,
40 .Nm ieee80211_rate2media , ieee80211_media2rate
41 .Nd core 802.11 network stack functions
43 .In net80211/ieee80211_var.h
44 .In net80211/ieee80211_proto.h
46 .Fn ieee80211_ifattach "struct ieee80211com *ic"
48 .Fn ieee80211_ifdetach "struct ieee80211com *ic"
50 .Fn ieee80211_mhz2ieee "u_int freq" "u_int flags"
52 .Fn ieee80211_chan2ieee "struct ieee80211com *ic" "struct ieee80211_channel *c"
54 .Fn ieee80211_ieee2mhz "u_int chan" "u_int flags"
56 .Fo ieee80211_media_init
57 .Fa "struct ieee80211com *ic" "ifm_change_cb_t media_change"
58 .Fa "ifm_stat_cb_t media_stat"
61 .Fn ieee80211_media_change "struct ifnet *ifp"
63 .Fn ieee80211_media_status "struct ifnet *ifp" "struct ifmediareq *imr"
65 .Fn ieee80211_watchdog "struct ieee80211com *ic"
67 .Fn ieee80211_setmode "struct ieee80211com *ic" "enum ieee80211_phymode mode"
68 .Ft enum ieee80211_phymode
69 .Fo ieee80211_chan2mode
70 .Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan"
73 .Fo ieee80211_rate2media
74 .Fa "struct ieee80211com *ic" "int rate" "enum ieee80211_phymode mode"
77 .Fn ieee80211_media2rate "int mword"
81 collection of functions are used to manage wireless network interfaces in the
82 system which use the system's software 802.11 network stack.
83 Most of these functions require that attachment to the stack is performed
85 Several utility functions are also provided; these are safe to call from
86 any driver without prior initialization.
90 .Fn ieee80211_ifattach
91 function attaches the wireless network interface
93 to the 802.11 network stack layer.
94 This function must be called before using any of the
96 functions which need to store driver state across invocations.
97 This function also performs Ethernet and BPF attachment (by calling
101 on behalf of the caller.
105 .Fn ieee80211_ifdetach
108 structures associated with the driver, and performs Ethernet and BPF
109 detachment on behalf of the caller.
113 .Fn ieee80211_mhz2ieee
114 utility function converts the frequency
116 (specified in MHz) to an IEEE 802.11 channel number.
119 argument is a hint which specifies whether the frequency is in
121 .Pq Vt IEEE80211_CHAN_2GHZ
123 .Pq Vt IEEE80211_CHAN_5GHZ ;
124 appropriate clipping of the result is then performed.
128 .Fn ieee80211_chan2ieee
129 function converts the channel specified in
131 to an IEEE channel number for the driver
133 If the conversion would be invalid, an error message is printed to the
135 This function REQUIRES that the driver is hooked up to the
141 .Fn ieee80211_ieee2mhz
142 utility function converts the IEEE channel number
144 to a frequency (in MHz).
147 argument is a hint which specifies whether the frequency is in
149 .Pq Vt IEEE80211_CHAN_2GHZ
151 .Pq Vt IEEE80211_CHAN_5GHZ ;
152 appropriate clipping of the result is then performed.
156 .Fn ieee80211_media_init
157 function initializes media data structures used by the
159 interface for the driver
161 It must be called by the driver after calling
162 .Fn ieee80211_ifattach
163 and before calling most
170 arguments specify helper functions which will be invoked by the
172 framework when the user changes or queries media options,
173 using a command such as
178 .Fn ieee80211_media_status
180 .Fn ieee80211_media_change
181 functions are device-independent handlers for
183 commands and are not intended to be called directly.
187 .Fn ieee80211_watchdog
188 function is intended to be called from a driver's
191 It is used to perform periodic cleanup of state within the software 802.11
192 stack, as well as timing out scans.
196 .Fn ieee80211_setmode
197 function is called from within the 802.11 stack to change the mode
198 of the driver's PHY; it is not intended to be called directly.
202 .Fn ieee80211_chan2mode
203 function returns the PHY mode required for use with the channel
207 This is typically used when selecting a rate set, to be advertised in
208 beacons, for example.
212 .Fn ieee80211_rate2media
213 function converts the bit rate
215 (measured in units of 0.5Mbps) to an
217 sub-type, for the device
222 .Fn ieee80211_media2rate
223 performs the reverse of this conversion, returning the bit rate (in 0.5Mbps
224 units) corresponding to an
229 .Xr ieee80211_crypto 9 ,
230 .Xr ieee80211_input 9 ,
231 .Xr ieee80211_ioctl 9 ,
232 .Xr ieee80211_node 9 ,
233 .Xr ieee80211_output 9 ,
234 .Xr ieee80211_proto 9 ,
235 .Xr ieee80211_radiotap 9
239 series of functions first appeared in
241 and were later ported to
245 This man page was written by
246 .An Bruce M. Simpson Aq bms@FreeBSD.org
248 .An Darron Broad Aq darron@kewl.org .