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>
This commit is contained in:

committed by
David S. Miller

parent
8ae6daca85
commit
25db033881
@@ -1068,25 +1068,26 @@ static int
|
||||
typhoon_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct typhoon *tp = netdev_priv(dev);
|
||||
u32 speed = ethtool_cmd_speed(cmd);
|
||||
struct cmd_desc xp_cmd;
|
||||
__le16 xcvr;
|
||||
int err;
|
||||
|
||||
err = -EINVAL;
|
||||
if(cmd->autoneg == AUTONEG_ENABLE) {
|
||||
if (cmd->autoneg == AUTONEG_ENABLE) {
|
||||
xcvr = TYPHOON_XCVR_AUTONEG;
|
||||
} else {
|
||||
if(cmd->duplex == DUPLEX_HALF) {
|
||||
if(cmd->speed == SPEED_10)
|
||||
if (cmd->duplex == DUPLEX_HALF) {
|
||||
if (speed == SPEED_10)
|
||||
xcvr = TYPHOON_XCVR_10HALF;
|
||||
else if(cmd->speed == SPEED_100)
|
||||
else if (speed == SPEED_100)
|
||||
xcvr = TYPHOON_XCVR_100HALF;
|
||||
else
|
||||
goto out;
|
||||
} else if(cmd->duplex == DUPLEX_FULL) {
|
||||
if(cmd->speed == SPEED_10)
|
||||
} else if (cmd->duplex == DUPLEX_FULL) {
|
||||
if (speed == SPEED_10)
|
||||
xcvr = TYPHOON_XCVR_10FULL;
|
||||
else if(cmd->speed == SPEED_100)
|
||||
else if (speed == SPEED_100)
|
||||
xcvr = TYPHOON_XCVR_100FULL;
|
||||
else
|
||||
goto out;
|
||||
@@ -1105,7 +1106,7 @@ typhoon_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
tp->speed = 0xff; /* invalid */
|
||||
tp->duplex = 0xff; /* invalid */
|
||||
} else {
|
||||
tp->speed = cmd->speed;
|
||||
tp->speed = speed;
|
||||
tp->duplex = cmd->duplex;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user