提交 fb6a6819 编写于 作者: L Luciano Coelho

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

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: NLuciano Coelho <luciano.coelho@nokia.com>
上级 1036dc16
...@@ -338,7 +338,6 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what, ...@@ -338,7 +338,6 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
static int wl1271_reg_notify(struct wiphy *wiphy, 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_supported_band *band;
struct ieee80211_channel *ch; struct ieee80211_channel *ch;
int i; int i;
...@@ -349,11 +348,6 @@ static int wl1271_reg_notify(struct wiphy *wiphy, ...@@ -349,11 +348,6 @@ static int wl1271_reg_notify(struct wiphy *wiphy,
if (ch->flags & IEEE80211_CHAN_DISABLED) if (ch->flags & IEEE80211_CHAN_DISABLED)
continue; continue;
if (!wl->enable_11a) {
ch->flags |= IEEE80211_CHAN_DISABLED;
continue;
}
if (ch->flags & IEEE80211_CHAN_RADAR) if (ch->flags & IEEE80211_CHAN_RADAR)
ch->flags |= IEEE80211_CHAN_NO_IBSS | ch->flags |= IEEE80211_CHAN_NO_IBSS |
IEEE80211_CHAN_PASSIVE_SCAN; IEEE80211_CHAN_PASSIVE_SCAN;
...@@ -1071,6 +1065,16 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ...@@ -1071,6 +1065,16 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
strncpy(wiphy->fw_version, wl->chip.fw_ver, strncpy(wiphy->fw_version, wl->chip.fw_ver,
sizeof(wiphy->fw_version)); 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: out:
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册