Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94724d10 authored by Shaohui Xie's avatar Shaohui Xie Committed by David S. Miller
Browse files

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: default avatarShaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5a6228a0
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -51,10 +51,17 @@ static int teranetics_aneg_done(struct phy_device *phydev)
{
	int reg;

	/* auto negotiation state can only be checked when using copper
	 * port, if using fiber port, just lie it's done.
	 */
	if (!phy_read_mmd(phydev, MDIO_MMD_VEND1, 93)) {
		reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
		return (reg < 0) ? reg : (reg & BMSR_ANEGCOMPLETE);
	}

	return 1;
}

static int teranetics_config_aneg(struct phy_device *phydev)
{
	return 0;