net: ethernet: Add helper for set_pauseparam for Pause
ethtool can be used to enable/disable pause. Add a helper to configure the PHY when Pause is supported. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
70814e819c
commit
0c122405d4
@@ -2229,13 +2229,8 @@ static int fec_enet_set_pauseparam(struct net_device *ndev,
|
||||
fep->pause_flag |= pause->rx_pause ? FEC_PAUSE_FLAG_ENABLE : 0;
|
||||
fep->pause_flag |= pause->autoneg ? FEC_PAUSE_FLAG_AUTONEG : 0;
|
||||
|
||||
if (pause->rx_pause || pause->autoneg) {
|
||||
ndev->phydev->supported |= ADVERTISED_Pause;
|
||||
ndev->phydev->advertising |= ADVERTISED_Pause;
|
||||
} else {
|
||||
ndev->phydev->supported &= ~ADVERTISED_Pause;
|
||||
ndev->phydev->advertising &= ~ADVERTISED_Pause;
|
||||
}
|
||||
phy_set_sym_pause(ndev->phydev, pause->rx_pause, pause->tx_pause,
|
||||
pause->autoneg);
|
||||
|
||||
if (pause->autoneg) {
|
||||
if (netif_running(ndev))
|
||||
|
Reference in New Issue
Block a user