diff options
author | Ryder Lee <ryder.lee@mediatek.com> | 2023-04-23 23:39:06 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2023-05-12 10:21:08 +0200 |
commit | c7ab7a29ef5c0779574120d922256ce4651555d3 (patch) | |
tree | 26ec336f801b0614d52ed1eea6bb9e1b8a678ca7 /drivers/net/wireless | |
parent | wifi: mt76: mt7996: fix endianness of MT_TXD6_TX_RATE (diff) | |
download | linux-c7ab7a29ef5c0779574120d922256ce4651555d3.tar.xz linux-c7ab7a29ef5c0779574120d922256ce4651555d3.zip |
wifi: mt76: connac: fix stats->tx_bytes calculation
The stats->tx_bytes shall subtract retry byte from tx byte.
Fixes: 43eaa3689507 ("wifi: mt76: add PPDU based TxS support for WED device")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/b3cd45596943cf5a06b2e08e2fe732ab0b51311b.1682285873.git.ryder.lee@mediatek.com
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h index a5ec0f631385..fabf637bdf7f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h @@ -173,7 +173,7 @@ enum { #define MT_TXS5_MPDU_TX_CNT GENMASK(31, 23) #define MT_TXS6_MPDU_FAIL_CNT GENMASK(31, 23) - +#define MT_TXS7_MPDU_RETRY_BYTE GENMASK(22, 0) #define MT_TXS7_MPDU_RETRY_CNT GENMASK(31, 23) /* RXD DW0 */ diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c index ee0fbfcd07d6..d39a3cc5e381 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c @@ -608,7 +608,8 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid, /* PPDU based reporting */ if (FIELD_GET(MT_TXS0_TXS_FORMAT, txs) > 1) { stats->tx_bytes += - le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_BYTE); + le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_BYTE) - + le32_get_bits(txs_data[7], MT_TXS7_MPDU_RETRY_BYTE); stats->tx_packets += le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_CNT); stats->tx_failed += |