wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value
authorSean Wang <sean.wang@mediatek.com>
Mon, 29 Aug 2022 22:57:44 +0000 (06:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:35 +0000 (12:35 +0200)
commitaf46b2b9b096c9d51a5bf76383c02dfd3a37f13e
treeb8df8d31e69e1c48230dcab2c5dd2f98df0630e5
parente33da263e9658bfe870ea7836fbbd72f246d7dbd
wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value

[ Upstream commit 1bf66dc31032ff5292f4d5b76436653f269fcfbd ]

We should reset mstat->airtime_ac along with clear up the entries in the
hardware WLAN table for the Rx and Rx accumulative airtime. Otherwsie, the
value msta->airtime_ac - [tx, rx]_last may be a negative and that is not
the actual airtime the device took in the last run.

Reported-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7921/main.c