All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH-RFC] drivers: net: ethernet: intel: e1000e: fix ethtool autoneg off for fiber
@ 2016-03-25 21:58 ` Daniel Walker
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Walker @ 2016-03-25 21:58 UTC (permalink / raw)
  To: intel-wired-lan

From: Steve Shih <sshih@cisco.com>

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

For fiber 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.

Cc: danielwa at fifo99.com
Cc: xe-kernel at external.cisco.com
Signed-off-by: Steve Shih <sshih@cisco.com>
---
 drivers/net/ethernet/intel/e1000e/ethtool.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index 6cab1f3..cd03dcd 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -201,6 +201,9 @@ static int e1000_get_settings(struct net_device *netdev,
 	else
 		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;
 }
 
@@ -236,8 +239,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx)
 		mac->forced_speed_duplex = ADVERTISE_100_FULL;
 		break;
 	case SPEED_1000 + DUPLEX_FULL:
-		mac->autoneg = 1;
-		adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
+		mac->forced_speed_duplex = ADVERTISE_1000_FULL;
 		break;
 	case SPEED_1000 + DUPLEX_HALF:	/* not supported */
 	default:
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-04-05 13:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25 21:58 [Intel-wired-lan] [PATCH-RFC] drivers: net: ethernet: intel: e1000e: fix ethtool autoneg off for fiber Daniel Walker
2016-03-25 21:58 ` Daniel Walker
2016-03-30 19:34 ` [Intel-wired-lan] " Daniel Walker
2016-03-30 19:34   ` Daniel Walker
2016-03-30 19:44   ` [Intel-wired-lan] " Jeff Kirsher
2016-03-30 19:44     ` Jeff Kirsher
2016-04-03 14:23   ` [Intel-wired-lan] " Ruinskiy, Dima
2016-04-03 14:23     ` Ruinskiy, Dima
2016-04-04 23:03     ` Daniel Walker
2016-04-04 23:03       ` Daniel Walker
2016-04-05 13:41       ` Ruinskiy, Dima
2016-04-05 13:41         ` Ruinskiy, Dima

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.