]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: phy: Create a phy_port for PHY-driven SFPs
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Thu, 8 Jan 2026 08:00:31 +0000 (09:00 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 14 Jan 2026 02:52:34 +0000 (18:52 -0800)
commit07f3ca9e092cb881466da0d726431a977f33858f
tree748c8310d8cae7ae2f4ce2c7566e9b9e8bce2037
parentffb8587363a3567131fdf3f49e4e3d7e9f8b48d5
net: phy: Create a phy_port for PHY-driven SFPs

Some PHY devices may be used as media-converters to drive SFP ports (for
example, to allow using SFP when the SoC can only output RGMII). This is
already supported to some extend by allowing PHY drivers to registers
themselves as being SFP upstream.

However, the logic to drive the SFP can actually be split to a per-port
control logic, allowing support for multi-port PHYs, or PHYs that can
either drive SFPs or Copper.

To that extent, create a phy_port when registering an SFP bus onto a
PHY. This port is considered a "serdes" port, in that it can feed data
to another entity on the link. The PHY driver needs to specify the
various PHY_INTERFACE_MODE_XXX that this port supports.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20260108080041.553250-7-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy_device.c
drivers/net/phy/phy_port.c