aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2025-05-17 22:13:48 +0200
committerJakub Kicinski <kuba@kernel.org>2025-05-21 15:56:10 -0700
commitd6c45707ac84c2d9f274ece1cea4dddb97996bde (patch)
treef28f08de6c65edd47eab17da87349c6504d8185e /include
parentnet: phy: nxp-c45-tja11xx: simplify .match_phy_device OP (diff)
downloadwireguard-linux-d6c45707ac84c2d9f274ece1cea4dddb97996bde.tar.xz
wireguard-linux-d6c45707ac84c2d9f274ece1cea4dddb97996bde.zip
net: phy: introduce genphy_match_phy_device()
Introduce new API, genphy_match_phy_device(), to provide a way to check to match a PHY driver for a PHY device based on the info stored in the PHY device struct. The function generalize the logic used in phy_bus_match() to check the PHY ID whether if C45 or C22 ID should be used for matching. This is useful for custom .match_phy_device function that wants to use the generic logic under some condition. (example a PHY is already setup and provide the correct PHY ID) Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://patch.msgid.link/20250517201353.5137-5-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/phy.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 10e66d45a8e8..32b9da274115 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1868,6 +1868,9 @@ char *phy_attached_info_irq(struct phy_device *phydev)
__malloc;
void phy_attached_info(struct phy_device *phydev);
+int genphy_match_phy_device(struct phy_device *phydev,
+ const struct phy_driver *phydrv);
+
/* Clause 22 PHY */
int genphy_read_abilities(struct phy_device *phydev);
int genphy_setup_forced(struct phy_device *phydev);