mt76: mt7615: modify mt7615_ampdu_stat_read for each phy
authorRyder Lee <ryder.lee@mediatek.com>
Tue, 31 Mar 2020 06:51:35 +0000 (14:51 +0800)
committerFelix Fietkau <nbd@nbd.name>
Tue, 12 May 2020 17:52:27 +0000 (19:52 +0200)
This is a preliminary patch to add more Tx counters.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c

index b4d0795..9fd40d7 100644 (file)
@@ -120,12 +120,17 @@ mt7615_reset_test_set(void *data, u64 val)
 DEFINE_DEBUGFS_ATTRIBUTE(fops_reset_test, NULL,
                         mt7615_reset_test_set, "%lld\n");
 
-static int
-mt7615_ampdu_stat_read(struct seq_file *file, void *data)
+static void
+mt7615_ampdu_stat_read_phy(struct mt7615_phy *phy,
+                          struct seq_file *file)
 {
        struct mt7615_dev *dev = file->private;
+       bool ext_phy = phy != &dev->phy;
        int bound[7], i, range;
 
+       if (!phy)
+               return;
+
        range = mt76_rr(dev, MT_AGG_ASRCR0);
        for (i = 0; i < 4; i++)
                bound[i] = MT_AGG_ASRCR_RANGE(range, i) + 1;
@@ -133,6 +138,8 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data)
        for (i = 0; i < 3; i++)
                bound[i + 4] = MT_AGG_ASRCR_RANGE(range, i) + 1;
 
+       seq_printf(file, "\nPhy %d\n", ext_phy);
+
        seq_printf(file, "Length: %8d | ", bound[0]);
        for (i = 0; i < ARRAY_SIZE(bound) - 1; i++)
                seq_printf(file, "%3d -%3d | ",
@@ -141,6 +148,15 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data)
        for (i = 0; i < ARRAY_SIZE(bound); i++)
                seq_printf(file, "%8d | ", dev->mt76.aggr_stats[i]);
        seq_puts(file, "\n");
+}
+
+static int
+mt7615_ampdu_stat_read(struct seq_file *file, void *data)
+{
+       struct mt7615_dev *dev = file->private;
+
+       mt7615_ampdu_stat_read_phy(&dev->phy, file);
+       mt7615_ampdu_stat_read_phy(mt7615_ext_phy(dev), file);
 
        return 0;
 }