diff options
Diffstat (limited to 'drivers/net/phy/phylink.c')
| -rw-r--r-- | drivers/net/phy/phylink.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 89750c7dfd6f..74983593834b 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c | |||
| @@ -422,28 +422,21 @@ static void phylink_resolve(struct work_struct *w) | |||
| 422 | 422 | ||
| 423 | case MLO_AN_INBAND: | 423 | case MLO_AN_INBAND: |
| 424 | phylink_get_mac_state(pl, &link_state); | 424 | phylink_get_mac_state(pl, &link_state); |
| 425 | if (pl->phydev) { | 425 | |
| 426 | bool changed = false; | 426 | /* If we have a phy, the "up" state is the union of |
| 427 | 427 | * both the PHY and the MAC */ | |
| 428 | link_state.link = link_state.link && | 428 | if (pl->phydev) |
| 429 | pl->phy_state.link; | 429 | link_state.link &= pl->phy_state.link; |
| 430 | 430 | ||
| 431 | if (pl->phy_state.interface != | 431 | /* Only update if the PHY link is up */ |
| 432 | link_state.interface) { | 432 | if (pl->phydev && pl->phy_state.link) { |
| 433 | link_state.interface = pl->phy_state.interface; | 433 | link_state.interface = pl->phy_state.interface; |
| 434 | changed = true; | 434 | |
| 435 | } | 435 | /* If we have a PHY, we need to update with |
| 436 | 436 | * the pause mode bits. */ | |
| 437 | /* Propagate the flow control from the PHY | 437 | link_state.pause |= pl->phy_state.pause; |
| 438 | * to the MAC. Also propagate the interface | 438 | phylink_resolve_flow(pl, &link_state); |
| 439 | * if changed. | 439 | phylink_mac_config(pl, &link_state); |
| 440 | */ | ||
| 441 | if (pl->phy_state.link || changed) { | ||
| 442 | link_state.pause |= pl->phy_state.pause; | ||
| 443 | phylink_resolve_flow(pl, &link_state); | ||
| 444 | |||
| 445 | phylink_mac_config(pl, &link_state); | ||
| 446 | } | ||
| 447 | } | 440 | } |
| 448 | break; | 441 | break; |
| 449 | } | 442 | } |
