aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bnx2.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 4be21b8501bf..6fbb5486163d 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4540,6 +4540,64 @@ bnx2_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
4540 info->fw_version[5] = 0; 4540 info->fw_version[5] = 0;
4541} 4541}
4542 4542
4543#define BNX2_REGDUMP_LEN (32 * 1024)
4544
4545static int
4546bnx2_get_regs_len(struct net_device *dev)
4547{
4548 return BNX2_REGDUMP_LEN;
4549}
4550
4551static void
4552bnx2_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p)
4553{
4554 u32 *p = _p, i, offset;
4555 u8 *orig_p = _p;
4556 struct bnx2 *bp = netdev_priv(dev);
4557 u32 reg_boundaries[] = { 0x0000, 0x0098, 0x0400, 0x045c,
4558 0x0800, 0x0880, 0x0c00, 0x0c10,
4559 0x0c30, 0x0d08, 0x1000, 0x101c,
4560 0x1040, 0x1048, 0x1080, 0x10a4,
4561 0x1400, 0x1490, 0x1498, 0x14f0,
4562 0x1500, 0x155c, 0x1580, 0x15dc,
4563 0x1600, 0x1658, 0x1680, 0x16d8,
4564 0x1800, 0x1820, 0x1840, 0x1854,
4565 0x1880, 0x1894, 0x1900, 0x1984,
4566 0x1c00, 0x1c0c, 0x1c40, 0x1c54,
4567 0x1c80, 0x1c94, 0x1d00, 0x1d84,
4568 0x2000, 0x2030, 0x23c0, 0x2400,
4569 0x2800, 0x2820, 0x2830, 0x2850,
4570 0x2b40, 0x2c10, 0x2fc0, 0x3058,
4571 0x3c00, 0x3c94, 0x4000, 0x4010,
4572 0x4080, 0x4090, 0x43c0, 0x4458,
4573 0x4c00, 0x4c18, 0x4c40, 0x4c54,
4574 0x4fc0, 0x5010, 0x53c0, 0x5444,
4575 0x5c00, 0x5c18, 0x5c80, 0x5c90,
4576 0x5fc0, 0x6000, 0x6400, 0x6428,
4577 0x6800, 0x6848, 0x684c, 0x6860,
4578 0x6888, 0x6910, 0x8000 };
4579
4580 regs->version = 0;
4581
4582 memset(p, 0, BNX2_REGDUMP_LEN);
4583
4584 if (!netif_running(bp->dev))
4585 return;
4586
4587 i = 0;
4588 offset = reg_boundaries[0];
4589 p += offset;
4590 while (offset < BNX2_REGDUMP_LEN) {
4591 *p++ = REG_RD(bp, offset);
4592 offset += 4;
4593 if (offset == reg_boundaries[i + 1]) {
4594 offset = reg_boundaries[i + 2];
4595 p = (u32 *) (orig_p + offset);
4596 i += 2;
4597 }
4598 }
4599}
4600
4543static void 4601static void
4544bnx2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 4602bnx2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
4545{ 4603{
@@ -5106,6 +5164,8 @@ static struct ethtool_ops bnx2_ethtool_ops = {
5106 .get_settings = bnx2_get_settings, 5164 .get_settings = bnx2_get_settings,
5107 .set_settings = bnx2_set_settings, 5165 .set_settings = bnx2_set_settings,
5108 .get_drvinfo = bnx2_get_drvinfo, 5166 .get_drvinfo = bnx2_get_drvinfo,
5167 .get_regs_len = bnx2_get_regs_len,
5168 .get_regs = bnx2_get_regs,
5109 .get_wol = bnx2_get_wol, 5169 .get_wol = bnx2_get_wol,
5110 .set_wol = bnx2_set_wol, 5170 .set_wol = bnx2_set_wol,
5111 .nway_reset = bnx2_nway_reset, 5171 .nway_reset = bnx2_nway_reset,