diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/phy.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 61755cbd978e..eda94fcd4065 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -928,13 +928,32 @@ static void phy_state_machine(struct work_struct *work) | |||
928 | * Otherwise, it's 0, and we're | 928 | * Otherwise, it's 0, and we're |
929 | * still waiting for AN */ | 929 | * still waiting for AN */ |
930 | if (err > 0) { | 930 | if (err > 0) { |
931 | phydev->state = PHY_RUNNING; | 931 | err = phy_read_status(phydev); |
932 | if (err) | ||
933 | break; | ||
934 | |||
935 | if (phydev->link) { | ||
936 | phydev->state = PHY_RUNNING; | ||
937 | netif_carrier_on(phydev->attached_dev); | ||
938 | } else | ||
939 | phydev->state = PHY_NOLINK; | ||
940 | phydev->adjust_link(phydev->attached_dev); | ||
932 | } else { | 941 | } else { |
933 | phydev->state = PHY_AN; | 942 | phydev->state = PHY_AN; |
934 | phydev->link_timeout = PHY_AN_TIMEOUT; | 943 | phydev->link_timeout = PHY_AN_TIMEOUT; |
935 | } | 944 | } |
936 | } else | 945 | } else { |
937 | phydev->state = PHY_RUNNING; | 946 | err = phy_read_status(phydev); |
947 | if (err) | ||
948 | break; | ||
949 | |||
950 | if (phydev->link) { | ||
951 | phydev->state = PHY_RUNNING; | ||
952 | netif_carrier_on(phydev->attached_dev); | ||
953 | } else | ||
954 | phydev->state = PHY_NOLINK; | ||
955 | phydev->adjust_link(phydev->attached_dev); | ||
956 | } | ||
938 | break; | 957 | break; |
939 | } | 958 | } |
940 | 959 | ||