1 From 9c34372c25519234add1cfdfe2b69c0847f2037e 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 33/57] NET: multi phy support
6 Signed-off-by: John Crispin <blogic@openwrt.org>
8 drivers/net/phy/phy.c | 9 ++++++---
9 include/linux/phy.h | 1 +
10 2 files changed, 7 insertions(+), 3 deletions(-)
12 --- a/drivers/net/phy/phy.c
13 +++ b/drivers/net/phy/phy.c
14 @@ -838,7 +838,8 @@ void phy_state_machine(struct work_struc
15 /* If the link is down, give up on negotiation for now */
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);
24 @@ -911,7 +912,8 @@ void phy_state_machine(struct work_struc
25 netif_carrier_on(phydev->attached_dev);
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);
33 phydev->adjust_link(phydev->attached_dev);
34 @@ -923,7 +925,8 @@ void phy_state_machine(struct work_struc
38 - netif_carrier_off(phydev->attached_dev);
39 + if (!phydev->no_auto_carrier_off)
40 + netif_carrier_off(phydev->attached_dev);
41 phydev->adjust_link(phydev->attached_dev);
44 --- a/include/linux/phy.h
45 +++ b/include/linux/phy.h
46 @@ -363,6 +363,7 @@ struct phy_device {
47 struct phy_c45_device_ids c45_ids;
50 + bool no_auto_carrier_off;