diff options
author | Andrew Lunn <andrew@lunn.ch> | 2018-09-12 02:53:17 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-13 06:24:21 +0300 |
commit | 70814e819c1139e5e7faacb3700eab5eac559272 (patch) | |
tree | ace5dc192ed3e22e719f148d531c6d01345a7858 /drivers/net/ethernet/faraday | |
parent | c306ad36184fb7d0bd53f45441f45c1810e88a53 (diff) | |
download | linux-70814e819c1139e5e7faacb3700eab5eac559272.tar.xz |
net: ethernet: Add helper for set_pauseparam for Asym Pause
ethtool can be used to enable/disable pause. Add a helper to configure
the PHY when asym 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>
Diffstat (limited to 'drivers/net/ethernet/faraday')
-rw-r--r-- | drivers/net/ethernet/faraday/ftgmac100.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 3f319ee66ab4..d8ead7e4177e 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1219,22 +1219,11 @@ static int ftgmac100_set_pauseparam(struct net_device *netdev, priv->tx_pause = pause->tx_pause; priv->rx_pause = pause->rx_pause; - if (phydev) { - phydev->advertising &= ~ADVERTISED_Pause; - phydev->advertising &= ~ADVERTISED_Asym_Pause; + if (phydev) + phy_set_asym_pause(phydev, pause->rx_pause, pause->tx_pause); - if (pause->rx_pause) { - phydev->advertising |= ADVERTISED_Pause; - phydev->advertising |= ADVERTISED_Asym_Pause; - } - - if (pause->tx_pause) - phydev->advertising ^= ADVERTISED_Asym_Pause; - } if (netif_running(netdev)) { - if (phydev && priv->aneg_pause) - phy_start_aneg(phydev); - else + if (!(phydev && priv->aneg_pause)) ftgmac100_config_pause(priv); } |