Commit f8de2bf2 authored by Ryder Lee's avatar Ryder Lee Committed by Felix Fietkau

mt76: mt7615: modify mt7615_ampdu_stat_read for each phy

This is a preliminary patch to add more Tx counters.
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 663e69b1
...@@ -120,12 +120,17 @@ mt7615_reset_test_set(void *data, u64 val) ...@@ -120,12 +120,17 @@ mt7615_reset_test_set(void *data, u64 val)
DEFINE_DEBUGFS_ATTRIBUTE(fops_reset_test, NULL, DEFINE_DEBUGFS_ATTRIBUTE(fops_reset_test, NULL,
mt7615_reset_test_set, "%lld\n"); mt7615_reset_test_set, "%lld\n");
static int static void
mt7615_ampdu_stat_read(struct seq_file *file, void *data) mt7615_ampdu_stat_read_phy(struct mt7615_phy *phy,
struct seq_file *file)
{ {
struct mt7615_dev *dev = file->private; struct mt7615_dev *dev = file->private;
bool ext_phy = phy != &dev->phy;
int bound[7], i, range; int bound[7], i, range;
if (!phy)
return;
range = mt76_rr(dev, MT_AGG_ASRCR0); range = mt76_rr(dev, MT_AGG_ASRCR0);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
bound[i] = MT_AGG_ASRCR_RANGE(range, i) + 1; bound[i] = MT_AGG_ASRCR_RANGE(range, i) + 1;
...@@ -133,6 +138,8 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data) ...@@ -133,6 +138,8 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
bound[i + 4] = MT_AGG_ASRCR_RANGE(range, i) + 1; 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]); seq_printf(file, "Length: %8d | ", bound[0]);
for (i = 0; i < ARRAY_SIZE(bound) - 1; i++) for (i = 0; i < ARRAY_SIZE(bound) - 1; i++)
seq_printf(file, "%3d -%3d | ", seq_printf(file, "%3d -%3d | ",
...@@ -141,6 +148,15 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data) ...@@ -141,6 +148,15 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data)
for (i = 0; i < ARRAY_SIZE(bound); i++) for (i = 0; i < ARRAY_SIZE(bound); i++)
seq_printf(file, "%8d | ", dev->mt76.aggr_stats[i]); seq_printf(file, "%8d | ", dev->mt76.aggr_stats[i]);
seq_puts(file, "\n"); 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment