1 From 7407b7d178e783074861a73da858b099f870270d 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 14/33] 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 38f0b31..ad64a75 100644
14 --- a/drivers/net/phy/phy.c
15 +++ b/drivers/net/phy/phy.c
16 @@ -773,7 +773,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 @@ -843,7 +844,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 @@ -855,7 +857,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 9e11039..9a8ca78 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;