diff options
Diffstat (limited to 'drivers/net/sunhme.c')
-rw-r--r-- | drivers/net/sunhme.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 8f3f02802427..d381a0f9ee18 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2401,6 +2401,7 @@ static void happy_meal_set_multicast(struct net_device *dev) | |||
2401 | static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 2401 | static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
2402 | { | 2402 | { |
2403 | struct happy_meal *hp = netdev_priv(dev); | 2403 | struct happy_meal *hp = netdev_priv(dev); |
2404 | u32 speed; | ||
2404 | 2405 | ||
2405 | cmd->supported = | 2406 | cmd->supported = |
2406 | (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | | 2407 | (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | |
@@ -2420,10 +2421,9 @@ static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
2420 | 2421 | ||
2421 | if (hp->sw_bmcr & BMCR_ANENABLE) { | 2422 | if (hp->sw_bmcr & BMCR_ANENABLE) { |
2422 | cmd->autoneg = AUTONEG_ENABLE; | 2423 | cmd->autoneg = AUTONEG_ENABLE; |
2423 | cmd->speed = | 2424 | speed = ((hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) ? |
2424 | (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) ? | 2425 | SPEED_100 : SPEED_10); |
2425 | SPEED_100 : SPEED_10; | 2426 | if (speed == SPEED_100) |
2426 | if (cmd->speed == SPEED_100) | ||
2427 | cmd->duplex = | 2427 | cmd->duplex = |
2428 | (hp->sw_lpa & (LPA_100FULL)) ? | 2428 | (hp->sw_lpa & (LPA_100FULL)) ? |
2429 | DUPLEX_FULL : DUPLEX_HALF; | 2429 | DUPLEX_FULL : DUPLEX_HALF; |
@@ -2433,13 +2433,12 @@ static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
2433 | DUPLEX_FULL : DUPLEX_HALF; | 2433 | DUPLEX_FULL : DUPLEX_HALF; |
2434 | } else { | 2434 | } else { |
2435 | cmd->autoneg = AUTONEG_DISABLE; | 2435 | cmd->autoneg = AUTONEG_DISABLE; |
2436 | cmd->speed = | 2436 | speed = (hp->sw_bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10; |
2437 | (hp->sw_bmcr & BMCR_SPEED100) ? | ||
2438 | SPEED_100 : SPEED_10; | ||
2439 | cmd->duplex = | 2437 | cmd->duplex = |
2440 | (hp->sw_bmcr & BMCR_FULLDPLX) ? | 2438 | (hp->sw_bmcr & BMCR_FULLDPLX) ? |
2441 | DUPLEX_FULL : DUPLEX_HALF; | 2439 | DUPLEX_FULL : DUPLEX_HALF; |
2442 | } | 2440 | } |
2441 | ethtool_cmd_speed_set(cmd, speed); | ||
2443 | return 0; | 2442 | return 0; |
2444 | } | 2443 | } |
2445 | 2444 | ||