> From: Ben Greear <greearb@xxxxxxxxxxxxxxx> > [...] > > msta = container_of(status->wcid, struct mt7915_sta, wcid); > + stats = &msta->stats; > spin_lock_bh(&dev->sta_poll_lock); > if (list_empty(&msta->poll_list)) > list_add_tail(&msta->poll_list, &dev->sta_poll_list); > @@ -654,8 +656,19 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb) > WARN_ON_ONCE(nss > 4); > } > > + if (stats) { > + if (nss > 3) > + stats->rx_nss[3]++; > + else > + stats->rx_nss[nss - 1]++; > + > + stats->rx_mode[mode]++; > + } > + > switch (FIELD_GET(MT_CRXV_FRAME_MODE, v2)) { > case IEEE80211_STA_RX_BW_20: > + if (stats) > + stats->rx_bw_20++; > break; > case IEEE80211_STA_RX_BW_40: > if (mode & MT_PHY_TYPE_HE_EXT_SU && > @@ -663,14 +676,24 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb) after mt7916 support, I guess this patch must be rebased Regards, Lorenzo > status->bw = RATE_INFO_BW_HE_RU; > status->he_ru = > NL80211_RATE_INFO_HE_RU_ALLOC_106; > + if (stats) { > + stats->rx_bw_he_ru++; > + stats->rx_ru_106++; > + } > } else { > status->bw = RATE_INFO_BW_40; > + if (stats) > + stats->rx_bw_40++; > } > break; > case IEEE80211_STA_RX_BW_80: > status->bw = RATE_INFO_BW_80; > + if (stats) > + stats->rx_bw_80++; > break; > case IEEE80211_STA_RX_BW_160: > + if (stats) > + stats->rx_bw_160++; > status->bw = RATE_INFO_BW_160; > break; > default: > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c > index e973b2527b34..bfc81e008f86 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c > @@ -1170,6 +1170,27 @@ static const char mt7915_gstrings_stats[][ETH_GSTRING_LEN] = { > "v_tx_mcs_9", > "v_tx_mcs_10", > "v_tx_mcs_11", > + > + /* per-vif rx counters */ > + "v_rx_nss1", > + "v_rx_nss2", > + "v_rx_nss3", > + "v_rx_nss4", > + "v_rx_mode_cck", > + "v_rx_mode_ofdm", > + "v_rx_mode_ht", > + "v_rx_mode_ht_gf", > + "v_rx_mode_vht", > + "v_rx_mode_he_su", > + "v_rx_mode_he_ext_su", > + "v_rx_mode_he_tb", > + "v_rx_mode_he_mu", > + "v_rx_bw_20", > + "v_rx_bw_40", > + "v_rx_bw_80", > + "v_rx_bw_160", > + "v_rx_bw_he_ru", > + "v_rx_ru_106", > }; > > #define MT7915_SSTATS_LEN ARRAY_SIZE(mt7915_gstrings_stats) > -- > 2.20.1 >
Attachment:
signature.asc
Description: PGP signature