All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Woojung Huh <woojung.huh@microchip.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Thangaraj Samynathan <Thangaraj.S@microchip.com>,
	Rengarajan Sundararajan <Rengarajan.S@microchip.com>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, UNGLinuxDriver@microchip.com,
	Phil Elwell <phil@raspberrypi.org>
Subject: Re: [PATCH net-next v3 6/7] net: usb: lan78xx: Transition get/set_pause to phylink
Date: Tue, 11 Mar 2025 18:31:01 +0100	[thread overview]
Message-ID: <20250311183101.5192c3df@fedora.home> (raw)
In-Reply-To: <20250310115737.784047-7-o.rempel@pengutronix.de>

Hi Oleksij,

On Mon, 10 Mar 2025 12:57:36 +0100
Oleksij Rempel <o.rempel@pengutronix.de> wrote:

> Replace lan78xx_get_pause and lan78xx_set_pause implementations with
> phylink-based functions. This transition aligns pause parameter handling
> with the phylink API, simplifying the code and improving
> maintainability.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---

Some very minor things below :

>  drivers/net/usb/lan78xx.c | 51 ++-------------------------------------
>  1 file changed, 2 insertions(+), 49 deletions(-)
> 
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index 7107eaa440e5..3aa916a9ee0b 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -1878,63 +1878,16 @@ static void lan78xx_get_pause(struct net_device *net,
>  			      struct ethtool_pauseparam *pause)
>  {
>  	struct lan78xx_net *dev = netdev_priv(net);
> -	struct phy_device *phydev = net->phydev;
> -	struct ethtool_link_ksettings ecmd;
> -
> -	phy_ethtool_ksettings_get(phydev, &ecmd);
> -
> -	pause->autoneg = dev->fc_autoneg;
>  
> -	if (dev->fc_request_control & FLOW_CTRL_TX)
> -		pause->tx_pause = 1;
> -
> -	if (dev->fc_request_control & FLOW_CTRL_RX)
> -		pause->rx_pause = 1;
> +	phylink_ethtool_get_pauseparam(dev->phylink, pause);
>  }
>  
>  static int lan78xx_set_pause(struct net_device *net,
>  			     struct ethtool_pauseparam *pause)
>  {
>  	struct lan78xx_net *dev = netdev_priv(net);
> -	struct phy_device *phydev = net->phydev;
> -	struct ethtool_link_ksettings ecmd;
> -	int ret;
> -
> -	phy_ethtool_ksettings_get(phydev, &ecmd);
> -
> -	if (pause->autoneg && !ecmd.base.autoneg) {
> -		ret = -EINVAL;
> -		goto exit;
> -	}
>  
> -	dev->fc_request_control = 0;
> -	if (pause->rx_pause)
> -		dev->fc_request_control |= FLOW_CTRL_RX;
> -
> -	if (pause->tx_pause)
> -		dev->fc_request_control |= FLOW_CTRL_TX;

Sorry not to have spotted that before, but after that patch you no
longer need dev->fc_request_control, you can get rid of that in
struct lan78xx_net.

Related to other patches (probably patch 1), it also appears you can get
rid of :
 - dev->fc_autoneg
 - dev->interface
 - dev->link_on

Thanks,

Maxime

  reply	other threads:[~2025-03-11 17:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 11:57 [PATCH net-next v3 0/7] Convert LAN78xx to PHYLINK Oleksij Rempel
2025-03-10 11:57 ` [PATCH net-next v3 1/7] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management Oleksij Rempel
2025-03-15  3:48   ` kernel test robot
2025-03-17 15:36   ` Simon Horman
2025-03-18  5:07     ` Oleksij Rempel
2025-03-10 11:57 ` [PATCH net-next v3 2/7] net: usb: lan78xx: improve error reporting on PHY attach failure Oleksij Rempel
2025-03-10 11:57 ` [PATCH net-next v3 3/7] net: usb: lan78xx: Improve error handling for PHY init path Oleksij Rempel
2025-03-10 11:57 ` [PATCH net-next v3 4/7] net: usb: lan78xx: Use ethtool_op_get_link to reflect current link status Oleksij Rempel
2025-03-11 17:04   ` Maxime Chevallier
2025-03-10 11:57 ` [PATCH net-next v3 5/7] net: usb: lan78xx: port link settings to phylink API Oleksij Rempel
2025-03-11 17:11   ` Maxime Chevallier
2025-03-15  7:16   ` kernel test robot
2025-03-10 11:57 ` [PATCH net-next v3 6/7] net: usb: lan78xx: Transition get/set_pause to phylink Oleksij Rempel
2025-03-11 17:31   ` Maxime Chevallier [this message]
2025-03-15 10:58   ` kernel test robot
2025-03-10 11:57 ` [PATCH net-next v3 7/7] net: usb: lan78xx: Integrate EEE support with phylink LPI API Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250311183101.5192c3df@fedora.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=Rengarajan.S@microchip.com \
    --cc=Thangaraj.S@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=phil@raspberrypi.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.