aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.h
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-11-12 17:22:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-25 16:41:26 -0500
commit3f2355cb9111ac04e7ae06a4d7044da2ae813863 (patch)
tree11f5594b7d48281a12a2116ad7af1d20d5947455 /net/wireless/reg.h
parent88dc1c3f7f9058cd5ceae1e4b53453484c7b0364 (diff)
cfg80211/mac80211: Add 802.11d support
This adds country IE parsing to mac80211 and enables its usage within the new regulatory infrastructure in cfg80211. We parse the country IEs only on management beacons for the BSSID you are associated to and disregard the IEs when the country and environment (indoor, outdoor, any) matches the already processed country IE. To avoid following misinformed or outdated APs we build and use a regulatory domain out of the intersection between what the AP provides us on the country IE and what CRDA is aware is allowed on the same country. A secondary device is allowed to follow only the same country IE as it make no sense for two devices on a system to be in two different countries. In the case the AP is using country IEs for an incorrect country the user may help compliance further by setting the regulatory domain before or after the IE is parsed and in that case another intersection will be performed. CONFIG_WIRELESS_OLD_REGULATORY is supported but requires CRDA present. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.h')
-rw-r--r--net/wireless/reg.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index c9b6b6358bbe..a76ea3ff7cd6 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -4,28 +4,41 @@
4bool is_world_regdom(const char *alpha2); 4bool is_world_regdom(const char *alpha2);
5bool reg_is_valid_request(const char *alpha2); 5bool reg_is_valid_request(const char *alpha2);
6 6
7void reg_device_remove(struct wiphy *wiphy);
8
7int regulatory_init(void); 9int regulatory_init(void);
8void regulatory_exit(void); 10void regulatory_exit(void);
9 11
10int set_regdom(const struct ieee80211_regdomain *rd); 12int set_regdom(const struct ieee80211_regdomain *rd);
11 13
14enum environment_cap {
15 ENVIRON_ANY,
16 ENVIRON_INDOOR,
17 ENVIRON_OUTDOOR,
18};
19
20
12/** 21/**
13 * __regulatory_hint - hint to the wireless core a regulatory domain 22 * __regulatory_hint - hint to the wireless core a regulatory domain
14 * @wiphy: if the hint comes from country information from an AP, this 23 * @wiphy: if the hint comes from country information from an AP, this
15 * is required to be set to the wiphy that received the information 24 * is required to be set to the wiphy that received the information
16 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain 25 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
17 * should be in. 26 * should be in.
27 * @country_ie_checksum: checksum of processed country IE, set this to 0
28 * if the hint did not come from a country IE
29 * @country_ie_env: the environment the IE told us we are in, %ENVIRON_*
18 * 30 *
19 * The Wireless subsystem can use this function to hint to the wireless core 31 * The Wireless subsystem can use this function to hint to the wireless core
20 * what it believes should be the current regulatory domain by 32 * what it believes should be the current regulatory domain by giving it an
21 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory 33 * ISO/IEC 3166 alpha2 country code it knows its regulatory domain should be
22 * domain should be in. 34 * in.
23 * 35 *
24 * Returns zero if all went fine, %-EALREADY if a regulatory domain had 36 * Returns zero if all went fine, %-EALREADY if a regulatory domain had
25 * already been set or other standard error codes. 37 * already been set or other standard error codes.
26 * 38 *
27 */ 39 */
28extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, 40extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
29 const char *alpha2); 41 const char *alpha2, u32 country_ie_checksum,
42 enum environment_cap country_ie_env);
30 43
31#endif /* __NET_WIRELESS_REG_H */ 44#endif /* __NET_WIRELESS_REG_H */