net: phylink: add PCS negotiation mode
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 16 Jun 2023 12:06:22 +0000 (13:06 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Jun 2023 02:41:01 +0000 (19:41 -0700)
commitf99d471afa03f770149f1cc60a288b9a08285903
tree5daac3af0aafab43da76ae96b0acc9bc08475812
parent84ef94d9421d39b9148f2f4fd4cca2888deb6103
net: phylink: add PCS negotiation mode

PCS have to work out whether they should enable PCS negotiation by
looking at the "mode" and "interface" arguments, and the Autoneg bit
in the advertising mask.

This leads to some complex logic, so lets pull that out into phylink
and instead pass a "neg_mode" argument to the PCS configuration and
link up methods, instead of the "mode" argument.

In order to transition drivers, add a "neg_mode" flag to the phylink
PCS structure to PCS can indicate whether they want to be passed the
neg_mode or the old mode argument.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1qA8De-00EaFA-Ht@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phylink.c
include/linux/phylink.h