2 .\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org>
3 .\" Copyright (c) 2004 Darron Broad <darron@kewl.org>
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" $DragonFly: src/share/man/man9/ieee80211.9,v 1.4 2006/06/28 19:41:59 swildner Exp $
29 .\" $Id: ieee80211.9,v 1.3 2004/07/07 12:59:39 ru Exp $
35 .Nm ieee80211_ifattach ,
36 .Nm ieee80211_ifdetach ,
37 .Nm ieee80211_mhz2ieee ,
38 .Nm ieee80211_chan2ieee ,
39 .Nm ieee80211_ieee2mhz ,
40 .Nm ieee80211_media_init ,
41 .Nm ieee80211_media_change ,
42 .Nm ieee80211_media_status ,
43 .Nm ieee80211_watchdog ,
44 .Nm ieee80211_setmode ,
45 .Nm ieee80211_chan2mode ,
46 .Nm ieee80211_rate2media ,
47 .Nm ieee80211_media2rate
48 .Nd core 802.11 network stack functions
50 .In netproto/802_11/ieee80211_var.h
52 .Fn ieee80211_ifattach "struct ieee80211com *ic"
54 .Fn ieee80211_ifdetach "struct ieee80211com *ic"
56 .Fn ieee80211_mhz2ieee "u_int freq" "u_int flags"
58 .Fn ieee80211_chan2ieee "struct ieee80211com *ic" "struct ieee80211_channel *c"
60 .Fn ieee80211_ieee2mhz "u_int chan" "u_int flags"
62 .Fo ieee80211_media_init
63 .Fa "struct ieee80211com *ic" "ifm_change_cb_t media_change"
64 .Fa "ifm_stat_cb_t media_stat"
67 .Fn ieee80211_media_change "struct ifnet *ifp"
69 .Fn ieee80211_media_status "struct ifnet *ifp" "struct ifmediareq *imr"
71 .Fn ieee80211_watchdog "struct ieee80211com *ic"
73 .Fn ieee80211_setmode "struct ieee80211com *ic" "enum ieee80211_phymode mode"
74 .Ft enum ieee80211_phymode
75 .Fo ieee80211_chan2mode
76 .Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan"
79 .Fo ieee80211_rate2media
80 .Fa "struct ieee80211com *ic" "int rate" "enum ieee80211_phymode mode"
83 .Fn ieee80211_media2rate "int mword"
87 collection of functions are used to manage wireless network interfaces in the
88 system which use the system's software 802.11 network stack.
89 Most of these functions require that attachment to the stack is performed
91 Several utility functions are also provided; these are safe to call from
92 any driver without prior initialization.
96 .Fn ieee80211_ifattach
97 function attaches the network interface
99 to the 802.11 network stack layer.
100 This function must be called before using any of the
102 functions which need to store driver state across invocations;
103 Various fields of the
104 .Vt struct ieee80211com
105 instance pointed to by
107 must be initialized to tell
109 about its capabilities.
110 This function performs Ethernet and BPF attachment (by calling
114 on behalf of the caller.
115 It also implements the
121 .Fn ieee80211_ifdetach
124 structures associated with the driver, and performs Ethernet and BPF
125 detachment on behalf of the caller.
129 .Fn ieee80211_mhz2ieee
130 utility function converts the frequency
132 (specified in MHz) to an IEEE 802.11 channel number.
135 argument is a hint which specifies whether the frequency is in
137 .Pq Dv IEEE80211_CHAN_2GHZ
139 .Pq Dv IEEE80211_CHAN_5GHZ ;
140 appropriate clipping of the result is then performed.
144 .Fn ieee80211_chan2ieee
145 function converts the channel specified in
147 to an IEEE channel number for the driver
149 If the conversion would be invalid, an error message is printed to the
151 This function REQUIRES that the driver is hooked up to the
157 .Fn ieee80211_ieee2mhz
158 utility function converts the IEEE channel number
160 to a frequency (in MHz).
163 argument is a hint which specifies whether the frequency is in
165 .Pq Dv IEEE80211_CHAN_2GHZ
167 .Pq Dv IEEE80211_CHAN_5GHZ ;
168 appropriate clipping of the result is then performed.
172 .Fn ieee80211_media_init
173 function initializes media data structures used by the
175 interface, for the driver
177 It must be called by the driver after calling
178 .Fn ieee80211_ifattach
179 and before calling most
186 arguments specify helper functions which will be invoked by the
188 framework when the user changes or queries media options,
189 using a command such as
194 .Fn ieee80211_media_status
196 .Fn ieee80211_media_change
197 functions are device-independent handlers for
199 commands and are not intended to be called directly.
203 .Fn ieee80211_watchdog
204 function is intended to be called from a driver's
207 It is used to perform periodic cleanup of state within the software 802.11
209 getting rid of inactive
210 .Vt struct ieee80211_node
212 as well as timing out scans.
216 .Fn ieee80211_setmode
217 function is called from within the 802.11 stack to change the mode
218 of the driver's PHY; it is not intended to be called directly.
222 .Fn ieee80211_chan2mode
223 function returns the PHY mode required for use with the channel
227 This is typically used when selecting a rate set, to be advertised in
228 beacons, for example.
232 .Fn ieee80211_rate2media
233 function converts the bit rate
235 (measured in units of 0.5Mbps) to an
237 sub-type, for the device
242 .Fn ieee80211_media2rate
243 performs the reverse of this conversion, returning the bit rate (in 0.5Mbps
244 units) corresponding to an
249 .Xr ieee80211_crypto 9 ,
250 .Xr ieee80211_input 9 ,
251 .Xr ieee80211_ioctl 9 ,
252 .Xr ieee80211_node 9 ,
253 .Xr ieee80211_output 9 ,
254 .Xr ieee80211_proto 9 ,
255 .Xr ieee80211_radiotap 9 ,
260 series of functions first appeared in
262 and were later ported to
266 This man page was written by
267 .An Bruce M. Simpson Aq bms@FreeBSD.org
269 .An Darron Broad Aq darron@kewl.org .