developer | 6bcdd6c | 2024-03-21 16:26:34 +0800 | [diff] [blame^] | 1 | From 433d5edafae636d56f3eded9d9bc3d181f00f2cc 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 048/120] mtk: 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 576fc048d..175699c1e 100644 |
| 13 | --- a/mt7996/mcu.c |
| 14 | +++ b/mt7996/mcu.c |
| 15 | @@ -525,6 +525,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 | @@ -544,11 +546,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 | |