···946 u8 channel;947 struct bcm43xx_phyinfo *phy;948 const char *iso_country;0949950 geo = kzalloc(sizeof(*geo), GFP_KERNEL);951 if (!geo)···968 }969 iso_country = bcm43xx_locale_iso(bcm->sprom.locale);97000000000000000000971 if (have_a) {972 for (i = 0, channel = IEEE80211_52GHZ_MIN_CHANNEL;973 channel <= IEEE80211_52GHZ_MAX_CHANNEL; channel++) {···996 }997 if (have_bg) {998 for (i = 0, channel = IEEE80211_24GHZ_MIN_CHANNEL;999- channel <= IEEE80211_24GHZ_MAX_CHANNEL; channel++) {1000 chan = &geo->bg[i++];1001 chan->freq = bcm43xx_channel_to_freq_bg(channel);1002 chan->channel = channel;
···946 u8 channel;947 struct bcm43xx_phyinfo *phy;948 const char *iso_country;949+ u8 max_bg_channel;950951 geo = kzalloc(sizeof(*geo), GFP_KERNEL);952 if (!geo)···967 }968 iso_country = bcm43xx_locale_iso(bcm->sprom.locale);969970+/* set the maximum channel based on locale set in sprom or witle locale option */971+ switch (bcm->sprom.locale) {972+ case BCM43xx_LOCALE_THAILAND:973+ case BCM43xx_LOCALE_ISRAEL:974+ case BCM43xx_LOCALE_JORDAN:975+ case BCM43xx_LOCALE_USA_CANADA_ANZ:976+ case BCM43xx_LOCALE_USA_LOW:977+ max_bg_channel = 11;978+ break;979+ case BCM43xx_LOCALE_JAPAN:980+ case BCM43xx_LOCALE_JAPAN_HIGH:981+ max_bg_channel = 14;982+ break;983+ default:984+ max_bg_channel = 13;985+ }986+987 if (have_a) {988 for (i = 0, channel = IEEE80211_52GHZ_MIN_CHANNEL;989 channel <= IEEE80211_52GHZ_MAX_CHANNEL; channel++) {···978 }979 if (have_bg) {980 for (i = 0, channel = IEEE80211_24GHZ_MIN_CHANNEL;981+ channel <= max_bg_channel; channel++) {982 chan = &geo->bg[i++];983 chan->freq = bcm43xx_channel_to_freq_bg(channel);984 chan->channel = channel;