aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sky2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index fe01b961b597..612257172b95 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)
3330 3330
3331/* 3331/*
3332 * Returns copy of control register region 3332 * Returns copy of control register region
3333 * Note: access to the RAM address register set will cause timeouts. 3333 * Note: ethtool_get_regs always provides full size (16k) buffer
3334 */ 3334 */
3335static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs, 3335static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs,
3336 void *p) 3336 void *p)
@@ -3338,15 +3338,19 @@ static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs,
3338 const struct sky2_port *sky2 = netdev_priv(dev); 3338 const struct sky2_port *sky2 = netdev_priv(dev);
3339 const void __iomem *io = sky2->hw->regs; 3339 const void __iomem *io = sky2->hw->regs;
3340 3340
3341 BUG_ON(regs->len < B3_RI_WTO_R1);
3342 regs->version = 1; 3341 regs->version = 1;
3343 memset(p, 0, regs->len); 3342 memset(p, 0, regs->len);
3344 3343
3345 memcpy_fromio(p, io, B3_RAM_ADDR); 3344 memcpy_fromio(p, io, B3_RAM_ADDR);
3346 3345
3347 memcpy_fromio(p + B3_RI_WTO_R1, 3346 /* skip diagnostic ram region */
3348 io + B3_RI_WTO_R1, 3347 memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, 0x2000 - B3_RI_WTO_R1);
3349 regs->len - B3_RI_WTO_R1); 3348
3349 /* copy GMAC registers */
3350 memcpy_fromio(p + BASE_GMAC_1, io + BASE_GMAC_1, 0x1000);
3351 if (sky2->hw->ports > 1)
3352 memcpy_fromio(p + BASE_GMAC_2, io + BASE_GMAC_2, 0x1000);
3353
3350} 3354}
3351 3355
3352/* In order to do Jumbo packets on these chips, need to turn off the 3356/* In order to do Jumbo packets on these chips, need to turn off the