Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168968
b: refs/heads/master
c: 6c53b1b
h: refs/heads/master
v: v3
  • Loading branch information
Steve Glendinning authored and David S. Miller committed Nov 30, 2009
1 parent a128684 commit b1d14f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc098dc705895f6b0109b7e8e026ac2b8ae1c0a1
refs/heads/master: 6c53b1b15e222244358d3cbbefd2a13920faa352
14 changes: 14 additions & 0 deletions trunk/drivers/net/smsc9420.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ static int smsc9420_ethtool_get_settings(struct net_device *dev,
{
struct smsc9420_pdata *pd = netdev_priv(dev);

if (!pd->phy_dev)
return -ENODEV;

cmd->maxtxpkt = 1;
cmd->maxrxpkt = 1;
return phy_ethtool_gset(pd->phy_dev, cmd);
Expand All @@ -262,6 +265,9 @@ static int smsc9420_ethtool_set_settings(struct net_device *dev,
{
struct smsc9420_pdata *pd = netdev_priv(dev);

if (!pd->phy_dev)
return -ENODEV;

return phy_ethtool_sset(pd->phy_dev, cmd);
}

Expand Down Expand Up @@ -290,6 +296,10 @@ static void smsc9420_ethtool_set_msglevel(struct net_device *netdev, u32 data)
static int smsc9420_ethtool_nway_reset(struct net_device *netdev)
{
struct smsc9420_pdata *pd = netdev_priv(netdev);

if (!pd->phy_dev)
return -ENODEV;

return phy_start_aneg(pd->phy_dev);
}

Expand All @@ -312,6 +322,10 @@ smsc9420_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs,
for (i = 0; i < 0x100; i += (sizeof(u32)))
data[j++] = smsc9420_reg_read(pd, i);

// cannot read phy registers if the net device is down
if (!phy_dev)
return;

for (i = 0; i <= 31; i++)
data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr, i);
}
Expand Down

0 comments on commit b1d14f9

Please sign in to comment.