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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -390,6 +390,7 @@ struct phy_device { · 389 unmodified lines | |||
| 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; |