Commit 29693184 authored by Henry Yen's avatar Henry Yen Committed by Felix Fietkau

wifi: mt76: mt7915: fix bogus Tx/Rx airtime duration values

Do not report measurements if the airtime counter was cleared since the
last update (possibly by firmware)
Signed-off-by: default avatarHenry Yen <henry.yen@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent b7e56fa0
......@@ -140,8 +140,15 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
msta->airtime_ac[i] = mt76_rr(dev, addr);
msta->airtime_ac[i + 4] = mt76_rr(dev, addr + 4);
tx_time[i] = msta->airtime_ac[i] - tx_last;
rx_time[i] = msta->airtime_ac[i + 4] - rx_last;
if (msta->airtime_ac[i] <= tx_last)
tx_time[i] = 0;
else
tx_time[i] = msta->airtime_ac[i] - tx_last;
if (msta->airtime_ac[i + 4] <= rx_last)
rx_time[i] = 0;
else
rx_time[i] = msta->airtime_ac[i + 4] - rx_last;
if ((tx_last | rx_last) & BIT(30))
clear = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment