aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211/rate.h
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-08-01 15:26:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-01 15:26:52 -0400
commit7546ff95499781306e8fd7d84ae38b84be961364 (patch)
tree58416d00380ad1122acee71b594b26ab9a201e48 /net/mac80211/rate.h
parent2cdf359a521bb72286b6714478dfdbcd2691f3fe (diff)
parentc82b5a74cc739385db6e4275fe504a0e9469bf01 (diff)
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'net/mac80211/rate.h')
-rw-r--r--net/mac80211/rate.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h
index d35a5dd3fb1..5dedc56c94d 100644
--- a/net/mac80211/rate.h
+++ b/net/mac80211/rate.h
@@ -66,11 +66,12 @@ static inline void rate_control_rate_init(struct sta_info *sta)
}
sband = local->hw.wiphy->bands[chanctx_conf->def.chan->band];
- rcu_read_unlock();
ieee80211_sta_set_rx_nss(sta);
- ref->ops->rate_init(ref->priv, sband, ista, priv_sta);
+ ref->ops->rate_init(ref->priv, sband, &chanctx_conf->def, ista,
+ priv_sta);
+ rcu_read_unlock();
set_sta_flag(sta, WLAN_STA_RATE_CONTROL);
}
@@ -81,10 +82,21 @@ static inline void rate_control_rate_update(struct ieee80211_local *local,
struct rate_control_ref *ref = local->rate_ctrl;
struct ieee80211_sta *ista = &sta->sta;
void *priv_sta = sta->rate_ctrl_priv;
+ struct ieee80211_chanctx_conf *chanctx_conf;
+
+ if (ref && ref->ops->rate_update) {
+ rcu_read_lock();
- if (ref && ref->ops->rate_update)
- ref->ops->rate_update(ref->priv, sband, ista,
- priv_sta, changed);
+ chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf);
+ if (WARN_ON(!chanctx_conf)) {
+ rcu_read_unlock();
+ return;
+ }
+
+ ref->ops->rate_update(ref->priv, sband, &chanctx_conf->def,
+ ista, priv_sta, changed);
+ rcu_read_unlock();
+ }
drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
}