blob: d6be2d2d0ca72c62a9b65915d09f718a5ea3693b [file] [log] [blame]
developer4721e252022-06-21 16:41:28 +08001From 2c6d87aad4535b918828b5d01e51650901131cd1 Mon Sep 17 00:00:00 2001
developer5a0d2a92022-06-15 17:22:32 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Wed, 15 Jun 2022 23:15:13 +0800
developer4721e252022-06-21 16:41:28 +08004Subject: [PATCH 09/12] check starec newly
developer5a0d2a92022-06-15 17:22:32 +08005
6---
developer4721e252022-06-21 16:41:28 +08007 mt7915/main.c | 2 +-
8 mt7915/mcu.c | 4 +++-
developer5a0d2a92022-06-15 17:22:32 +08009 2 files changed, 4 insertions(+), 2 deletions(-)
10
11diff --git a/mt7915/main.c b/mt7915/main.c
developer4721e252022-06-21 16:41:28 +080012index 7934981..3958799 100644
developer5a0d2a92022-06-15 17:22:32 +080013--- a/mt7915/main.c
14+++ b/mt7915/main.c
developerf64861f2022-06-22 11:44:53 +080015@@ -235,7 +235,6 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
developer5a0d2a92022-06-15 17:22:32 +080016 mt7915_mac_wtbl_update(dev, idx,
17 MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
18
19- rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
20 if (vif->txq) {
21 mtxq = (struct mt76_txq *)vif->txq->drv_priv;
22 mtxq->wcid = idx;
developerf64861f2022-06-22 11:44:53 +080023@@ -251,6 +250,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
developer5a0d2a92022-06-15 17:22:32 +080024
25 mt7915_mcu_add_bss_info(phy, vif, true);
26 mt7915_mcu_add_sta(dev, vif, NULL, true);
27+ rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
28
29 out:
30 mutex_unlock(&dev->mt76.mutex);
31diff --git a/mt7915/mcu.c b/mt7915/mcu.c
developer4721e252022-06-21 16:41:28 +080032index 1b7a630..a726021 100644
developer5a0d2a92022-06-15 17:22:32 +080033--- a/mt7915/mcu.c
34+++ b/mt7915/mcu.c
developerf64861f2022-06-22 11:44:53 +080035@@ -1610,6 +1610,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
developer5a0d2a92022-06-15 17:22:32 +080036 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
37 struct mt7915_sta *msta;
38 struct sk_buff *skb;
39+ bool newly;
40 int ret;
41
42 msta = sta ? (struct mt7915_sta *)sta->drv_priv : &mvif->sta;
developerf64861f2022-06-22 11:44:53 +080043@@ -1620,7 +1621,8 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
developer5a0d2a92022-06-15 17:22:32 +080044 return PTR_ERR(skb);
45
46 /* starec basic */
47- mt76_connac_mcu_sta_basic_tlv(skb, vif, sta, enable, true);
48+ newly = !rcu_access_pointer(dev->mt76.wcid[msta->wcid.idx]);
49+ mt76_connac_mcu_sta_basic_tlv(skb, vif, sta, enable, newly);
50 if (!enable)
51 goto out;
52
53--
developer4721e252022-06-21 16:41:28 +0800542.18.0
developer5a0d2a92022-06-15 17:22:32 +080055