diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-06-10 09:30:05 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-11 13:47:11 +0400 |
commit | e762cd70efad6b6236b084ff7e5ce54a5f524320 (patch) | |
tree | 7b229749f3aafa8ba5f307721d39df633b08f284 /drivers/net/sfc | |
parent | d005ba6cc82440d9ebf96f3ec8f79c54578b898f (diff) | |
download | linux-e762cd70efad6b6236b084ff7e5ce54a5f524320.tar.xz |
sfc: Expose 100/1000BASE-T MDI-X status via ethtool
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/tenxpress.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c index db723c58f6f1..f4d509015f75 100644 --- a/drivers/net/sfc/tenxpress.c +++ b/drivers/net/sfc/tenxpress.c @@ -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 */ @@ -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 */ |