Skip to contentSkip to conversation

ethtool: Support et131x registers in -d

PATCH Applied Mark Einon 2 participants 2 messages Oct 30, 2012 – Nov 8, 2012

Subsystems (3)
lore
Share & tools
lore

Mark Einon

author
#0 lore raw

PATCH 1/1 ethtool: Support et131x registers in -d

The et131x register set contains useful details of RX/TX queues for the device. This dumps them with the -d option.

---
 Makefile.am |    2 +-
 et131x.c    |  120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ethtool.c   |    1 +
 internal.h  |    3 ++
 4 files changed, 125 insertions(+), 1 deletion(-)
 create mode 100644 et131x.c
Makefile.am +1 -1
index 1b96b98..e33f71f 100644
@@ -5,7 +5,7 @@ EXTRA_DIST = LICENSE ethtool.8 ethtool.spec.in aclocal.m4 ChangeLog autogen.sh
 
 sbin_PROGRAMS = ethtool
 ethtool_SOURCES = ethtool.c ethtool-copy.h internal.h net_tstamp-copy.h \
-		  amd8111e.c de2104x.c e100.c e1000.c igb.c	\
+		  amd8111e.c de2104x.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	\
et131x.c new file +120 -0

120 lines not on this page · raw message

ethtool.c +1 -0
index f3649e2..7c1bd22 100644
@@ -888,6 +888,7 @@ static const struct {
         { "sfc", sfc_dump_regs },
 	{ "st_mac100", st_mac100_dump_regs },
 	{ "st_gmac", st_gmac_dump_regs },
+	{ "et131x", et131x_dump_regs },
 };
 
 void dump_hex(FILE *file, const u8 *data, int len, int offset)
internal.h +3 -0
index deb7868..4f96fd5 100644
@@ -238,6 +238,9 @@ int st_mac100_dump_regs(struct ethtool_drvinfo *info,
 			struct ethtool_regs *regs);
 int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
 
+/* Et131x ethernet controller */
+int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
+
 /* Rx flow classification */
 int rxclass_parse_ruleopts(struct cmd_context *ctx,
 			   struct ethtool_rx_flow_spec *fsp);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Mark Einon

The et131x register set contains useful details of RX/TX queues for the device. This dumps them with the -d option.

Applied, thanks. However:

[...]

et131x.c line 9

Quoted 12 lines
et131x.c new file +9 -0
@@ -0,0 +1,120 @@
+#include <stdio.h>
+#include <string.h>
+#include "internal.h"
+
+int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
+{
+	u32 *reg = (u32 *)regs->data;
+
+	fprintf(stdout, "PHY Registers\n");

[...]

In case you need to change the dump format later, it might be worth adding a version check here. But if you're confident that you'll only ever append to the dump format, this should be fine for now.

Ben.

Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.