Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3ead5db7bcd343917e567c083f5faf45f5301664
Commit:     3ead5db7bcd343917e567c083f5faf45f5301664
Parent:     3213e3abc68c776589d574decf3e6aee0467d12c
Author:     Stephen Hemminger <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 4 17:23:21 2007 -0700
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sun Jul 8 22:16:42 2007 -0400

    sky2: avoid reserved regions on ethtool reg dump
    
    On Yukon EX reading some of the undocumented places in the
    memory space will cause a hang. Since they don't provide useful
    information, just skip the reserved areas.
    
    Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/sky2.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index fe01b96..6122571 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3330,7 +3330,7 @@ static int sky2_get_regs_len(struct net_device *dev)
 
 /*
  * Returns copy of control register region
- * Note: access to the RAM address register set will cause timeouts.
+ * Note: ethtool_get_regs always provides full size (16k) buffer
  */
 static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs,
                          void *p)
@@ -3338,15 +3338,19 @@ static void sky2_get_regs(struct net_device *dev, 
struct ethtool_regs *regs,
        const struct sky2_port *sky2 = netdev_priv(dev);
        const void __iomem *io = sky2->hw->regs;
 
-       BUG_ON(regs->len < B3_RI_WTO_R1);
        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);
+       /* skip diagnostic ram region */
+       memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, 0x2000 - 
B3_RI_WTO_R1);
+
+       /* copy GMAC registers */
+       memcpy_fromio(p + BASE_GMAC_1, io + BASE_GMAC_1, 0x1000);
+       if (sky2->hw->ports > 1)
+               memcpy_fromio(p + BASE_GMAC_2, io + BASE_GMAC_2, 0x1000);
+
 }
 
 /* In order to do Jumbo packets on these chips, need to turn off the
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to