summaryrefslogtreecommitdiff
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorMaxime Chevallier <maxime.chevallier@bootlin.com>2024-08-21 18:09:57 +0300
committerDavid S. Miller <davem@davemloft.net>2024-08-23 15:04:34 +0300
commitb2db6f4ace72e71fa09b8d1354f8ac9854140d74 (patch)
tree6b689ac33cb21ddd5c85dedb0321386c6deea6f2 /include/linux/phy.h
parent4d76f115ab9121f4458330da962ae9ef5430e60b (diff)
downloadlinux-b2db6f4ace72e71fa09b8d1354f8ac9854140d74.tar.xz
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 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 3b0f4bf80650..a98bc91a0cde 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1781,6 +1781,8 @@ int phy_suspend(struct phy_device *phydev);
int phy_resume(struct phy_device *phydev);
int __phy_resume(struct phy_device *phydev);
int phy_loopback(struct phy_device *phydev, bool enable);
+int phy_sfp_connect_phy(void *upstream, struct phy_device *phy);
+void phy_sfp_disconnect_phy(void *upstream, struct phy_device *phy);
void phy_sfp_attach(void *upstream, struct sfp_bus *bus);
void phy_sfp_detach(void *upstream, struct sfp_bus *bus);
int phy_sfp_probe(struct phy_device *phydev,