Opennet Firmware
 Alle Dateien Funktionen Variablen Gruppen Seiten
openwrt_backport_r43776.patch
gehe zur Dokumentation dieser Datei
1 --- /dev/null
2 +++ b/openwrt/target/linux/generic/patches-3.10/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch
3 @@ -0,0 +1,35 @@
4 +From: Balakumaran Kannan <kumaran.4353@gmail.com>
5 +Date: Thu, 24 Apr 2014 08:22:47 +0530
6 +Subject: [PATCH] net phy: Check for aneg completion before setting state to
7 + PHY_RUNNING
8 +
9 +phy_state_machine should check whether auto-negotiatin is completed
10 +before changing phydev->state from PHY_NOLINK to PHY_RUNNING. If
11 +auto-negotiation is not completed phydev->state should be set to
12 +PHY_AN.
13 +
14 +Signed-off-by: Balakumaran Kannan <kumaran.4353@gmail.com>
15 +Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
16 +Signed-off-by: David S. Miller <davem@davemloft.net>
17 +---
18 +
19 +--- a/drivers/net/phy/phy.c
20 ++++ b/drivers/net/phy/phy.c
21 +@@ -805,6 +805,17 @@ void phy_state_machine(struct work_struc
22 + break;
23 +
24 + if (phydev->link) {
25 ++ if (AUTONEG_ENABLE == phydev->autoneg) {
26 ++ err = phy_aneg_done(phydev);
27 ++ if (err < 0)
28 ++ break;
29 ++
30 ++ if (!err) {
31 ++ phydev->state = PHY_AN;
32 ++ phydev->link_timeout = PHY_AN_TIMEOUT;
33 ++ break;
34 ++ }
35 ++ }
36 + phydev->state = PHY_RUNNING;
37 + netif_carrier_on(phydev->attached_dev);
38 + phydev->adjust_link(phydev->attached_dev);
39 --- /dev/null
40 +++ b/openwrt/target/linux/generic/patches-3.10/073-net-phy-resume-phydev-when-going-to-RESUMING.patch
41 @@ -0,0 +1,65 @@
42 +--- a/drivers/net/phy/phy.c
43 ++++ b/drivers/net/phy/phy.c
44 +@@ -743,7 +743,7 @@ void phy_state_machine(struct work_struc
45 + struct delayed_work *dwork = to_delayed_work(work);
46 + struct phy_device *phydev =
47 + container_of(dwork, struct phy_device, state_queue);
48 +- int needs_aneg = 0;
49 ++ bool needs_aneg = false, do_suspend = false, do_resume = false;
50 + int err = 0;
51 +
52 + mutex_lock(&phydev->lock);
53 +@@ -758,7 +758,7 @@ void phy_state_machine(struct work_struc
54 + case PHY_PENDING:
55 + break;
56 + case PHY_UP:
57 +- needs_aneg = 1;
58 ++ needs_aneg = true;
59 +
60 + phydev->link_timeout = PHY_AN_TIMEOUT;
61 +
62 +@@ -791,7 +791,7 @@ void phy_state_machine(struct work_struc
63 + phydev->adjust_link(phydev->attached_dev);
64 +
65 + } else if (0 == phydev->link_timeout--) {
66 +- needs_aneg = 1;
67 ++ needs_aneg = true;
68 + /* If we have the magic_aneg bit,
69 + * we try again */
70 + if (phydev->drv->flags & PHY_HAS_MAGICANEG)
71 +@@ -832,7 +832,7 @@ void phy_state_machine(struct work_struc
72 + netif_carrier_on(phydev->attached_dev);
73 + } else {
74 + if (0 == phydev->link_timeout--)
75 +- needs_aneg = 1;
76 ++ needs_aneg = true;
77 + }
78 +
79 + phydev->adjust_link(phydev->attached_dev);
80 +@@ -868,6 +868,7 @@ void phy_state_machine(struct work_struc
81 + phydev->link = 0;
82 + netif_carrier_off(phydev->attached_dev);
83 + phydev->adjust_link(phydev->attached_dev);
84 ++ do_suspend = true;
85 + }
86 + break;
87 + case PHY_RESUMING:
88 +@@ -918,6 +919,7 @@ void phy_state_machine(struct work_struc
89 + phydev->state = PHY_NOLINK;
90 + phydev->adjust_link(phydev->attached_dev);
91 + }
92 ++ do_resume = true;
93 + break;
94 + }
95 +
96 +@@ -925,6 +927,10 @@ void phy_state_machine(struct work_struc
97 +
98 + if (needs_aneg)
99 + err = phy_start_aneg(phydev);
100 ++ else if (do_suspend)
101 ++ genphy_suspend(phydev);
102 ++ else if (do_resume)
103 ++ genphy_resume(phydev);
104 +
105 + if (err < 0)
106 + phy_error(phydev);