diff options
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index d24b3f3e646b..d09e8b0add01 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -3955,6 +3955,7 @@ static int nv_set_wol(struct net_device *dev, struct ethtool_wolinfo *wolinfo) | |||
3955 | static int nv_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | 3955 | static int nv_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) |
3956 | { | 3956 | { |
3957 | struct fe_priv *np = netdev_priv(dev); | 3957 | struct fe_priv *np = netdev_priv(dev); |
3958 | u32 speed; | ||
3958 | int adv; | 3959 | int adv; |
3959 | 3960 | ||
3960 | spin_lock_irq(&np->lock); | 3961 | spin_lock_irq(&np->lock); |
@@ -3974,23 +3975,26 @@ static int nv_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
3974 | if (netif_carrier_ok(dev)) { | 3975 | if (netif_carrier_ok(dev)) { |
3975 | switch (np->linkspeed & (NVREG_LINKSPEED_MASK)) { | 3976 | switch (np->linkspeed & (NVREG_LINKSPEED_MASK)) { |
3976 | case NVREG_LINKSPEED_10: | 3977 | case NVREG_LINKSPEED_10: |
3977 | ecmd->speed = SPEED_10; | 3978 | speed = SPEED_10; |
3978 | break; | 3979 | break; |
3979 | case NVREG_LINKSPEED_100: | 3980 | case NVREG_LINKSPEED_100: |
3980 | ecmd->speed = SPEED_100; | 3981 | speed = SPEED_100; |
3981 | break; | 3982 | break; |
3982 | case NVREG_LINKSPEED_1000: | 3983 | case NVREG_LINKSPEED_1000: |
3983 | ecmd->speed = SPEED_1000; | 3984 | speed = SPEED_1000; |
3985 | break; | ||
3986 | default: | ||
3987 | speed = -1; | ||
3984 | break; | 3988 | break; |
3985 | } | 3989 | } |
3986 | ecmd->duplex = DUPLEX_HALF; | 3990 | ecmd->duplex = DUPLEX_HALF; |
3987 | if (np->duplex) | 3991 | if (np->duplex) |
3988 | ecmd->duplex = DUPLEX_FULL; | 3992 | ecmd->duplex = DUPLEX_FULL; |
3989 | } else { | 3993 | } else { |
3990 | ecmd->speed = -1; | 3994 | speed = -1; |
3991 | ecmd->duplex = -1; | 3995 | ecmd->duplex = -1; |
3992 | } | 3996 | } |
3993 | 3997 | ethtool_cmd_speed_set(ecmd, speed); | |
3994 | ecmd->autoneg = np->autoneg; | 3998 | ecmd->autoneg = np->autoneg; |
3995 | 3999 | ||
3996 | ecmd->advertising = ADVERTISED_MII; | 4000 | ecmd->advertising = ADVERTISED_MII; |