wifi: mt76: mt7996: exclude tx backoff time from airtime
authorChad Monroe <chad@monroe.io>
Tue, 26 Nov 2024 20:40:49 +0000 (20:40 +0000)
committerFelix Fietkau <nbd@nbd.name>
Tue, 14 Jan 2025 12:34:34 +0000 (13:34 +0100)
This helps to make STA airtime counters more accurate.

Signed-off-by: Chad Monroe <chad@monroe.io>
Suggested-by: Ryder Lee <ryder.lee@mediatek.com>
Link: https://patch.msgid.link/88821d8f08e2715927939b35e630a06171962636.1732653612.git.chad@monroe.io
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7996/init.c
drivers/net/wireless/mediatek/mt76/mt7996/regs.h

index 8cfb122b48accd991301fd510c9d2d0a20e43b88..260cd1c34c64c0249acdff40d143a61e3a8e7795 100644 (file)
@@ -457,6 +457,10 @@ mt7996_mac_init_band(struct mt7996_dev *dev, u8 band)
        mt76_clear(dev, MT_WF_RMAC_MIB_AIRTIME4(band),
                   MT_WF_RMAC_MIB_QOS23_BACKOFF);
 
+       /* clear backoff time for Tx duration */
+       mt76_clear(dev, MT_WTBLOFF_ACR(band),
+                  MT_WTBLOFF_ADM_BACKOFFTIME);
+
        /* clear backoff time and set software compensation for OBSS time */
        mask = MT_WF_RMAC_MIB_OBSS_BACKOFF | MT_WF_RMAC_MIB_ED_OFFSET;
        set = FIELD_PREP(MT_WF_RMAC_MIB_OBSS_BACKOFF, 0) |
index 06e307b5b02ec54f376dfc36000e46385ba57bb1..1876a968c92dee2f5b4916ec64266b29945b5e02 100644 (file)
@@ -175,6 +175,9 @@ enum offs_rev {
 #define MT_WTBLOFF_RSCR_RCPI_MODE              GENMASK(31, 30)
 #define MT_WTBLOFF_RSCR_RCPI_PARAM             GENMASK(25, 24)
 
+#define MT_WTBLOFF_ACR(_band)                  MT_WTBLOFF(_band, 0x010)
+#define MT_WTBLOFF_ADM_BACKOFFTIME             BIT(29)
+
 /* ETBF: band 0(0x820ea000), band 1(0x820fa000), band 2(0x830ea000) */
 #define MT_WF_ETBF_BASE(_band)                 __BASE(WF_ETBF_BASE, (_band))
 #define MT_WF_ETBF(_band, ofs)                 (MT_WF_ETBF_BASE(_band) + (ofs))