1 From c00adb2a1ac75eaef1e71cd9819636b86eabebd9 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Sat, 11 May 2013 23:40:19 +0200
4 Subject: [PATCH 70/79] 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 | 2 +-
10 2 files changed, 7 insertions(+), 4 deletions(-)
12 diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
13 index ef9ea92..27f9b45 100644
14 --- a/drivers/net/phy/phy.c
15 +++ b/drivers/net/phy/phy.c
16 @@ -800,7 +800,8 @@ void phy_state_machine(struct work_struct *work)
17 * negotiation for now */
19 phydev->state = PHY_NOLINK;
20 - netif_carrier_off(phydev->attached_dev);
21 + if (!phydev->no_auto_carrier_off)
22 + netif_carrier_off(phydev->attached_dev);
23 phydev->adjust_link(phydev->attached_dev);
26 @@ -891,7 +892,8 @@ void phy_state_machine(struct work_struct *work)
27 netif_carrier_on(phydev->attached_dev);
29 phydev->state = PHY_NOLINK;
30 - netif_carrier_off(phydev->attached_dev);
31 + if (!phydev->no_auto_carrier_off)
32 + netif_carrier_off(phydev->attached_dev);
35 phydev->adjust_link(phydev->attached_dev);
36 @@ -903,7 +905,8 @@ void phy_state_machine(struct work_struct *work)
40 - netif_carrier_off(phydev->attached_dev);
41 + if (!phydev->no_auto_carrier_off)
42 + netif_carrier_off(phydev->attached_dev);
43 phydev->adjust_link(phydev->attached_dev);
46 diff --git a/include/linux/phy.h b/include/linux/phy.h
47 index 93b3cf7..c09b4ad 100644
48 --- a/include/linux/phy.h
49 +++ b/include/linux/phy.h
50 @@ -298,7 +298,7 @@ struct phy_device {
52 struct phy_c45_device_ids c45_ids;
55 + bool no_auto_carrier_off;