developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 1 | From fd96728a963faf55b7daba46a78aa25ab0c5f147 Mon Sep 17 00:00:00 2001 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 2 | From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com> |
| 3 | Date: Sat, 12 Aug 2023 04:17:22 +0800 |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 4 | Subject: [PATCH 57/98] wifi: mt76: mt7996: report tx and rx byte to tpt_led |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 5 | |
| 6 | --- |
| 7 | mt7996/mcu.c | 15 +++++++++++---- |
| 8 | 1 file changed, 11 insertions(+), 4 deletions(-) |
| 9 | |
| 10 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 11 | index a4f3ed9..3a960d1 100644 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 12 | --- 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 | -- |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 45 | 2.18.0 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 46 | |