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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 611c89720d9992d54da93bd946000c574d23f2b7 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Sat, 11 May 2013 23:40:19 +0200
  4. Subject: [PATCH 157/164] 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 | 2 +-
  9. 2 files changed, 7 insertions(+), 4 deletions(-)
  10. --- a/drivers/net/phy/phy.c
  11. +++ b/drivers/net/phy/phy.c
  12. @@ -847,7 +847,8 @@ void phy_state_machine(struct work_struc
  13. * 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. @@ -938,7 +939,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. @@ -950,7 +952,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. }
  40. break;
  41. --- a/include/linux/phy.h
  42. +++ b/include/linux/phy.h
  43. @@ -298,7 +298,7 @@ struct phy_device {
  44. struct phy_c45_device_ids c45_ids;
  45. bool is_c45;
  46. -
  47. + bool no_auto_carrier_off;
  48. enum phy_state state;
  49. u32 dev_flags;