summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-09-12 02:53:16 +0300
committerDavid S. Miller <davem@davemloft.net>2018-09-13 06:24:21 +0300
commitc306ad36184fb7d0bd53f45441f45c1810e88a53 (patch)
tree4f7f276b7e8f4cf4ea1da7df63bdff78d117aee5 /drivers/net/phy/phy_device.c
parentaf8d9bb2f2f405ad541794b46f9d7bc70f13e5cb (diff)
downloadlinux-c306ad36184fb7d0bd53f45441f45c1810e88a53.tar.xz
net: ethernet: Add helper for MACs which support pause
Rather than have the MAC drivers manipulate phydev members, add a helper function for MACs supporting Pause, but not Asym Pause. 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/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index a0646a66f005..e657d5ae2ab8 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1784,6 +1784,20 @@ void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode)
EXPORT_SYMBOL(phy_remove_link_mode);
/**
+ * phy_support_sym_pause - Enable support of symmetrical pause
+ * @phydev: target phy_device struct
+ *
+ * Description: Called by the MAC to indicate is supports symmetrical
+ * Pause, but not asym pause.
+ */
+void phy_support_sym_pause(struct phy_device *phydev)
+{
+ phydev->supported |= SUPPORTED_Pause;
+ phydev->advertising = phydev->supported;
+}
+EXPORT_SYMBOL(phy_support_sym_pause);
+
+/**
* phy_support_asym_pause - Enable support of asym pause
* @phydev: target phy_device struct
*