diff options
-rw-r--r-- | include/linux/nl80211.h | 6 | ||||
-rw-r--r-- | net/wireless/reg.c | 20 |
2 files changed, 24 insertions, 2 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 0edb2566c14c..fb877b5621b7 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -1307,7 +1307,11 @@ enum nl80211_bitrate_attr { | |||
1307 | * wireless core it thinks its knows the regulatory domain we should be in. | 1307 | * wireless core it thinks its knows the regulatory domain we should be in. |
1308 | * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an | 1308 | * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an |
1309 | * 802.11 country information element with regulatory information it | 1309 | * 802.11 country information element with regulatory information it |
1310 | * thinks we should consider. | 1310 | * thinks we should consider. cfg80211 only processes the country |
1311 | * code from the IE, and relies on the regulatory domain information | ||
1312 | * structure pased by userspace (CRDA) from our wireless-regdb. | ||
1313 | * If a channel is enabled but the country code indicates it should | ||
1314 | * be disabled we disable the channel and re-enable it upon disassociation. | ||
1311 | */ | 1315 | */ |
1312 | enum nl80211_reg_initiator { | 1316 | enum nl80211_reg_initiator { |
1313 | NL80211_REGDOM_SET_BY_CORE, | 1317 | NL80211_REGDOM_SET_BY_CORE, |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 1bc8131a5185..8ab65f2afe70 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -750,8 +750,26 @@ static void handle_channel(struct wiphy *wiphy, | |||
750 | desired_bw_khz, | 750 | desired_bw_khz, |
751 | ®_rule); | 751 | ®_rule); |
752 | 752 | ||
753 | if (r) | 753 | if (r) { |
754 | /* | ||
755 | * We will disable all channels that do not match our | ||
756 | * recieved regulatory rule unless the hint is coming | ||
757 | * from a Country IE and the Country IE had no information | ||
758 | * about a band. The IEEE 802.11 spec allows for an AP | ||
759 | * to send only a subset of the regulatory rules allowed, | ||
760 | * so an AP in the US that only supports 2.4 GHz may only send | ||
761 | * a country IE with information for the 2.4 GHz band | ||
762 | * while 5 GHz is still supported. | ||
763 | */ | ||
764 | if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE && | ||
765 | r == -ERANGE) | ||
766 | return; | ||
767 | |||
768 | REG_DBG_PRINT("cfg80211: Disabling freq %d MHz\n", | ||
769 | chan->center_freq); | ||
770 | chan->flags = IEEE80211_CHAN_DISABLED; | ||
754 | return; | 771 | return; |
772 | } | ||
755 | 773 | ||
756 | power_rule = ®_rule->power_rule; | 774 | power_rule = ®_rule->power_rule; |
757 | freq_range = ®_rule->freq_range; | 775 | freq_range = ®_rule->freq_range; |