diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-06-10 07:28:04 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-11 11:47:10 +0200 |
commit | d005ba6cc82440d9ebf96f3ec8f79c54578b898f (patch) | |
tree | 871a9a75e1fcb6dbf9c8f3aa6944fe6a7baf2068 /drivers/net/mdio.c | |
parent | qlge: Allow RX buf rings to be > than 4096 bytes. (diff) | |
download | linux-d005ba6cc82440d9ebf96f3ec8f79c54578b898f.tar.xz linux-d005ba6cc82440d9ebf96f3ec8f79c54578b898f.zip |
mdio: Expose 10GBASE-T MDI-X status via ethtool
This is available in a standard MDIO register in 10GBASE-T PHYs.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mdio.c')
-rw-r--r-- | drivers/net/mdio.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/mdio.c b/drivers/net/mdio.c index 66483035f683..dc45e9856c35 100644 --- a/drivers/net/mdio.c +++ b/drivers/net/mdio.c @@ -296,6 +296,23 @@ void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio, ecmd->duplex = (reg & MDIO_CTRL1_FULLDPLX || ecmd->speed == SPEED_10000); } + + /* 10GBASE-T MDI/MDI-X */ + if (ecmd->port == PORT_TP && ecmd->speed == SPEED_10000) { + switch (mdio->mdio_read(mdio->dev, mdio->prtad, MDIO_MMD_PMAPMD, + MDIO_PMA_10GBT_SWAPPOL)) { + case MDIO_PMA_10GBT_SWAPPOL_ABNX | MDIO_PMA_10GBT_SWAPPOL_CDNX: + ecmd->eth_tp_mdix = ETH_TP_MDI; + break; + case 0: + ecmd->eth_tp_mdix = ETH_TP_MDI_X; + break; + default: + /* It's complicated... */ + ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID; + break; + } + } } EXPORT_SYMBOL(mdio45_ethtool_gset_npage); |