blob: 63afb2ccbba53e28dff4e5015aabcde2b8c09ab9 [file] [log] [blame]
From fd96728a963faf55b7daba46a78aa25ab0c5f147 Mon Sep 17 00:00:00 2001
From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
Date: Sat, 12 Aug 2023 04:17:22 +0800
Subject: [PATCH 57/98] wifi: mt76: mt7996: report tx and rx byte to tpt_led
---
mt7996/mcu.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/mt7996/mcu.c b/mt7996/mcu.c
index a4f3ed9..3a960d1 100644
--- a/mt7996/mcu.c
+++ b/mt7996/mcu.c
@@ -531,6 +531,8 @@ mt7996_mcu_rx_all_sta_info_event(struct mt7996_dev *dev, struct sk_buff *skb)
u8 ac;
u16 wlan_idx;
struct mt76_wcid *wcid;
+ struct mt76_phy *mphy;
+ u32 tx_bytes, rx_bytes;
switch (le16_to_cpu(res->tag)) {
case UNI_ALL_STA_TXRX_RATE:
@@ -550,11 +552,16 @@ mt7996_mcu_rx_all_sta_info_event(struct mt7996_dev *dev, struct sk_buff *skb)
if (!wcid)
break;
+ mphy = mt76_dev_phy(&dev->mt76, wcid->phy_idx);
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
- wcid->stats.tx_bytes +=
- le32_to_cpu(res->adm_stat[i].tx_bytes[ac]);
- wcid->stats.rx_bytes +=
- le32_to_cpu(res->adm_stat[i].rx_bytes[ac]);
+ tx_bytes = le32_to_cpu(res->adm_stat[i].tx_bytes[ac]);
+ rx_bytes = le32_to_cpu(res->adm_stat[i].rx_bytes[ac]);
+
+ wcid->stats.tx_bytes += tx_bytes;
+ wcid->stats.rx_bytes += rx_bytes;
+
+ ieee80211_tpt_led_trig_tx(mphy->hw, tx_bytes);
+ ieee80211_tpt_led_trig_rx(mphy->hw, rx_bytes);
}
break;
case UNI_ALL_STA_TXRX_MSDU_COUNT:
--
2.18.0