diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-07-26 17:24:39 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-10-17 11:02:09 +0200 |
commit | 55de908ab292c03f1eb280f51170ddb9c6b57e31 (patch) | |
tree | bc75bb5cea581cadf6fe8b4f121cce02d07c276a /net/mac80211/rate.h | |
parent | fe57d9f5c0a2c1ef97ba8cdc42cfda5743f287b8 (diff) | |
download | linux-stable-55de908ab292c03f1eb280f51170ddb9c6b57e31.tar.gz linux-stable-55de908ab292c03f1eb280f51170ddb9c6b57e31.tar.bz2 linux-stable-55de908ab292c03f1eb280f51170ddb9c6b57e31.zip |
mac80211: use channel contexts
Instead of operating on a single channel only,
use the new channel context infrastructure in
all mac80211 code.
This enables drivers that want to use the new
channel context infrastructure to use multiple
channels, while nothing should change for all
the other drivers that don't support it.
Right now this disables both TX power settings
and spatial multiplexing powersave. Both need
to be re-enabled on a channel context basis.
Additionally, when channel contexts are used
drop the connection when channel switch is
received rather than trying to handle it. This
will have to be improved later.
[With fixes from Eliad and Emmanuel incorporated]
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rate.h')
-rw-r--r-- | net/mac80211/rate.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h index 10de668eb9f6..ec198ef6aa8a 100644 --- a/net/mac80211/rate.h +++ b/net/mac80211/rate.h @@ -52,11 +52,21 @@ static inline void rate_control_rate_init(struct sta_info *sta) struct ieee80211_sta *ista = &sta->sta; void *priv_sta = sta->rate_ctrl_priv; struct ieee80211_supported_band *sband; + struct ieee80211_chanctx_conf *chanctx_conf; if (!ref) return; - sband = local->hw.wiphy->bands[local->oper_channel->band]; + rcu_read_lock(); + + chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf); + if (WARN_ON(!chanctx_conf)) { + rcu_read_unlock(); + return; + } + + sband = local->hw.wiphy->bands[chanctx_conf->channel->band]; + rcu_read_unlock(); ref->ops->rate_init(ref->priv, sband, ista, priv_sta); set_sta_flag(sta, WLAN_STA_RATE_CONTROL); |