iwm: Fix S:N reporting in ifconfig(8)
[dragonfly.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: head/share/man/man9/ieee80211_regdomain.9 233648 2012-03-29 05:02:12Z eadler $
27 .\"
28 .Dd April 28, 2010
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 net/if.h
36 .In net/if_media.h
37 .In netproto/802_11/ieee80211_var.h
38 .In netproto/802_11/ieee80211_regdomain.h
39 .Pp
40 .Ft int
41 .Fo ieee80211_init_channels
42 .Fa "struct ieee80211com *"
43 .Fa "const struct ieee80211_regdomain *"
44 .Fa "const uint8_t bands[]"
45 .Fc
46 .\"
47 .Ft void
48 .Fo ieee80211_sort_channels
49 .Fa "struct ieee80211_channel *"
50 .Fa "int nchans"
51 .Fc
52 .\"
53 .Ft "struct ieee80211_appie *"
54 .Fn ieee80211_alloc_countryie "struct ieee80211com *"
55 .Sh DESCRIPTION
56 The
57 .Nm net80211
58 software layer provides a support framework for drivers that includes
59 comprehensive regulatory support.
60 .Nm net80211
61 provides mechanisms that enforce
62 .Em "regulatory policy"
63 by privileged user applications.
64 .Pp
65 Drivers define a device's capabilities and can
66 intercept and control regulatory changes requested through
67 .Nm net80211 .
68 The initial regulatory state, including the channel list, must be
69 filled in by the driver before calling
70 .Fn ieee80211_ifattach .
71 The channel list should reflect the set of channels the device is
72 .Em calibrated
73 for use on.
74 This list may also be requested later through the
75 .Vt ic_getradiocaps
76 method in the
77 .Vt ieee80211com
78 structure.
79 The
80 .Fn ieee80211_init_channels
81 function is provided as a rudimentary fallback for drivers that do not
82 (or cannot) fill in a proper channel list.
83 Default regulatory state is supplied such as the regulatory SKU,
84 ISO country code, location (e.g. indoor, outdoor), and a set of
85 frequency bands the device is capable of operating on.
86 .Nm net80211
87 populates the channel table in
88 .Vt ic_channels
89 with a default set of channels and capabilities.
90 Note this mechanism should be used with care as any mismatch between
91 the channel list created and the device's capabilities can result
92 in runtime errors (e.g. a request to operate on a channel the device
93 does not support).
94 The SKU and country information are used for generating 802.11h protocol
95 elements and related operation such as for 802.11d; mis-setup by a
96 driver is not fatal, only potentially confusing.
97 .Pp
98 Devices that do not have a fixed/default regulatory state can set
99 the regulatory SKU to
100 .Dv SKU_DEBUG
101 and country code to
102 .Dv CTRY_DEFAULT
103 and leave proper setup to user applications.
104 If default settings are known they can be installed and/or an event
105 can be dispatched to user space using
106 .Fn ieee80211_notify_country
107 so that
108 .Xr devd 8
109 will do the appropriate setup work at system boot (or device insertion).
110 .Pp
111 The channel table is sorted to optimize lookups using the
112 .Fn ieee80211_sort_channels
113 routine.
114 This should be done whenever the channel table contents are modified.
115 .Pp
116 The
117 .Fn ieee80211_alloc_countryie
118 function allocates an information element as specified by 802.11h.
119 Because this is expensive to generate it is cached in
120 .Vt ic_countryie
121 and generated only when regulatory state changes.
122 Drivers that call
123 .Fn ieee80211_alloc_countryie
124 directly should not help with this caching; doing so may confuse the
125 .Nm net80211
126 layer.
127 .Sh DRIVER REGULATORY CONTROL
128 Drivers can control regulatory change requests by overriding the
129 .Vt ic_setregdomain
130 method that checks change requests.
131 While drivers can reject any request that does not meet its requirements
132 it is recommended that one be lenient in what is accepted and, whenever
133 possible, instead of rejecting a request, alter it to be correct.
134 For example, if the transmit power cap for a channel is too high the
135 driver can either reject the request or (better) reduce the cap to be
136 compliant.
137 Requests that include unacceptable channels should cause the request
138 to be rejected as otherwise a mismatch may be created between application
139 state and the state managed by
140 .Nm net80211 .
141 The exact rules by which to operate are still being codified.
142 .Sh SEE ALSO
143 .Xr regdomain 5 ,
144 .Xr ifconfig 8 ,
145 .Xr ieee80211 9