Skip to content

Commit 94724d1

Browse files
Shaohui Xiedavem330
authored andcommitted
net: phy: fix auto negotiation checking for teranetics
When using fiber port, the phy cannot report it's auto negotiation state, driver should always report auto negotiation is done when using fiber port. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5a6228a commit 94724d1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/net/phy/teranetics.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ static int teranetics_aneg_done(struct phy_device *phydev)
5151
{
5252
int reg;
5353

54-
reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
55-
return (reg < 0) ? reg : (reg & BMSR_ANEGCOMPLETE);
54+
/* auto negotiation state can only be checked when using copper
55+
* port, if using fiber port, just lie it's done.
56+
*/
57+
if (!phy_read_mmd(phydev, MDIO_MMD_VEND1, 93)) {
58+
reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
59+
return (reg < 0) ? reg : (reg & BMSR_ANEGCOMPLETE);
60+
}
61+
62+
return 1;
5663
}
5764

5865
static int teranetics_config_aneg(struct phy_device *phydev)

0 commit comments

Comments
 (0)