aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rate.h
diff options
context:
space:
mode:
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 d35a5dd3fb13..5dedc56c94db 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)
66 } 66 }
67 67
68 sband = local->hw.wiphy->bands[chanctx_conf->def.chan->band]; 68 sband = local->hw.wiphy->bands[chanctx_conf->def.chan->band];
69 rcu_read_unlock();
70 69
71 ieee80211_sta_set_rx_nss(sta); 70 ieee80211_sta_set_rx_nss(sta);
72 71
73 ref->ops->rate_init(ref->priv, sband, ista, priv_sta); 72 ref->ops->rate_init(ref->priv, sband, &chanctx_conf->def, ista,
73 priv_sta);
74 rcu_read_unlock();
74 set_sta_flag(sta, WLAN_STA_RATE_CONTROL); 75 set_sta_flag(sta, WLAN_STA_RATE_CONTROL);
75} 76}
76 77
@@ -81,10 +82,21 @@ static inline void rate_control_rate_update(struct ieee80211_local *local,
81 struct rate_control_ref *ref = local->rate_ctrl; 82 struct rate_control_ref *ref = local->rate_ctrl;
82 struct ieee80211_sta *ista = &sta->sta; 83 struct ieee80211_sta *ista = &sta->sta;
83 void *priv_sta = sta->rate_ctrl_priv; 84 void *priv_sta = sta->rate_ctrl_priv;
85 struct ieee80211_chanctx_conf *chanctx_conf;
86
87 if (ref && ref->ops->rate_update) {
88 rcu_read_lock();
84 89
85 if (ref && ref->ops->rate_update) 90 chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf);
86 ref->ops->rate_update(ref->priv, sband, ista, 91 if (WARN_ON(!chanctx_conf)) {
87 priv_sta, changed); 92 rcu_read_unlock();
93 return;
94 }
95
96 ref->ops->rate_update(ref->priv, sband, &chanctx_conf->def,
97 ista, priv_sta, changed);
98 rcu_read_unlock();
99 }
88 drv_sta_rc_update(local, sta->sdata, &sta->sta, changed); 100 drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
89} 101}
90 102