From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
Woojung Huh <woojung.huh@microchip.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
UNGLinuxDriver@microchip.com
Subject: [PATCH net-next 0/4] net: dsa: microchip: use phylink_mac_ops for ksz driver
Date: Fri, 26 Apr 2024 17:02:05 +0100 [thread overview]
Message-ID: <ZivP/R1IwKEPb5T6@shell.armlinux.org.uk> (raw)
Hi,
This four patch series switches the Microchip KSZ DSA driver to use
phylink_mac_ops support, and for this one we go a little further
beyond a simple conversion. This driver has four distinct cases:
lan937x
ksz9477
ksz8
ksz8830
Three of these cases are handled by shimming the existing DSA calls
through ksz_dev_ops, and the final case is handled through a
conditional in ksz_phylink_mac_config(). These can all be handled
with separate phylink_mac_ops.
To get there, we do a progressive conversion.
Patch 1 removes ksz_dev_ops' phylink_mac_config() method which is
not populated in any of the arrays - and is thus redundant.
Patch 2 switches the driver to use a common set of phylink_mac_ops
for all cases, doing the simple conversion to avoid the DSA shim.
Patch 3 pushes the phylink_mac_ops down to the first three classes
(lan937x, ksz9477, ksz8) adding an appropriate pointer to the
phylink_mac_ops to struct ksz_chip_data, and using that to
populate DSA's ds->phylink_mac_ops pointer. The difference between
each of these are the mac_link_up() method. mac_config() and
mac_link_down() remain common between each at this stage.
Patch 4 splits out ksz8830, which needs different mac_config()
handling, and thus means we have a difference in mac_config()
methods between the now four phylink_mac_ops structures.
Build tested only, with additional -Wunused-const-variable flag.
drivers/net/dsa/microchip/ksz8.h | 6 +-
drivers/net/dsa/microchip/ksz8795.c | 10 ++-
drivers/net/dsa/microchip/ksz_common.c | 121 ++++++++++++++++++++++-----------
drivers/net/dsa/microchip/ksz_common.h | 5 +-
4 files changed, 94 insertions(+), 48 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next reply other threads:[~2024-04-26 16:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 16:02 Russell King (Oracle) [this message]
2024-04-26 16:07 ` [PATCH net-next 1/4] net: dsa: ksz_common: remove phylink_mac_config from ksz_dev_ops Russell King (Oracle)
2024-04-26 18:28 ` Florian Fainelli
2024-04-26 16:08 ` [PATCH net-next 2/4] net: dsa: ksz_common: provide own phylink MAC operations Russell King (Oracle)
2024-04-26 18:28 ` Florian Fainelli
2024-04-26 16:08 ` [PATCH net-next 3/4] net: dsa: ksz_common: sub-driver phylink ops Russell King (Oracle)
2024-04-26 16:08 ` [PATCH net-next 4/4] net: dsa: ksz_common: use separate phylink_mac_ops for ksz8830 Russell King (Oracle)
2024-04-30 2:20 ` [PATCH net-next 0/4] net: dsa: microchip: use phylink_mac_ops for ksz driver patchwork-bot+netdevbpf
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=ZivP/R1IwKEPb5T6@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--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).