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/phy | |
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/phy')
-rw-r--r-- | drivers/net/phy/phy.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index f7670330f988..e3f3501d4347 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -238,6 +238,8 @@ static void phy_sanitize_settings(struct phy_device *phydev) | |||
238 | */ | 238 | */ |
239 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd) | 239 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd) |
240 | { | 240 | { |
241 | u32 speed = ethtool_cmd_speed(cmd); | ||
242 | |||
241 | if (cmd->phy_address != phydev->addr) | 243 | if (cmd->phy_address != phydev->addr) |
242 | return -EINVAL; | 244 | return -EINVAL; |
243 | 245 | ||
@@ -253,16 +255,16 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd) | |||
253 | return -EINVAL; | 255 | return -EINVAL; |
254 | 256 | ||
255 | if (cmd->autoneg == AUTONEG_DISABLE && | 257 | if (cmd->autoneg == AUTONEG_DISABLE && |
256 | ((cmd->speed != SPEED_1000 && | 258 | ((speed != SPEED_1000 && |
257 | cmd->speed != SPEED_100 && | 259 | speed != SPEED_100 && |
258 | cmd->speed != SPEED_10) || | 260 | speed != SPEED_10) || |
259 | (cmd->duplex != DUPLEX_HALF && | 261 | (cmd->duplex != DUPLEX_HALF && |
260 | cmd->duplex != DUPLEX_FULL))) | 262 | cmd->duplex != DUPLEX_FULL))) |
261 | return -EINVAL; | 263 | return -EINVAL; |
262 | 264 | ||
263 | phydev->autoneg = cmd->autoneg; | 265 | phydev->autoneg = cmd->autoneg; |
264 | 266 | ||
265 | phydev->speed = cmd->speed; | 267 | phydev->speed = speed; |
266 | 268 | ||
267 | phydev->advertising = cmd->advertising; | 269 | phydev->advertising = cmd->advertising; |
268 | 270 | ||