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 v2 1/7] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management
Date: Sat, 8 Mar 2025 14:51:55 +0100 [thread overview]
Message-ID: <20250308145155.12c437c5@fedora.home> (raw)
In-Reply-To: <20250307182432.1976273-2-o.rempel@pengutronix.de>
Hi Oleksij,
On Fri, 7 Mar 2025 19:24:26 +0100
Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> Convert the LAN78xx driver to use the PHYlink framework for managing
> PHY and MAC interactions.
>
> Key changes include:
> - Replace direct PHY operations with phylink equivalents (e.g.,
> phylink_start, phylink_stop).
> - Introduce lan78xx_phylink_setup for phylink initialization and
> configuration.
> - Add phylink MAC operations (lan78xx_mac_config,
> lan78xx_mac_link_down, lan78xx_mac_link_up) for managing link
> settings and flow control.
> - Remove redundant and now phylink-managed functions like
> `lan78xx_link_status_change`.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
I only have a small comment, the rest looks OK (at least to me) :
> +static int lan78xx_phylink_setup(struct lan78xx_net *dev)
> +{
> + phy_interface_t link_interface;
> + struct phylink *phylink;
> +
> + dev->phylink_config.dev = &dev->net->dev;
> + dev->phylink_config.type = PHYLINK_NETDEV;
> + dev->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
> + MAC_10 | MAC_100 | MAC_1000FD;
> + dev->phylink_config.mac_managed_pm = true;
> +
> + if (dev->chipid == ID_REV_CHIP_ID_7801_) {
> + __set_bit(PHY_INTERFACE_MODE_RGMII,
> + dev->phylink_config.supported_interfaces);
> + __set_bit(PHY_INTERFACE_MODE_RGMII_ID,
> + dev->phylink_config.supported_interfaces);
> + __set_bit(PHY_INTERFACE_MODE_RGMII_RXID,
> + dev->phylink_config.supported_interfaces);
> + __set_bit(PHY_INTERFACE_MODE_RGMII_TXID,
> + dev->phylink_config.supported_interfaces);
You can use :
phy_interface_set_rgmii(dev->phylink_config.supported_interfaces);
instead of setting all indivdual RGMII modes :)
> + link_interface = PHY_INTERFACE_MODE_RGMII_ID;
> + } else {
> + __set_bit(PHY_INTERFACE_MODE_INTERNAL,
> + dev->phylink_config.supported_interfaces);
> + link_interface = PHY_INTERFACE_MODE_INTERNAL;
> + }
> +
> + phylink = phylink_create(&dev->phylink_config, dev->net->dev.fwnode,
> + link_interface, &lan78xx_phylink_mac_ops);
> + if (IS_ERR(phylink))
> + return PTR_ERR(phylink);
> +
> + dev->phylink = phylink;
> +
> + return 0;
> +}
> +
Maxime
next prev parent reply other threads:[~2025-03-08 13:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 18:24 [PATCH net-next v2 0/7] Convert LAN78xx to PHYLINK Oleksij Rempel
2025-03-07 18:24 ` [PATCH net-next v2 1/7] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management Oleksij Rempel
2025-03-08 13:51 ` Maxime Chevallier [this message]
2025-03-10 9:29 ` Thangaraj.S
2025-03-10 9:58 ` Oleksij Rempel
2025-03-10 10:11 ` Russell King (Oracle)
2025-03-10 10:16 ` Oleksij Rempel
2025-03-10 10:23 ` Russell King (Oracle)
2025-03-07 18:24 ` [PATCH net-next v2 2/7] net: usb: lan78xx: Move fixed PHY cleanup to lan78xx_unbind() Oleksij Rempel
2025-03-08 13:54 ` Maxime Chevallier
2025-03-07 18:24 ` [PATCH net-next v2 3/7] net: usb: lan78xx: Improve error handling for PHY init path Oleksij Rempel
2025-03-07 18:24 ` [PATCH net-next v2 4/7] net: usb: lan78xx: Use ethtool_op_get_link to reflect current link status Oleksij Rempel
2025-03-07 18:24 ` [PATCH net-next v2 5/7] net: usb: lan78xx: port link settings to phylink API Oleksij Rempel
2025-03-07 18:24 ` [PATCH net-next v2 6/7] net: usb: lan78xx: Transition get/set_pause to phylink Oleksij Rempel
2025-03-07 18:24 ` [PATCH net-next v2 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=20250308145155.12c437c5@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).