developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 1 | From c14b26df4ab2474ea89fbc410f570d28d415bb9f Mon Sep 17 00:00:00 2001 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Wed, 5 Jun 2024 10:11:13 +0800 |
developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 136/193] mtk: mt76: mt7996: set unused band to UNSPECIFIED in |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 5 | band_to_link |
| 6 | |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame] | 7 | Change-Id: I21190c5952a9c2f2a7f5f619f8d1fb23dd127c6f |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 8 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 9 | --- |
| 10 | mt7996/main.c | 4 ++++ |
| 11 | mt7996/mcu.c | 3 +++ |
| 12 | mt7996/mt7996.h | 3 +++ |
| 13 | 3 files changed, 10 insertions(+) |
| 14 | |
| 15 | diff --git a/mt7996/main.c b/mt7996/main.c |
developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 16 | index 7bd189b..436ef82 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 17 | --- a/mt7996/main.c |
| 18 | +++ b/mt7996/main.c |
| 19 | @@ -482,6 +482,8 @@ static int mt7996_add_interface(struct ieee80211_hw *hw, |
| 20 | mvif->sta.vif = mvif; |
| 21 | /* TODO: temporaily set this to prevent some crashes */ |
| 22 | mvif->deflink.phy = phy; |
| 23 | + memset(mvif->band_to_link, IEEE80211_LINK_UNSPECIFIED, |
| 24 | + sizeof(mvif->band_to_link)); |
| 25 | |
| 26 | if (vif->type == NL80211_IFTYPE_STATION) |
| 27 | ret = mt7996_add_bss_conf(phy, vif, &vif->bss_conf); |
developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 28 | @@ -1053,6 +1055,8 @@ mt7996_channel_switch_beacon(struct ieee80211_hw *hw, |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 29 | |
| 30 | mutex_lock(&dev->mt76.mutex); |
| 31 | link_id = mvif->band_to_link[phy->mt76->band_idx]; |
| 32 | + if (link_id == IEEE80211_LINK_UNSPECIFIED) |
| 33 | + goto out; |
| 34 | |
| 35 | if (!mvif->cs_ready_links) |
| 36 | mvif->cs_link_id = link_id; |
| 37 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 38 | index 29dc95b..b498e9e 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 39 | --- a/mt7996/mcu.c |
| 40 | +++ b/mt7996/mcu.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame] | 41 | @@ -379,6 +379,9 @@ mt7996_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 42 | int link_id, band_idx = mphy->band_idx; |
| 43 | |
| 44 | link_id = mvif->band_to_link[band_idx]; |
| 45 | + if (link_id == IEEE80211_LINK_UNSPECIFIED) |
| 46 | + return; |
| 47 | + |
| 48 | link_conf = rcu_dereference(vif->link_conf[link_id]); |
| 49 | |
| 50 | if (!link_conf || !link_conf->csa_active || vif->type == NL80211_IFTYPE_STATION) |
| 51 | diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 52 | index 7bb1712..3ff9cb6 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 53 | --- a/mt7996/mt7996.h |
| 54 | +++ b/mt7996/mt7996.h |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame] | 55 | @@ -966,6 +966,9 @@ mt7996_get_link_wcid(struct mt7996_dev *dev, u16 idx, u8 band_idx) |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 56 | |
| 57 | mlink = wcid_to_mlink(wcid); |
| 58 | link_id = mlink->sta->vif->band_to_link[band_idx]; |
| 59 | + if (link_id == IEEE80211_LINK_UNSPECIFIED) |
| 60 | + return wcid; |
| 61 | + |
| 62 | mlink = rcu_dereference(mlink->sta->link[link_id]); |
| 63 | if (!mlink) |
| 64 | return wcid; |
| 65 | -- |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame] | 66 | 2.45.2 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 67 | |