diff options
author | David Decotigny <decot@google.com> | 2011-04-27 18:32:39 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-29 14:03:00 -0700 |
commit | 25db0338813a8915457636b1f6abe6a28fa73f8d (patch) | |
tree | 29ea39e45de1342beb4e3c58da0cfbc9915b617e /drivers/net/ksz884x.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/ksz884x.c')
-rw-r--r-- | drivers/net/ksz884x.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c index 2c37a380430..41ea5920c15 100644 --- a/drivers/net/ksz884x.c +++ b/drivers/net/ksz884x.c @@ -5998,6 +5998,7 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) struct dev_priv *priv = netdev_priv(dev); struct dev_info *hw_priv = priv->adapter; struct ksz_port *port = &priv->port; + u32 speed = ethtool_cmd_speed(cmd); int rc; /* @@ -6006,11 +6007,11 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) */ if (cmd->autoneg && priv->advertising == cmd->advertising) { cmd->advertising |= ADVERTISED_ALL; - if (10 == cmd->speed) + if (10 == speed) cmd->advertising &= ~(ADVERTISED_100baseT_Full | ADVERTISED_100baseT_Half); - else if (100 == cmd->speed) + else if (100 == speed) cmd->advertising &= ~(ADVERTISED_10baseT_Full | ADVERTISED_10baseT_Half); @@ -6032,8 +6033,8 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) port->force_link = 0; } else { port->duplex = cmd->duplex + 1; - if (cmd->speed != 1000) - port->speed = cmd->speed; + if (1000 != speed) + port->speed = speed; if (cmd->autoneg) port->force_link = 0; else |