diff options
author | Michael Chan <mchan@broadcom.com> | 2014-01-01 08:22:34 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-02 04:03:38 +0100 |
commit | 4016baddac7dca0b31cbba5c915c6c63f2ae2ba5 (patch) | |
tree | f73bf3d130b894fe78e4526eeb74cdb5f561e3d9 /drivers/net/ethernet/broadcom/bnx2.c | |
parent | bnx2: Enable auto-mdix when autoneg is disabled. (diff) | |
download | linux-4016baddac7dca0b31cbba5c915c6c63f2ae2ba5.tar.xz linux-4016baddac7dca0b31cbba5c915c6c63f2ae2ba5.zip |
bnx2: Report MDI/MDIX status to ethtool.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index b380c69d57a5..3fcabd9e4b7e 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -1197,6 +1197,8 @@ bnx2_copper_linkup(struct bnx2 *bp) { u32 bmcr; + bp->phy_flags &= ~BNX2_PHY_FLAG_MDIX; + bnx2_read_phy(bp, bp->mii_bmcr, &bmcr); if (bmcr & BMCR_ANENABLE) { u32 local_adv, remote_adv, common; @@ -1255,6 +1257,14 @@ bnx2_copper_linkup(struct bnx2 *bp) } } + if (bp->link_up) { + u32 ext_status; + + bnx2_read_phy(bp, MII_BNX2_EXT_STATUS, &ext_status); + if (ext_status & EXT_STATUS_MDIX) + bp->phy_flags |= BNX2_PHY_FLAG_MDIX; + } + return 0; } @@ -6874,6 +6884,12 @@ bnx2_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) if (netif_carrier_ok(dev)) { ethtool_cmd_speed_set(cmd, bp->line_speed); cmd->duplex = bp->duplex; + if (!(bp->phy_flags & BNX2_PHY_FLAG_SERDES)) { + if (bp->phy_flags & BNX2_PHY_FLAG_MDIX) + cmd->eth_tp_mdix = ETH_TP_MDI_X; + else + cmd->eth_tp_mdix = ETH_TP_MDI; + } } else { ethtool_cmd_speed_set(cmd, -1); |