aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2007-04-07 14:54:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-04-10 14:35:57 -0400
commit81e880064dd32b3efdc41ad4cc2416c4744693ee (patch)
treefd67d80cee79c0635ab90233cdb5eefedc29c942 /drivers
parent92b3e2e9253a9f4c9224071842fd263c334dece0 (diff)
[PATCH] bcm43xx: Fix 802.11b/g scan limits to match regulatory reqs
In 802.11b/g mode, bcm43xx actively scans channels 1-14 no matter what locale has been set, either in the sprom or by the locale option. This behaviorviolates regulatory rules everywhere in the world except Japan. This patch changes the default range to the correct value if the locale has been set, and to channels 1-13 if no locale has been set. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index 80cb88eb98c6..a38e7eec0e62 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -946,6 +946,7 @@ static int bcm43xx_geo_init(struct bcm43xx_private *bcm)
946 u8 channel; 946 u8 channel;
947 struct bcm43xx_phyinfo *phy; 947 struct bcm43xx_phyinfo *phy;
948 const char *iso_country; 948 const char *iso_country;
949 u8 max_bg_channel;
949 950
950 geo = kzalloc(sizeof(*geo), GFP_KERNEL); 951 geo = kzalloc(sizeof(*geo), GFP_KERNEL);
951 if (!geo) 952 if (!geo)
@@ -967,6 +968,23 @@ static int bcm43xx_geo_init(struct bcm43xx_private *bcm)
967 } 968 }
968 iso_country = bcm43xx_locale_iso(bcm->sprom.locale); 969 iso_country = bcm43xx_locale_iso(bcm->sprom.locale);
969 970
971/* set the maximum channel based on locale set in sprom or witle locale option */
972 switch (bcm->sprom.locale) {
973 case BCM43xx_LOCALE_THAILAND:
974 case BCM43xx_LOCALE_ISRAEL:
975 case BCM43xx_LOCALE_JORDAN:
976 case BCM43xx_LOCALE_USA_CANADA_ANZ:
977 case BCM43xx_LOCALE_USA_LOW:
978 max_bg_channel = 11;
979 break;
980 case BCM43xx_LOCALE_JAPAN:
981 case BCM43xx_LOCALE_JAPAN_HIGH:
982 max_bg_channel = 14;
983 break;
984 default:
985 max_bg_channel = 13;
986 }
987
970 if (have_a) { 988 if (have_a) {
971 for (i = 0, channel = IEEE80211_52GHZ_MIN_CHANNEL; 989 for (i = 0, channel = IEEE80211_52GHZ_MIN_CHANNEL;
972 channel <= IEEE80211_52GHZ_MAX_CHANNEL; channel++) { 990 channel <= IEEE80211_52GHZ_MAX_CHANNEL; channel++) {
@@ -978,7 +996,7 @@ static int bcm43xx_geo_init(struct bcm43xx_private *bcm)
978 } 996 }
979 if (have_bg) { 997 if (have_bg) {
980 for (i = 0, channel = IEEE80211_24GHZ_MIN_CHANNEL; 998 for (i = 0, channel = IEEE80211_24GHZ_MIN_CHANNEL;
981 channel <= IEEE80211_24GHZ_MAX_CHANNEL; channel++) { 999 channel <= max_bg_channel; channel++) {
982 chan = &geo->bg[i++]; 1000 chan = &geo->bg[i++];
983 chan->freq = bcm43xx_channel_to_freq_bg(channel); 1001 chan->freq = bcm43xx_channel_to_freq_bg(channel);
984 chan->channel = channel; 1002 chan->channel = channel;