aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2009-12-18 17:59:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:31:37 -0500
commitbaeb66fe2306783e3b9a492b03882f2e249b2eeb (patch)
tree9c904289cf3a3cd5a538f46a4413090c4b277cb9 /net/wireless
parent8f648c00039a42e67a9dff034c77d41502dab1f3 (diff)
wireless: remove CONFIG_WIRELESS_OLD_REGULATORY
This is no longer needed with the availability of CONFIG_CFG80211_INTERNAL_REGDB. Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/Kconfig15
-rw-r--r--net/wireless/nl80211.c6
-rw-r--r--net/wireless/reg.c89
3 files changed, 2 insertions, 108 deletions
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index 8419971f07c5..d0ee29063e5d 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -94,21 +94,6 @@ config CFG80211_DEBUGFS
94 94
95 If unsure, say N. 95 If unsure, say N.
96 96
97config WIRELESS_OLD_REGULATORY
98 bool "Old wireless static regulatory definitions"
99 default n
100 depends on CFG80211
101 ---help---
102 This option enables the old static regulatory information
103 and uses it within the new framework. This option is available
104 for historical reasons and it is advised to leave it off.
105
106 For details see:
107
108 http://wireless.kernel.org/en/developers/Regulatory
109
110 Say N and if you say Y, please tell us why. The default is N.
111
112config CFG80211_INTERNAL_REGDB 97config CFG80211_INTERNAL_REGDB
113 bool "use statically compiled regulatory rules database" if EMBEDDED 98 bool "use statically compiled regulatory rules database" if EMBEDDED
114 default n 99 default n
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7cb0d647fc34..60f854377f90 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2550,12 +2550,6 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
2550 2550
2551 data = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]); 2551 data = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]);
2552 2552
2553#ifdef CONFIG_WIRELESS_OLD_REGULATORY
2554 /* We ignore world regdom requests with the old regdom setup */
2555 if (is_world_regdom(data))
2556 return -EINVAL;
2557#endif
2558
2559 r = regulatory_hint_user(data); 2553 r = regulatory_hint_user(data);
2560 2554
2561 return r; 2555 return r;
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index dc13c3ffeca6..87ea60d84c3c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -129,78 +129,6 @@ static char *ieee80211_regdom = "00";
129module_param(ieee80211_regdom, charp, 0444); 129module_param(ieee80211_regdom, charp, 0444);
130MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code"); 130MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
131 131
132#ifdef CONFIG_WIRELESS_OLD_REGULATORY
133/*
134 * We assume 40 MHz bandwidth for the old regulatory work.
135 * We make emphasis we are using the exact same frequencies
136 * as before
137 */
138
139static const struct ieee80211_regdomain us_regdom = {
140 .n_reg_rules = 6,
141 .alpha2 = "US",
142 .reg_rules = {
143 /* IEEE 802.11b/g, channels 1..11 */
144 REG_RULE(2412-10, 2462+10, 40, 6, 27, 0),
145 /* IEEE 802.11a, channel 36..48 */
146 REG_RULE(5180-10, 5240+10, 40, 6, 17, 0),
147 /* IEEE 802.11a, channels 48..64 */
148 REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_DFS),
149 /* IEEE 802.11a, channels 100..124 */
150 REG_RULE(5500-10, 5590+10, 40, 6, 20, NL80211_RRF_DFS),
151 /* IEEE 802.11a, channels 132..144 */
152 REG_RULE(5660-10, 5700+10, 40, 6, 20, NL80211_RRF_DFS),
153 /* IEEE 802.11a, channels 149..165, outdoor */
154 REG_RULE(5745-10, 5825+10, 40, 6, 30, 0),
155 }
156};
157
158static const struct ieee80211_regdomain jp_regdom = {
159 .n_reg_rules = 6,
160 .alpha2 = "JP",
161 .reg_rules = {
162 /* IEEE 802.11b/g, channels 1..11 */
163 REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
164 /* IEEE 802.11b/g, channels 12..13 */
165 REG_RULE(2467-10, 2472+10, 20, 6, 20, 0),
166 /* IEEE 802.11b/g, channel 14 */
167 REG_RULE(2484-10, 2484+10, 20, 6, 20, NL80211_RRF_NO_OFDM),
168 /* IEEE 802.11a, channels 36..48 */
169 REG_RULE(5180-10, 5240+10, 40, 6, 20, 0),
170 /* IEEE 802.11a, channels 52..64 */
171 REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_DFS),
172 /* IEEE 802.11a, channels 100..144 */
173 REG_RULE(5500-10, 5700+10, 40, 6, 23, NL80211_RRF_DFS),
174 }
175};
176
177static const struct ieee80211_regdomain *static_regdom(char *alpha2)
178{
179 if (alpha2[0] == 'U' && alpha2[1] == 'S')
180 return &us_regdom;
181 if (alpha2[0] == 'J' && alpha2[1] == 'P')
182 return &jp_regdom;
183 /* Use world roaming rules for "EU", since it was a pseudo
184 domain anyway... */
185 if (alpha2[0] == 'E' && alpha2[1] == 'U')
186 return &world_regdom;
187 /* Default, world roaming rules */
188 return &world_regdom;
189}
190
191static bool is_old_static_regdom(const struct ieee80211_regdomain *rd)
192{
193 if (rd == &us_regdom || rd == &jp_regdom || rd == &world_regdom)
194 return true;
195 return false;
196}
197#else
198static inline bool is_old_static_regdom(const struct ieee80211_regdomain *rd)
199{
200 return false;
201}
202#endif
203
204static void reset_regdomains(void) 132static void reset_regdomains(void)
205{ 133{
206 /* avoid freeing static information or freeing something twice */ 134 /* avoid freeing static information or freeing something twice */
@@ -210,8 +138,6 @@ static void reset_regdomains(void)
210 cfg80211_world_regdom = NULL; 138 cfg80211_world_regdom = NULL;
211 if (cfg80211_regdomain == &world_regdom) 139 if (cfg80211_regdomain == &world_regdom)
212 cfg80211_regdomain = NULL; 140 cfg80211_regdomain = NULL;
213 if (is_old_static_regdom(cfg80211_regdomain))
214 cfg80211_regdomain = NULL;
215 141
216 kfree(cfg80211_regdomain); 142 kfree(cfg80211_regdomain);
217 kfree(cfg80211_world_regdom); 143 kfree(cfg80211_world_regdom);
@@ -1490,8 +1416,6 @@ static int ignore_request(struct wiphy *wiphy,
1490 return REG_INTERSECT; 1416 return REG_INTERSECT;
1491 case NL80211_REGDOM_SET_BY_DRIVER: 1417 case NL80211_REGDOM_SET_BY_DRIVER:
1492 if (last_request->initiator == NL80211_REGDOM_SET_BY_CORE) { 1418 if (last_request->initiator == NL80211_REGDOM_SET_BY_CORE) {
1493 if (is_old_static_regdom(cfg80211_regdomain))
1494 return 0;
1495 if (regdom_changes(pending_request->alpha2)) 1419 if (regdom_changes(pending_request->alpha2))
1496 return 0; 1420 return 0;
1497 return -EALREADY; 1421 return -EALREADY;
@@ -1528,8 +1452,7 @@ static int ignore_request(struct wiphy *wiphy,
1528 return -EAGAIN; 1452 return -EAGAIN;
1529 } 1453 }
1530 1454
1531 if (!is_old_static_regdom(cfg80211_regdomain) && 1455 if (!regdom_changes(pending_request->alpha2))
1532 !regdom_changes(pending_request->alpha2))
1533 return -EALREADY; 1456 return -EALREADY;
1534 1457
1535 return 0; 1458 return 0;
@@ -2111,8 +2034,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2111 * If someone else asked us to change the rd lets only bother 2034 * If someone else asked us to change the rd lets only bother
2112 * checking if the alpha2 changes if CRDA was already called 2035 * checking if the alpha2 changes if CRDA was already called
2113 */ 2036 */
2114 if (!is_old_static_regdom(cfg80211_regdomain) && 2037 if (!regdom_changes(rd->alpha2))
2115 !regdom_changes(rd->alpha2))
2116 return -EINVAL; 2038 return -EINVAL;
2117 } 2039 }
2118 2040
@@ -2311,15 +2233,8 @@ int regulatory_init(void)
2311 spin_lock_init(&reg_requests_lock); 2233 spin_lock_init(&reg_requests_lock);
2312 spin_lock_init(&reg_pending_beacons_lock); 2234 spin_lock_init(&reg_pending_beacons_lock);
2313 2235
2314#ifdef CONFIG_WIRELESS_OLD_REGULATORY
2315 cfg80211_regdomain = static_regdom(ieee80211_regdom);
2316
2317 printk(KERN_INFO "cfg80211: Using static regulatory domain info\n");
2318 print_regdomain_info(cfg80211_regdomain);
2319#else
2320 cfg80211_regdomain = cfg80211_world_regdom; 2236 cfg80211_regdomain = cfg80211_world_regdom;
2321 2237
2322#endif
2323 /* We always try to get an update for the static regdomain */ 2238 /* We always try to get an update for the static regdomain */
2324 err = regulatory_hint_core(cfg80211_regdomain->alpha2); 2239 err = regulatory_hint_core(cfg80211_regdomain->alpha2);
2325 if (err) { 2240 if (err) {