mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-16 22:51:32 +00:00
bnx2: Report MDI/MDIX status to ethtool.
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
41033b65b9
commit
4016baddac
@ -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);
|
||||
|
@ -6471,6 +6471,9 @@ struct l2_fhdr {
|
||||
|
||||
#define BCM5708S_TX_ACTL3 0x17
|
||||
|
||||
#define MII_BNX2_EXT_STATUS 0x11
|
||||
#define EXT_STATUS_MDIX (1 << 13)
|
||||
|
||||
#define MII_BNX2_AUX_CTL 0x18
|
||||
#define AUX_CTL_MISC_CTL 0x7007
|
||||
#define AUX_CTL_MISC_CTL_WIRESPEED (1 << 4)
|
||||
@ -6850,6 +6853,7 @@ struct bnx2 {
|
||||
#define BNX2_PHY_FLAG_REMOTE_PHY_CAP 0x00000800
|
||||
#define BNX2_PHY_FLAG_FORCED_DOWN 0x00001000
|
||||
#define BNX2_PHY_FLAG_NO_PARALLEL 0x00002000
|
||||
#define BNX2_PHY_FLAG_MDIX 0x00004000
|
||||
|
||||
u32 mii_bmcr;
|
||||
u32 mii_bmsr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user