Skip to contentSkip to conversation

VIOC: Ethtool

PATCH In review Misha Tomushev 2 participants 2 messages Oct 13, 2006 – Oct 21, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VIOC: Ethtool

The following is the ethtool patch for VIOC Device Driver.

Makefile.am +1 -1
diff -uprN ethtool-5/Makefile.am ethtool-5.vioc/Makefile.am
@@ -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)
ethtool-util.h +3 -0
diff -uprN ethtool-5/ethtool-util.h ethtool-5.vioc/ethtool-util.h
@@ -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
ethtool.c +1 -0
diff -uprN ethtool-5/ethtool.c ethtool-5.vioc/ethtool.c
@@ -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)
vioc.c +35 -0
diff -uprN ethtool-5/vioc.c ethtool-5.vioc/vioc.c
@@ -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;
+}
Signature · 2 lines
Misha Tomushev
[email protected]
#1 lore raw
Quoted 3 lines · Misha Tomushev

The following is the ethtool patch for VIOC Device Driver.

ACK but does not apply to ethtool.git:

Applying 'add VIOC support'

Adds trailing whitespace.
.dotest/patch:50:#define VIOC_REGS_LINE_SIZE sizeof(struct regs_line)
error: patch failed: Makefile.am:7
error: Makefile.am: patch does not apply
error: patch failed: ethtool-util.h:48
error: ethtool-util.h: patch does not apply
error: patch failed: ethtool.c:945
error: ethtool.c: patch does not apply