0001-NET-multi-phy-support.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From c30a296646a42302065ba452abe95b0b4b550883 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Sun, 27 Jul 2014 09:38:50 +0100
  4. Subject: [PATCH 01/78] NET: multi phy support
  5. Signed-off-by: John Crispin <[email protected]>
  6. ---
  7. drivers/net/phy/phy.c | 9 ++++++---
  8. include/linux/phy.h | 1 +
  9. 2 files changed, 7 insertions(+), 3 deletions(-)
  10. diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
  11. index 47cd306..f69d12f 100644
  12. --- a/drivers/net/phy/phy.c
  13. +++ b/drivers/net/phy/phy.c
  14. @@ -844,7 +844,8 @@ void phy_state_machine(struct work_struct *work)
  15. /* If the link is down, give up on negotiation for now */
  16. if (!phydev->link) {
  17. phydev->state = PHY_NOLINK;
  18. - netif_carrier_off(phydev->attached_dev);
  19. + if (!phydev->no_auto_carrier_off)
  20. + netif_carrier_off(phydev->attached_dev);
  21. phydev->adjust_link(phydev->attached_dev);
  22. break;
  23. }
  24. @@ -927,7 +928,8 @@ void phy_state_machine(struct work_struct *work)
  25. netif_carrier_on(phydev->attached_dev);
  26. } else {
  27. phydev->state = PHY_NOLINK;
  28. - netif_carrier_off(phydev->attached_dev);
  29. + if (!phydev->no_auto_carrier_off)
  30. + netif_carrier_off(phydev->attached_dev);
  31. }
  32. phydev->adjust_link(phydev->attached_dev);
  33. @@ -939,7 +941,8 @@ void phy_state_machine(struct work_struct *work)
  34. case PHY_HALTED:
  35. if (phydev->link) {
  36. phydev->link = 0;
  37. - netif_carrier_off(phydev->attached_dev);
  38. + if (!phydev->no_auto_carrier_off)
  39. + netif_carrier_off(phydev->attached_dev);
  40. phydev->adjust_link(phydev->attached_dev);
  41. do_suspend = true;
  42. }
  43. diff --git a/include/linux/phy.h b/include/linux/phy.h
  44. index 05fde31..276ab8a 100644
  45. --- a/include/linux/phy.h
  46. +++ b/include/linux/phy.h
  47. @@ -377,6 +377,7 @@ struct phy_device {
  48. bool is_pseudo_fixed_link;
  49. bool has_fixups;
  50. bool suspended;
  51. + bool no_auto_carrier_off;
  52. enum phy_state state;
  53. --
  54. 1.7.10.4