From: Vivien Didelot <vivien.didelot@gmail.com>
To: netdev@vger.kernel.org
Cc: Chris Healy <cphealy@gmail.com>,
Vivien Didelot <vivien.didelot@gmail.com>,
"John W . Linville" <linville@tuxdriver.com>,
f.fainelli@gmail.com, andrew@lunn.ch
Subject: [PATCH 3/7] ethtool: dsa: mv88e6xxx: add pretty dump for 88E6185
Date: Fri, 14 Dec 2018 21:50:31 -0500 [thread overview]
Message-ID: <20181215025035.26977-4-vivien.didelot@gmail.com> (raw)
In-Reply-To: <20181215025035.26977-1-vivien.didelot@gmail.com>
This patch adds support for pretty dump the port registers of the
88E6185 switch.
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
---
dsa.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/dsa.c b/dsa.c
index e747c1f..d447a7f 100644
--- a/dsa.c
+++ b/dsa.c
@@ -30,6 +30,66 @@
((_val) & 0x4000) ? "14 " : "", \
((_val) & 0x8000) ? "15 " : "")
+static void dsa_mv88e6185(int reg, u16 val)
+{
+ switch (reg) {
+ case 0:
+ REG(reg, "Port Status", val);
+ break;
+ case 1:
+ REG(reg, "PCS Control", val);
+ break;
+ case 3:
+ REG(reg, "Switch Identifier", val);
+ break;
+ case 4:
+ REG(reg, "Port Control", val);
+ break;
+ case 5:
+ REG(reg, "Port Control 1", val);
+ break;
+ case 6:
+ REG(reg, "Port Base VLAN Map (Header)", val);
+ break;
+ case 7:
+ REG(reg, "Default VLAN ID & Priority", val);
+ break;
+ case 8:
+ REG(reg, "Port Control 2", val);
+ break;
+ case 9:
+ REG(reg, "Rate Control", val);
+ break;
+ case 10:
+ REG(reg, "Rate Control 2", val);
+ break;
+ case 11:
+ REG(reg, "Port Association Vector", val);
+ break;
+ case 16:
+ REG(reg, "InDiscardsLo Frame Counter", val);
+ break;
+ case 17:
+ REG(reg, "InDiscardsHi Frame Counter", val);
+ break;
+ case 18:
+ REG(reg, "InFiltered Frame Counter", val);
+ break;
+ case 19:
+ REG(reg, "OutFiltered Frame Counter", val);
+ break;
+ case 24:
+ REG(reg, "Tag Remap 0-3", val);
+ break;
+ case 25:
+ REG(reg, "Tag Remap 4-7", val);
+ break;
+ default:
+ REG(reg, "Reserved", val);
+ break;
+ }
+};
+
struct dsa_mv88e6xxx_switch {
void (*dump)(int reg, u16 val);
const char *name;
@@ -37,6 +97,7 @@ struct dsa_mv88e6xxx_switch {
};
static const struct dsa_mv88e6xxx_switch dsa_mv88e6xxx_switches[] = {
+ { .id = 0x1a70, .name = "88E6185 ", .dump = dsa_mv88e6185 },
};
static int dsa_mv88e6xxx_dump_regs(struct ethtool_regs *regs)
--
2.19.2
next prev parent reply other threads:[~2018-12-15 2:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-15 2:50 [PATCH 0/7] ethtool: add pretty dump for DSA mv88e6xxx drivers Vivien Didelot
2018-12-15 2:50 ` [PATCH 1/7] ethtool: dsa: add pretty dump Vivien Didelot
2018-12-15 2:50 ` [PATCH 2/7] ethtool: dsa: mv88e6xxx: " Vivien Didelot
2018-12-15 2:50 ` Vivien Didelot [this message]
2018-12-15 2:50 ` [PATCH 4/7] ethtool: dsa: mv88e6xxx: add pretty dump for 88E6161 Vivien Didelot
2018-12-15 2:50 ` [PATCH 5/7] ethtool: dsa: mv88e6xxx: add pretty dump for 88E6352 Vivien Didelot
2018-12-15 2:50 ` [PATCH 6/7] ethtool: dsa: mv88e6xxx: add pretty dump for 88E6390 Vivien Didelot
2018-12-15 2:50 ` [PATCH 7/7] ethtool: dsa: mv88e6xxx: pretty dump others Vivien Didelot
2018-12-15 17:28 ` [PATCH 0/7] ethtool: add pretty dump for DSA mv88e6xxx drivers Florian Fainelli
2018-12-15 17:48 ` Andrew Lunn
2018-12-16 18:02 ` Florian Fainelli
2018-12-16 20:00 ` Andrew Lunn
2018-12-16 18:03 ` Vivien Didelot
2018-12-16 17:57 ` Vivien Didelot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181215025035.26977-4-vivien.didelot@gmail.com \
--to=vivien.didelot@gmail.com \
--cc=andrew@lunn.ch \
--cc=cphealy@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).