Hello community,
here is the log from the commit of package ethtool
checked in at Mon Sep 4 12:30:55 CEST 2006.
--------
--- ethtool/ethtool.changes 2006-08-31 10:14:15.000000000 +0200
+++ ethtool/ethtool.changes 2006-09-04 08:00:01.000000000 +0200
@@ -1,0 +2,8 @@
+Mon Sep 4 07:59:08 CEST 2006 - mskibbe@suse.de
+
+- update to version 5 which includes:
+ o Security: Avoid potential buffer overflow
+ o Feature: GSO support
+ o Feature: skge register dump
+
+-------------------------------------------------------------------
Old:
----
ethtool-4.tar.bz2
New:
----
ethtool-5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ethtool.spec ++++++
--- /var/tmp/diff_new_pack.Rpiv5r/_old 2006-09-04 12:28:01.000000000 +0200
+++ /var/tmp/diff_new_pack.Rpiv5r/_new 2006-09-04 12:28:01.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package ethtool (Version 4)
+# spec file for package ethtool (Version 5)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -15,7 +15,7 @@
Group: Productivity/Networking/Diagnostic
Autoreqprov: on
Summary: Examine and Tune Ethernet-Based Network Interfaces
-Version: 4
+Version: 5
Release: 1
URL: http://sourceforge.net/projects/gkernel
Source: %{name}-%{version}.tar.bz2
@@ -62,6 +62,11 @@
%doc AUTHORS COPYING INSTALL NEWS README ChangeLog
%changelog -n ethtool
+* Mon Sep 04 2006 - mskibbe@suse.de
+- update to version 5 which includes:
+ o Security: Avoid potential buffer overflow
+ o Feature: GSO support
+ o Feature: skge register dump
* Thu Aug 31 2006 - mskibbe@suse.de
- update to version 4 which
o includes UFO support
++++++ ethtool-4.tar.bz2 -> ethtool-5.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/Makefile.am new/ethtool-5/Makefile.am
--- old/ethtool-4/Makefile.am 2006-04-11 17:19:08.000000000 +0200
+++ new/ethtool-5/Makefile.am 2006-08-24 08:53:06.000000000 +0200
@@ -7,7 +7,7 @@
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
+ realtek.c tg3.c skge.c
dist-hook:
cp $(top_srcdir)/ethtool.spec $(distdir)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/Makefile.in new/ethtool-5/Makefile.in
--- old/ethtool-4/Makefile.in 2006-07-19 04:25:30.000000000 +0200
+++ new/ethtool-5/Makefile.in 2006-09-02 00:19:38.000000000 +0200
@@ -55,7 +55,8 @@
am_ethtool_OBJECTS = ethtool.$(OBJEXT) amd8111e.$(OBJEXT) \
de2104x.$(OBJEXT) e100.$(OBJEXT) e1000.$(OBJEXT) \
fec_8xx.$(OBJEXT) ibm_emac.$(OBJEXT) natsemi.$(OBJEXT) \
- pcnet32.$(OBJEXT) realtek.$(OBJEXT) tg3.$(OBJEXT)
+ pcnet32.$(OBJEXT) realtek.$(OBJEXT) tg3.$(OBJEXT) \
+ skge.$(OBJEXT)
ethtool_OBJECTS = $(am_ethtool_OBJECTS)
ethtool_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
@@ -163,7 +164,7 @@
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
+ realtek.c tg3.c skge.c
all: ethtool-config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -265,6 +266,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/natsemi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcnet32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realtek.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skge.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg3.Po@am__quote@
.c.o:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/NEWS new/ethtool-5/NEWS
--- old/ethtool-4/NEWS 2006-07-19 04:22:31.000000000 +0200
+++ new/ethtool-5/NEWS 2006-09-02 00:18:17.000000000 +0200
@@ -1,4 +1,10 @@
+Version 5 - September 1, 2006
+
+ * Security: Avoid potential buffer overflow
+ * Feature: GSO support
+ * Feature: skge register dump
+
Version 4 - July 18, 2006
* Feature: UFO support
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/configure new/ethtool-5/configure
--- old/ethtool-4/configure 2006-07-19 04:25:31.000000000 +0200
+++ new/ethtool-5/configure 2006-09-02 00:19:39.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for ethtool 4.
+# Generated by GNU Autoconf 2.59 for ethtool 5.
#
# Report bugs to >.
#
@@ -269,8 +269,8 @@
# Identity of this package.
PACKAGE_NAME='ethtool'
PACKAGE_TARNAME='ethtool'
-PACKAGE_VERSION='4'
-PACKAGE_STRING='ethtool 4'
+PACKAGE_VERSION='5'
+PACKAGE_STRING='ethtool 5'
PACKAGE_BUGREPORT='Jeff Garzik '
ac_unique_file="ethtool.c"
@@ -780,7 +780,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ethtool 4 to adapt to many kinds of systems.
+\`configure' configures ethtool 5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -842,7 +842,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ethtool 4:";;
+ short | recursive ) echo "Configuration of ethtool 5:";;
esac
cat <<\_ACEOF
@@ -962,7 +962,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-ethtool configure 4
+ethtool configure 5
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -976,7 +976,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ethtool $as_me 4, which was
+It was created by ethtool $as_me 5, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1621,7 +1621,7 @@
# Define the identity of the package.
PACKAGE='ethtool'
- VERSION='4'
+ VERSION='5'
cat >>confdefs.h <<_ACEOF
@@ -4231,7 +4231,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by ethtool $as_me 4, which was
+This file was extended by ethtool $as_me 5, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4294,7 +4294,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-ethtool config.status 4
+ethtool config.status 5
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/configure.ac new/ethtool-5/configure.ac
--- old/ethtool-4/configure.ac 2006-07-19 04:22:14.000000000 +0200
+++ new/ethtool-5/configure.ac 2006-09-02 00:17:16.000000000 +0200
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(ethtool, 4, [Jeff Garzik ])
+AC_INIT(ethtool, 5, [Jeff Garzik ])
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR([ethtool.c])
AM_INIT_AUTOMAKE([gnu])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/ethtool-copy.h new/ethtool-5/ethtool-copy.h
--- old/ethtool-4/ethtool-copy.h 2006-07-19 04:21:38.000000000 +0200
+++ new/ethtool-5/ethtool-copy.h 2006-08-24 08:45:56.000000000 +0200
@@ -285,6 +285,8 @@
#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
+#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
+#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/ethtool-util.h new/ethtool-5/ethtool-util.h
--- old/ethtool-4/ethtool-util.h 2006-04-11 17:19:08.000000000 +0200
+++ new/ethtool-5/ethtool-util.h 2006-08-24 08:53:06.000000000 +0200
@@ -45,4 +45,7 @@
/* Broadcom Tigon3 Ethernet controller */
int tg3_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
+/* SysKonnect Gigabit (Genesis and Yukon) */
+int skge_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
+
#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/ethtool.8 new/ethtool-5/ethtool.8
--- old/ethtool-4/ethtool.8 2006-07-19 04:24:38.000000000 +0200
+++ new/ethtool-5/ethtool.8 2006-09-02 00:19:08.000000000 +0200
@@ -40,7 +40,7 @@
.\" \(*WO - wol flags
.\"
.ds WO \fBp\fP|\fBu\fP|\fBm\fP|\fBb\fP|\fBa\fP|\fBg\fP|\fBs\fP|\fBd\fP...
-.TH ETHTOOL 8 "July 2006" "Ethtool version 4"
+.TH ETHTOOL 8 "September 2006" "Ethtool version 5"
.SH NAME
ethtool \- Display or change ethernet card settings
.SH SYNOPSIS
@@ -154,6 +154,7 @@
.B2 sg on off
.B2 tso on off
.B2 ufo on off
+.B2 gso on off
.B ethtool \-p|\-\-blink
.I ethX
@@ -276,6 +277,9 @@
.A2 ufo on off
Specify if UDP fragmentation offload is enabled
.TP
+.A2 gso on off
+Specify if generic segmentation offload is enabled
+.TP
.B \-p \-\-identify
initiates adapter-specific action intended to enable an operator to
easily identify the adapter by sight. Typically this involves
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/ethtool.c new/ethtool-5/ethtool.c
--- old/ethtool-4/ethtool.c 2006-07-19 04:21:38.000000000 +0200
+++ new/ethtool-5/ethtool.c 2006-08-24 08:53:16.000000000 +0200
@@ -88,11 +88,11 @@
MODE_GSTATS,
} mode = MODE_GSET;
-static struct option {
+static struct option {
char *srt, *lng;
int Mode;
char *help;
- char *opthelp;
+ char *opthelp;
} args[] = {
{ "-s", "--change", MODE_SSET, "Change generic options",
" [ speed 10|100|1000 ]\n"
@@ -145,8 +145,9 @@
" [ tx on|off ]\n"
" [ sg on|off ]\n"
" [ tso on|off ]\n"
- " [ ufo on|off ]\n" },
- { "-i", "--driver", MODE_GDRV, "Show driver information" },
+ " [ ufo on|off ]\n"
+ " [ gso on|off ]\n" },
+ { "-i", "--driver", MODE_GDRV, "Show driver information" },
{ "-d", "--register-dump", MODE_GREGS, "Do a register dump" },
{ "-e", "--eeprom-dump", MODE_GEEPROM, "Do a EEPROM dump",
" [ raw on|off ]\n"
@@ -155,7 +156,7 @@
{ "-E", "--change-eeprom", MODE_SEEPROM, "Change bytes in device EEPROM",
" [ magic N ]\n"
" [ offset N ]\n"
- " [ value N ]\n" },
+ " [ value N ]\n" },
{ "-r", "--negotiate", MODE_NWAY_RST, "Restart N-WAY negotation" },
{ "-p", "--identify", MODE_PHYS_ID, "Show visible port identification (e.g. blinking)",
" [ TIME-IN-SECONDS ]\n" },
@@ -173,11 +174,11 @@
fprintf(stderr, PACKAGE " version " VERSION "\n");
fprintf(stderr,
"Usage:\n"
- "ethtool DEVNAME\tDisplay standard information about device\n");
+ "ethtool DEVNAME\tDisplay standard information about device\n");
for (i = 0; args[i].srt; i++) {
fprintf(stderr, " ethtool %s|%s DEVNAME\t%s\n%s",
- args[i].srt, args[i].lng,
- args[i].help,
+ args[i].srt, args[i].lng,
+ args[i].help,
args[i].opthelp ? args[i].opthelp : "");
}
exit(badarg);
@@ -191,6 +192,7 @@
static int off_sg_wanted = -1;
static int off_tso_wanted = -1;
static int off_ufo_wanted = -1;
+static int off_gso_wanted = -1;
static struct ethtool_pauseparam epause;
static int gpause_changed = 0;
@@ -295,6 +297,7 @@
{ "sg", CMDL_BOOL, &off_sg_wanted, NULL },
{ "tso", CMDL_BOOL, &off_tso_wanted, NULL },
{ "ufo", CMDL_BOOL, &off_ufo_wanted, NULL },
+ { "gso", CMDL_BOOL, &off_gso_wanted, NULL },
};
static struct cmdline_info cmdline_pause[] = {
@@ -378,13 +381,13 @@
for (i = 1; i < argc; i++) {
switch (i) {
case 1:
- for (k = 0; args[k].srt; k++)
+ for (k = 0; args[k].srt; k++)
if (!strcmp(argp[i], args[k].srt) ||
- !strcmp(argp[i], args[k].lng)) {
+ !strcmp(argp[i], args[k].lng)) {
mode = args[k].Mode;
break;
- }
- if (mode == MODE_HELP ||
+ }
+ if (mode == MODE_HELP ||
(!args[k].srt && argp[i][0] == '-'))
show_usage(0);
else
@@ -624,9 +627,10 @@
}
- if (devname == NULL) {
+ if (devname == NULL)
+ show_usage(1);
+ if (strlen(devname) >= IFNAMSIZ)
show_usage(1);
- }
}
static void dump_supported(struct ethtool_cmd *ep)
@@ -940,6 +944,7 @@
{ "fec_8xx", fec_8xx_dump_regs },
{ "ibm_emac", ibm_emac_dump_regs },
{ "tg3", tg3_dump_regs },
+ { "skge", skge_dump_regs },
};
static int dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
@@ -1115,19 +1120,21 @@
return 0;
}
-static int dump_offload (int rx, int tx, int sg, int tso, int ufo)
+static int dump_offload (int rx, int tx, int sg, int tso, int ufo, int gso)
{
fprintf(stdout,
"rx-checksumming: %s\n"
"tx-checksumming: %s\n"
"scatter-gather: %s\n"
"tcp segmentation offload: %s\n"
- "udp fragmentation offload: %s\n",
+ "udp fragmentation offload: %s\n"
+ "generic segmentation offload: %s\n",
rx ? "on" : "off",
tx ? "on" : "off",
sg ? "on" : "off",
tso ? "on" : "off",
- ufo ? "on" : "off");
+ ufo ? "on" : "off",
+ gso ? "on" : "off");
return 0;
}
@@ -1391,7 +1398,7 @@
static int do_goffload(int fd, struct ifreq *ifr)
{
struct ethtool_value eval;
- int err, allfail = 1, rx = 0, tx = 0, sg = 0, tso = 0, ufo = 0;
+ int err, allfail = 1, rx = 0, tx = 0, sg = 0, tso = 0, ufo = 0, gso = 0;
fprintf(stdout, "Offload parameters for %s:\n", devname);
@@ -1445,12 +1452,22 @@
allfail = 0;
}
+ eval.cmd = ETHTOOL_GGSO;
+ ifr->ifr_data = (caddr_t)&eval;
+ err = ioctl(fd, SIOCETHTOOL, ifr);
+ if (err)
+ perror("Cannot get device generic segmentation offload settings");
+ else {
+ gso = eval.data;
+ allfail = 0;
+ }
+
if (allfail) {
fprintf(stdout, "no offload info available\n");
return 83;
}
- return dump_offload(rx, tx, sg, tso, ufo);
+ return dump_offload(rx, tx, sg, tso, ufo, gso);
}
static int do_soffload(int fd, struct ifreq *ifr)
@@ -1516,6 +1533,17 @@
return 89;
}
}
+ if (off_gso_wanted >= 0) {
+ changed = 1;
+ eval.cmd = ETHTOOL_SGSO;
+ eval.data = (off_gso_wanted == 1);
+ ifr->ifr_data = (caddr_t)&eval;
+ err = ioctl(fd, SIOCETHTOOL, ifr);
+ if (err) {
+ perror("Cannot set device generic segmentation offload settings");
+ return 90;
+ }
+ }
if (!changed) {
fprintf(stdout, "no offload settings changed\n");
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/ethtool.spec new/ethtool-5/ethtool.spec
--- old/ethtool-4/ethtool.spec 2006-07-19 04:25:45.000000000 +0200
+++ new/ethtool-5/ethtool.spec 2006-09-02 00:21:19.000000000 +0200
@@ -1,5 +1,5 @@
Name : ethtool
-Version : 4
+Version : 5
Release : 1
Group : Utilities
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/fec_8xx.c new/ethtool-5/fec_8xx.c
--- old/ethtool-4/fec_8xx.c 2006-04-11 17:19:08.000000000 +0200
+++ new/ethtool-5/fec_8xx.c 2006-08-24 08:53:16.000000000 +0200
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2004 Intracom S.A.
* Pantelis Antoniou
*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/ibm_emac.c new/ethtool-5/ibm_emac.c
--- old/ethtool-4/ibm_emac.c 2006-04-11 17:19:08.000000000 +0200
+++ new/ethtool-5/ibm_emac.c 2006-08-24 08:53:16.000000000 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005 Zultys Technologies
+ * Copyright (c) 2004, 2005 Zultys Technologies
* Eugene Surovegin or
*/
#include
@@ -9,13 +9,13 @@
#include "ethtool-util.h"
/* Ethtool get_regs complex data.
- * we want to get not just EMAC registers, but also MAL, ZMII, RGMII, TAH
+ * we want to get not just EMAC registers, but also MAL, ZMII, RGMII, TAH
* when available.
- *
- * Returned BLOB consists of the ibm_emac_ethtool_regs_hdr,
+ *
+ * Returned BLOB consists of the ibm_emac_ethtool_regs_hdr,
* MAL registers, EMAC registers and optional ZMII, RGMII, TAH registers.
* Each register component is preceded with emac_ethtool_regs_subhdr.
- * Order of the optional headers follows their relative bit posititions
+ * Order of the optional headers follows their relative bit posititions
* in emac_ethtool_regs_hdr.components
*/
#define EMAC_ETHTOOL_REGS_ZMII 0x00000001
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ethtool-4/skge.c new/ethtool-5/skge.c
--- old/ethtool-4/skge.c 1970-01-01 01:00:00.000000000 +0100
+++ new/ethtool-5/skge.c 2006-08-24 08:53:16.000000000 +0200
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2004
+ * Stephen Hemminger
+ */
+
+#include
+
+#include "ethtool-util.h"
+
+static void dump_addr(int n, const u8 *a)
+{
+ int i;
+
+ printf("Addr %d ", n);
+ for (i = 0; i < 6; i++)
+ printf("%02X%c", a[i], i == 5 ? '\n' : ' ');
+}
+
+static void dump_timer(const char *name, const void *p)
+{
+ const u8 *a = p;
+ const u32 *r = p;
+
+ printf("%s\n", name);
+ printf("\tInit 0x%08X Value 0x%08X\n", r[0], r[1]);
+ printf("\tTest 0x%02X Control 0x%02X\n", a[8], a[9]);
+}
+
+static void dump_queue(const char *name, const void *a, int rx)
+{
+ struct desc {
+ u_int32_t ctl;
+ u_int32_t next;
+ u_int32_t data_lo;
+ u_int32_t data_hi;
+ u_int32_t status;
+ u_int32_t timestamp;
+ u_int16_t csum2;
+ u_int16_t csum1;
+ u_int16_t csum2_start;
+ u_int16_t csum1_start;
+ u_int32_t addr_lo;
+ u_int32_t addr_hi;
+ u_int32_t count_lo;
+ u_int32_t count_hi;
+ u_int32_t byte_count;
+ u_int32_t csr;
+ u_int32_t flag;
+ };
+ const struct desc *d = a;
+
+ printf("\n%s\n", name);
+ printf("---------------\n");
+ printf("Descriptor Address 0x%08X%08X\n",
+ d->addr_hi, d->addr_lo);
+ printf("Address Counter 0x%08X%08X\n",
+ d->count_hi, d->count_lo);
+ printf("Current Byte Counter %d\n", d->byte_count);
+ printf("BMU Control/Status 0x%08X\n", d->csr);
+ printf("Flag & FIFO Address 0x%08X\n", d->flag);
+ printf("\n");
+ printf("Control 0x%08X\n", d->ctl);
+ printf("Next 0x%08X\n", d->next);
+ printf("Data 0x%08X%08X\n",
+ d->data_hi, d->data_lo);
+ printf("Status 0x%08X\n", d->status);
+ printf("Timestamp 0x%08X\n", d->timestamp);
+ if (rx) {
+ printf("Csum1 Offset %4d Positon %d\n",
+ d->csum1, d->csum1_start);
+ printf("Csum2 Offset %4d Positon %d\n",
+ d->csum2, d->csum2_start);
+ } else
+ printf("Csum Start 0x%04X Pos %4d Write %d\n",
+ d->csum1, d->csum2_start, d->csum1_start);
+
+}
+
+static void dump_ram(const char *name, const void *p)
+{
+ const u32 *r = p;
+
+ printf("\n%s\n", name);
+ printf("---------------\n");
+ printf("Start Address 0x%08X\n", r[0]);
+ printf("End Address 0x%08X\n", r[1]);
+ printf("Write Pointer 0x%08X\n", r[2]);
+ printf("Read Pointer 0x%08X\n", r[3]);
+ printf("Upper Threshold/Pause Packets 0x%08X\n", r[4]);
+ printf("Lower Threshold/Pause Packets 0x%08X\n", r[5]);
+ printf("Upper Threshold/High Priority 0x%08X\n", r[6]);
+ printf("Lower Threshold/High Priority 0x%08X\n", r[7]);
+ printf("Packet Counter 0x%08X\n", r[8]);
+ printf("Level 0x%08X\n", r[9]);
+ printf("Test 0x%08X\n", r[10]);
+}
+
+static void dump_fifo(const char *name, const void *p)
+{
+ const u32 *r = p;
+
+ printf("\n%s\n", name);
+ printf("---------------\n");
+ printf("End Address 0x%08X\n", r[0]);
+ printf("Write Pointer 0x%08X\n", r[1]);
+ printf("Read Pointer 0x%08X\n", r[2]);
+ printf("Packet Counter 0x%08X\n", r[3]);
+ printf("Level 0x%08X\n", r[4]);
+ printf("Control 0x%08X\n", r[5]);
+ printf("Control/Test 0x%08X\n", r[6]);
+ dump_timer("LED", p + 0x20);
+}
+
+int skge_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
+{
+ const u32 *r = (const u32 *) regs->data;
+ int dual = !(regs->data[0x11a] & 1);
+
+ printf("Control Registers\n");
+ printf("-----------------\n");
+
+ printf("Register Access Port 0x%08X\n", r[0]);
+ printf("LED Control/Status 0x%08X\n", r[1]);
+ printf("Interrupt Source 0x%08X\n", r[2]);
+ printf("Interrupt Mask 0x%08X\n", r[3]);
+ printf("Interrupt Hardware Error Source 0x%08X\n", r[4]);
+ printf("Interrupt Hardware Error Mask 0x%08X\n", r[5]);
+ printf("Special Interrupt Source 0x%08X\n", r[6]);
+
+ printf("\nBus Management Unit\n");
+ printf("-------------------\n");
+ printf("CSR Receive Queue 1 0x%08X\n", r[24]);
+ printf("CSR Sync Queue 1 0x%08X\n", r[26]);
+ printf("CSR Async Queue 1 0x%08X\n", r[27]);
+ if (dual) {
+ printf("CSR Receive Queue 2 0x%08X\n", r[25]);
+ printf("CSR Async Queue 2 0x%08X\n", r[29]);
+ printf("CSR Sync Queue 2 0x%08X\n", r[28]);
+ }
+
+ printf("\nMAC Address\n");
+ printf("-------------\n");
+ dump_addr(1, regs->data + 0x100);
+ dump_addr(2, regs->data + 0x108);
+ dump_addr(3, regs->data + 0x110);
+ printf("\n");
+
+ printf("Connector type 0x%02X\n",
+ regs->data[0x118]);
+ printf("PMD type 0x%02X\n",
+ regs->data[0x119]);
+ printf("Configuration 0x%02X\n",
+ regs->data[0x11a]);
+ printf("Chip Revision 0x%02X\n",
+ regs->data[0x11b]);
+
+ dump_timer("Timer", regs->data + 0x130);
+ dump_timer("IRQ Moderation", regs->data +0x140);
+ dump_timer("Blink Source", regs->data +0x170);
+
+ dump_queue("Receive Queue 1", regs->data +0x400, 1);
+ dump_queue("Sync Transmit Queue 1", regs->data +0x600, 0);
+ dump_queue("Async Transmit Queue 1", regs->data +0x680, 0);
+ if (dual) {
+ dump_queue("Receive Queue 2", regs->data +0x480, 1);
+ dump_queue("Async Transmit Queue 2", regs->data +0x780, 0);
+ dump_queue("Sync Transmit Queue 2", regs->data +0x700, 0);
+ }
+
+ dump_ram("Receive RAMbuffer 1", regs->data+0x800);
+ dump_ram("Sync Transmit RAMbuffer 1", regs->data+0xa00);
+ dump_ram("Async Transmit RAMbuffer 1", regs->data+0xa80);
+ if (dual) {
+ dump_ram("Receive RAMbuffer 2", regs->data+0x880);
+ dump_ram("Sync Transmit RAMbuffer 2", regs->data+0xb00);
+ dump_ram("Async Transmit RAMbuffer 21", regs->data+0xb80);
+ }
+
+ dump_fifo("Receive MAC FIFO 1", regs->data+0xc00);
+ dump_fifo("Transmit MAC FIFO 1", regs->data+0xd00);
+ if (dual) {
+ dump_fifo("Receive MAC FIFO 2", regs->data+0xc80);
+ dump_fifo("Transmit MAC FIFO 2", regs->data+0xd80);
+ }
+
+ dump_timer("Descriptor Poll", regs->data+0xe00);
+ return 0;
+
+}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org