0ccdfb9fb548b34f0fe871e6a515693229e97b21
[openwrt/staging/nbd.git] /
1 From: Johannes Berg <johannes.berg@intel.com>
2 Date: Mon, 7 Oct 2024 15:00:54 +0300
3 Subject: [PATCH] wifi: mac80211: call rate_control_rate_update() for link STA
4
5 In order to update the right link information, call the update
6 rate_control_rate_update() with the right link_sta, and then
7 pass that through to the driver's sta_rc_update() method. The
8 software rate control still doesn't support it, but that'll be
9 skipped by not having a rate control ref.
10
11 Since it now operates on a link sta, rename the driver method.
12
13 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14 Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
15 Link: https://patch.msgid.link/20241007144851.5851b6b5fd41.Ibdf50d96afa4b761dd9b9dfd54a1147e77a75329@changeid
16 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
17 ---
18
19 --- a/drivers/net/wireless/ath/ath10k/mac.c
20 +++ b/drivers/net/wireless/ath/ath10k/mac.c
21 @@ -8507,9 +8507,10 @@ exit:
22
23 static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
24 struct ieee80211_vif *vif,
25 - struct ieee80211_sta *sta,
26 + struct ieee80211_link_sta *link_sta,
27 u32 changed)
28 {
29 + struct ieee80211_sta *sta = link_sta->sta;
30 struct ath10k *ar = hw->priv;
31 struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
32 struct ath10k_vif *arvif = (void *)vif->drv_priv;
33 @@ -9450,7 +9451,7 @@ static const struct ieee80211_ops ath10k
34 .reconfig_complete = ath10k_reconfig_complete,
35 .get_survey = ath10k_get_survey,
36 .set_bitrate_mask = ath10k_mac_op_set_bitrate_mask,
37 - .sta_rc_update = ath10k_sta_rc_update,
38 + .link_sta_rc_update = ath10k_sta_rc_update,
39 .offset_tsf = ath10k_offset_tsf,
40 .ampdu_action = ath10k_ampdu_action,
41 .get_et_sset_count = ath10k_debug_get_et_sset_count,
42 --- a/drivers/net/wireless/ath/ath11k/mac.c
43 +++ b/drivers/net/wireless/ath/ath11k/mac.c
44 @@ -5079,9 +5079,10 @@ static void ath11k_mac_op_sta_set_4addr(
45
46 static void ath11k_mac_op_sta_rc_update(struct ieee80211_hw *hw,
47 struct ieee80211_vif *vif,
48 - struct ieee80211_sta *sta,
49 + struct ieee80211_link_sta *link_sta,
50 u32 changed)
51 {
52 + struct ieee80211_sta *sta = link_sta->sta;
53 struct ath11k *ar = hw->priv;
54 struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta);
55 struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
56 @@ -9708,7 +9709,7 @@ static const struct ieee80211_ops ath11k
57 .sta_state = ath11k_mac_op_sta_state,
58 .sta_set_4addr = ath11k_mac_op_sta_set_4addr,
59 .sta_set_txpwr = ath11k_mac_op_sta_set_txpwr,
60 - .sta_rc_update = ath11k_mac_op_sta_rc_update,
61 + .link_sta_rc_update = ath11k_mac_op_sta_rc_update,
62 .conf_tx = ath11k_mac_op_conf_tx,
63 .set_antenna = ath11k_mac_op_set_antenna,
64 .get_antenna = ath11k_mac_op_get_antenna,
65 --- a/drivers/net/wireless/ath/ath12k/mac.c
66 +++ b/drivers/net/wireless/ath/ath12k/mac.c
67 @@ -4740,9 +4740,10 @@ out:
68
69 static void ath12k_mac_op_sta_rc_update(struct ieee80211_hw *hw,
70 struct ieee80211_vif *vif,
71 - struct ieee80211_sta *sta,
72 + struct ieee80211_link_sta *link_sta,
73 u32 changed)
74 {
75 + struct ieee80211_sta *sta = link_sta->sta;
76 struct ath12k *ar;
77 struct ath12k_sta *arsta = ath12k_sta_to_arsta(sta);
78 struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
79 @@ -8684,7 +8685,7 @@ static const struct ieee80211_ops ath12k
80 .set_rekey_data = ath12k_mac_op_set_rekey_data,
81 .sta_state = ath12k_mac_op_sta_state,
82 .sta_set_txpwr = ath12k_mac_op_sta_set_txpwr,
83 - .sta_rc_update = ath12k_mac_op_sta_rc_update,
84 + .link_sta_rc_update = ath12k_mac_op_sta_rc_update,
85 .conf_tx = ath12k_mac_op_conf_tx,
86 .set_antenna = ath12k_mac_op_set_antenna,
87 .get_antenna = ath12k_mac_op_get_antenna,
88 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
89 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
90 @@ -1357,8 +1357,10 @@ static int ath9k_htc_sta_remove(struct i
91
92 static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw,
93 struct ieee80211_vif *vif,
94 - struct ieee80211_sta *sta, u32 changed)
95 + struct ieee80211_link_sta *link_sta,
96 + u32 changed)
97 {
98 + struct ieee80211_sta *sta = link_sta->sta;
99 struct ath9k_htc_sta *ista = (struct ath9k_htc_sta *) sta->drv_priv;
100
101 if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED))
102 @@ -1883,7 +1885,7 @@ struct ieee80211_ops ath9k_htc_ops = {
103 .sta_add = ath9k_htc_sta_add,
104 .sta_remove = ath9k_htc_sta_remove,
105 .conf_tx = ath9k_htc_conf_tx,
106 - .sta_rc_update = ath9k_htc_sta_rc_update,
107 + .link_sta_rc_update = ath9k_htc_sta_rc_update,
108 .bss_info_changed = ath9k_htc_bss_info_changed,
109 .set_key = ath9k_htc_set_key,
110 .get_tsf = ath9k_htc_get_tsf,
111 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
112 +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
113 @@ -4248,8 +4248,9 @@ int iwl_mvm_mac_set_rts_threshold(struct
114 }
115
116 void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
117 - struct ieee80211_sta *sta, u32 changed)
118 + struct ieee80211_link_sta *link_sta, u32 changed)
119 {
120 + struct ieee80211_sta *sta = link_sta->sta;
121 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
122
123 if (changed & (IEEE80211_RC_BW_CHANGED |
124 @@ -6574,7 +6575,7 @@ const struct ieee80211_ops iwl_mvm_hw_op
125 .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
126 .release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
127 .set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
128 - .sta_rc_update = iwl_mvm_sta_rc_update,
129 + .link_sta_rc_update = iwl_mvm_sta_rc_update,
130 .conf_tx = iwl_mvm_mac_conf_tx,
131 .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
132 .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
133 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
134 +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
135 @@ -1413,7 +1413,7 @@ const struct ieee80211_ops iwl_mvm_mld_h
136 .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
137 .release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
138 .set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
139 - .sta_rc_update = iwl_mvm_sta_rc_update,
140 + .link_sta_rc_update = iwl_mvm_sta_rc_update,
141 .conf_tx = iwl_mvm_mld_mac_conf_tx,
142 .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
143 .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
144 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
145 +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
146 @@ -2914,7 +2914,7 @@ iwl_mvm_mac_release_buffered_frames(stru
147 bool more_data);
148 int iwl_mvm_mac_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
149 void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
150 - struct ieee80211_sta *sta, u32 changed);
151 + struct ieee80211_link_sta *link_sta, u32 changed);
152 void iwl_mvm_mac_mgd_prepare_tx(struct ieee80211_hw *hw,
153 struct ieee80211_vif *vif,
154 struct ieee80211_prep_tx_info *info);
155 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
156 +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
157 @@ -1163,9 +1163,10 @@ static void mt7915_sta_rc_work(void *dat
158
159 static void mt7915_sta_rc_update(struct ieee80211_hw *hw,
160 struct ieee80211_vif *vif,
161 - struct ieee80211_sta *sta,
162 + struct ieee80211_link_sta *link_sta,
163 u32 changed)
164 {
165 + struct ieee80211_sta *sta = link_sta->sta;
166 struct mt7915_phy *phy = mt7915_hw_phy(hw);
167 struct mt7915_dev *dev = phy->dev;
168 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
169 @@ -1709,7 +1710,7 @@ const struct ieee80211_ops mt7915_ops =
170 .stop_ap = mt7915_stop_ap,
171 .sta_state = mt76_sta_state,
172 .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
173 - .sta_rc_update = mt7915_sta_rc_update,
174 + .link_sta_rc_update = mt7915_sta_rc_update,
175 .set_key = mt7915_set_key,
176 .ampdu_action = mt7915_ampdu_action,
177 .set_rts_threshold = mt7915_set_rts_threshold,
178 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
179 +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
180 @@ -1060,9 +1060,10 @@ static void mt7996_sta_rc_work(void *dat
181
182 static void mt7996_sta_rc_update(struct ieee80211_hw *hw,
183 struct ieee80211_vif *vif,
184 - struct ieee80211_sta *sta,
185 + struct ieee80211_link_sta *link_sta,
186 u32 changed)
187 {
188 + struct ieee80211_sta *sta = link_sta->sta;
189 struct mt7996_phy *phy = mt7996_hw_phy(hw);
190 struct mt7996_dev *dev = phy->dev;
191
192 @@ -1472,7 +1473,7 @@ const struct ieee80211_ops mt7996_ops =
193 .sta_add = mt7996_sta_add,
194 .sta_remove = mt7996_sta_remove,
195 .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
196 - .sta_rc_update = mt7996_sta_rc_update,
197 + .link_sta_rc_update = mt7996_sta_rc_update,
198 .set_key = mt7996_set_key,
199 .ampdu_action = mt7996_ampdu_action,
200 .set_rts_threshold = mt7996_set_rts_threshold,
201 --- a/drivers/net/wireless/realtek/rtw88/mac80211.c
202 +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
203 @@ -928,8 +928,10 @@ static int rtw_ops_set_sar_specs(struct
204
205 static void rtw_ops_sta_rc_update(struct ieee80211_hw *hw,
206 struct ieee80211_vif *vif,
207 - struct ieee80211_sta *sta, u32 changed)
208 + struct ieee80211_link_sta *link_sta,
209 + u32 changed)
210 {
211 + struct ieee80211_sta *sta = link_sta->sta;
212 struct rtw_dev *rtwdev = hw->priv;
213 struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
214
215 @@ -973,7 +975,7 @@ const struct ieee80211_ops rtw_ops = {
216 .reconfig_complete = rtw_reconfig_complete,
217 .hw_scan = rtw_ops_hw_scan,
218 .cancel_hw_scan = rtw_ops_cancel_hw_scan,
219 - .sta_rc_update = rtw_ops_sta_rc_update,
220 + .link_sta_rc_update = rtw_ops_sta_rc_update,
221 .set_sar_specs = rtw_ops_set_sar_specs,
222 #ifdef CONFIG_PM
223 .suspend = rtw_ops_suspend,
224 --- a/drivers/net/wireless/realtek/rtw89/mac80211.c
225 +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
226 @@ -1290,8 +1290,10 @@ out:
227
228 static void rtw89_ops_sta_rc_update(struct ieee80211_hw *hw,
229 struct ieee80211_vif *vif,
230 - struct ieee80211_sta *sta, u32 changed)
231 + struct ieee80211_link_sta *link_sta,
232 + u32 changed)
233 {
234 + struct ieee80211_sta *sta = link_sta->sta;
235 struct rtw89_dev *rtwdev = hw->priv;
236
237 rtw89_phy_ra_update_sta(rtwdev, sta, changed);
238 @@ -1594,7 +1596,7 @@ const struct ieee80211_ops rtw89_ops = {
239 .remain_on_channel = rtw89_ops_remain_on_channel,
240 .cancel_remain_on_channel = rtw89_ops_cancel_remain_on_channel,
241 .set_sar_specs = rtw89_ops_set_sar_specs,
242 - .sta_rc_update = rtw89_ops_sta_rc_update,
243 + .link_sta_rc_update = rtw89_ops_sta_rc_update,
244 .set_tid_config = rtw89_ops_set_tid_config,
245 #ifdef CONFIG_PM
246 .suspend = rtw89_ops_suspend,
247 --- a/drivers/net/wireless/ti/wlcore/main.c
248 +++ b/drivers/net/wireless/ti/wlcore/main.c
249 @@ -5789,9 +5789,10 @@ static int wlcore_op_cancel_remain_on_ch
250
251 static void wlcore_op_sta_rc_update(struct ieee80211_hw *hw,
252 struct ieee80211_vif *vif,
253 - struct ieee80211_sta *sta,
254 + struct ieee80211_link_sta *link_sta,
255 u32 changed)
256 {
257 + struct ieee80211_sta *sta = link_sta->sta;
258 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
259
260 wl1271_debug(DEBUG_MAC80211, "mac80211 sta_rc_update");
261 @@ -6052,7 +6053,7 @@ static const struct ieee80211_ops wl1271
262 .assign_vif_chanctx = wlcore_op_assign_vif_chanctx,
263 .unassign_vif_chanctx = wlcore_op_unassign_vif_chanctx,
264 .switch_vif_chanctx = wlcore_op_switch_vif_chanctx,
265 - .sta_rc_update = wlcore_op_sta_rc_update,
266 + .link_sta_rc_update = wlcore_op_sta_rc_update,
267 .sta_statistics = wlcore_op_sta_statistics,
268 .get_expected_throughput = wlcore_op_get_expected_throughput,
269 CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
270 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c
271 +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
272 @@ -2594,10 +2594,11 @@ static void mac80211_hwsim_link_info_cha
273 static void
274 mac80211_hwsim_sta_rc_update(struct ieee80211_hw *hw,
275 struct ieee80211_vif *vif,
276 - struct ieee80211_sta *sta,
277 + struct ieee80211_link_sta *link_sta,
278 u32 changed)
279 {
280 struct mac80211_hwsim_data *data = hw->priv;
281 + struct ieee80211_sta *sta = link_sta->sta;
282 u32 bw = U32_MAX;
283 int link_id;
284
285 @@ -2607,7 +2608,6 @@ mac80211_hwsim_sta_rc_update(struct ieee
286 link_id++) {
287 enum nl80211_chan_width confbw = NL80211_CHAN_WIDTH_20_NOHT;
288 struct ieee80211_bss_conf *vif_conf;
289 - struct ieee80211_link_sta *link_sta;
290
291 link_sta = rcu_dereference(sta->link[link_id]);
292
293 @@ -2659,7 +2659,7 @@ static int mac80211_hwsim_sta_add(struct
294
295 hwsim_check_magic(vif);
296 hwsim_set_sta_magic(sta);
297 - mac80211_hwsim_sta_rc_update(hw, vif, sta, 0);
298 + mac80211_hwsim_sta_rc_update(hw, vif, &sta->deflink, 0);
299
300 if (sta->valid_links) {
301 WARN(hweight16(sta->valid_links) > 1,
302 @@ -3961,7 +3961,7 @@ out:
303 .link_info_changed = mac80211_hwsim_link_info_changed, \
304 .tx_last_beacon = mac80211_hwsim_tx_last_beacon, \
305 .sta_notify = mac80211_hwsim_sta_notify, \
306 - .sta_rc_update = mac80211_hwsim_sta_rc_update, \
307 + .link_sta_rc_update = mac80211_hwsim_sta_rc_update, \
308 .conf_tx = mac80211_hwsim_conf_tx, \
309 .get_survey = mac80211_hwsim_get_survey, \
310 CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd) \
311 --- a/include/net/mac80211.h
312 +++ b/include/net/mac80211.h
313 @@ -4075,8 +4075,8 @@ struct ieee80211_prep_tx_info {
314 * in @sta_state.
315 * The callback can sleep.
316 *
317 - * @sta_rc_update: Notifies the driver of changes to the bitrates that can be
318 - * used to transmit to the station. The changes are advertised with bits
319 + * @link_sta_rc_update: Notifies the driver of changes to the bitrates that can
320 + * be used to transmit to the station. The changes are advertised with bits
321 * from &enum ieee80211_rate_control_changed and the values are reflected
322 * in the station data. This callback should only be used when the driver
323 * uses hardware rate control (%IEEE80211_HW_HAS_RATE_CONTROL) since
324 @@ -4560,10 +4560,10 @@ struct ieee80211_ops {
325 void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw,
326 struct ieee80211_vif *vif,
327 struct ieee80211_sta *sta);
328 - void (*sta_rc_update)(struct ieee80211_hw *hw,
329 - struct ieee80211_vif *vif,
330 - struct ieee80211_sta *sta,
331 - u32 changed);
332 + void (*link_sta_rc_update)(struct ieee80211_hw *hw,
333 + struct ieee80211_vif *vif,
334 + struct ieee80211_link_sta *link_sta,
335 + u32 changed);
336 void (*sta_rate_tbl_update)(struct ieee80211_hw *hw,
337 struct ieee80211_vif *vif,
338 struct ieee80211_sta *sta);
339 --- a/net/mac80211/chan.c
340 +++ b/net/mac80211/chan.c
341 @@ -467,7 +467,7 @@ static void ieee80211_chan_bw_change(str
342 continue;
343
344 link_sta->pub->bandwidth = new_sta_bw;
345 - rate_control_rate_update(local, sband, sta, link_id,
346 + rate_control_rate_update(local, sband, link_sta,
347 IEEE80211_RC_BW_CHANGED);
348 }
349 }
350 --- a/net/mac80211/driver-ops.c
351 +++ b/net/mac80211/driver-ops.c
352 @@ -181,9 +181,10 @@ int drv_sta_set_txpwr(struct ieee80211_l
353 return ret;
354 }
355
356 -void drv_sta_rc_update(struct ieee80211_local *local,
357 - struct ieee80211_sub_if_data *sdata,
358 - struct ieee80211_sta *sta, u32 changed)
359 +void drv_link_sta_rc_update(struct ieee80211_local *local,
360 + struct ieee80211_sub_if_data *sdata,
361 + struct ieee80211_link_sta *link_sta,
362 + u32 changed)
363 {
364 sdata = get_bss_sdata(sdata);
365 if (!check_sdata_in_driver(sdata))
366 @@ -193,10 +194,10 @@ void drv_sta_rc_update(struct ieee80211_
367 (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
368 sdata->vif.type != NL80211_IFTYPE_MESH_POINT));
369
370 - trace_drv_sta_rc_update(local, sdata, sta, changed);
371 - if (local->ops->sta_rc_update)
372 - local->ops->sta_rc_update(&local->hw, &sdata->vif,
373 - sta, changed);
374 + trace_drv_link_sta_rc_update(local, sdata, link_sta, changed);
375 + if (local->ops->link_sta_rc_update)
376 + local->ops->link_sta_rc_update(&local->hw, &sdata->vif,
377 + link_sta, changed);
378
379 trace_drv_return_void(local);
380 }
381 --- a/net/mac80211/driver-ops.h
382 +++ b/net/mac80211/driver-ops.h
383 @@ -594,9 +594,9 @@ int drv_sta_set_txpwr(struct ieee80211_l
384 struct ieee80211_sub_if_data *sdata,
385 struct sta_info *sta);
386
387 -void drv_sta_rc_update(struct ieee80211_local *local,
388 - struct ieee80211_sub_if_data *sdata,
389 - struct ieee80211_sta *sta, u32 changed);
390 +void drv_link_sta_rc_update(struct ieee80211_local *local,
391 + struct ieee80211_sub_if_data *sdata,
392 + struct ieee80211_link_sta *link_sta, u32 changed);
393
394 static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local,
395 struct ieee80211_sub_if_data *sdata,
396 --- a/net/mac80211/ibss.c
397 +++ b/net/mac80211/ibss.c
398 @@ -1072,7 +1072,8 @@ static void ieee80211_update_sta_info(st
399 if (sta->sta.deflink.rx_nss != rx_nss)
400 changed |= IEEE80211_RC_NSS_CHANGED;
401
402 - drv_sta_rc_update(local, sdata, &sta->sta, changed);
403 + drv_link_sta_rc_update(local, sdata, &sta->sta.deflink,
404 + changed);
405 }
406
407 rcu_read_unlock();
408 --- a/net/mac80211/mesh_plink.c
409 +++ b/net/mac80211/mesh_plink.c
410 @@ -489,7 +489,7 @@ static void mesh_sta_info_init(struct ie
411 if (!test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
412 rate_control_rate_init(sta);
413 else
414 - rate_control_rate_update(local, sband, sta, 0, changed);
415 + rate_control_rate_update(local, sband, &sta->deflink, changed);
416 out:
417 spin_unlock_bh(&sta->mesh->plink_lock);
418 }
419 --- a/net/mac80211/rate.c
420 +++ b/net/mac80211/rate.c
421 @@ -93,16 +93,15 @@ void rate_control_tx_status(struct ieee8
422
423 void rate_control_rate_update(struct ieee80211_local *local,
424 struct ieee80211_supported_band *sband,
425 - struct sta_info *sta, unsigned int link_id,
426 + struct link_sta_info *link_sta,
427 u32 changed)
428 {
429 struct rate_control_ref *ref = local->rate_ctrl;
430 + struct sta_info *sta = link_sta->sta;
431 struct ieee80211_sta *ista = &sta->sta;
432 void *priv_sta = sta->rate_ctrl_priv;
433 struct ieee80211_chanctx_conf *chanctx_conf;
434
435 - WARN_ON(link_id != 0);
436 -
437 if (ref && ref->ops->rate_update) {
438 rcu_read_lock();
439
440 @@ -120,7 +119,8 @@ void rate_control_rate_update(struct iee
441 }
442
443 if (sta->uploaded)
444 - drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
445 + drv_link_sta_rc_update(local, sta->sdata, link_sta->pub,
446 + changed);
447 }
448
449 int ieee80211_rate_control_register(const struct rate_control_ops *ops)
450 --- a/net/mac80211/rate.h
451 +++ b/net/mac80211/rate.h
452 @@ -32,8 +32,7 @@ void rate_control_tx_status(struct ieee8
453 void rate_control_rate_init(struct sta_info *sta);
454 void rate_control_rate_update(struct ieee80211_local *local,
455 struct ieee80211_supported_band *sband,
456 - struct sta_info *sta,
457 - unsigned int link_id,
458 + struct link_sta_info *link_sta,
459 u32 changed);
460
461 static inline void *rate_control_alloc_sta(struct rate_control_ref *ref,
462 --- a/net/mac80211/rx.c
463 +++ b/net/mac80211/rx.c
464 @@ -3568,7 +3568,7 @@ ieee80211_rx_h_action(struct ieee80211_r
465
466 sband = rx->local->hw.wiphy->bands[status->band];
467
468 - rate_control_rate_update(local, sband, rx->sta, 0,
469 + rate_control_rate_update(local, sband, rx->link_sta,
470 IEEE80211_RC_SMPS_CHANGED);
471 cfg80211_sta_opmode_change_notify(sdata->dev,
472 rx->sta->addr,
473 @@ -3605,7 +3605,7 @@ ieee80211_rx_h_action(struct ieee80211_r
474 ieee80211_sta_rx_bw_to_chan_width(rx->link_sta);
475 sta_opmode.changed = STA_OPMODE_MAX_BW_CHANGED;
476
477 - rate_control_rate_update(local, sband, rx->sta, 0,
478 + rate_control_rate_update(local, sband, rx->link_sta,
479 IEEE80211_RC_BW_CHANGED);
480 cfg80211_sta_opmode_change_notify(sdata->dev,
481 rx->sta->addr,
482 --- a/net/mac80211/tdls.c
483 +++ b/net/mac80211/tdls.c
484 @@ -1342,7 +1342,8 @@ static void iee80211_tdls_recalc_chanctx
485 bw = min(bw, ieee80211_sta_cap_rx_bw(&sta->deflink));
486 if (bw != sta->sta.deflink.bandwidth) {
487 sta->sta.deflink.bandwidth = bw;
488 - rate_control_rate_update(local, sband, sta, 0,
489 + rate_control_rate_update(local, sband,
490 + &sta->deflink,
491 IEEE80211_RC_BW_CHANGED);
492 /*
493 * if a TDLS peer BW was updated, we need to
494 --- a/net/mac80211/trace.h
495 +++ b/net/mac80211/trace.h
496 @@ -945,31 +945,34 @@ TRACE_EVENT(drv_sta_set_txpwr,
497 )
498 );
499
500 -TRACE_EVENT(drv_sta_rc_update,
501 +TRACE_EVENT(drv_link_sta_rc_update,
502 TP_PROTO(struct ieee80211_local *local,
503 struct ieee80211_sub_if_data *sdata,
504 - struct ieee80211_sta *sta,
505 + struct ieee80211_link_sta *link_sta,
506 u32 changed),
507
508 - TP_ARGS(local, sdata, sta, changed),
509 + TP_ARGS(local, sdata, link_sta, changed),
510
511 TP_STRUCT__entry(
512 LOCAL_ENTRY
513 VIF_ENTRY
514 STA_ENTRY
515 __field(u32, changed)
516 + __field(u32, link_id)
517 ),
518
519 TP_fast_assign(
520 LOCAL_ASSIGN;
521 VIF_ASSIGN;
522 - STA_ASSIGN;
523 + STA_NAMED_ASSIGN(link_sta->sta);
524 __entry->changed = changed;
525 + __entry->link_id = link_sta->link_id;
526 ),
527
528 TP_printk(
529 - LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x",
530 - LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
531 + LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " (link %d) changed: 0x%x",
532 + LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->link_id,
533 + __entry->changed
534 )
535 );
536
537 --- a/net/mac80211/vht.c
538 +++ b/net/mac80211/vht.c
539 @@ -766,8 +766,7 @@ void ieee80211_vht_handle_opmode(struct
540
541 if (changed > 0) {
542 ieee80211_recalc_min_chandef(sdata, link_sta->link_id);
543 - rate_control_rate_update(local, sband, link_sta->sta,
544 - link_sta->link_id, changed);
545 + rate_control_rate_update(local, sband, link_sta, changed);
546 }
547 }
548