blob: a4e17a9612b06d3230c1e5168dad8de62e17a4f7 [file] [log] [blame]
developer064da3c2023-06-13 15:57:26 +08001From 3c7a5592ea211f5ddb2f6bbd6ba8720c74faf459 Mon Sep 17 00:00:00 2001
2From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Thu, 2 Mar 2023 15:44:52 +0800
4Subject: [PATCH 04/11] wifi: mt76: mt7996: fix bss wlan_idx when sending
5 bss_info command
6
7The bmc_tx_wlan_idx should be the wlan_idx of the current bss rather
8than peer AP's wlan_idx, otherwise there will appear some frame
9decryption problems on station mode.
10
11Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
12Reviewed-by: Shayne Chen <shayne.chen@mediatek.com>
13Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
14Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
15---
16 mt7996/mcu.c | 5 +++--
17 1 file changed, 3 insertions(+), 2 deletions(-)
18
19diff --git a/mt7996/mcu.c b/mt7996/mcu.c
20index 545cc987..6706d38c 100644
21--- a/mt7996/mcu.c
22+++ b/mt7996/mcu.c
23@@ -712,6 +712,7 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
24 struct cfg80211_chan_def *chandef = &phy->chandef;
25 struct mt76_connac_bss_basic_tlv *bss;
26 u32 type = CONNECTION_INFRA_AP;
27+ u16 sta_wlan_idx = wlan_idx;
28 struct tlv *tlv;
29 int idx;
30
31@@ -731,7 +732,7 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
32 struct mt76_wcid *wcid;
33
34 wcid = (struct mt76_wcid *)sta->drv_priv;
35- wlan_idx = wcid->idx;
36+ sta_wlan_idx = wcid->idx;
37 }
38 rcu_read_unlock();
39 }
40@@ -751,7 +752,7 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
41 bss->bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int);
42 bss->dtim_period = vif->bss_conf.dtim_period;
43 bss->bmc_tx_wlan_idx = cpu_to_le16(wlan_idx);
44- bss->sta_idx = cpu_to_le16(wlan_idx);
45+ bss->sta_idx = cpu_to_le16(sta_wlan_idx);
46 bss->conn_type = cpu_to_le32(type);
47 bss->omac_idx = mvif->omac_idx;
48 bss->band_idx = mvif->band_idx;
49--
502.39.2
51