linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shayne Chen <shayne.chen@mediatek.com>
To: Felix Fietkau <nbd@nbd.name>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	Bo Jiao <Bo.Jiao@mediatek.com>,
	linux-mediatek <linux-mediatek@lists.infradead.org>,
	Peter Chiu <chui-hao.chiu@mediatek.com>,
	Shayne Chen <shayne.chen@mediatek.com>
Subject: [PATCH 04/12] wifi: mt76: mt7996: fix bss wlan_idx when sending bss_info command
Date: Fri, 2 Jun 2023 23:21:00 +0800	[thread overview]
Message-ID: <20230602152108.26860-4-shayne.chen@mediatek.com> (raw)
In-Reply-To: <20230602152108.26860-1-shayne.chen@mediatek.com>

From: Peter Chiu <chui-hao.chiu@mediatek.com>

The bmc_tx_wlan_idx should be the wlan_idx of the current bss rather
than peer AP's wlan_idx, otherwise there will appear some frame
decryption problems on station mode.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Reviewed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 243647dbd8c7..db51b3023654 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -712,6 +712,7 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
 	struct cfg80211_chan_def *chandef = &phy->chandef;
 	struct mt76_connac_bss_basic_tlv *bss;
 	u32 type = CONNECTION_INFRA_AP;
+	u16 sta_wlan_idx = wlan_idx;
 	struct tlv *tlv;
 	int idx;
 
@@ -731,7 +732,7 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
 				struct mt76_wcid *wcid;
 
 				wcid = (struct mt76_wcid *)sta->drv_priv;
-				wlan_idx = wcid->idx;
+				sta_wlan_idx = wcid->idx;
 			}
 			rcu_read_unlock();
 		}
@@ -751,7 +752,7 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
 	bss->bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int);
 	bss->dtim_period = vif->bss_conf.dtim_period;
 	bss->bmc_tx_wlan_idx = cpu_to_le16(wlan_idx);
-	bss->sta_idx = cpu_to_le16(wlan_idx);
+	bss->sta_idx = cpu_to_le16(sta_wlan_idx);
 	bss->conn_type = cpu_to_le32(type);
 	bss->omac_idx = mvif->omac_idx;
 	bss->band_idx = mvif->band_idx;
-- 
2.39.2



  parent reply	other threads:[~2023-06-02 15:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 15:20 [PATCH 01/12] wifi: mt76: mt7996: move radio ctrl commands to proper functions Shayne Chen
2023-06-02 15:20 ` [PATCH 02/12] wifi: mt76: connac: add a setting bit for dsp firmware Shayne Chen
2023-06-02 17:55   ` Lorenzo Bianconi
2023-06-02 15:20 ` [PATCH 03/12] wifi: mt76: mt7996: add dsp firmware download Shayne Chen
2023-06-02 17:56   ` Lorenzo Bianconi
2023-06-07 14:16     ` Kalle Valo
2023-06-02 15:21 ` Shayne Chen [this message]
2023-06-02 15:21 ` [PATCH 05/12] wifi: mt76: mt7996: init he and eht cap for AP_VLAN Shayne Chen
2023-06-02 15:21 ` [PATCH 06/12] wifi: mt76: mt7996: enable VHT extended NSS BW feature Shayne Chen
2023-06-02 15:21 ` [PATCH 07/12] wifi: mt76: connac: add a new bss_info tag for setting ifs time Shayne Chen
2023-06-02 17:57   ` Lorenzo Bianconi
2023-06-02 15:21 ` [PATCH 08/12] wifi: mt76: mt7996: set ifs time by mcu command Shayne Chen
2023-06-02 18:12   ` Lorenzo Bianconi
2023-06-02 15:21 ` [PATCH 09/12] wifi: mt76: mt7996: use correct phy for background radar event Shayne Chen
2023-06-02 15:21 ` [PATCH 10/12] wifi: mt76: mt7996: fix WA event ring size Shayne Chen
2023-06-02 15:21 ` [PATCH 11/12] wifi: mt76: mt7996: add muru support Shayne Chen
2023-06-02 15:21 ` [PATCH 12/12] wifi: mt76: mt7996: increase tx token size Shayne Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230602152108.26860-4-shayne.chen@mediatek.com \
    --to=shayne.chen@mediatek.com \
    --cc=Bo.Jiao@mediatek.com \
    --cc=chui-hao.chiu@mediatek.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).