wifi: mt76: enable page_pool stats

Enable page_pool ethtool statistics for mt7915 and mt7921 chipsets.

Tested-by: Felix Fietkau <[email protected]>
Tested-by: Deren Wu <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2023-01-25 20:12:27 +01:00
committed by Felix Fietkau
parent 9686cd7cc6
commit 04da4eaa82
4 changed files with 57 additions and 14 deletions
+13
View File
@@ -1727,6 +1727,19 @@ void mt76_ethtool_worker(struct mt76_ethtool_worker_info *wi,
}
EXPORT_SYMBOL_GPL(mt76_ethtool_worker);
void mt76_ethtool_page_pool_stats(struct mt76_dev *dev, u64 *data, int *index)
{
struct page_pool_stats stats = {};
int i;
mt76_for_each_q_rx(dev, i)
page_pool_get_stats(dev->q_rx[i].page_pool, &stats);
page_pool_ethtool_stats_get(data, &stats);
*index += page_pool_ethtool_stats_get_count();
}
EXPORT_SYMBOL_GPL(mt76_ethtool_page_pool_stats);
enum mt76_dfs_state mt76_phy_dfs_state(struct mt76_phy *phy)
{
struct ieee80211_hw *hw = phy->hw;