Skip to content

Commit

Permalink
mt76: mt7915: add sta_rec with EXTRA_INFO_NEW for the first time only
Browse files Browse the repository at this point in the history
Set EXTRA_INFO_NEW for the first time only to prevent adding the same
starec entry, otherwise the entry might be removed in fw.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
csyuanc authored and nbd168 committed Jun 22, 2022
1 parent a4db586 commit 500c180
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mt7915/main.c
Expand Up @@ -235,7 +235,6 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
mt7915_mac_wtbl_update(dev, idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);

rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
if (vif->txq) {
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = idx;
Expand All @@ -251,6 +250,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,

mt7915_mcu_add_bss_info(phy, vif, true);
mt7915_mcu_add_sta(dev, vif, NULL, true);
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);

out:
mutex_unlock(&dev->mt76.mutex);
Expand Down
3 changes: 2 additions & 1 deletion mt7915/mcu.c
Expand Up @@ -1620,7 +1620,8 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
return PTR_ERR(skb);

/* starec basic */
mt76_connac_mcu_sta_basic_tlv(skb, vif, sta, enable, true);
mt76_connac_mcu_sta_basic_tlv(skb, vif, sta, enable,
!rcu_access_pointer(dev->mt76.wcid[msta->wcid.idx]));
if (!enable)
goto out;

Expand Down

0 comments on commit 500c180

Please sign in to comment.