diff mbox

wl12xx: disable 11a channels when wl->enable_11a is known

Message ID 1291388740-27218-1-git-send-email-luciano.coelho@nokia.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Luciano Coelho Dec. 3, 2010, 3:05 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index dc3a093..9cdbfde 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -338,7 +338,6 @@  out:
 static int wl1271_reg_notify(struct wiphy *wiphy,
 			     struct regulatory_request *request)
 {
-	struct wl1271 *wl = wiphy_to_ieee80211_hw(wiphy)->priv;
 	struct ieee80211_supported_band *band;
 	struct ieee80211_channel *ch;
 	int i;
@@ -349,11 +348,6 @@  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;
@@ -1071,6 +1065,16 @@  power_off:
 	strncpy(wiphy->fw_version, wl->chip.fw_ver,
 		sizeof(wiphy->fw_version));
 
+	/*
+	 * Now we know if 11a is supported (info from the NVS), so disable
+	 * 11a channels if not supported
+	 */
+	if (!wl->enable_11a)
+		wiphy->bands[IEEE80211_BAND_5GHZ]->n_channels = 0;
+
+	wl1271_debug(DEBUG_MAC80211, "11a is %ssupported",
+		     wl->enable_11a ? "":"not ");
+
 out:
 	mutex_unlock(&wl->mutex);