5ea43a444569a16c7111460ab66932a3541cd359
[openwrt/staging/thess.git] /
1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Mon, 18 Sep 2023 12:29:17 +0200
3 Subject: [PATCH] net: ethernet: mtk_wed: debugfs: move wed_v2 specific regs
4 out of regs array
5
6 Move specific WED2.0 debugfs entries out of regs array. This is a
7 preliminary patch to introduce WED 3.0 debugfs info.
8
9 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
11 ---
12
13 --- a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
14 +++ b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
15 @@ -151,7 +151,7 @@ DEFINE_SHOW_ATTRIBUTE(wed_txinfo);
16 static int
17 wed_rxinfo_show(struct seq_file *s, void *data)
18 {
19 - static const struct reg_dump regs[] = {
20 + static const struct reg_dump regs_common[] = {
21 DUMP_STR("WPDMA RX"),
22 DUMP_WPDMA_RX_RING(0),
23 DUMP_WPDMA_RX_RING(1),
24 @@ -169,7 +169,7 @@ wed_rxinfo_show(struct seq_file *s, void
25 DUMP_WED_RING(WED_RING_RX_DATA(0)),
26 DUMP_WED_RING(WED_RING_RX_DATA(1)),
27
28 - DUMP_STR("WED RRO"),
29 + DUMP_STR("WED WO RRO"),
30 DUMP_WED_RRO_RING(WED_RROQM_MIOD_CTRL0),
31 DUMP_WED(WED_RROQM_MID_MIB),
32 DUMP_WED(WED_RROQM_MOD_MIB),
33 @@ -180,17 +180,6 @@ wed_rxinfo_show(struct seq_file *s, void
34 DUMP_WED(WED_RROQM_FDBK_ANC_MIB),
35 DUMP_WED(WED_RROQM_FDBK_ANC2H_MIB),
36
37 - DUMP_STR("WED Route QM"),
38 - DUMP_WED(WED_RTQM_R2H_MIB(0)),
39 - DUMP_WED(WED_RTQM_R2Q_MIB(0)),
40 - DUMP_WED(WED_RTQM_Q2H_MIB(0)),
41 - DUMP_WED(WED_RTQM_R2H_MIB(1)),
42 - DUMP_WED(WED_RTQM_R2Q_MIB(1)),
43 - DUMP_WED(WED_RTQM_Q2H_MIB(1)),
44 - DUMP_WED(WED_RTQM_Q2N_MIB),
45 - DUMP_WED(WED_RTQM_Q2B_MIB),
46 - DUMP_WED(WED_RTQM_PFDBK_MIB),
47 -
48 DUMP_STR("WED WDMA TX"),
49 DUMP_WED(WED_WDMA_TX_MIB),
50 DUMP_WED_RING(WED_WDMA_RING_TX),
51 @@ -211,11 +200,25 @@ wed_rxinfo_show(struct seq_file *s, void
52 DUMP_WED(WED_RX_BM_INTF),
53 DUMP_WED(WED_RX_BM_ERR_STS),
54 };
55 + static const struct reg_dump regs_wed_v2[] = {
56 + DUMP_STR("WED Route QM"),
57 + DUMP_WED(WED_RTQM_R2H_MIB(0)),
58 + DUMP_WED(WED_RTQM_R2Q_MIB(0)),
59 + DUMP_WED(WED_RTQM_Q2H_MIB(0)),
60 + DUMP_WED(WED_RTQM_R2H_MIB(1)),
61 + DUMP_WED(WED_RTQM_R2Q_MIB(1)),
62 + DUMP_WED(WED_RTQM_Q2H_MIB(1)),
63 + DUMP_WED(WED_RTQM_Q2N_MIB),
64 + DUMP_WED(WED_RTQM_Q2B_MIB),
65 + DUMP_WED(WED_RTQM_PFDBK_MIB),
66 + };
67 struct mtk_wed_hw *hw = s->private;
68 struct mtk_wed_device *dev = hw->wed_dev;
69
70 - if (dev)
71 - dump_wed_regs(s, dev, regs, ARRAY_SIZE(regs));
72 + if (dev) {
73 + dump_wed_regs(s, dev, regs_common, ARRAY_SIZE(regs_common));
74 + dump_wed_regs(s, dev, regs_wed_v2, ARRAY_SIZE(regs_wed_v2));
75 + }
76
77 return 0;
78 }