developer | 617abbd | 2024-04-23 14:50:01 +0800 | [diff] [blame^] | 1 | From b22d9da27623db1d7c3bf7f677afcdb99ec5ec27 Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Wed, 31 Jan 2024 11:40:28 +0800 |
| 4 | Subject: [PATCH 46/61] mtk: mac80211: remove link != 0 warn on in |
| 5 | rate_control_rate_update for mlo channel switch |
| 6 | |
| 7 | Remove link warning for mlo channel switch |
| 8 | |
| 9 | CR-Id: WCNCR00274293 |
| 10 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 11 | --- |
| 12 | net/mac80211/rate.c | 10 ++++++++-- |
| 13 | 1 file changed, 8 insertions(+), 2 deletions(-) |
| 14 | |
| 15 | diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c |
| 16 | index bbdd3b8..8f54562 100644 |
| 17 | --- a/net/mac80211/rate.c |
| 18 | +++ b/net/mac80211/rate.c |
| 19 | @@ -100,13 +100,19 @@ void rate_control_rate_update(struct ieee80211_local *local, |
| 20 | struct ieee80211_sta *ista = &sta->sta; |
| 21 | void *priv_sta = sta->rate_ctrl_priv; |
| 22 | struct ieee80211_chanctx_conf *chanctx_conf; |
| 23 | + struct ieee80211_link_data *link; |
| 24 | |
| 25 | - WARN_ON(link_id != 0); |
| 26 | + // WARN_ON(link_id != 0); |
| 27 | |
| 28 | if (ref && ref->ops->rate_update) { |
| 29 | rcu_read_lock(); |
| 30 | |
| 31 | - chanctx_conf = rcu_dereference(sta->sdata->vif.bss_conf.chanctx_conf); |
| 32 | + link = rcu_dereference(sta->sdata->link[link_id]); |
| 33 | + if (!link) { |
| 34 | + rcu_read_unlock(); |
| 35 | + return; |
| 36 | + } |
| 37 | + chanctx_conf = rcu_dereference(link->conf->chanctx_conf); |
| 38 | if (WARN_ON(!chanctx_conf)) { |
| 39 | rcu_read_unlock(); |
| 40 | return; |
| 41 | -- |
| 42 | 2.39.2 |
| 43 | |