]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mt76: mt7921: update mib counters dumping phy stats
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 18 Aug 2021 08:23:14 +0000 (10:23 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 20 Oct 2021 08:36:38 +0000 (10:36 +0200)
mt7921 mac work can be idle for a long time due to runtime-pm so
update mib counters dumping phy stats

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c
drivers/net/wireless/mediatek/mt76/mt7921/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h

index 599e6e53e94f6697d9c70d384379942172511f0a..11f8acf4f59ef1ee587befd2845278d7b178c2c2 100644 (file)
@@ -68,6 +68,8 @@ mt7921_ampdu_stat_read_phy(struct mt7921_phy *phy,
        if (!phy)
                return;
 
+       mt7921_mac_update_mib_stats(phy);
+
        /* Tx ampdu stat */
        for (i = 0; i < ARRAY_SIZE(range); i++)
                range[i] = mt76_rr(dev, MT_MIB_ARNG(0, i));
index e26ecfc2bdd308f2eff020e87382ab199faf66ad..99db8c68713fd88ff5e4c564fda6977cae59fbd9 100644 (file)
@@ -1483,8 +1483,7 @@ void mt7921_reset(struct mt76_dev *mdev)
        queue_work(dev->mt76.wq, &dev->reset_work);
 }
 
-static void
-mt7921_mac_update_mib_stats(struct mt7921_phy *phy)
+void mt7921_mac_update_mib_stats(struct mt7921_phy *phy)
 {
        struct mt7921_dev *dev = phy->dev;
        struct mib_stats *mib = &phy->mib;
index 547f777beb153c3ab4fbc1913617e18752e9af5b..5aac76dba90c408270452de356fb49d3182a9b17 100644 (file)
@@ -338,6 +338,7 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
                           struct ieee80211_sta *sta);
 void mt7921_mac_work(struct work_struct *work);
 void mt7921_mac_reset_work(struct work_struct *work);
+void mt7921_mac_update_mib_stats(struct mt7921_phy *phy);
 void mt7921_reset(struct mt76_dev *mdev);
 void mt7921_tx_cleanup(struct mt7921_dev *dev);
 int mt7921_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,