netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Krishnakumar. R" <krishnakumar@naturesoft.net>
To: jgarzik@pobox.com
Cc: netdev@oss.sgi.com
Subject: [PATCH] PIO register dump support for 8139 driver
Date: Tue, 17 Feb 2004 17:25:54 +0530	[thread overview]
Message-ID: <200402171725.54339.krishnakumar@naturesoft.net> (raw)

Hi,

The following patch adds the pio register dump
support for the 8139too.c. The register dump can 
be now obtained when we are using PIO mode.
(eg: ethtool -d eth0 will give the register dump
in the PIO mode after this patch is applied.)

The patch is against linux-2.6.1-bk4-netdev1.

Please do apply.

Regards,
KK.

Diffstat output:
---------------------
8139too.c |   24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)

The Patch:
---------------
--- linux-2.6.1-bk4-netdev1/drivers/net/8139too.orig.c	2004-02-09 
14:09:22.000000000 +0530
+++ linux-2.6.1-bk4-netdev1/drivers/net/8139too.c	2004-02-17 
14:55:05.681637552 +0530
@@ -2391,17 +2391,31 @@
 	np->msg_enable = datum;
 }
 
-/* TODO: we are too slack to do reg dumping for pio, for now */
-#ifdef CONFIG_8139TOO_PIO
-#define rtl8139_get_regs_len	NULL
-#define rtl8139_get_regs	NULL
-#else
 static int rtl8139_get_regs_len(struct net_device *dev)
 {
 	struct rtl8139_private *np = dev->priv;
 	return np->regs_len;
 }
 
+#ifdef CONFIG_8139TOO_PIO
+static void rtl8139_get_regs(struct net_device *dev, 
+                             struct ethtool_regs *regs, void *regbuf)
+{
+	struct rtl8139_private *np = dev->priv;
+	int i;
+	char *p;
+	void *ioaddr = np->mmio_addr;
+	
+	regs->version = RTL_REGS_VER;
+	p = (char *)regbuf;
+
+	spin_lock_irq(&np->lock);
+	for ( i=0 ; i<np->regs_len ; i++ ) {
+		p[i] =  RTL_R8 (i);
+	}
+	spin_unlock_irq(&np->lock);
+}
+#else
 static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs 
*regs, void *regbuf)
 {
 	struct rtl8139_private *np = dev->priv;




-- 
HomePage: http://puggy.symonds.net/~krishnakumar

                 reply	other threads:[~2004-02-17 11:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200402171725.54339.krishnakumar@naturesoft.net \
    --to=krishnakumar@naturesoft.net \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.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).