Skip to content

Commit

Permalink
sfc: Expose 100/1000BASE-T MDI-X status via ethtool
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Jun 11, 2009
1 parent d005ba6 commit e762cd7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/net/sfc/tenxpress.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

/* extended status register */
#define PMA_PMD_XSTATUS_REG 49153
#define PMA_PMD_XSTAT_MDIX_LBN 14
#define PMA_PMD_XSTAT_FLP_LBN (12)

/* LED control register */
Expand Down Expand Up @@ -741,9 +742,17 @@ tenxpress_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)

mdio45_ethtool_gset_npage(&efx->mdio, ecmd, adv, lpa);

if (efx->phy_type != PHY_TYPE_SFX7101)
if (efx->phy_type != PHY_TYPE_SFX7101) {
ecmd->supported |= (SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Full);
if (ecmd->speed != SPEED_10000) {
ecmd->eth_tp_mdix =
(efx_mdio_read(efx, MDIO_MMD_PMAPMD,
PMA_PMD_XSTATUS_REG) &
(1 << PMA_PMD_XSTAT_MDIX_LBN))
? ETH_TP_MDI_X : ETH_TP_MDI;
}
}

/* In loopback, the PHY automatically brings up the correct interface,
* but doesn't advertise the correct speed. So override it */
Expand Down

0 comments on commit e762cd7

Please sign in to comment.