net/igb/e1000/e1000e: more robust ethtool duplex/speed configuration
This makes sure that one cannot request a 99Mbps full-duplex and get a 100Mbps half-duplex configuration in return due to the way the speed/duplex parameters are handled internally. Tested: e1000 works 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
fbef7139a8
commit
14ad2513ed
@@ -224,7 +224,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
hw->fc.requested_mode = e1000_fc_default;
|
||||
} else {
|
||||
u32 speed = ethtool_cmd_speed(ecmd);
|
||||
if (igb_set_spd_dplx(adapter, speed + ecmd->duplex)) {
|
||||
if (igb_set_spd_dplx(adapter, speed, ecmd->duplex)) {
|
||||
clear_bit(__IGB_RESETTING, &adapter->state);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user