| From b4eb6156a2693382e93c5a2d5d3c564c0a2bb198 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 02/17] mtk: 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. |
| |
| 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 368c5f46..fec158ec 100644 |
| --- a/mt76_connac_mcu.c |
| +++ b/mt76_connac_mcu.c |
| @@ -392,7 +392,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 2bf8e8a8..37e40f1d 100644 |
| --- a/mt7996/main.c |
| +++ b/mt7996/main.c |
| @@ -598,6 +598,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 |
| |