summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/testmode.c
diff options
context:
space:
mode:
authorShayne Chen <shayne.chen@mediatek.com>2021-06-08 09:55:57 +0300
committerFelix Fietkau <nbd@nbd.name>2021-06-19 10:22:49 +0300
commita0d65f627ba0fc7d93fddda3c11d3543dbe1c425 (patch)
tree6a35fd9fc62d0b41b120e7f9d63cf0bee01e510a /drivers/net/wireless/mediatek/mt76/testmode.c
parentf7d2958ca4614a53b155b9ac37c400b216357394 (diff)
downloadlinux-a0d65f627ba0fc7d93fddda3c11d3543dbe1c425.tar.xz
mt76: testmode: move chip-specific stats dump before common stats
Move chip-specific stats dumping part before common stats dumping to provide flexibility for per-chip driver to modify the value of common stats. Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/testmode.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/testmode.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/testmode.c b/drivers/net/wireless/mediatek/mt76/testmode.c
index c6a85a0cfc89..f73ffbd6e622 100644
--- a/drivers/net/wireless/mediatek/mt76/testmode.c
+++ b/drivers/net/wireless/mediatek/mt76/testmode.c
@@ -521,6 +521,14 @@ mt76_testmode_dump_stats(struct mt76_phy *phy, struct sk_buff *msg)
u64 rx_fcs_error = 0;
int i;
+ if (dev->test_ops->dump_stats) {
+ int ret;
+
+ ret = dev->test_ops->dump_stats(phy, msg);
+ if (ret)
+ return ret;
+ }
+
for (i = 0; i < ARRAY_SIZE(td->rx_stats.packets); i++) {
rx_packets += td->rx_stats.packets[i];
rx_fcs_error += td->rx_stats.fcs_error[i];
@@ -535,9 +543,6 @@ mt76_testmode_dump_stats(struct mt76_phy *phy, struct sk_buff *msg)
MT76_TM_STATS_ATTR_PAD))
return -EMSGSIZE;
- if (dev->test_ops->dump_stats)
- return dev->test_ops->dump_stats(phy, msg);
-
return 0;
}