wifi: mt76: mt7915: initialize rssi on adding stations
authorFelix Fietkau <nbd@nbd.name>
Sat, 9 Mar 2024 16:44:42 +0000 (17:44 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 2 May 2024 10:44:49 +0000 (12:44 +0200)
Improves initial rate selection after connecting

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

index 3709d18da0e6baafee9d171bffb4a166a2c00b33..49d5b459fb449ee8d4e6634703e76674972d46b9 100644 (file)
@@ -744,6 +744,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
        struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
        bool ext_phy = mvif->phy != &dev->phy;
        int ret, idx;
+       u32 addr;
 
        idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
        if (idx < 0)
@@ -767,6 +768,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
        if (ret)
                return ret;
 
+       addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 30);
+       mt76_rmw_field(dev, addr, GENMASK(7, 0), 0xa0);
+
        return mt7915_mcu_add_rate_ctrl(dev, vif, sta, false);
 }