Skip to contentSkip to conversation

igb: Expose MDI-X status accessible via ethtool

PATCH New Chaitanya Lala 1 participant 1 message Jun 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igb: Expose MDI-X status accessible via ethtool

In a recent patch, ethtool kernel interface changed to incorporate MDI-X status. We expose MDI-X status with this patch. This patch depends a previous patch called
"e1000e: Expose MDI-X status via ethtool change".

---
 drivers/net/igb/igb_ethtool.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/net/igb/igb_ethtool.c +9 -0
index 27eae49..17486ff 100644
@@ -168,6 +168,15 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
 
 	ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) ||
 			 hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE;
+
+	/* MDI-X => 2; MDI =>1; Invalid =>0 */
+	if ((hw->phy.media_type == e1000_media_type_copper) &&
+	    !hw->mac.get_link_status)
+		ecmd->eth_tp_mdix = hw->phy.is_mdix ? ETH_TP_MDI_X :
+							ETH_TP_MDI;
+	else
+		ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID;
+
 	return 0;
 }
 
Signature · 1 line
1.6.0.4