diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-09-19 18:47:57 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-21 22:30:52 -0400 |
commit | 6e4cbb34d4cabec48f25f0bbad68935221bd457b (patch) | |
tree | 7128d9b92a49deb8ad3dd49f7a0468cc535661a6 /drivers | |
parent | 79e57d32fe6d2d5bd38378f6dccfdbe6bd1d1dab (diff) |
[PATCH] sky2: allow ethtool debug access to all of PCI space
For debugging, it is useful to allow ethtool to dump all of
the PCI mapped space. There is one small set of registers for RAM
diagnostics that needs to be avoided to prevent hanging, but all
the rest is accessible.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sky2.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index c057694cf047..1acca982ac14 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -2488,33 +2488,30 @@ static int sky2_set_ringparam(struct net_device *dev, | |||
2488 | return err; | 2488 | return err; |
2489 | } | 2489 | } |
2490 | 2490 | ||
2491 | #define SKY2_REGS_LEN 0x1000 | ||
2492 | static int sky2_get_regs_len(struct net_device *dev) | 2491 | static int sky2_get_regs_len(struct net_device *dev) |
2493 | { | 2492 | { |
2494 | return SKY2_REGS_LEN; | 2493 | return 0x4000; |
2495 | } | 2494 | } |
2496 | 2495 | ||
2497 | /* | 2496 | /* |
2498 | * Returns copy of control register region | 2497 | * Returns copy of control register region |
2499 | * I/O region is divided into banks and certain regions are unreadable | 2498 | * Note: access to the RAM address register set will cause timeouts. |
2500 | */ | 2499 | */ |
2501 | static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs, | 2500 | static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs, |
2502 | void *p) | 2501 | void *p) |
2503 | { | 2502 | { |
2504 | const struct sky2_port *sky2 = netdev_priv(dev); | 2503 | const struct sky2_port *sky2 = netdev_priv(dev); |
2505 | unsigned long offs; | ||
2506 | const void __iomem *io = sky2->hw->regs; | 2504 | const void __iomem *io = sky2->hw->regs; |
2507 | static const unsigned long bankmap = 0xfff3f305; | ||
2508 | 2505 | ||
2506 | BUG_ON(regs->len < B3_RI_WTO_R1); | ||
2509 | regs->version = 1; | 2507 | regs->version = 1; |
2510 | for (offs = 0; offs < regs->len; offs += 128) { | 2508 | memset(p, 0, regs->len); |
2511 | u32 len = min_t(u32, 128, regs->len - offs); | ||
2512 | 2509 | ||
2513 | if (bankmap & (1 << (offs / 128))) | 2510 | memcpy_fromio(p, io, B3_RAM_ADDR); |
2514 | memcpy_fromio(p + offs, io + offs, len); | 2511 | |
2515 | else | 2512 | memcpy_fromio(p + B3_RI_WTO_R1, |
2516 | memset(p + offs, 0, len); | 2513 | io + B3_RI_WTO_R1, |
2517 | } | 2514 | regs->len - B3_RI_WTO_R1); |
2518 | } | 2515 | } |
2519 | 2516 | ||
2520 | static struct ethtool_ops sky2_ethtool_ops = { | 2517 | static struct ethtool_ops sky2_ethtool_ops = { |