aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2010-10-20 13:18:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:24:10 -0500
commitca4ffe8f2848169a8ded0ea8a60b2d81925564c9 (patch)
treebfc6dabaf52b07b59c5146e26f71fe5193ddd04c /net/wireless
parent749b527b21465fb079796c03ffb4302584dc31c1 (diff)
cfg80211: fix disabling channels based on hints
After a module loads you will have loaded the world roaming regulatory domain or a custom regulatory domain. Further regulatory hints are welcomed and should be respected unless the regulatory hint is coming from a country IE as the IEEE spec allows for a country IE to be a subset of what is allowed by the local regulatory agencies. So disable all channels that do not fit a regulatory domain sent from a unless the hint is from a country IE and the country IE had no information about the band we are currently processing. This fixes a few regulatory issues, for example for drivers that depend on CRDA and had no 5 GHz freqencies allowed were not properly disabling 5 GHz at all, furthermore it also allows users to restrict devices further as was intended. If you recieve a country IE upon association we will also disable the channels that are not allowed if the country IE had at least one channel on the respective band we are procesing. This was the original intention behind this design but it was completely overlooked... Cc: David Quan <david.quan@atheros.com> Cc: Jouni Malinen <jouni.malinen@atheros.com> cc: Easwar Krishnan <easwar.krishnan@atheros.com> Cc: stable@kernel.org Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c20
1 files changed, 19 insertions, 1 deletions
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 &reg_rule); 751 &reg_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 = &reg_rule->power_rule; 774 power_rule = &reg_rule->power_rule;
757 freq_range = &reg_rule->freq_range; 775 freq_range = &reg_rule->freq_range;