developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 1 | From 3c7a5592ea211f5ddb2f6bbd6ba8720c74faf459 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Thu, 2 Mar 2023 15:44:52 +0800 |
| 4 | Subject: [PATCH 04/11] wifi: mt76: mt7996: fix bss wlan_idx when sending |
| 5 | bss_info command |
| 6 | |
| 7 | The bmc_tx_wlan_idx should be the wlan_idx of the current bss rather |
| 8 | than peer AP's wlan_idx, otherwise there will appear some frame |
| 9 | decryption problems on station mode. |
| 10 | |
| 11 | Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") |
| 12 | Reviewed-by: Shayne Chen <shayne.chen@mediatek.com> |
| 13 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 14 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 15 | --- |
| 16 | mt7996/mcu.c | 5 +++-- |
| 17 | 1 file changed, 3 insertions(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| 20 | index 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 | -- |
| 50 | 2.39.2 |
| 51 | |