Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/mt76.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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-10 14:28:33 +0300
commit5954e3381ff9881b24fe6da27a16f92e06813d6c (patch)
tree9d0f6bc891ae80a53a3de65694ddfc95ba995c01 /testmode.c
parentb24598b1c1a9f67e25cd3f3107a6ee882c2d0ff6 (diff)
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 'testmode.c')
-rw-r--r--testmode.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/testmode.c b/testmode.c
index c6a85a0c..f73ffbd6 100644
--- a/testmode.c
+++ b/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;
}