diff options
Diffstat (limited to 'drivers/net/chelsio/cxgb2.c')
-rw-r--r-- | drivers/net/chelsio/cxgb2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 5f82c9c34978..8e14d652996b 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c | |||
@@ -638,11 +638,12 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
638 | return -EOPNOTSUPP; /* can't change speed/duplex */ | 638 | return -EOPNOTSUPP; /* can't change speed/duplex */ |
639 | 639 | ||
640 | if (cmd->autoneg == AUTONEG_DISABLE) { | 640 | if (cmd->autoneg == AUTONEG_DISABLE) { |
641 | int cap = speed_duplex_to_caps(cmd->speed, cmd->duplex); | 641 | u32 speed = ethtool_cmd_speed(cmd); |
642 | int cap = speed_duplex_to_caps(speed, cmd->duplex); | ||
642 | 643 | ||
643 | if (!(lc->supported & cap) || cmd->speed == SPEED_1000) | 644 | if (!(lc->supported & cap) || (speed == SPEED_1000)) |
644 | return -EINVAL; | 645 | return -EINVAL; |
645 | lc->requested_speed = cmd->speed; | 646 | lc->requested_speed = speed; |
646 | lc->requested_duplex = cmd->duplex; | 647 | lc->requested_duplex = cmd->duplex; |
647 | lc->advertising = 0; | 648 | lc->advertising = 0; |
648 | } else { | 649 | } else { |