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