aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smsc9420.c
diff options
context:
space:
mode:
authorSteve Glendinning <steve.glendinning@smsc.com>2008-12-15 03:59:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-15 03:59:47 -0500
commita7276db6adfded660eec1e1629710b8b82d83455 (patch)
tree4d35c330d24e1f3324bd01c1b726bb8d85d219a0 /drivers/net/smsc9420.c
parentb1721d2bb9d015d7e49079414671569a2fc0ac9b (diff)
smsc9420: add ethtool register dump support
This patch adds support for SMSC's LAN9420 PCI ethernet controller to ethtool's dump registers (-d) command. This patch is for use with an accompanying ethtool patch, which decodes the register dump. Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/smsc9420.c')
-rw-r--r--drivers/net/smsc9420.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index 2a8e9b71de92..bc9879d5f281 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -293,6 +293,29 @@ static int smsc9420_ethtool_nway_reset(struct net_device *netdev)
293 return phy_start_aneg(pd->phy_dev); 293 return phy_start_aneg(pd->phy_dev);
294} 294}
295 295
296static int smsc9420_ethtool_getregslen(struct net_device *dev)
297{
298 /* all smsc9420 registers plus all phy registers */
299 return 0x100 + (32 * sizeof(u32));
300}
301
302static void
303smsc9420_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs,
304 void *buf)
305{
306 struct smsc9420_pdata *pd = netdev_priv(dev);
307 struct phy_device *phy_dev = pd->phy_dev;
308 unsigned int i, j = 0;
309 u32 *data = buf;
310
311 regs->version = smsc9420_reg_read(pd, ID_REV);
312 for (i = 0; i < 0x100; i += (sizeof(u32)))
313 data[j++] = smsc9420_reg_read(pd, i);
314
315 for (i = 0; i <= 31; i++)
316 data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr, i);
317}
318
296static void smsc9420_eeprom_enable_access(struct smsc9420_pdata *pd) 319static void smsc9420_eeprom_enable_access(struct smsc9420_pdata *pd)
297{ 320{
298 unsigned int temp = smsc9420_reg_read(pd, GPIO_CFG); 321 unsigned int temp = smsc9420_reg_read(pd, GPIO_CFG);
@@ -422,6 +445,8 @@ static const struct ethtool_ops smsc9420_ethtool_ops = {
422 .get_eeprom_len = smsc9420_ethtool_get_eeprom_len, 445 .get_eeprom_len = smsc9420_ethtool_get_eeprom_len,
423 .get_eeprom = smsc9420_ethtool_get_eeprom, 446 .get_eeprom = smsc9420_ethtool_get_eeprom,
424 .set_eeprom = smsc9420_ethtool_set_eeprom, 447 .set_eeprom = smsc9420_ethtool_set_eeprom,
448 .get_regs_len = smsc9420_ethtool_getregslen,
449 .get_regs = smsc9420_ethtool_getregs,
425}; 450};
426 451
427/* Sets the device MAC address to dev_addr */ 452/* Sets the device MAC address to dev_addr */