blob: 575b7dbfb0643038fcc387893c043bd7067fccdd [file] [log] [blame]
developer7e2761e2023-10-12 08:11:13 +08001From 1b0bafc1cfb554b6150eb2ea3e1a5100ef1b0a24 Mon Sep 17 00:00:00 2001
developerc2cfe0f2023-09-22 04:11:09 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Thu, 24 Aug 2023 18:38:11 +0800
developer7e2761e2023-10-12 08:11:13 +08004Subject: [PATCH 22/98] wifi: mt76: connac: use peer address for station BMC
developerc2cfe0f2023-09-22 04:11:09 +08005 entry
6
7Set peer address and aid for the BMC wtbl of station interface. For some
8functions such as parsing MU_EDCA parameters from beacon, firmware will
9need peer address to do the correct mapping.
10
11Change-Id: I0e812312fe730f69f8e431215b8e591c5faec06a
12Reported-by: Howard Hsu <howard-yh.hsu@mediatek.com>
13Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
14---
15 mt76_connac_mcu.c | 9 ++++++++-
16 mt7996/main.c | 3 +++
17 2 files changed, 11 insertions(+), 1 deletion(-)
18
19diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
developer7e2761e2023-10-12 08:11:13 +080020index 68de525..bb570f2 100644
developerc2cfe0f2023-09-22 04:11:09 +080021--- a/mt76_connac_mcu.c
22+++ b/mt76_connac_mcu.c
23@@ -391,7 +391,14 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
24
25 if (!sta) {
26 basic->conn_type = cpu_to_le32(CONNECTION_INFRA_BC);
27- eth_broadcast_addr(basic->peer_addr);
28+
29+ if (vif->type == NL80211_IFTYPE_STATION &&
30+ !is_zero_ether_addr(vif->bss_conf.bssid)) {
31+ memcpy(basic->peer_addr, vif->bss_conf.bssid, ETH_ALEN);
32+ basic->aid = cpu_to_le16(vif->cfg.aid);
33+ } else {
34+ eth_broadcast_addr(basic->peer_addr);
35+ }
36 return;
37 }
38
39diff --git a/mt7996/main.c b/mt7996/main.c
developer7e2761e2023-10-12 08:11:13 +080040index 832b861..0e51fe0 100644
developerc2cfe0f2023-09-22 04:11:09 +080041--- a/mt7996/main.c
42+++ b/mt7996/main.c
43@@ -582,6 +582,9 @@ static void mt7996_bss_info_changed(struct ieee80211_hw *hw,
44 if ((changed & BSS_CHANGED_BSSID && !is_zero_ether_addr(info->bssid)) ||
45 (changed & BSS_CHANGED_ASSOC && vif->cfg.assoc) ||
46 (changed & BSS_CHANGED_BEACON_ENABLED && info->enable_beacon)) {
47+ /* reset bmc wtbl once BSSID changed */
48+ if (changed & BSS_CHANGED_BSSID)
49+ mt7996_mcu_add_sta(dev, vif, NULL, false);
50 mt7996_mcu_add_bss_info(phy, vif, true);
51 mt7996_mcu_add_sta(dev, vif, NULL, true);
52 }
53--
developer7e2761e2023-10-12 08:11:13 +0800542.18.0
developerc2cfe0f2023-09-22 04:11:09 +080055