linux/drivers/net/phy
Russell King (Oracle) 7a1f9a17ee net: phylink: use the PHY's possible_interfaces if populated
Some PHYs such as Aquantia, Broadcom 84881, and Marvell 88X33x0 can
switch between a set of interface types depending on the negotiated
media speed, or can use rate adaption for some or all of these
interface types.

We currently assume that these are Clause 45 PHYs that are configured
not to use a specific set of interface modes, which has worked so far,
but is just a work-around. In this workaround, we validate using all
interfaces that the MAC supports, which can lead to extra modes being
advertised that can not be supported.

To properly address this, switch to using the newly introduced PHY
possible_interfaces bitmap which indicates which interface modes will
be used by the PHY as configured. We calculate the union of the PHY's
possible interfaces and MACs supported interfaces, checking that is
non-empty. If the PHY is on a SFP, we further reduce the set by those
which can be used on a SFP module, again checking that is non-empty.
Finally, we validate the subset of interfaces, taking account of
whether rate matching will be used for each individual interface mode.

This becomes independent of whether the PHY is clause 22 or clause 45.

It is encouraged that all PHYs that switch interface modes or use
rate matching should populate phydev->possible_interfaces.

Tested-by: Luo Jie <quic_luoj@quicinc.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/E1r6VIV-00DDMF-Pi@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-27 18:04:12 -08:00
..
aquantia net: phy: aquantia: fill in possible_interfaces for AQR113C 2023-11-27 18:04:12 -08:00
mscc net: partial revert of the "Make timestamping selectable: series 2023-11-18 18:42:37 -08:00
Kconfig net: phy: aquantia: move to separate directory 2023-11-16 22:10:29 +00:00
Makefile net: phy: aquantia: move to separate directory 2023-11-16 22:10:29 +00:00
adin.c
adin1100.c
amd.c
at803x.c
ax88796b.c
bcm-cygnus.c
bcm-phy-lib.c
bcm-phy-lib.h
bcm-phy-ptp.c net: partial revert of the "Make timestamping selectable: series 2023-11-18 18:42:37 -08:00
bcm7xxx.c
bcm63xx.c
bcm87xx.c net: phy: fill in missing MODULE_DESCRIPTION()s 2023-11-01 21:50:56 -07:00
bcm54140.c
bcm84881.c net: phy: bcm84881: fill in possible_interfaces 2023-11-27 18:04:12 -08:00
broadcom.c net: phy: broadcom: Wire suspend/resume for BCM54612E 2023-11-17 02:45:47 +00:00
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83td510.c
dp83640.c net: partial revert of the "Make timestamping selectable: series 2023-11-18 18:42:37 -08:00
dp83640_reg.h
dp83822.c
dp83848.c
dp83867.c
dp83869.c
et1011c.c
fixed_phy.c
icplus.c
intel-xway.c
linkmode.c
lxt.c
marvell-88q2xxx.c
marvell-88x2222.c
marvell.c
marvell10g.c net: phy: marvell10g: fill in possible_interfaces 2023-11-27 18:04:11 -08:00
mdio-boardinfo.c
mdio-boardinfo.h
mdio-open-alliance.h
mdio_bus.c
mdio_device.c
mdio_devres.c
mediatek-ge-soc.c
mediatek-ge.c
meson-gxl.c
micrel.c net: partial revert of the "Make timestamping selectable: series 2023-11-18 18:42:37 -08:00
microchip.c
microchip_t1.c
microchip_t1s.c
mii_timestamper.c
motorcomm.c
mxl-gpy.c
national.c
ncn26000.c
nxp-c45-tja11xx.c net: partial revert of the "Make timestamping selectable: series 2023-11-18 18:42:37 -08:00
nxp-cbtx.c
nxp-tja11xx.c
phy-c45.c
phy-core.c
phy.c net: phy: Remove the call to phy_mii_ioctl in phy_hwstamp_get/set 2023-11-18 14:52:56 +00:00
phy_device.c net: phy: add possible interfaces 2023-11-27 18:04:11 -08:00
phy_led_triggers.c
phylink.c net: phylink: use the PHY's possible_interfaces if populated 2023-11-27 18:04:12 -08:00
qsemi.c
realtek.c
rockchip.c
sfp-bus.c net: sfp: use linkmode_*() rather than open coding 2023-11-16 23:45:04 +00:00
sfp.c net: sfp: rework the RollBall PHY waiting code 2023-11-25 19:17:28 +00:00
sfp.h
smsc.c
spi_ks8995.c
ste10Xp.c
stubs.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c