aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/atlx/atl1.c
diff options
context:
space:
mode:
authorJay Cliburn <jacliburn@bellsouth.net>2008-02-02 20:50:06 -0500
committerJeff Garzik <jeff@garzik.org>2008-03-17 07:49:23 -0400
commitc67c9a2f11d97a545c0e8f56b2ca3e5e36566a94 (patch)
tree7e0d1e6751757c501c77c3875e418acd11db1815 /drivers/net/atlx/atl1.c
parent9d90fb1ac9d97da86e24d9ea947bf2a2f333829a (diff)
atl1: add ethtool register dump
Add the ethtool register dump option to the atl1 driver. Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net> Acked-by: Chris Snook <csnook@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/atlx/atl1.c')
-rw-r--r--drivers/net/atlx/atl1.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 8a26dad96acb..1f564f03d9d6 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2513,6 +2513,57 @@ static int atl1_set_wol(struct net_device *netdev,
2513 return 0; 2513 return 0;
2514} 2514}
2515 2515
2516static int atl1_get_regs_len(struct net_device *netdev)
2517{
2518 return ATL1_REG_COUNT * sizeof(u32);
2519}
2520
2521static void atl1_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
2522 void *p)
2523{
2524 struct atl1_adapter *adapter = netdev_priv(netdev);
2525 struct atl1_hw *hw = &adapter->hw;
2526 unsigned int i;
2527 u32 *regbuf = p;
2528
2529 for (i = 0; i < ATL1_REG_COUNT; i++) {
2530 /*
2531 * This switch statement avoids reserved regions
2532 * of register space.
2533 */
2534 switch (i) {
2535 case 6 ... 9:
2536 case 14:
2537 case 29 ... 31:
2538 case 34 ... 63:
2539 case 75 ... 127:
2540 case 136 ... 1023:
2541 case 1027 ... 1087:
2542 case 1091 ... 1151:
2543 case 1194 ... 1195:
2544 case 1200 ... 1201:
2545 case 1206 ... 1213:
2546 case 1216 ... 1279:
2547 case 1290 ... 1311:
2548 case 1323 ... 1343:
2549 case 1358 ... 1359:
2550 case 1368 ... 1375:
2551 case 1378 ... 1383:
2552 case 1388 ... 1391:
2553 case 1393 ... 1395:
2554 case 1402 ... 1403:
2555 case 1410 ... 1471:
2556 case 1522 ... 1535:
2557 /* reserved region; don't read it */
2558 regbuf[i] = 0;
2559 break;
2560 default:
2561 /* unreserved region */
2562 regbuf[i] = ioread32(hw->hw_addr + (i * sizeof(u32)));
2563 }
2564 }
2565}
2566
2516static void atl1_get_ringparam(struct net_device *netdev, 2567static void atl1_get_ringparam(struct net_device *netdev,
2517 struct ethtool_ringparam *ring) 2568 struct ethtool_ringparam *ring)
2518{ 2569{
@@ -2703,6 +2754,8 @@ const struct ethtool_ops atl1_ethtool_ops = {
2703 .get_drvinfo = atl1_get_drvinfo, 2754 .get_drvinfo = atl1_get_drvinfo,
2704 .get_wol = atl1_get_wol, 2755 .get_wol = atl1_get_wol,
2705 .set_wol = atl1_set_wol, 2756 .set_wol = atl1_set_wol,
2757 .get_regs_len = atl1_get_regs_len,
2758 .get_regs = atl1_get_regs,
2706 .get_ringparam = atl1_get_ringparam, 2759 .get_ringparam = atl1_get_ringparam,
2707 .set_ringparam = atl1_set_ringparam, 2760 .set_ringparam = atl1_set_ringparam,
2708 .get_pauseparam = atl1_get_pauseparam, 2761 .get_pauseparam = atl1_get_pauseparam,