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>
这个提交包含在:
@@ -194,9 +194,7 @@ static int dpaa_set_pauseparam(struct net_device *net_dev,
|
||||
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;
|
||||
|
||||
/* The MAC should know how to handle PAUSE frame autonegotiation before
|
||||
|
@@ -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;
|
||||
|
在新工单中引用
屏蔽一个用户