1 From 1da223db3a0c522300b519ecbe1dc45927e28088 Mon Sep 17 00:00:00 2001
2 From: Andrew Lunn <andrew@lunn.ch>
3 Date: Wed, 12 Sep 2018 01:53:15 +0200
4 Subject: [PATCH 600/660] net: ethernet: Add helper for MACs which support asym
7 Rather than have the MAC drivers manipulate phydev members to indicate
8 they support Asym Pause, add a helper function.
10 Signed-off-by: Andrew Lunn <andrew@lunn.ch>
11 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
14 drivers/net/phy/phy_device.c | 13 +++++++++++++
15 include/linux/phy.h | 1 +
16 2 files changed, 14 insertions(+)
18 --- a/drivers/net/phy/phy_device.c
19 +++ b/drivers/net/phy/phy_device.c
20 @@ -1781,6 +1781,19 @@ int phy_set_max_speed(struct phy_device
22 EXPORT_SYMBOL(phy_set_max_speed);
25 + * phy_support_asym_pause - Enable support of asym pause
26 + * @phydev: target phy_device struct
28 + * Description: Called by the MAC to indicate is supports Asym Pause.
30 +void phy_support_asym_pause(struct phy_device *phydev)
32 + phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
33 + phydev->advertising = phydev->supported;
35 +EXPORT_SYMBOL(phy_support_asym_pause);
37 static void of_set_phy_supported(struct phy_device *phydev)
39 struct device_node *node = phydev->mdio.dev.of_node;
40 --- a/include/linux/phy.h
41 +++ b/include/linux/phy.h
42 @@ -1051,6 +1051,7 @@ int phy_mii_ioctl(struct phy_device *phy
43 int phy_start_interrupts(struct phy_device *phydev);
44 void phy_print_status(struct phy_device *phydev);
45 int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
46 +void phy_support_asym_pause(struct phy_device *phydev);
48 int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
49 int (*run)(struct phy_device *));