From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next 11/12] net: ethernet: Add helper for set_pauseparam for Pause Date: Mon, 3 Sep 2018 10:49:44 -0700 Message-ID: References: <1535908001-18593-1-git-send-email-andrew@lunn.ch> <1535908001-18593-12-git-send-email-andrew@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev , maxime.chevallier@bootlin.com To: Andrew Lunn , David Miller Return-path: Received: from mail-pg1-f194.google.com ([209.85.215.194]:35482 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727465AbeICWLI (ORCPT ); Mon, 3 Sep 2018 18:11:08 -0400 Received: by mail-pg1-f194.google.com with SMTP id 7-v6so469875pgf.2 for ; Mon, 03 Sep 2018 10:49:55 -0700 (PDT) In-Reply-To: <1535908001-18593-12-git-send-email-andrew@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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