summaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2019-04-02 14:43:30 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-04 00:47:54 -0400
commit4950c2ba49cc6f2b38dbedcfa0ff67acf761419a (patch)
treee1bea0ceb1887369c734f6a48b5bbbc2a916ff81 /include/linux/phy.h
parent49ffba361d5b3637d3b926d8bfe79dde9710272c (diff)
net: phy: fix autoneg mismatch case in genphy_read_status
The original patch didn't consider the case that autoneg process finishes successfully but both link partners have no mode in common. In this case there's no link, nevertheless we may be interested in what the link partner advertised. Like phydev->link we set phydev->autoneg_complete in genphy_update_link() and use the stored value in genphy_read_status(). This way we don't have to read register BMSR again. Fixes: b6163f194c69 ("net: phy: improve genphy_read_status") Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index ad88f063e50f..ab7439b3da2b 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -390,6 +390,7 @@ struct phy_device {
390 unsigned autoneg:1; 390 unsigned autoneg:1;
391 /* The most recently read link state */ 391 /* The most recently read link state */
392 unsigned link:1; 392 unsigned link:1;
393 unsigned autoneg_complete:1;
393 394
394 /* Interrupts are enabled */ 395 /* Interrupts are enabled */
395 unsigned interrupts:1; 396 unsigned interrupts:1;