diff options
author | Andrew Lunn <andrew@lunn.ch> | 2018-09-12 02:53:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-13 06:24:21 +0300 |
commit | 22b7d29926b577ff4f480611380d03268545b787 (patch) | |
tree | 6b25af156504351518b1e7bbab8e39ff1fe3de00 /drivers/net/ethernet/freescale/gianfar_ethtool.c | |
parent | 0c122405d4c3ec638ba00865c872ec5a3ed1a6c0 (diff) | |
download | linux-22b7d29926b577ff4f480611380d03268545b787.tar.xz |
net: ethernet: Add helper to determine if pause configuration is supported
Rather than have MAC drivers open code the test, add a helper in
phylib. This will help when we change the type of phydev->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/freescale/gianfar_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar_ethtool.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 3545e8f715f2..d3662965f59d 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -507,9 +507,7 @@ static int gfar_spauseparam(struct net_device *dev, if (!phydev) return -ENODEV; - if (!(phydev->supported & SUPPORTED_Pause) || - (!(phydev->supported & SUPPORTED_Asym_Pause) && - (epause->rx_pause != epause->tx_pause))) + if (!phy_validate_pause(phydev, epause)) return -EINVAL; priv->rx_pause_en = priv->tx_pause_en = 0; |