2 +++ b/openwrt/target/linux/
generic/patches-3.10/072-net-phy-Check-
for-aneg-completion-before-setting-sta.patch
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
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
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>
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
25 ++ if (AUTONEG_ENABLE == phydev->autoneg) {
26 ++ err = phy_aneg_done(phydev);
31 ++ phydev->state = PHY_AN;
32 ++ phydev->link_timeout = PHY_AN_TIMEOUT;
36 + phydev->state = PHY_RUNNING;
37 + netif_carrier_on(phydev->attached_dev);
38 + phydev->adjust_link(phydev->attached_dev);
40 +++ b/openwrt/target/linux/
generic/patches-3.10/073-net-phy-resume-phydev-when-going-to-RESUMING.patch
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;
52 + mutex_lock(&phydev->lock);
53 +@@ -758,7 +758,7 @@
void phy_state_machine(
struct work_struc
60 + phydev->link_timeout = PHY_AN_TIMEOUT;
62 +@@ -791,7 +791,7 @@
void phy_state_machine(
struct work_struc
63 + phydev->adjust_link(phydev->attached_dev);
65 + }
else if (0 == phydev->link_timeout--) {
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);
74 +
if (0 == phydev->link_timeout--)
79 + phydev->adjust_link(phydev->attached_dev);
80 +@@ -868,6 +868,7 @@
void phy_state_machine(
struct work_struc
82 + netif_carrier_off(phydev->attached_dev);
83 + phydev->adjust_link(phydev->attached_dev);
88 +@@ -918,6 +919,7 @@
void phy_state_machine(
struct work_struc
89 + phydev->state = PHY_NOLINK;
90 + phydev->adjust_link(phydev->attached_dev);
96 +@@ -925,6 +927,10 @@
void phy_state_machine(
struct work_struc
99 + err = phy_start_aneg(phydev);
100 ++
else if (do_suspend)
101 ++ genphy_suspend(phydev);
102 ++
else if (do_resume)
103 ++ genphy_resume(phydev);