From: Misha Tomushev <misha@fabric7.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: KERNEL Linux <linux-kernel@vger.kernel.org>,
NETDEV Linux <netdev@vger.kernel.org>,
"Sriram Chidambaram" <schidambaram@fabric7.com>
Subject: [PATCH] VIOC: Ethtool
Date: Fri, 13 Oct 2006 10:56:28 -0700 [thread overview]
Message-ID: <200610131056.28563.misha@fabric7.com> (raw)
The following is the ethtool patch for VIOC Device Driver.
Signed-off-by: Misha Tomushev <misha@fabric7.com>
diff -uprN ethtool-5/Makefile.am ethtool-5.vioc/Makefile.am
--- ethtool-5/Makefile.am 2006-08-23 23:53:06.000000000 -0700
+++ ethtool-5.vioc/Makefile.am 2006-10-12 18:26:22.000000000 -0700
@@ -7,7 +7,7 @@ sbin_PROGRAMS = ethtool
ethtool_SOURCES = ethtool.c ethtool-copy.h ethtool-util.h \
amd8111e.c de2104x.c e100.c e1000.c \
fec_8xx.c ibm_emac.c natsemi.c pcnet32.c \
- realtek.c tg3.c skge.c
+ realtek.c tg3.c skge.c vioc.c
dist-hook:
cp $(top_srcdir)/ethtool.spec $(distdir)
diff -uprN ethtool-5/ethtool-util.h ethtool-5.vioc/ethtool-util.h
--- ethtool-5/ethtool-util.h 2006-08-23 23:53:06.000000000 -0700
+++ ethtool-5.vioc/ethtool-util.h 2006-10-12 18:27:23.000000000 -0700
@@ -48,4 +48,7 @@ int tg3_dump_regs(struct ethtool_drvinfo
/* SysKonnect Gigabit (Genesis and Yukon) */
int skge_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
+/* VIOC */
+int vioc_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
+
#endif
diff -uprN ethtool-5/ethtool.c ethtool-5.vioc/ethtool.c
--- ethtool-5/ethtool.c 2006-08-23 23:53:16.000000000 -0700
+++ ethtool-5.vioc/ethtool.c 2006-10-12 18:28:06.000000000 -0700
@@ -945,6 +945,7 @@ static struct {
{ "ibm_emac", ibm_emac_dump_regs },
{ "tg3", tg3_dump_regs },
{ "skge", skge_dump_regs },
+ { "vioc", vioc_dump_regs },
};
static int dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
diff -uprN ethtool-5/vioc.c ethtool-5.vioc/vioc.c
--- ethtool-5/vioc.c 1969-12-31 16:00:00.000000000 -0800
+++ ethtool-5.vioc/vioc.c 2006-10-12 18:41:58.000000000 -0700
@@ -0,0 +1,35 @@
+/* Copyright 2006 Fabric7 Systems, Inc */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "ethtool-util.h"
+
+struct regs_line {
+ u32 addr;
+ u32 data;
+};
+
+#define VIOC_REGS_LINE_SIZE sizeof(struct regs_line)
+
+int vioc_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
+{
+ unsigned int i;
+ unsigned int num_regs;
+ struct regs_line *reg_info = (struct regs_line *) regs->data;
+
+ printf("%s: Enter\n", __FUNCTION__);
+
+ printf("ethtool_regs\n"
+ "%-20s = %04x\n"
+ "%-20s = %04x\n",
+ "cmd", regs->cmd,
+ "version", regs->version);
+
+ num_regs = regs->len/VIOC_REGS_LINE_SIZE;
+
+ for (i = 0; i < num_regs; i++){
+ printf("%08x = %08x\n", reg_info[i].addr, reg_info[i].data);
+ }
+
+ return 0;
+}
--
Misha Tomushev
misha@fabric7.com
next reply other threads:[~2006-10-13 18:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 17:56 Misha Tomushev [this message]
2006-10-21 19:25 ` [PATCH] VIOC: Ethtool Jeff Garzik
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=200610131056.28563.misha@fabric7.com \
--to=misha@fabric7.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=schidambaram@fabric7.com \
/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).