mt76: rely on mac80211 utility routines to compute airtime

Rely on mac80211 airitme utility routines and remove mt76 duplicated code
to estimate tx/rx airtime

Signed-off-by: Lorenzo Bianconi <[email protected]>
Acked-by: Toke Høiland-Jørgensen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2020-01-27 17:48:38 +01:00
committed by Felix Fietkau
parent c94afbe3d7
commit 29fec3a9b0
5 changed files with 11 additions and 333 deletions
+9 -1
View File
@@ -746,10 +746,18 @@ mt76_airtime_report(struct mt76_dev *dev, struct mt76_rx_status *status,
int len)
{
struct mt76_wcid *wcid = status->wcid;
struct ieee80211_rx_status info = {
.enc_flags = status->enc_flags,
.rate_idx = status->rate_idx,
.encoding = status->encoding,
.band = status->band,
.nss = status->nss,
.bw = status->bw,
};
struct ieee80211_sta *sta;
u32 airtime;
airtime = mt76_calc_rx_airtime(dev, status, len);
airtime = ieee80211_calc_rx_airtime(dev->hw, &info, len);
spin_lock(&dev->cc_lock);
dev->cur_cc_bss_rx += airtime;
spin_unlock(&dev->cc_lock);