net: dsa: allow DSA switch drivers to provide their own phylink mac ops
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 10 Apr 2024 19:42:43 +0000 (20:42 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Apr 2024 03:01:14 +0000 (20:01 -0700)
commitcae425cb43feddd9fd62fc1b25567f9463da4915
tree7643586e81d8d0f28eca234df0cae6bb8b7aebb6
parentdd0c9855b41310470086500c9963bbb64bb90dd0
net: dsa: allow DSA switch drivers to provide their own phylink mac ops

Rather than having a shim for each and every phylink MAC operation,
allow DSA switch drivers to provide their own ops structure. When a
DSA driver provides the phylink MAC operations, the shimmed ops must
not be provided, so fail an attempt to register a switch with both
the phylink_mac_ops in struct dsa_switch and the phylink_mac_*
operations populated in dsa_switch_ops populated.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/E1rudqF-006K9H-Cc@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/dsa.h
net/dsa/dsa.c
net/dsa/port.c