提交 94724d10 编写于 作者: S Shaohui Xie 提交者: David S. Miller

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: NShaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5a6228a0
......@@ -51,8 +51,15 @@ static int teranetics_aneg_done(struct phy_device *phydev)
{
int reg;
reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
return (reg < 0) ? reg : (reg & BMSR_ANEGCOMPLETE);
/* 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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册