diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/cfg80211.h | 121 |
1 files changed, 115 insertions, 6 deletions
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 |