ar71xx: update to 3.10.1
[openwrt/openwrt.git] / target / linux / ramips / patches-3.8 / 0070-NET-multi-phy-support.patch
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
5
6 Signed-off-by: John Crispin <blogic@openwrt.org>
7 ---
8 drivers/net/phy/phy.c | 9 ++++++---
9 include/linux/phy.h | 2 +-
10 2 files changed, 7 insertions(+), 4 deletions(-)
11
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 */
18 if (!phydev->link) {
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);
24 break;
25 }
26 @@ -891,7 +892,8 @@ void phy_state_machine(struct work_struct *work)
27 netif_carrier_on(phydev->attached_dev);
28 } else {
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);
33 }
34
35 phydev->adjust_link(phydev->attached_dev);
36 @@ -903,7 +905,8 @@ void phy_state_machine(struct work_struct *work)
37 case PHY_HALTED:
38 if (phydev->link) {
39 phydev->link = 0;
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);
44 }
45 break;
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 {
51
52 struct phy_c45_device_ids c45_ids;
53 bool is_c45;
54 -
55 + bool no_auto_carrier_off;
56 enum phy_state state;
57
58 u32 dev_flags;
59 --
60 1.7.10.4
61