aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c2
-rw-r--r--drivers/net/wireless/iwlegacy/3945-rs.c1
-rw-r--r--drivers/net/wireless/iwlegacy/4965-rs.c1
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rs.c3
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rs.c5
-rw-r--r--drivers/net/wireless/rtlwifi/rc.c1
-rw-r--r--include/net/mac80211.h2
-rw-r--r--net/mac80211/rate.h22
-rw-r--r--net/mac80211/rc80211_minstrel.c3
-rw-r--r--net/mac80211/rc80211_minstrel_ht.c10
-rw-r--r--net/mac80211/rc80211_pid_algo.c1
11 files changed, 39 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 7eb1f4b458e4..a3c4ca0c94bf 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1275,6 +1275,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
1275} 1275}
1276 1276
1277static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, 1277static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
1278 struct cfg80211_chan_def *chandef,
1278 struct ieee80211_sta *sta, void *priv_sta) 1279 struct ieee80211_sta *sta, void *priv_sta)
1279{ 1280{
1280 struct ath_softc *sc = priv; 1281 struct ath_softc *sc = priv;
@@ -1313,6 +1314,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
1313} 1314}
1314 1315
1315static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, 1316static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1317 struct cfg80211_chan_def *chandef,
1316 struct ieee80211_sta *sta, void *priv_sta, 1318 struct ieee80211_sta *sta, void *priv_sta,
1317 u32 changed) 1319 u32 changed)
1318{ 1320{
diff --git a/drivers/net/wireless/iwlegacy/3945-rs.c b/drivers/net/wireless/iwlegacy/3945-rs.c
index fe31590a51b2..aea667b430c3 100644
--- a/drivers/net/wireless/iwlegacy/3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/3945-rs.c
@@ -887,6 +887,7 @@ il3945_remove_debugfs(void *il, void *il_sta)
887 */ 887 */
888static void 888static void
889il3945_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband, 889il3945_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband,
890 struct cfg80211_chan_def *chandef,
890 struct ieee80211_sta *sta, void *il_sta) 891 struct ieee80211_sta *sta, void *il_sta)
891{ 892{
892} 893}
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c
index ed3c42a63a43..3ccbaf791b48 100644
--- a/drivers/net/wireless/iwlegacy/4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/4965-rs.c
@@ -2803,6 +2803,7 @@ il4965_rs_remove_debugfs(void *il, void *il_sta)
2803 */ 2803 */
2804static void 2804static void
2805il4965_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband, 2805il4965_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband,
2806 struct cfg80211_chan_def *chandef,
2806 struct ieee80211_sta *sta, void *il_sta) 2807 struct ieee80211_sta *sta, void *il_sta)
2807{ 2808{
2808} 2809}
diff --git a/drivers/net/wireless/iwlwifi/dvm/rs.c b/drivers/net/wireless/iwlwifi/dvm/rs.c
index 1b693944123b..91eb09b9b56f 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rs.c
@@ -3319,7 +3319,8 @@ static void rs_remove_debugfs(void *priv, void *priv_sta)
3319 * station is added we ignore it. 3319 * station is added we ignore it.
3320 */ 3320 */
3321static void rs_rate_init_stub(void *priv_r, struct ieee80211_supported_band *sband, 3321static void rs_rate_init_stub(void *priv_r, struct ieee80211_supported_band *sband,
3322 struct ieee80211_sta *sta, void *priv_sta) 3322 struct cfg80211_chan_def *chandef,
3323 struct ieee80211_sta *sta, void *priv_sta)
3323{ 3324{
3324} 3325}
3325static struct rate_control_ops rs_ops = { 3326static struct rate_control_ops rs_ops = {
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
index b328a988c130..376ea2112de2 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.c
@@ -3159,8 +3159,9 @@ static void rs_remove_debugfs(void *mvm, void *mvm_sta)
3159 * station is added we ignore it. 3159 * station is added we ignore it.
3160 */ 3160 */
3161static void rs_rate_init_stub(void *mvm_r, 3161static void rs_rate_init_stub(void *mvm_r,
3162 struct ieee80211_supported_band *sband, 3162 struct ieee80211_supported_band *sband,
3163 struct ieee80211_sta *sta, void *mvm_sta) 3163 struct cfg80211_chan_def *chandef,
3164 struct ieee80211_sta *sta, void *mvm_sta)
3164{ 3165{
3165} 3166}
3166static struct rate_control_ops rs_mvm_ops = { 3167static struct rate_control_ops rs_mvm_ops = {
diff --git a/drivers/net/wireless/rtlwifi/rc.c b/drivers/net/wireless/rtlwifi/rc.c
index f9f059dadb73..a98acefb8c06 100644
--- a/drivers/net/wireless/rtlwifi/rc.c
+++ b/drivers/net/wireless/rtlwifi/rc.c
@@ -218,6 +218,7 @@ static void rtl_tx_status(void *ppriv,
218 218
219static void rtl_rate_init(void *ppriv, 219static void rtl_rate_init(void *ppriv,
220 struct ieee80211_supported_band *sband, 220 struct ieee80211_supported_band *sband,
221 struct cfg80211_chan_def *chandef,
221 struct ieee80211_sta *sta, void *priv_sta) 222 struct ieee80211_sta *sta, void *priv_sta)
222{ 223{
223} 224}
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7c5dc787a8e8..fe5fee830aa8 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4204,8 +4204,10 @@ struct rate_control_ops {
4204 4204
4205 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); 4205 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
4206 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband, 4206 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband,
4207 struct cfg80211_chan_def *chandef,
4207 struct ieee80211_sta *sta, void *priv_sta); 4208 struct ieee80211_sta *sta, void *priv_sta);
4208 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, 4209 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband,
4210 struct cfg80211_chan_def *chandef,
4209 struct ieee80211_sta *sta, void *priv_sta, 4211 struct ieee80211_sta *sta, void *priv_sta,
4210 u32 changed); 4212 u32 changed);
4211 void (*free_sta)(void *priv, struct ieee80211_sta *sta, 4213 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
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
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index ac7ef5414bde..5b25966add10 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -417,7 +417,8 @@ init_sample_table(struct minstrel_sta_info *mi)
417 417
418static void 418static void
419minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, 419minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
420 struct ieee80211_sta *sta, void *priv_sta) 420 struct cfg80211_chan_def *chandef,
421 struct ieee80211_sta *sta, void *priv_sta)
421{ 422{
422 struct minstrel_sta_info *mi = priv_sta; 423 struct minstrel_sta_info *mi = priv_sta;
423 struct minstrel_priv *mp = priv; 424 struct minstrel_priv *mp = priv;
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 5b2d3012b983..52562973fbd1 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -836,6 +836,7 @@ minstrel_ht_update_cck(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
836 836
837static void 837static void
838minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband, 838minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
839 struct cfg80211_chan_def *chandef,
839 struct ieee80211_sta *sta, void *priv_sta) 840 struct ieee80211_sta *sta, void *priv_sta)
840{ 841{
841 struct minstrel_priv *mp = priv; 842 struct minstrel_priv *mp = priv;
@@ -931,22 +932,25 @@ use_legacy:
931 memset(&msp->legacy, 0, sizeof(msp->legacy)); 932 memset(&msp->legacy, 0, sizeof(msp->legacy));
932 msp->legacy.r = msp->ratelist; 933 msp->legacy.r = msp->ratelist;
933 msp->legacy.sample_table = msp->sample_table; 934 msp->legacy.sample_table = msp->sample_table;
934 return mac80211_minstrel.rate_init(priv, sband, sta, &msp->legacy); 935 return mac80211_minstrel.rate_init(priv, sband, chandef, sta,
936 &msp->legacy);
935} 937}
936 938
937static void 939static void
938minstrel_ht_rate_init(void *priv, struct ieee80211_supported_band *sband, 940minstrel_ht_rate_init(void *priv, struct ieee80211_supported_band *sband,
941 struct cfg80211_chan_def *chandef,
939 struct ieee80211_sta *sta, void *priv_sta) 942 struct ieee80211_sta *sta, void *priv_sta)
940{ 943{
941 minstrel_ht_update_caps(priv, sband, sta, priv_sta); 944 minstrel_ht_update_caps(priv, sband, chandef, sta, priv_sta);
942} 945}
943 946
944static void 947static void
945minstrel_ht_rate_update(void *priv, struct ieee80211_supported_band *sband, 948minstrel_ht_rate_update(void *priv, struct ieee80211_supported_band *sband,
949 struct cfg80211_chan_def *chandef,
946 struct ieee80211_sta *sta, void *priv_sta, 950 struct ieee80211_sta *sta, void *priv_sta,
947 u32 changed) 951 u32 changed)
948{ 952{
949 minstrel_ht_update_caps(priv, sband, sta, priv_sta); 953 minstrel_ht_update_caps(priv, sband, chandef, sta, priv_sta);
950} 954}
951 955
952static void * 956static void *
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c
index 502d3ecc4a79..958fad07b54c 100644
--- a/net/mac80211/rc80211_pid_algo.c
+++ b/net/mac80211/rc80211_pid_algo.c
@@ -293,6 +293,7 @@ rate_control_pid_get_rate(void *priv, struct ieee80211_sta *sta,
293 293
294static void 294static void
295rate_control_pid_rate_init(void *priv, struct ieee80211_supported_band *sband, 295rate_control_pid_rate_init(void *priv, struct ieee80211_supported_band *sband,
296 struct cfg80211_chan_def *chandef,
296 struct ieee80211_sta *sta, void *priv_sta) 297 struct ieee80211_sta *sta, void *priv_sta)
297{ 298{
298 struct rc_pid_sta_info *spinfo = priv_sta; 299 struct rc_pid_sta_info *spinfo = priv_sta;