Commit 48f9a0c7 authored by Alexandre Messier's avatar Alexandre Messier Committed by Joe Hershberger

net: phy: Use 'autoneg' flag from phydev

Use the 'autoneg' flag available in phydev when checking if
autoneg is in use.

The previous implementation was checking directly in the PHY
if autoneg was supported. Some PHYs will report that autoneg
is supported, even when it is disabled. Thus it is not possible
to use that bit to determine if autoneg is currently in use or
not.
Signed-off-by: default avatarAlexandre Messier <amessier@tycoint.com>
Acked-by: Joe Hershberger's avatarJoe Hershberger <joe.hershberger@ni.com>
Patch: 571773
parent 514d81bc
......@@ -233,7 +233,8 @@ int genphy_update_link(struct phy_device *phydev)
if (phydev->link && mii_reg & BMSR_LSTATUS)
return 0;
if ((mii_reg & BMSR_ANEGCAPABLE) && !(mii_reg & BMSR_ANEGCOMPLETE)) {
if ((phydev->autoneg == AUTONEG_ENABLE) &&
!(mii_reg & BMSR_ANEGCOMPLETE)) {
int i = 0;
printf("%s Waiting for PHY auto negotiation to complete",
......@@ -289,7 +290,7 @@ int genphy_parse_link(struct phy_device *phydev)
int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
/* We're using autonegotiation */
if (phydev->supported & SUPPORTED_Autoneg) {
if (phydev->autoneg == AUTONEG_ENABLE) {
u32 lpa = 0;
int gblpa = 0;
u32 estatus = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment