Commit af006240 authored by Russell King's avatar Russell King Committed by David S. Miller

net: phy: use phy_resolve_aneg_pause()

Several drivers code their own version of this, working from the LPA
register, after setting the ethtool link partner advertisement bitmask.
Use the generic function instead.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c48f16b4
...@@ -190,10 +190,7 @@ static int lxt973a2_read_status(struct phy_device *phydev) ...@@ -190,10 +190,7 @@ static int lxt973a2_read_status(struct phy_device *phydev)
phydev->duplex = DUPLEX_FULL; phydev->duplex = DUPLEX_FULL;
} }
if (phydev->duplex == DUPLEX_FULL) { phy_resolve_aneg_pause(phydev);
phydev->pause = lpa & LPA_PAUSE_CAP ? 1 : 0;
phydev->asym_pause = lpa & LPA_PAUSE_ASYM ? 1 : 0;
}
} else { } else {
int bmcr = phy_read(phydev, MII_BMCR); int bmcr = phy_read(phydev, MII_BMCR);
......
...@@ -1384,10 +1384,7 @@ static int marvell_read_status_page_an(struct phy_device *phydev, ...@@ -1384,10 +1384,7 @@ static int marvell_read_status_page_an(struct phy_device *phydev,
mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising, lpa); mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising, lpa);
mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, lpagb); mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, lpagb);
if (phydev->duplex == DUPLEX_FULL) { phy_resolve_aneg_pause(phydev);
phydev->pause = lpa & LPA_PAUSE_CAP ? 1 : 0;
phydev->asym_pause = lpa & LPA_PAUSE_ASYM ? 1 : 0;
}
} else { } else {
/* The fiber link is only 1000M capable */ /* The fiber link is only 1000M capable */
fiber_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, lpa); fiber_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, lpa);
......
...@@ -68,12 +68,7 @@ static int upd60620_read_status(struct phy_device *phydev) ...@@ -68,12 +68,7 @@ static int upd60620_read_status(struct phy_device *phydev)
mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising, mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising,
phy_state); phy_state);
if (phydev->duplex == DUPLEX_FULL) { phy_resolve_aneg_pause(phydev);
if (phy_state & LPA_PAUSE_CAP)
phydev->pause = 1;
if (phy_state & LPA_PAUSE_ASYM)
phydev->asym_pause = 1;
}
} }
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment