ralink: bump to the target to v4.3
[openwrt.git] / target / linux / ramips / patches-4.3 / 0034-NET-multi-phy-support.patch
1 From 0b6eb1e68290243d439ee330ea8d0b239a5aec69 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 34/53] 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   |    1 +
10  2 files changed, 7 insertions(+), 3 deletions(-)
11
12 diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
13 index adb48ab..7eb83bd 100644
14 --- a/drivers/net/phy/phy.c
15 +++ b/drivers/net/phy/phy.c
16 @@ -843,7 +843,8 @@ void phy_state_machine(struct work_struct *work)
17                 /* If the link is down, give up on 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 @@ -923,7 +924,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 @@ -935,7 +937,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                         do_suspend = true;
45                 }
46 diff --git a/include/linux/phy.h b/include/linux/phy.h
47 index 4a4e3a0..a260bdc 100644
48 --- a/include/linux/phy.h
49 +++ b/include/linux/phy.h
50 @@ -375,6 +375,7 @@ struct phy_device {
51         bool is_pseudo_fixed_link;
52         bool has_fixups;
53         bool suspended;
54 +       bool no_auto_carrier_off;
55  
56         enum phy_state state;
57  
58 -- 
59 1.7.10.4
60