View | Details | Raw Unified | Return to bug 214602
Collapse All | Expand All

(-)ieee80211.9.fni (+150 lines)
Lines 1-4 Link Here
1
.\"
1
.\"
2
.\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org>
3
.\" Copyright (c) 2004 Darron Broad <darron@kewl.org>
2
.\" Copyright (c) 2009 Sam Leffler, Errno Consulting
4
.\" Copyright (c) 2009 Sam Leffler, Errno Consulting
3
.\" All rights reserved.
5
.\" All rights reserved.
4
.\"
6
.\"
Lines 37-42 Link Here
37
.Fn ieee80211_ifattach "struct ieee80211com *ic" "const uint8_t macaddr[IEEE80211_ADDR_LEN]"
39
.Fn ieee80211_ifattach "struct ieee80211com *ic" "const uint8_t macaddr[IEEE80211_ADDR_LEN]"
38
.Ft void
40
.Ft void
39
.Fn ieee80211_ifdetach "struct ieee80211com *ic"
41
.Fn ieee80211_ifdetach "struct ieee80211com *ic"
42
.Ft u_int
43
.Fn ieee80211_mhz2ieee "u_int freq" "u_int flags"
44
.Ft u_int
45
.Fn ieee80211_chan2ieee "struct ieee80211com *ic" "struct ieee80211_channel *c"
46
.Ft u_int
47
.Fn ieee80211_ieee2mhz "u_int chan" "u_int flags"
48
.Ft int
49
.Fn ieee80211_media_change "struct ifnet *ifp"
50
.Ft void
51
.Fn ieee80211_media_status "struct ifnet *ifp" "struct ifmediareq *imr"
52
.Ft int
53
.Fn ieee80211_setmode "struct ieee80211com *ic" "enum ieee80211_phymode mode"
54
.Ft enum ieee80211_phymode
55
.Fo ieee80211_chan2mode
56
.Fa "const struct ieee80211_channel *chan"
57
.Fc
58
.Ft int
59
.Fo ieee80211_rate2media
60
.Fa "struct ieee80211com *ic" "int rate" "enum ieee80211_phymode mode"
61
.Fc
62
.Ft int
63
.Fn ieee80211_media2rate "int mword"
40
.Sh DESCRIPTION
64
.Sh DESCRIPTION
41
IEEE 802.11 device drivers are written to use the infrastructure provided
65
IEEE 802.11 device drivers are written to use the infrastructure provided
42
by the
66
by the
Lines 89-94 Link Here
89
layer means that drivers must be structured to follow specific rules.
113
layer means that drivers must be structured to follow specific rules.
90
Drivers that support only a single interface at any time must still
114
Drivers that support only a single interface at any time must still
91
follow these rules.
115
follow these rules.
116
.Pp
117
Most of these functions require that attachment to the stack is performed
118
before calling.
119
.Pp
120
.\"
121
The
122
.Fn ieee80211_ifattach
123
function attaches the wireless network interface
124
.Fa ic
125
to the 802.11 network stack layer.
126
This function must be called before using any of the
127
.Nm
128
functions which need to store driver state across invocations.
129
.Pp
130
.\"
131
The
132
.Fn ieee80211_ifdetach
133
function frees any
134
.Nm
135
structures associated with the driver, and performs Ethernet and BPF
136
detachment on behalf of the caller.
137
.Pp
138
.\"
139
The
140
.Fn ieee80211_mhz2ieee
141
utility function converts the frequency
142
.Fa freq
143
(specified in MHz) to an IEEE 802.11 channel number.
144
The
145
.Fa flags
146
argument is a hint which specifies whether the frequency is in
147
the 2GHz ISM band
148
.Pq Vt IEEE80211_CHAN_2GHZ
149
or the 5GHz band
150
.Pq Vt IEEE80211_CHAN_5GHZ ;
151
appropriate clipping of the result is then performed.
152
.Pp
153
.\"
154
The
155
.Fn ieee80211_chan2ieee
156
function converts the channel specified in
157
.Fa *c
158
to an IEEE channel number for the driver
159
.Fa ic .
160
If the conversion would be invalid, an error message is printed to the
161
system console.
162
This function REQUIRES that the driver is hooked up to the
163
.Nm
164
subsystem.
165
.Pp
166
.\"
167
The
168
.Fn ieee80211_ieee2mhz
169
utility function converts the IEEE channel number
170
.Ft chan
171
to a frequency (in MHz).
172
The
173
.Fa flags
174
argument is a hint which specifies whether the frequency is in
175
the 2GHz ISM band
176
.Pq Vt IEEE80211_CHAN_2GHZ
177
or the 5GHz band
178
.Pq Vt IEEE80211_CHAN_5GHZ ;
179
appropriate clipping of the result is then performed.
180
.Pp
181
.\"
182
The
183
.Fn ieee80211_media_status
184
and
185
.Fn ieee80211_media_change
186
functions are device-independent handlers for
187
.Vt ifmedia
188
commands and are not intended to be called directly.
189
.Pp
190
.\"
191
The
192
.Fn ieee80211_setmode
193
function is called from within the 802.11 stack to change the mode
194
of the driver's PHY; it is not intended to be called directly.
195
.Pp
196
.\"
197
The
198
.Fn ieee80211_chan2mode
199
function returns the PHY mode required for use with the channel
200
.Fa chan .
201
This is typically used when selecting a rate set, to be advertised in
202
beacons, for example.
203
.Pp
204
.\"
205
The
206
.Fn ieee80211_rate2media
207
function converts the bit rate
208
.Fa rate
209
(measured in units of 0.5Mbps) to an
210
.Vt ifmedia
211
sub-type, for the device
212
.Fa ic
213
running in PHY mode
214
.Fa mode .
215
The
216
.Fn ieee80211_media2rate
217
performs the reverse of this conversion, returning the bit rate (in 0.5Mbps
218
units) corresponding to an
219
.Vt ifmedia
220
sub-type.
221
.
92
.Sh DATA STRUCTURES
222
.Sh DATA STRUCTURES
93
The virtual radio architecture splits state between a single per-device
223
The virtual radio architecture splits state between a single per-device
94
.Vt ieee80211com
224
.Vt ieee80211com
Lines 566-568 Link Here
566
.Xr ieee80211_vap 9 ,
696
.Xr ieee80211_vap 9 ,
567
.Xr ifnet 9 ,
697
.Xr ifnet 9 ,
568
.Xr malloc 9
698
.Xr malloc 9
699
.Sh HISTORY
700
The
701
.Nm
702
series of functions first appeared in
703
.Nx 1.5 ,
704
and were later ported to
705
.Fx 4.6 .
706
This man page was updated with the information from
707
.Nx
708
.Nm
709
man page. 
710
.Sh AUTHORS
711
.An -nosplit
712
The original
713
.Nx
714
.Nm
715
man page was written by
716
.An Bruce M. Simpson Aq Mt bms@FreeBSD.org
717
and
718
.An Darron Broad Aq Mt darron@kewl.org .

Return to bug 214602