mt792x_mac_rssi_iter() adds status->signal of auth and assoc response frames to the BSS RSSI average, which mt7921_mcu_sta_update() and mt7925_mcu_sta_update() send to the firmware as the station RCPI. mt7925 never sets status->signal, since mt76_rx_convert() computes it from the chain values later. The average is thus fed 0 dBm on mt7925. Compute the signal from the chain values, as mt76_rx_convert() and mt76_check_sta() do, and skip a frame without a valid chain signal. On mt7921, the average now follows the combined value instead of the strongest chain. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt792x_mac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_mac.c b/drivers/net/wireless/mediatek/mt76/mt792x_mac.c index 1e20b333cc61..ebf4c32924c4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt792x_mac.c @@ -165,14 +165,16 @@ mt792x_mac_rssi_iter(void *priv, u8 *mac, struct ieee80211_vif *vif) struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb; struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb); + int signal; - if (status->signal > 0) + signal = mt76_rx_signal(status->chains, status->chain_signal); + if (signal > 0 || signal <= -128) return; if (!ether_addr_equal(vif->addr, hdr->addr1)) return; - ewma_rssi_add(&mvif->bss_conf.rssi, -status->signal); + ewma_rssi_add(&mvif->bss_conf.rssi, -signal); } void mt792x_mac_assoc_rssi(struct mt792x_dev *dev, struct sk_buff *skb) -- 2.47.3