diff options
author | David Decotigny <decot@google.com> | 2011-04-27 14:32:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-29 17:03:00 -0400 |
commit | 25db0338813a8915457636b1f6abe6a28fa73f8d (patch) | |
tree | 29ea39e45de1342beb4e3c58da0cfbc9915b617e /drivers/net/sungem.c | |
parent | 8ae6daca85c8bbd6a32c382db5e2a2a989f8bed2 (diff) |
ethtool: Use full 32 bit speed range in ethtool's set_settings
This makes sure the ethtool's set_settings() callback of network
drivers don't ignore the 16 most significant bits when ethtool calls
their set_settings().
All drivers compiled with make allyesconfig on x86_64 have been
updated.
Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sungem.c')
-rw-r--r-- | drivers/net/sungem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 81b6eb8ed4d7..40a755dd1a26 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -1294,7 +1294,7 @@ static void gem_begin_auto_negotiation(struct gem *gp, struct ethtool_cmd *ep) | |||
1294 | autoneg = 1; | 1294 | autoneg = 1; |
1295 | } else { | 1295 | } else { |
1296 | autoneg = 0; | 1296 | autoneg = 0; |
1297 | speed = ep->speed; | 1297 | speed = ethtool_cmd_speed(ep); |
1298 | duplex = ep->duplex; | 1298 | duplex = ep->duplex; |
1299 | } | 1299 | } |
1300 | 1300 | ||
@@ -2686,6 +2686,7 @@ static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
2686 | static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 2686 | static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
2687 | { | 2687 | { |
2688 | struct gem *gp = netdev_priv(dev); | 2688 | struct gem *gp = netdev_priv(dev); |
2689 | u32 speed = ethtool_cmd_speed(cmd); | ||
2689 | 2690 | ||
2690 | /* Verify the settings we care about. */ | 2691 | /* Verify the settings we care about. */ |
2691 | if (cmd->autoneg != AUTONEG_ENABLE && | 2692 | if (cmd->autoneg != AUTONEG_ENABLE && |
@@ -2697,9 +2698,9 @@ static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
2697 | return -EINVAL; | 2698 | return -EINVAL; |
2698 | 2699 | ||
2699 | if (cmd->autoneg == AUTONEG_DISABLE && | 2700 | if (cmd->autoneg == AUTONEG_DISABLE && |
2700 | ((cmd->speed != SPEED_1000 && | 2701 | ((speed != SPEED_1000 && |
2701 | cmd->speed != SPEED_100 && | 2702 | speed != SPEED_100 && |
2702 | cmd->speed != SPEED_10) || | 2703 | speed != SPEED_10) || |
2703 | (cmd->duplex != DUPLEX_HALF && | 2704 | (cmd->duplex != DUPLEX_HALF && |
2704 | cmd->duplex != DUPLEX_FULL))) | 2705 | cmd->duplex != DUPLEX_FULL))) |
2705 | return -EINVAL; | 2706 | return -EINVAL; |