0026-NET-multi-phy-support.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From c6feeeb407a3b8a6597ae377ba4dd138e185e3dd Mon Sep 17 00:00:00 2001
  2. From: John Crispin <blogic@openwrt.org>
  3. Date: Sun, 27 Jul 2014 09:38:50 +0100
  4. Subject: [PATCH 26/36] NET: multi phy support
  5. Signed-off-by: John Crispin <blogic@openwrt.org>
  6. ---
  7. drivers/net/phy/phy.c | 9 ++++++---
  8. include/linux/phy.h | 1 +
  9. 2 files changed, 7 insertions(+), 3 deletions(-)
  10. --- a/drivers/net/phy/phy.c
  11. +++ b/drivers/net/phy/phy.c
  12. @@ -896,7 +896,8 @@ void phy_state_machine(struct work_struc
  13. /* If the link is down, give up on negotiation for now */
  14. if (!phydev->link) {
  15. phydev->state = PHY_NOLINK;
  16. - netif_carrier_off(phydev->attached_dev);
  17. + if (!phydev->no_auto_carrier_off)
  18. + netif_carrier_off(phydev->attached_dev);
  19. phydev->adjust_link(phydev->attached_dev);
  20. break;
  21. }
  22. @@ -988,7 +989,8 @@ void phy_state_machine(struct work_struc
  23. netif_carrier_on(phydev->attached_dev);
  24. } else {
  25. phydev->state = PHY_NOLINK;
  26. - netif_carrier_off(phydev->attached_dev);
  27. + if (!phydev->no_auto_carrier_off)
  28. + netif_carrier_off(phydev->attached_dev);
  29. }
  30. phydev->adjust_link(phydev->attached_dev);
  31. @@ -1000,7 +1002,8 @@ void phy_state_machine(struct work_struc
  32. case PHY_HALTED:
  33. if (phydev->link) {
  34. phydev->link = 0;
  35. - netif_carrier_off(phydev->attached_dev);
  36. + if (!phydev->no_auto_carrier_off)
  37. + netif_carrier_off(phydev->attached_dev);
  38. phydev->adjust_link(phydev->attached_dev);
  39. do_suspend = true;
  40. }
  41. --- a/include/linux/phy.h
  42. +++ b/include/linux/phy.h
  43. @@ -373,6 +373,7 @@ struct phy_device {
  44. bool is_pseudo_fixed_link;
  45. bool has_fixups;
  46. bool suspended;
  47. + bool no_auto_carrier_off;
  48. enum phy_state state;