netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 1/7] ethtool: dsa: add pretty dump
Date: Fri, 14 Dec 2018 21:50:29 -0500	[thread overview]
Message-ID: <20181215025035.26977-2-vivien.didelot@gmail.com> (raw)
In-Reply-To: <20181215025035.26977-1-vivien.didelot@gmail.com>

This patch adds the preliminary bits for pretty dumping the registers
of the "dsa" kernel drivers.

Following patches will add support for the "mv88e6xxx" DSA driver.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
---
 Makefile.am |  2 +-
 dsa.c       | 12 ++++++++++++
 ethtool.c   |  1 +
 internal.h  |  3 +++
 4 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 dsa.c

diff --git a/Makefile.am b/Makefile.am
index 14f79b6..468eed1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@ ethtool_SOURCES = ethtool.c ethtool-copy.h internal.h net_tstamp-copy.h \
 		  rxclass.c
 if ETHTOOL_ENABLE_PRETTY_DUMP
 ethtool_SOURCES += \
-		  amd8111e.c de2104x.c e100.c e1000.c et131x.c igb.c	\
+		  amd8111e.c de2104x.c dsa.c e100.c e1000.c et131x.c igb.c	\
 		  fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c	\
 		  pcnet32.c realtek.c tg3.c marvell.c vioc.c	\
 		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
diff --git a/dsa.c b/dsa.c
new file mode 100644
index 0000000..83396b5
--- /dev/null
+++ b/dsa.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include <string.h>
+
+#include "internal.h"
+
+int dsa_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
+{
+	/* DSA per-driver register dump */
+
+	/* Fallback to hexdump */
+	return 1;
+}
diff --git a/ethtool.c b/ethtool.c
index 2f7e96b..f1f1ec2 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1166,6 +1166,7 @@ static const struct {
 	{ "vmxnet3", vmxnet3_dump_regs },
 	{ "fjes", fjes_dump_regs },
 	{ "lan78xx", lan78xx_dump_regs },
+	{ "dsa", dsa_dump_regs },
 #endif
 };
 
diff --git a/internal.h b/internal.h
index b239dc7..84b0f9c 100644
--- a/internal.h
+++ b/internal.h
@@ -354,4 +354,7 @@ int fjes_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
 /* MICROCHIP LAN78XX USB ETHERNET Controller */
 int lan78xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
 
+/* Distributed Switch Architecture */
+int dsa_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
+
 #endif /* ETHTOOL_INTERNAL_H__ */
-- 
2.19.2

  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 ` Vivien Didelot [this message]
2018-12-15  2:50 ` [PATCH 2/7] ethtool: dsa: mv88e6xxx: add pretty dump Vivien Didelot
2018-12-15  2:50 ` [PATCH 3/7] ethtool: dsa: mv88e6xxx: add pretty dump for 88E6185 Vivien Didelot
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-2-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).