[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190429215254.GG12333@lunn.ch>
Date: Mon, 29 Apr 2019 23:52:54 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Florian Fainelli <f.fainelli@...il.com>,
David Miller <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 2/2] net: phy: improve phy_set_sym_pause and
phy_set_asym_pause
> @@ -2078,6 +2089,11 @@ EXPORT_SYMBOL(phy_set_sym_pause);
> void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx)
> {
> __ETHTOOL_DECLARE_LINK_MODE_MASK(oldadv);
> + bool asym_pause_supported;
> +
> + asym_pause_supported =
> + linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> + phydev->supported);
>
> linkmode_copy(oldadv, phydev->advertising);
>
> @@ -2086,14 +2102,14 @@ void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx)
> linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> phydev->advertising);
>
> - if (rx) {
> + if (rx && asym_pause_supported) {
> linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT,
> phydev->advertising);
> linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> phydev->advertising);
> }
>
> - if (tx)
> + if (tx && asym_pause_supported)
> linkmode_change_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> phydev->advertising);
Hi Heiner
If the PHY only supports Pause, not Asym Pause, i wounder if we should
fall back to Pause here?
Andrew
Powered by blists - more mailing lists