[PATCH RFC net-next 00/12] Allow DSA drivers to set all phylink capabilities

Russell King (Oracle)
2021-11-24T17:46:18Z

Hi,

During the last cycle, I introduced a phylink_get_interfaces() method
for DSA drivers to be able to fill out the supported_interfaces member
of phylink_config. However, further phylink development allowing the
validation hook to be greatly simplified became possible when a bitmask
of MAC capabilities is used along with the supported_interfaces bitmap.

In order to allow DSA drivers to fill out both fields, we either need
to add another method, or change the existing method. As there are no
users of the phylink_get_interfaces() yet, let's take the latter
approach, and pass the phylink_config structure to the DSA driver, so
that it can set both fields. (patch 3)

We also add the capability for DSA drivers to transition to using the
phylink_generic_validate() functionality by filling out the phylink
mac_capabilities field, and removing their .phylink_validate method.
(patch 2)

This series also contains an initial patch that consolidates the logic
in DSA around the call to phylink_create(), meaning that there becomes
a single site which issues the new call, rather than two. (patch 1)

The overall effect will be that, once this series has been applied, it
becomes possible to start eliminating the phylink validation
implementations scattered throughout the DSA drivers. Patches to do
this will follow once this series is merged.

I am including nine DSA drivers that were relatively simple to convert
in this series. The more complex ones will follow later. Please note
that none of these DSA drivers have been tested beyond a build-test,
so should be checked by the DSA switch driver maintainers.

include/net/dsa.h | 4 ++--
net/dsa/dsa_priv.h | 2 +-
net/dsa/port.c | 48 +++++++++++++++++++++++++++++++-----------------
net/dsa/slave.c | 19 +++----------------
4 files changed, 37 insertions(+), 36 deletions(-)

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!