* [PATCH] wl12xx: disable 11a channels when wl->enable_11a is known
@ 2010-12-03 15:05 luciano.coelho
2010-12-15 13:00 ` Luciano Coelho
0 siblings, 1 reply; 2+ messages in thread
From: luciano.coelho @ 2010-12-03 15:05 UTC (permalink / raw)
To: linux-wireless; +Cc: luciano.coelho, geryk
From: Luciano Coelho <luciano.coelho@nokia.com>
Disabling the 11a channels when not supported in the reg_notify function was
not working as it should, because when the driver is initiailizing (and
registering itself with mac80211), it would get the reg notification too
early. At that point the driver wouldn't have received the NVS yet, so it
wouldn't know whether 11a was supported.
To fix this, we disable 11a channels when we read the NVS instead. Also, it
is easier (and still safe) to set n_channels to zero instead of setting the
disabled flag on every 11a channel.
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
drivers/net/wireless/wl12xx/main.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
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);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wl12xx: disable 11a channels when wl->enable_11a is known
2010-12-03 15:05 [PATCH] wl12xx: disable 11a channels when wl->enable_11a is known luciano.coelho
@ 2010-12-15 13:00 ` Luciano Coelho
0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2010-12-15 13:00 UTC (permalink / raw)
To: linux-wireless; +Cc: geryk
On Fri, 2010-12-03 at 17:05 +0200, luciano.coelho@nokia.com wrote:
> From: Luciano Coelho <luciano.coelho@nokia.com>
>
> Disabling the 11a channels when not supported in the reg_notify function was
> not working as it should, because when the driver is initiailizing (and
> registering itself with mac80211), it would get the reg notification too
> early. At that point the driver wouldn't have received the NVS yet, so it
> wouldn't know whether 11a was supported.
>
> To fix this, we disable 11a channels when we read the NVS instead. Also, it
> is easier (and still safe) to set n_channels to zero instead of setting the
> disabled flag on every 11a channel.
>
> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Applied.
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-15 12:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-03 15:05 [PATCH] wl12xx: disable 11a channels when wl->enable_11a is known luciano.coelho
2010-12-15 13:00 ` Luciano Coelho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).