* [PATCH] PIO register dump support for 8139 driver
@ 2004-02-17 11:55 Krishnakumar. R
0 siblings, 0 replies; only message in thread
From: Krishnakumar. R @ 2004-02-17 11:55 UTC (permalink / raw)
To: jgarzik; +Cc: netdev
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-02-17 11:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-17 11:55 [PATCH] PIO register dump support for 8139 driver Krishnakumar. R
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).