mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 10:01:25 +00:00
net phy: Check for aneg completion before setting state to PHY_RUNNING
phy_state_machine should check whether auto-negotiatin is completed before changing phydev->state from PHY_NOLINK to PHY_RUNNING. If auto-negotiation is not completed phydev->state should be set to PHY_AN. Signed-off-by: Balakumaran Kannan <kumaran.4353@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
22041fb05b
commit
e46e08b843
1 changed files with 11 additions and 0 deletions
|
@ -765,6 +765,17 @@ void phy_state_machine(struct work_struct *work)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (phydev->link) {
|
if (phydev->link) {
|
||||||
|
if (AUTONEG_ENABLE == phydev->autoneg) {
|
||||||
|
err = phy_aneg_done(phydev);
|
||||||
|
if (err < 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (!err) {
|
||||||
|
phydev->state = PHY_AN;
|
||||||
|
phydev->link_timeout = PHY_AN_TIMEOUT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
phydev->state = PHY_RUNNING;
|
phydev->state = PHY_RUNNING;
|
||||||
netif_carrier_on(phydev->attached_dev);
|
netif_carrier_on(phydev->attached_dev);
|
||||||
phydev->adjust_link(phydev->attached_dev);
|
phydev->adjust_link(phydev->attached_dev);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue