From patchwork Fri Dec 3 15:05:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 378081 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB3F52GW007935 for ; Fri, 3 Dec 2010 15:05:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751271Ab0LCPFA (ORCPT ); Fri, 3 Dec 2010 10:05:00 -0500 Received: from smtp.nokia.com ([147.243.128.26]:35522 "EHLO mgw-da02.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998Ab0LCPFA (ORCPT ); Fri, 3 Dec 2010 10:05:00 -0500 Received: from nokia.com (localhost [127.0.0.1]) by mgw-da02.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id oB3F4spF026018; Fri, 3 Dec 2010 17:04:54 +0200 Received: from localhost.localdomain ([esdhcp040213.research.nokia.com [172.21.40.213]]) by mgw-da02.nokia.com with RELAY id oB3F4beC025521 ; Fri, 3 Dec 2010 17:04:40 +0200 From: luciano.coelho@nokia.com To: linux-wireless@vger.kernel.org Cc: luciano.coelho@nokia.com, geryk@ti.com Subject: [PATCH] wl12xx: disable 11a channels when wl->enable_11a is known Date: Fri, 3 Dec 2010 17:05:40 +0200 Message-Id: <1291388740-27218-1-git-send-email-luciano.coelho@nokia.com> X-Mailer: git-send-email 1.7.0.4 X-Nokia-AV: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 15:05:05 +0000 (UTC) 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);