lantiq: update to 3.14
[openwrt.git] / target / linux / lantiq / patches-3.14 / 0023-NET-multi-phy-support.patch
1 From 2e265bc5154636daecf941acfea3087e7820877d 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 23/31] 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 76d96b9..371f0b6 100644
14 --- a/drivers/net/phy/phy.c
15 +++ b/drivers/net/phy/phy.c
16 @@ -715,7 +715,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 @@ -781,7 +782,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 @@ -793,7 +795,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 = 1;
45                 }
46 diff --git a/include/linux/phy.h b/include/linux/phy.h
47 index 565188c..91b93f7 100644
48 --- a/include/linux/phy.h
49 +++ b/include/linux/phy.h
50 @@ -308,6 +308,7 @@ struct phy_device {
51         struct phy_c45_device_ids c45_ids;
52         bool is_c45;
53         bool is_internal;
54 +       bool no_auto_carrier_off;
55  
56         enum phy_state state;
57  
58 -- 
59 1.7.10.4
60