diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-19 10:11:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-24 16:32:06 -0400 |
commit | d70e96932de55fb2c05b1c0af1dff178651a9b77 (patch) | |
tree | aa79113a4fffbc5e3163effd3949ad39e31a71c0 | |
parent | 672ddeffeb2afad18fe1a2fc5aa14a07b4da1551 (diff) |
cfg80211: add some documentation
Add some documentation for cfg80211. I'm hoping some of
the regulatory documentation will be filled by somebody
more familiar with it, hint hint! :)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | Documentation/DocBook/80211.tmpl | 136 | ||||
-rw-r--r-- | include/net/cfg80211.h | 121 |
2 files changed, 246 insertions, 11 deletions
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl index 52310ac892ea..b84c9282828f 100644 --- a/Documentation/DocBook/80211.tmpl +++ b/Documentation/DocBook/80211.tmpl | |||
@@ -65,18 +65,144 @@ | |||
65 | </abstract> | 65 | </abstract> |
66 | </setinfo> | 66 | </setinfo> |
67 | <book id="cfg80211-developers-guide"> | 67 | <book id="cfg80211-developers-guide"> |
68 | !Ainclude/net/cfg80211.h | ||
68 | <bookinfo> | 69 | <bookinfo> |
69 | <title>The cfg80211 subsystem</title> | 70 | <title>The cfg80211 subsystem</title> |
70 | 71 | ||
71 | <abstract> | 72 | <abstract> |
72 | <para> | 73 | !Pinclude/net/cfg80211.h Introduction |
73 | MISSING | ||
74 | </para> | ||
75 | </abstract> | 74 | </abstract> |
76 | </bookinfo> | 75 | </bookinfo> |
77 | <part><chapter> | 76 | <chapter> |
77 | <title>Device registration</title> | ||
78 | !Pinclude/net/cfg80211.h Device registration | ||
78 | !Finclude/net/cfg80211.h ieee80211_band | 79 | !Finclude/net/cfg80211.h ieee80211_band |
79 | </chapter></part> | 80 | !Finclude/net/cfg80211.h ieee80211_channel_flags |
81 | !Finclude/net/cfg80211.h ieee80211_channel | ||
82 | !Finclude/net/cfg80211.h ieee80211_rate_flags | ||
83 | !Finclude/net/cfg80211.h ieee80211_rate | ||
84 | !Finclude/net/cfg80211.h ieee80211_sta_ht_cap | ||
85 | !Finclude/net/cfg80211.h ieee80211_supported_band | ||
86 | !Finclude/net/cfg80211.h cfg80211_signal_type | ||
87 | !Finclude/net/cfg80211.h wiphy_params_flags | ||
88 | !Finclude/net/cfg80211.h wiphy_flags | ||
89 | !Finclude/net/cfg80211.h wiphy | ||
90 | !Finclude/net/cfg80211.h wireless_dev | ||
91 | !Finclude/net/cfg80211.h wiphy_new | ||
92 | !Finclude/net/cfg80211.h wiphy_register | ||
93 | !Finclude/net/cfg80211.h wiphy_unregister | ||
94 | !Finclude/net/cfg80211.h wiphy_free | ||
95 | |||
96 | !Finclude/net/cfg80211.h wiphy_name | ||
97 | !Finclude/net/cfg80211.h wiphy_dev | ||
98 | !Finclude/net/cfg80211.h wiphy_priv | ||
99 | !Finclude/net/cfg80211.h priv_to_wiphy | ||
100 | !Finclude/net/cfg80211.h set_wiphy_dev | ||
101 | !Finclude/net/cfg80211.h wdev_priv | ||
102 | </chapter> | ||
103 | <chapter> | ||
104 | <title>Actions and configuration</title> | ||
105 | !Pinclude/net/cfg80211.h Actions and configuration | ||
106 | !Finclude/net/cfg80211.h cfg80211_ops | ||
107 | !Finclude/net/cfg80211.h vif_params | ||
108 | !Finclude/net/cfg80211.h key_params | ||
109 | !Finclude/net/cfg80211.h survey_info_flags | ||
110 | !Finclude/net/cfg80211.h survey_info | ||
111 | !Finclude/net/cfg80211.h beacon_parameters | ||
112 | !Finclude/net/cfg80211.h plink_actions | ||
113 | !Finclude/net/cfg80211.h station_parameters | ||
114 | !Finclude/net/cfg80211.h station_info_flags | ||
115 | !Finclude/net/cfg80211.h rate_info_flags | ||
116 | !Finclude/net/cfg80211.h rate_info | ||
117 | !Finclude/net/cfg80211.h station_info | ||
118 | !Finclude/net/cfg80211.h monitor_flags | ||
119 | !Finclude/net/cfg80211.h mpath_info_flags | ||
120 | !Finclude/net/cfg80211.h mpath_info | ||
121 | !Finclude/net/cfg80211.h bss_parameters | ||
122 | !Finclude/net/cfg80211.h ieee80211_txq_params | ||
123 | !Finclude/net/cfg80211.h cfg80211_crypto_settings | ||
124 | !Finclude/net/cfg80211.h cfg80211_auth_request | ||
125 | !Finclude/net/cfg80211.h cfg80211_assoc_request | ||
126 | !Finclude/net/cfg80211.h cfg80211_deauth_request | ||
127 | !Finclude/net/cfg80211.h cfg80211_disassoc_request | ||
128 | !Finclude/net/cfg80211.h cfg80211_ibss_params | ||
129 | !Finclude/net/cfg80211.h cfg80211_connect_params | ||
130 | !Finclude/net/cfg80211.h cfg80211_pmksa | ||
131 | !Finclude/net/cfg80211.h cfg80211_send_rx_auth | ||
132 | !Finclude/net/cfg80211.h cfg80211_send_auth_timeout | ||
133 | !Finclude/net/cfg80211.h __cfg80211_auth_canceled | ||
134 | !Finclude/net/cfg80211.h cfg80211_send_rx_assoc | ||
135 | !Finclude/net/cfg80211.h cfg80211_send_assoc_timeout | ||
136 | !Finclude/net/cfg80211.h cfg80211_send_deauth | ||
137 | !Finclude/net/cfg80211.h __cfg80211_send_deauth | ||
138 | !Finclude/net/cfg80211.h cfg80211_send_disassoc | ||
139 | !Finclude/net/cfg80211.h __cfg80211_send_disassoc | ||
140 | !Finclude/net/cfg80211.h cfg80211_ibss_joined | ||
141 | !Finclude/net/cfg80211.h cfg80211_connect_result | ||
142 | !Finclude/net/cfg80211.h cfg80211_roamed | ||
143 | !Finclude/net/cfg80211.h cfg80211_disconnected | ||
144 | !Finclude/net/cfg80211.h cfg80211_ready_on_channel | ||
145 | !Finclude/net/cfg80211.h cfg80211_remain_on_channel_expired | ||
146 | !Finclude/net/cfg80211.h cfg80211_new_sta | ||
147 | !Finclude/net/cfg80211.h cfg80211_rx_mgmt | ||
148 | !Finclude/net/cfg80211.h cfg80211_mgmt_tx_status | ||
149 | !Finclude/net/cfg80211.h cfg80211_cqm_rssi_notify | ||
150 | !Finclude/net/cfg80211.h cfg80211_michael_mic_failure | ||
151 | </chapter> | ||
152 | <chapter> | ||
153 | <title>Scanning and BSS list handling</title> | ||
154 | !Pinclude/net/cfg80211.h Scanning and BSS list handling | ||
155 | !Finclude/net/cfg80211.h cfg80211_ssid | ||
156 | !Finclude/net/cfg80211.h cfg80211_scan_request | ||
157 | !Finclude/net/cfg80211.h cfg80211_scan_done | ||
158 | !Finclude/net/cfg80211.h cfg80211_bss | ||
159 | !Finclude/net/cfg80211.h cfg80211_inform_bss_frame | ||
160 | !Finclude/net/cfg80211.h cfg80211_inform_bss | ||
161 | !Finclude/net/cfg80211.h cfg80211_unlink_bss | ||
162 | !Finclude/net/cfg80211.h cfg80211_find_ie | ||
163 | !Finclude/net/cfg80211.h ieee80211_bss_get_ie | ||
164 | </chapter> | ||
165 | <chapter> | ||
166 | <title>Utility functions</title> | ||
167 | !Pinclude/net/cfg80211.h Utility functions | ||
168 | !Finclude/net/cfg80211.h ieee80211_channel_to_frequency | ||
169 | !Finclude/net/cfg80211.h ieee80211_frequency_to_channel | ||
170 | !Finclude/net/cfg80211.h ieee80211_get_channel | ||
171 | !Finclude/net/cfg80211.h ieee80211_get_response_rate | ||
172 | !Finclude/net/cfg80211.h ieee80211_hdrlen | ||
173 | !Finclude/net/cfg80211.h ieee80211_get_hdrlen_from_skb | ||
174 | !Finclude/net/cfg80211.h ieee80211_radiotap_iterator | ||
175 | </chapter> | ||
176 | <chapter> | ||
177 | <title>Data path helpers</title> | ||
178 | !Pinclude/net/cfg80211.h Data path helpers | ||
179 | !Finclude/net/cfg80211.h ieee80211_data_to_8023 | ||
180 | !Finclude/net/cfg80211.h ieee80211_data_from_8023 | ||
181 | !Finclude/net/cfg80211.h ieee80211_amsdu_to_8023s | ||
182 | !Finclude/net/cfg80211.h cfg80211_classify8021d | ||
183 | </chapter> | ||
184 | <chapter> | ||
185 | <title>Regulatory enforcement infrastructure</title> | ||
186 | !Pinclude/net/cfg80211.h Regulatory enforcement infrastructure | ||
187 | !Finclude/net/cfg80211.h regulatory_hint | ||
188 | !Finclude/net/cfg80211.h wiphy_apply_custom_regulatory | ||
189 | !Finclude/net/cfg80211.h freq_reg_info | ||
190 | </chapter> | ||
191 | <chapter> | ||
192 | <title>RFkill integration</title> | ||
193 | !Pinclude/net/cfg80211.h RFkill integration | ||
194 | !Finclude/net/cfg80211.h wiphy_rfkill_set_hw_state | ||
195 | !Finclude/net/cfg80211.h wiphy_rfkill_start_polling | ||
196 | !Finclude/net/cfg80211.h wiphy_rfkill_stop_polling | ||
197 | </chapter> | ||
198 | <chapter> | ||
199 | <title>Test mode</title> | ||
200 | !Pinclude/net/cfg80211.h Test mode | ||
201 | !Finclude/net/cfg80211.h cfg80211_testmode_alloc_reply_skb | ||
202 | !Finclude/net/cfg80211.h cfg80211_testmode_reply | ||
203 | !Finclude/net/cfg80211.h cfg80211_testmode_alloc_event_skb | ||
204 | !Finclude/net/cfg80211.h cfg80211_testmode_event | ||
205 | </chapter> | ||
80 | </book> | 206 | </book> |
81 | <book id="mac80211-developers-guide"> | 207 | <book id="mac80211-developers-guide"> |
82 | <bookinfo> | 208 | <bookinfo> |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 6a98b1b3bfde..f2740537b5d6 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -25,6 +25,43 @@ | |||
25 | #include <linux/wireless.h> | 25 | #include <linux/wireless.h> |
26 | 26 | ||
27 | 27 | ||
28 | /** | ||
29 | * DOC: Introduction | ||
30 | * | ||
31 | * cfg80211 is the configuration API for 802.11 devices in Linux. It bridges | ||
32 | * userspace and drivers, and offers some utility functionality associated | ||
33 | * with 802.11. cfg80211 must, directly or indirectly via mac80211, be used | ||
34 | * by all modern wireless drivers in Linux, so that they offer a consistent | ||
35 | * API through nl80211. For backward compatibility, cfg80211 also offers | ||
36 | * wireless extensions to userspace, but hides them from drivers completely. | ||
37 | * | ||
38 | * Additionally, cfg80211 contains code to help enforce regulatory spectrum | ||
39 | * use restrictions. | ||
40 | */ | ||
41 | |||
42 | |||
43 | /** | ||
44 | * DOC: Device registration | ||
45 | * | ||
46 | * In order for a driver to use cfg80211, it must register the hardware device | ||
47 | * with cfg80211. This happens through a number of hardware capability structs | ||
48 | * described below. | ||
49 | * | ||
50 | * The fundamental structure for each device is the 'wiphy', of which each | ||
51 | * instance describes a physical wireless device connected to the system. Each | ||
52 | * such wiphy can have zero, one, or many virtual interfaces associated with | ||
53 | * it, which need to be identified as such by pointing the network interface's | ||
54 | * @ieee80211_ptr pointer to a &struct wireless_dev which further describes | ||
55 | * the wireless part of the interface, normally this struct is embedded in the | ||
56 | * network interface's private data area. Drivers can optionally allow creating | ||
57 | * or destroying virtual interfaces on the fly, but without at least one or the | ||
58 | * ability to create some the wireless device isn't useful. | ||
59 | * | ||
60 | * Each wiphy structure contains device capability information, and also has | ||
61 | * a pointer to the various operations the driver offers. The definitions and | ||
62 | * structures here describe these capabilities in detail. | ||
63 | */ | ||
64 | |||
28 | /* | 65 | /* |
29 | * wireless hardware capability structures | 66 | * wireless hardware capability structures |
30 | */ | 67 | */ |
@@ -205,6 +242,21 @@ struct ieee80211_supported_band { | |||
205 | */ | 242 | */ |
206 | 243 | ||
207 | /** | 244 | /** |
245 | * DOC: Actions and configuration | ||
246 | * | ||
247 | * Each wireless device and each virtual interface offer a set of configuration | ||
248 | * operations and other actions that are invoked by userspace. Each of these | ||
249 | * actions is described in the operations structure, and the parameters these | ||
250 | * operations use are described separately. | ||
251 | * | ||
252 | * Additionally, some operations are asynchronous and expect to get status | ||
253 | * information via some functions that drivers need to call. | ||
254 | * | ||
255 | * Scanning and BSS list handling with its associated functionality is described | ||
256 | * in a separate chapter. | ||
257 | */ | ||
258 | |||
259 | /** | ||
208 | * struct vif_params - describes virtual interface parameters | 260 | * struct vif_params - describes virtual interface parameters |
209 | * @mesh_id: mesh ID to use | 261 | * @mesh_id: mesh ID to use |
210 | * @mesh_id_len: length of the mesh ID | 262 | * @mesh_id_len: length of the mesh ID |
@@ -570,8 +622,28 @@ struct ieee80211_txq_params { | |||
570 | /* from net/wireless.h */ | 622 | /* from net/wireless.h */ |
571 | struct wiphy; | 623 | struct wiphy; |
572 | 624 | ||
573 | /* from net/ieee80211.h */ | 625 | /** |
574 | struct ieee80211_channel; | 626 | * DOC: Scanning and BSS list handling |
627 | * | ||
628 | * The scanning process itself is fairly simple, but cfg80211 offers quite | ||
629 | * a bit of helper functionality. To start a scan, the scan operation will | ||
630 | * be invoked with a scan definition. This scan definition contains the | ||
631 | * channels to scan, and the SSIDs to send probe requests for (including the | ||
632 | * wildcard, if desired). A passive scan is indicated by having no SSIDs to | ||
633 | * probe. Additionally, a scan request may contain extra information elements | ||
634 | * that should be added to the probe request. The IEs are guaranteed to be | ||
635 | * well-formed, and will not exceed the maximum length the driver advertised | ||
636 | * in the wiphy structure. | ||
637 | * | ||
638 | * When scanning finds a BSS, cfg80211 needs to be notified of that, because | ||
639 | * it is responsible for maintaining the BSS list; the driver should not | ||
640 | * maintain a list itself. For this notification, various functions exist. | ||
641 | * | ||
642 | * Since drivers do not maintain a BSS list, there are also a number of | ||
643 | * functions to search for a BSS and obtain information about it from the | ||
644 | * BSS structure cfg80211 maintains. The BSS list is also made available | ||
645 | * to userspace. | ||
646 | */ | ||
575 | 647 | ||
576 | /** | 648 | /** |
577 | * struct cfg80211_ssid - SSID description | 649 | * struct cfg80211_ssid - SSID description |
@@ -1574,8 +1646,10 @@ static inline void *wdev_priv(struct wireless_dev *wdev) | |||
1574 | return wiphy_priv(wdev->wiphy); | 1646 | return wiphy_priv(wdev->wiphy); |
1575 | } | 1647 | } |
1576 | 1648 | ||
1577 | /* | 1649 | /** |
1578 | * Utility functions | 1650 | * DOC: Utility functions |
1651 | * | ||
1652 | * cfg80211 offers a number of utility functions that can be useful. | ||
1579 | */ | 1653 | */ |
1580 | 1654 | ||
1581 | /** | 1655 | /** |
@@ -1729,6 +1803,14 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
1729 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); | 1803 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); |
1730 | 1804 | ||
1731 | /** | 1805 | /** |
1806 | * DOC: Data path helpers | ||
1807 | * | ||
1808 | * In addition to generic utilities, cfg80211 also offers | ||
1809 | * functions that help implement the data path for devices | ||
1810 | * that do not do the 802.11/802.3 conversion on the device. | ||
1811 | */ | ||
1812 | |||
1813 | /** | ||
1732 | * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 | 1814 | * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 |
1733 | * @skb: the 802.11 data frame | 1815 | * @skb: the 802.11 data frame |
1734 | * @addr: the device MAC address | 1816 | * @addr: the device MAC address |
@@ -1788,8 +1870,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb); | |||
1788 | */ | 1870 | */ |
1789 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); | 1871 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); |
1790 | 1872 | ||
1791 | /* | 1873 | /** |
1792 | * Regulatory helper functions for wiphys | 1874 | * DOC: Regulatory enforcement infrastructure |
1875 | * | ||
1876 | * TODO | ||
1793 | */ | 1877 | */ |
1794 | 1878 | ||
1795 | /** | 1879 | /** |
@@ -2192,6 +2276,20 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, | |||
2192 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); | 2276 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); |
2193 | 2277 | ||
2194 | /** | 2278 | /** |
2279 | * DOC: RFkill integration | ||
2280 | * | ||
2281 | * RFkill integration in cfg80211 is almost invisible to drivers, | ||
2282 | * as cfg80211 automatically registers an rfkill instance for each | ||
2283 | * wireless device it knows about. Soft kill is also translated | ||
2284 | * into disconnecting and turning all interfaces off, drivers are | ||
2285 | * expected to turn off the device when all interfaces are down. | ||
2286 | * | ||
2287 | * However, devices may have a hard RFkill line, in which case they | ||
2288 | * also need to interact with the rfkill subsystem, via cfg80211. | ||
2289 | * They can do this with a few helper functions documented here. | ||
2290 | */ | ||
2291 | |||
2292 | /** | ||
2195 | * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state | 2293 | * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state |
2196 | * @wiphy: the wiphy | 2294 | * @wiphy: the wiphy |
2197 | * @blocked: block status | 2295 | * @blocked: block status |
@@ -2212,6 +2310,17 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy); | |||
2212 | 2310 | ||
2213 | #ifdef CONFIG_NL80211_TESTMODE | 2311 | #ifdef CONFIG_NL80211_TESTMODE |
2214 | /** | 2312 | /** |
2313 | * DOC: Test mode | ||
2314 | * | ||
2315 | * Test mode is a set of utility functions to allow drivers to | ||
2316 | * interact with driver-specific tools to aid, for instance, | ||
2317 | * factory programming. | ||
2318 | * | ||
2319 | * This chapter describes how drivers interact with it, for more | ||
2320 | * information see the nl80211 book's chapter on it. | ||
2321 | */ | ||
2322 | |||
2323 | /** | ||
2215 | * cfg80211_testmode_alloc_reply_skb - allocate testmode reply | 2324 | * cfg80211_testmode_alloc_reply_skb - allocate testmode reply |
2216 | * @wiphy: the wiphy | 2325 | * @wiphy: the wiphy |
2217 | * @approxlen: an upper bound of the length of the data that will | 2326 | * @approxlen: an upper bound of the length of the data that will |