mac80211: revert a faulty upstream change which is causing channel 12 to be enabled for US regdomain

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41298 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2014-06-22 11:42:24 +00:00
parent 5691e7e3ec
commit 95169666fe
2 changed files with 67 additions and 2 deletions

View File

@ -1,3 +1,14 @@
commit edcdf0989410a05a6a4b8438df4010447eaa7d9a
Author: Felix Fietkau <nbd@openwrt.org>
Date: Sun Jun 22 13:36:20 2014 +0200
Revert "cfg80211: Use 5MHz bandwidth by default when checking usable channels"
It enables channels that are not supposed to be enabled according to the
regulatory rules.
This reverts commit 8eca1fb692cc9557f386eddce75c300a3855d11a.
commit 6e7341074823d2a45b81f2742cbf75f1da790031 commit 6e7341074823d2a45b81f2742cbf75f1da790031
Author: Rafał Miłecki <zajec5@gmail.com> Author: Rafał Miłecki <zajec5@gmail.com>
Date: Sat May 31 19:40:45 2014 +0200 Date: Sat May 31 19:40:45 2014 +0200
@ -2855,3 +2866,57 @@ Date: Mon May 19 21:20:49 2014 +0200
case B43_PHYTYPE_N: case B43_PHYTYPE_N:
case B43_PHYTYPE_LP: case B43_PHYTYPE_LP:
case B43_PHYTYPE_HT: case B43_PHYTYPE_HT:
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -935,7 +935,7 @@ freq_reg_info_regd(struct wiphy *wiphy,
if (!band_rule_found)
band_rule_found = freq_in_rule_band(fr, center_freq);
- bw_fits = reg_does_bw_fit(fr, center_freq, MHZ_TO_KHZ(5));
+ bw_fits = reg_does_bw_fit(fr, center_freq, MHZ_TO_KHZ(20));
if (band_rule_found && bw_fits)
return rr;
@@ -1019,10 +1019,10 @@ static void chan_reg_rule_print_dbg(cons
}
#endif
-/* Find an ieee80211_reg_rule such that a 5MHz channel with frequency
- * chan->center_freq fits there.
- * If there is no such reg_rule, disable the channel, otherwise set the
- * flags corresponding to the bandwidths allowed in the particular reg_rule
+/*
+ * Note that right now we assume the desired channel bandwidth
+ * is always 20 MHz for each individual channel (HT40 uses 20 MHz
+ * per channel, the primary and the extension channel).
*/
static void handle_channel(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator,
@@ -1083,12 +1083,8 @@ static void handle_channel(struct wiphy
if (reg_rule->flags & NL80211_RRF_AUTO_BW)
max_bandwidth_khz = reg_get_max_bandwidth(regd, reg_rule);
- if (max_bandwidth_khz < MHZ_TO_KHZ(10))
- bw_flags = IEEE80211_CHAN_NO_10MHZ;
- if (max_bandwidth_khz < MHZ_TO_KHZ(20))
- bw_flags |= IEEE80211_CHAN_NO_20MHZ;
if (max_bandwidth_khz < MHZ_TO_KHZ(40))
- bw_flags |= IEEE80211_CHAN_NO_HT40;
+ bw_flags = IEEE80211_CHAN_NO_HT40;
if (max_bandwidth_khz < MHZ_TO_KHZ(80))
bw_flags |= IEEE80211_CHAN_NO_80MHZ;
if (max_bandwidth_khz < MHZ_TO_KHZ(160))
@@ -1522,12 +1518,8 @@ static void handle_channel_custom(struct
if (reg_rule->flags & NL80211_RRF_AUTO_BW)
max_bandwidth_khz = reg_get_max_bandwidth(regd, reg_rule);
- if (max_bandwidth_khz < MHZ_TO_KHZ(10))
- bw_flags = IEEE80211_CHAN_NO_10MHZ;
- if (max_bandwidth_khz < MHZ_TO_KHZ(20))
- bw_flags |= IEEE80211_CHAN_NO_20MHZ;
if (max_bandwidth_khz < MHZ_TO_KHZ(40))
- bw_flags |= IEEE80211_CHAN_NO_HT40;
+ bw_flags = IEEE80211_CHAN_NO_HT40;
if (max_bandwidth_khz < MHZ_TO_KHZ(80))
bw_flags |= IEEE80211_CHAN_NO_80MHZ;
if (max_bandwidth_khz < MHZ_TO_KHZ(160))

View File

@ -1,6 +1,6 @@
--- a/net/wireless/reg.c --- a/net/wireless/reg.c
+++ b/net/wireless/reg.c +++ b/net/wireless/reg.c
@@ -2080,6 +2080,8 @@ void regulatory_hint_country_ie(struct w @@ -2072,6 +2072,8 @@ void regulatory_hint_country_ie(struct w
enum environment_cap env = ENVIRON_ANY; enum environment_cap env = ENVIRON_ANY;
struct regulatory_request *request = NULL, *lr; struct regulatory_request *request = NULL, *lr;
@ -9,7 +9,7 @@
/* IE len must be evenly divisible by 2 */ /* IE len must be evenly divisible by 2 */
if (country_ie_len & 0x01) if (country_ie_len & 0x01)
return; return;
@@ -2276,6 +2278,7 @@ static void restore_regulatory_settings( @@ -2268,6 +2270,7 @@ static void restore_regulatory_settings(
void regulatory_hint_disconnect(void) void regulatory_hint_disconnect(void)
{ {