Hi,
On 7/20/26 19:48, Maxime Chevallier wrote:
Now that the SFP bus infrastructure notifies when PHY-less modules are
connected, we can create a phy_port to represent it. Instead of letting
the SFP subsystem handle that, the Bus' upstream is in charge of
maintaining that phy_port and register it to the topology, as the
upstream (in this case a phy device) is directly interacting with the
underlying net_device.
Add a phy_caps helper to get the achievable modes on this module based
on what the phy_port representing the bus supports.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Sashiko NIPA says :
"
Can re-attaching a phy_device that owns an SFP cage with an inserted
PHY-less module to a different netdev corrupt the destination topology?
The mod_port is created during module_start and lives until module_stop,
so it survives phy_detach on the original netdev. On phy_detach, only
phy_link_topo_del_port() is called, but phydev->mod_port and
mod_port->id are left as-is
"
That's not possible, we can't detach a port and attach it to another netdev.
the port->id is kept accross topo remove/add to keep a consistent ID in
case we detach the port's parent at link-down.
Maxime