Commit e11f303e authored by Steve Shih's avatar Steve Shih Committed by Jeff Kirsher

e1000e: fix ethtool autoneg off for non-copper

This patch fixes the issues for disabling auto-negotiation and forcing
speed and duplex settings for the non-copper media.

For non-copper media, e1000_get_settings should return ETH_TP_MDI_INVALID for
eth_tp_mdix_ctrl instead of ETH_TP_MDI_AUTO so subsequent e1000_set_settings
call would not fail with -EOPNOTSUPP.

e1000_set_spd_dplx should not automatically turn autoneg back on for forced
1000 Mbps full duplex settings for non-copper media.

Cc: xe-kernel@external.cisco.com
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: default avatarSteve Shih <sshih@cisco.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent ed7cbbce
...@@ -201,6 +201,9 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -201,6 +201,9 @@ static int e1000_get_settings(struct net_device *netdev,
else else
ecmd->eth_tp_mdix_ctrl = hw->phy.mdix; ecmd->eth_tp_mdix_ctrl = hw->phy.mdix;
if (hw->phy.media_type != e1000_media_type_copper)
ecmd->eth_tp_mdix_ctrl = ETH_TP_MDI_INVALID;
return 0; return 0;
} }
...@@ -236,8 +239,13 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx) ...@@ -236,8 +239,13 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx)
mac->forced_speed_duplex = ADVERTISE_100_FULL; mac->forced_speed_duplex = ADVERTISE_100_FULL;
break; break;
case SPEED_1000 + DUPLEX_FULL: case SPEED_1000 + DUPLEX_FULL:
if (adapter->hw.phy.media_type == e1000_media_type_copper) {
mac->autoneg = 1; mac->autoneg = 1;
adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL; adapter->hw.phy.autoneg_advertised =
ADVERTISE_1000_FULL;
} else {
mac->forced_speed_duplex = ADVERTISE_1000_FULL;
}
break; break;
case SPEED_1000 + DUPLEX_HALF: /* not supported */ case SPEED_1000 + DUPLEX_HALF: /* not supported */
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment