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. @@ -838,7 +838,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. @@ -911,7 +912,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. @@ -923,7 +925,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. @@ -360,6 +360,7 @@ struct phy_device {
  44. bool is_c45;
  45. bool is_internal;
  46. bool has_fixups;
  47. + bool no_auto_carrier_off;
  48. enum phy_state state;