diff mbox series

[2/3] mt76: mt7615: add missing code for providing aid info to the mcu

Message ID 0292e088e934199434f0ea06598274f57a24f3d9.1587445885.git.sean.wang@mediatek.com
State New
Headers show
Series None | expand

Commit Message

Sean Wang April 21, 2020, 5:20 a.m. UTC
From: Sean Wang <sean.wang@mediatek.com>


Parameters in station record should be kept as up to date as BSS being
updated.

Fixes: a90b4ba1f134 ("mt76: mt7615: provide aid info to the mcu")
Suggested-by: YF Luo <Yf.Luo@mediatek.com>
Suggested-by: Lucy Hsu <Lucy.Hsu@mediatek.com>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Signed-off-by: Sean Wang <sean.wang@mediatek.com>

---
 drivers/net/wireless/mediatek/mt76/mt7615/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

-- 
2.25.1
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index cdc8babca85a..e5012ad680bb 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -497,9 +497,19 @@  static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
 
 	mutex_lock(&dev->mt76.mutex);
 
-	if (changed & BSS_CHANGED_ASSOC)
+	if (changed & BSS_CHANGED_ASSOC) {
+		struct ieee80211_sta *sta;
+
 		mt7615_mcu_add_bss_info(phy, vif, info->assoc);
 
+		rcu_read_lock();
+		sta = ieee80211_find_sta(vif, vif->bss_conf.bssid);
+		rcu_read_unlock();
+
+		if (sta)
+			mt7615_mcu_sta_add(dev, vif, sta, info->assoc);
+	}
+
 	if (changed & BSS_CHANGED_ERP_SLOT) {
 		int slottime = info->use_short_slot ? 9 : 20;
 
@@ -557,7 +567,8 @@  int mt7615_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 	mt7615_mac_wtbl_update(dev, idx,
 			       MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
 
-	mt7615_mcu_sta_add(dev, vif, sta, true);
+	if (vif->type != NL80211_IFTYPE_STATION)
+		mt7615_mcu_sta_add(dev, vif, sta, true);
 
 	return 0;
 }