diff options
author | Maxime Chevallier <maxime.chevallier@bootlin.com> | 2024-08-21 17:09:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-08-23 14:04:34 +0200 |
commit | b2db6f4ace72e71fa09b8d1354f8ac9854140d74 (patch) | |
tree | 6b689ac33cb21ddd5c85dedb0321386c6deea6f2 /drivers/net/phy/marvell10g.c | |
parent | net: sfp: pass the phy_device when disconnecting an sfp module's PHY (diff) | |
download | linux-b2db6f4ace72e71fa09b8d1354f8ac9854140d74.tar.xz linux-b2db6f4ace72e71fa09b8d1354f8ac9854140d74.zip |
net: phy: add helpers to handle sfp phy connect/disconnect
There are a few PHY drivers that can handle SFP modules through their
sfp_upstream_ops. Introduce Phylib helpers to keep track of connected
SFP PHYs in a netdevice's namespace, by adding the SFP PHY to the
upstream PHY's netdev's namespace.
By doing so, these SFP PHYs can be enumerated and exposed to users,
which will be able to use their capabilities.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/marvell10g.c')
-rw-r--r-- | drivers/net/phy/marvell10g.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index ad43e280930c..6642eb642d4b 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -503,6 +503,8 @@ static int mv3310_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) static const struct sfp_upstream_ops mv3310_sfp_ops = { .attach = phy_sfp_attach, .detach = phy_sfp_detach, + .connect_phy = phy_sfp_connect_phy, + .disconnect_phy = phy_sfp_disconnect_phy, .module_insert = mv3310_sfp_insert, }; |