From: Luciano Coelho Date: Fri, 26 Nov 2010 11:44:59 +0000 (+0200) Subject: wl12xx: disable 11a channels when regulatory changes if 11a is not supported X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=573c67cf819d52d2e12adf75a9a8cfbd216190a3;p=linux-beck.git wl12xx: disable 11a channels when regulatory changes if 11a is not supported Instead of simply not scanning for the 11a channels when not supported by the hardware, disable the channels in reg_notify. This centralizes the decision on whether to scan 5GHz channel in one place and allows userspace to know exactly which channels are in use. Based on Juuso Oikarinen's idea. Cc: Juuso Oikarinen Signed-off-by: Luciano Coelho Reviewed-by: Juuso Oikarinen --- diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 35cfcf675795..97eb186b5a8a 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c @@ -336,7 +336,9 @@ out: } static int wl1271_reg_notify(struct wiphy *wiphy, - struct regulatory_request *request) { + struct regulatory_request *request) +{ + struct wl1271 *wl = wiphy_to_ieee80211_hw(wiphy)->priv; struct ieee80211_supported_band *band; struct ieee80211_channel *ch; int i; @@ -347,6 +349,11 @@ static int wl1271_reg_notify(struct wiphy *wiphy, if (ch->flags & IEEE80211_CHAN_DISABLED) continue; + if (!wl->enable_11a) { + ch->flags |= IEEE80211_CHAN_DISABLED; + continue; + } + if (ch->flags & IEEE80211_CHAN_RADAR) ch->flags |= IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_PASSIVE_SCAN;