lantiq: add v3.10 patches
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.10 / 0022-NET-multi-phy-support.patch
1 From 88837a59f8a84ced5ac6d64a5096fe129545d8e5 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 22/34] 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 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 */
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 @@ -843,7 +844,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 @@ -855,7 +857,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 9e11039..9a8ca78 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