]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man9/ieee80211_regdomain.9
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man9 / ieee80211_regdomain.9
1 .\"
2 .\" Copyright (c) 2009 Sam Leffler, Errno Consulting
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd August 4, 2009
29 .Dt IEEE80211_REGDOMAIN 9
30 .Os
31 .Sh NAME
32 .Nm ieee80211_regdomain
33 .Nd 802.11 regulatory support
34 .Sh SYNOPSIS
35 .In net80211/ieee80211_var.h
36 .In net80211/ieee80211_regdomain.h
37 .Pp
38 .Ft int
39 .Fo ieee80211_init_channels
40 .Fa "struct ieee80211com *"
41 .Fa "const struct ieee80211_regdomain *"
42 .Fa "const uint8_t bands[]"
43 .Fc
44 .\"
45 .Ft void
46 .Fo ieee80211_sort_channels
47 .Fa "struct ieee80211_channel *"
48 .Fa "int nchans"
49 .Fc
50 .\"
51 .Ft "struct ieee80211_appie *"
52 .Fn ieee80211_alloc_countryie "struct ieee80211com *"
53 .Sh DESCRIPTION
54 The
55 .Nm net80211
56 software layer provides a support framework for drivers that includes
57 comprehensive regulatory support.
58 .Nm net80211
59 provides mechanisms that enforce
60 .Em "regulatory policy"
61 by privileged user applications.
62 .Pp
63 Drivers define a device's capabilities and can
64 intercept and control regulatory changes requested through
65 .Nm net80211 .
66 The initial regulatory state, including the channel list, must be
67 filled in by the driver before calling
68 .Fn ieee80211_ifattach .
69 The channel list should reflect the set of channels the device is
70 .Em calibrated
71 for use on.
72 This list may also be requested later through the
73 .Vt ic_getradiocaps
74 method in the
75 .Vt ieee80211com
76 structure.
77 The
78 .Fn ieee80211_init_channels
79 function is provided as a rudimentary fallback for drivers that do not
80 (or cannot) fill in a proper channel list.
81 Default regulatory state is supplied such as the regulatory SKU,
82 ISO country code, location (e.g. indoor, outdoor), and a set of
83 frequency bands the device is capable of operating on.
84 .Nm net80211
85 populates the channel table in
86 .Vt ic_channels
87 with a default set of channels and capabilities.
88 Note this mechanism should be used with care as any mismatch between
89 the channel list created and the device's capabilities can result
90 in runtime errors (e.g. a request to operate on a channel the device
91 does not support).
92 The SKU and country information are used for generating 802.11h protocol
93 elements and related operation such as for 802.11d; mis-setup by a
94 driver is not fatal, only potentially confusing.
95 .Pp
96 Devices that do not have a fixed/default regulatory state can set
97 the regulatory SKU to
98 .Dv SKU_DEBUG
99 and country code to
100 .Dv CTRY_DEFAULT
101 and leave proper setup to user applications.
102 If default settings are known they can be installed and/or an event
103 can be dispatched to user space using
104 .Fn ieee80211_notify_country
105 so that
106 .Xr devd 8
107 will do the appropriate setup work at system boot (or device insertion).
108 .Pp
109 The channel table is sorted to optimize lookups using the
110 .Fn ieee80211_sort_channels
111 routine.
112 This should be done whenever the channel table contents are modified.
113 .Pp
114 The
115 .Fn ieee80211_alloc_countryie
116 function allocates an information element as specified by 802.11h.
117 Because this is expensive to generate it is cached in
118 .Vt ic_countryie
119 and generated only when regulatory state changes.
120 Drivers that call
121 .Fn ieee80211_alloc_countryie
122 directly should not help with this caching; doing so may confuse the
123 .Nm net80211
124 layer.
125 .Sh DRIVER REGULATORY CONTROL
126 Drivers can control regulatory change requests by overriding the
127 .Vt ic_setregdomain
128 method that checks change requests.
129 While drivers can reject any request that does not meet its requirements
130 it is recommended that one be lenient in what is accepted and, whenever
131 possible, instead of rejecting a request, alter it to be correct.
132 For example, if the transmit power cap for a channel is too high the
133 driver can either reject the request or (better) reduce the cap to be
134 compliant.
135 Requests that include unacceptable channels should cause the request
136 to be rejected as otherwise a mismatch may be created between application
137 state and the state managed by
138 .Nm net80211 .
139 The exact rules by which to operate are still being codified.
140 .Sh SEE ALSO
141 .Xr regdomain 5 ,
142 .Xr ifconfig 8 ,
143 .Xr ieee80211 9