702-phy_add_aneg_done_function.patch 737 B

123456789101112131415161718192021222324252627
  1. --- a/include/linux/phy.h
  2. +++ b/include/linux/phy.h
  3. @@ -497,6 +497,12 @@ struct phy_driver {
  4. /* Determines the negotiated speed and duplex */
  5. int (*read_status)(struct phy_device *phydev);
  6. + /*
  7. + * Update the value in phydev->link to reflect the
  8. + * current link value
  9. + */
  10. + int (*update_link)(struct phy_device *phydev);
  11. +
  12. /* Clears any pending interrupts */
  13. int (*ack_interrupt)(struct phy_device *phydev);
  14. --- a/drivers/net/phy/phy_device.c
  15. +++ b/drivers/net/phy/phy_device.c
  16. @@ -1001,6 +1001,9 @@ int genphy_update_link(struct phy_device
  17. {
  18. int status;
  19. + if (phydev->drv->update_link)
  20. + return phydev->drv->update_link(phydev);
  21. +
  22. /* Do a fake read */
  23. status = phy_read(phydev, MII_BMSR);
  24. if (status < 0)