[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ee46449f-0537-1e08-a959-f152814e96da@gmail.com>
Date: Mon, 3 Sep 2018 10:49:44 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Andrew Lunn <andrew@...n.ch>, David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>, maxime.chevallier@...tlin.com
Subject: Re: [PATCH net-next 11/12] net: ethernet: Add helper for
set_pauseparam for Pause
On 9/2/2018 10:06 AM, Andrew Lunn wrote:
> ethtool can be used to enable/disable pause. Add a helper to configure
> the PHY when Pause is supported.
One comment, see below:
[snip]
> +/**
> + * phy_set_pause - Configure Pause
> + * @phydev: target phy_device struct
> + * @rx: Receiver Pause is supported
> + * @autoneg: Auto neg should be used
> + *
> + * Description: Configure advertised Pause support depending on if
> + * receiver pause and pause auto neg is supported. Generally called
> + * from the set_pauseparam .ndo.
> + */
> +void phy_set_pause(struct phy_device *phydev, bool rx, bool autoneg)
> +{
> + phydev->supported &= ~SUPPORTED_Pause;
> +
> + if (rx || autoneg)
> + phydev->supported |= SUPPORTED_Pause;
> +
> + phydev->advertising = phydev->supported;
This is the logic from FEC, but I think the one from bcm63xx_enet.c is
actually the correct one, you can enable symmetric pause support if it
is enabled for both the RX and TX paths here.
Similar comment to patch 9, I would name this phy_set_sym_pause() for
clarity.
--
Florian
Powered by blists - more mailing lists