]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[PATCH] sk98lin: ethtool register dump
authorStephen Hemminger <shemminger@osdl.org>
Thu, 5 Oct 2006 17:16:23 +0000 (10:16 -0700)
committerJeff Garzik <jeff@garzik.org>
Sat, 2 Dec 2006 05:11:56 +0000 (00:11 -0500)
Add support for dumping the registers in the deprecated
sk98lin driver. This is allows for easier comparison with
settings in new skge driver.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/sk98lin/skethtool.c

index e5cb5b548b8850b37973eb50e17faeec02aa5039..36460694eb82adae53581558b6e679f275eed5d3 100644 (file)
@@ -581,6 +581,30 @@ static int setRxCsum(struct net_device *dev, u32 data)
        return 0;
 }
 
+static int getRegsLen(struct net_device *dev)
+{
+       return 0x4000;
+}
+
+/*
+ * Returns copy of whole control register region
+ * Note: skip RAM address register because accessing it will
+ *      cause bus hangs!
+ */
+static void getRegs(struct net_device *dev, struct ethtool_regs *regs,
+                         void *p)
+{
+       DEV_NET *pNet = netdev_priv(dev);
+       const void __iomem *io = pNet->pAC->IoBase;
+
+       regs->version = 1;
+       memset(p, 0, regs->len);
+       memcpy_fromio(p, io, B3_RAM_ADDR);
+
+       memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1,
+                     regs->len - B3_RI_WTO_R1);
+}
+
 const struct ethtool_ops SkGeEthtoolOps = {
        .get_settings           = getSettings,
        .set_settings           = setSettings,
@@ -599,4 +623,6 @@ const struct ethtool_ops SkGeEthtoolOps = {
        .set_tx_csum            = setTxCsum,
        .get_rx_csum            = getRxCsum,
        .set_rx_csum            = setRxCsum,
+       .get_regs               = getRegs,
+       .get_regs_len           = getRegsLen,
 };