summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexandre Messier <amessier@tycoint.com>2016-01-22 14:16:56 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2016-01-28 13:20:29 -0600
commit1f9e672c792404744006658047c5866c74bc1ab1 (patch)
tree66be49d1ea869db7522f09cbe2e72dad232d0295 /drivers/net
parent53b0c38c7a691d13d53c08e4c4ebbfd2612f20a7 (diff)
downloadtalos-obmc-uboot-1f9e672c792404744006658047c5866c74bc1ab1.tar.gz
talos-obmc-uboot-1f9e672c792404744006658047c5866c74bc1ab1.zip
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: Alexandre Messier <amessier@tycoint.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/phy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index a06115d9f8..467efd8bc7 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -235,7 +235,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",
@@ -291,7 +292,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;
OpenPOWER on IntegriCloud