blob: 575b7dbfb0643038fcc387893c043bd7067fccdd [file] [log] [blame]
From 1b0bafc1cfb554b6150eb2ea3e1a5100ef1b0a24 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 24 Aug 2023 18:38:11 +0800
Subject: [PATCH 22/98] wifi: mt76: connac: use peer address for station BMC
entry
Set peer address and aid for the BMC wtbl of station interface. For some
functions such as parsing MU_EDCA parameters from beacon, firmware will
need peer address to do the correct mapping.
Change-Id: I0e812312fe730f69f8e431215b8e591c5faec06a
Reported-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
mt76_connac_mcu.c | 9 ++++++++-
mt7996/main.c | 3 +++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
index 68de525..bb570f2 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -391,7 +391,14 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
if (!sta) {
basic->conn_type = cpu_to_le32(CONNECTION_INFRA_BC);
- eth_broadcast_addr(basic->peer_addr);
+
+ if (vif->type == NL80211_IFTYPE_STATION &&
+ !is_zero_ether_addr(vif->bss_conf.bssid)) {
+ memcpy(basic->peer_addr, vif->bss_conf.bssid, ETH_ALEN);
+ basic->aid = cpu_to_le16(vif->cfg.aid);
+ } else {
+ eth_broadcast_addr(basic->peer_addr);
+ }
return;
}
diff --git a/mt7996/main.c b/mt7996/main.c
index 832b861..0e51fe0 100644
--- a/mt7996/main.c
+++ b/mt7996/main.c
@@ -582,6 +582,9 @@ static void mt7996_bss_info_changed(struct ieee80211_hw *hw,
if ((changed & BSS_CHANGED_BSSID && !is_zero_ether_addr(info->bssid)) ||
(changed & BSS_CHANGED_ASSOC && vif->cfg.assoc) ||
(changed & BSS_CHANGED_BEACON_ENABLED && info->enable_beacon)) {
+ /* reset bmc wtbl once BSSID changed */
+ if (changed & BSS_CHANGED_BSSID)
+ mt7996_mcu_add_sta(dev, vif, NULL, false);
mt7996_mcu_add_bss_info(phy, vif, true);
mt7996_mcu_add_sta(dev, vif, NULL, true);
}
--
2.18.0