blob: 63afb2ccbba53e28dff4e5015aabcde2b8c09ab9 [file] [log] [blame]
developer7e2761e2023-10-12 08:11:13 +08001From fd96728a963faf55b7daba46a78aa25ab0c5f147 Mon Sep 17 00:00:00 2001
developerc2cfe0f2023-09-22 04:11:09 +08002From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
3Date: Sat, 12 Aug 2023 04:17:22 +0800
developer7e2761e2023-10-12 08:11:13 +08004Subject: [PATCH 57/98] wifi: mt76: mt7996: report tx and rx byte to tpt_led
developerc2cfe0f2023-09-22 04:11:09 +08005
6---
7 mt7996/mcu.c | 15 +++++++++++----
8 1 file changed, 11 insertions(+), 4 deletions(-)
9
10diff --git a/mt7996/mcu.c b/mt7996/mcu.c
developer7e2761e2023-10-12 08:11:13 +080011index a4f3ed9..3a960d1 100644
developerc2cfe0f2023-09-22 04:11:09 +080012--- a/mt7996/mcu.c
13+++ b/mt7996/mcu.c
14@@ -531,6 +531,8 @@ mt7996_mcu_rx_all_sta_info_event(struct mt7996_dev *dev, struct sk_buff *skb)
15 u8 ac;
16 u16 wlan_idx;
17 struct mt76_wcid *wcid;
18+ struct mt76_phy *mphy;
19+ u32 tx_bytes, rx_bytes;
20
21 switch (le16_to_cpu(res->tag)) {
22 case UNI_ALL_STA_TXRX_RATE:
23@@ -550,11 +552,16 @@ mt7996_mcu_rx_all_sta_info_event(struct mt7996_dev *dev, struct sk_buff *skb)
24 if (!wcid)
25 break;
26
27+ mphy = mt76_dev_phy(&dev->mt76, wcid->phy_idx);
28 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
29- wcid->stats.tx_bytes +=
30- le32_to_cpu(res->adm_stat[i].tx_bytes[ac]);
31- wcid->stats.rx_bytes +=
32- le32_to_cpu(res->adm_stat[i].rx_bytes[ac]);
33+ tx_bytes = le32_to_cpu(res->adm_stat[i].tx_bytes[ac]);
34+ rx_bytes = le32_to_cpu(res->adm_stat[i].rx_bytes[ac]);
35+
36+ wcid->stats.tx_bytes += tx_bytes;
37+ wcid->stats.rx_bytes += rx_bytes;
38+
39+ ieee80211_tpt_led_trig_tx(mphy->hw, tx_bytes);
40+ ieee80211_tpt_led_trig_rx(mphy->hw, rx_bytes);
41 }
42 break;
43 case UNI_ALL_STA_TXRX_MSDU_COUNT:
44--
developer7e2761e2023-10-12 08:11:13 +0800452.18.0
developerc2cfe0f2023-09-22 04:11:09 +080046