net: ethernet: Add helper for MACs which support asym pause

Rather than have the MAC drivers manipulate phydev members to indicate
they support Asym Pause, add a helper function.

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:
Andrew Lunn
2018-09-12 01:53:15 +02:00
committed by David S. Miller
parent 41124fa64d
commit af8d9bb2f2
17 changed files with 33 additions and 43 deletions

View File

@@ -1783,6 +1783,19 @@ void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode)
}
EXPORT_SYMBOL(phy_remove_link_mode);
/**
* phy_support_asym_pause - Enable support of asym pause
* @phydev: target phy_device struct
*
* Description: Called by the MAC to indicate is supports Asym Pause.
*/
void phy_support_asym_pause(struct phy_device *phydev)
{
phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
phydev->advertising = phydev->supported;
}
EXPORT_SYMBOL(phy_support_asym_pause);
static void of_set_phy_supported(struct phy_device *phydev)
{
struct device_node *node = phydev->mdio.dev.of_node;