mt76: mt7615: add sta_rec with EXTRA_INFO_NEW for the first time only
authorFelix Fietkau <nbd@nbd.name>
Wed, 22 Jun 2022 12:11:06 +0000 (14:11 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 11 Jul 2022 11:40:03 +0000 (13:40 +0200)
Set EXTRA_INFO_NEW for the first time only to prevent adding the same
starec entry, otherwise the entry might be removed in fw.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h

index 194e9ccd4a730d9ada29517b0d8d55536ff5a954..989b2a41b6707578111b708ba371d4ddb9547ea4 100644 (file)
@@ -844,6 +844,7 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif,
        struct mt7615_dev *dev = phy->dev;
        struct wtbl_req_hdr *wtbl_hdr;
        struct mt7615_sta *msta;
+       bool new_entry = true;
        int cmd, err;
 
        msta = sta ? (struct mt7615_sta *)sta->drv_priv : &mvif->sta;
@@ -853,7 +854,13 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif,
        if (IS_ERR(sskb))
                return PTR_ERR(sskb);
 
-       mt76_connac_mcu_sta_basic_tlv(sskb, vif, sta, enable, true);
+       if (!sta) {
+               if (mvif->sta_added)
+                       new_entry = false;
+               else
+                       mvif->sta_added = true;
+       }
+       mt76_connac_mcu_sta_basic_tlv(sskb, vif, sta, enable, new_entry);
        if (enable && sta)
                mt76_connac_mcu_sta_tlv(phy->mt76, sskb, sta, vif, 0,
                                        MT76_STA_INFO_STATE_ASSOC);
index 653181905d0946a23cbd9b57c0f294a55e004a75..8499cdc4bb0d1dd04c43c132894e3357956b5cd0 100644 (file)
@@ -141,6 +141,7 @@ struct mt7615_sta {
 struct mt7615_vif {
        struct mt76_vif mt76; /* must be first */
        struct mt7615_sta sta;
+       bool sta_added;
 };
 
 struct mib_stats {