summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2025-09-11 16:08:31 +0300
committerJakub Kicinski <kuba@kernel.org>2025-09-14 22:48:17 +0300
commitae1c658b33d4bec20c037aebba583a68375d4773 (patch)
tree5ebb2bc50d337a35ded55f601bef540911a01970 /include/linux
parente0706474b186ed4a99a98c8650f1cdbbd27b7509 (diff)
downloadlinux-ae1c658b33d4bec20c037aebba583a68375d4773.tar.xz
net: phy: introduce phy_id_compare_model() PHY ID helper
Similar to phy_id_compare_vendor(), introduce the equivalent phy_id_compare_model() helper for the generic PHY ID Model mask. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://patch.msgid.link/20250911130840.23569-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 04553419adc3..6f3b25cb7f4e 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1309,6 +1309,19 @@ static inline bool phy_id_compare_vendor(u32 id, u32 vendor_mask)
}
/**
+ * phy_id_compare_model - compare @id with @model mask
+ * @id: PHY ID
+ * @model_mask: PHY Model mask
+ *
+ * Return: true if the bits from @id match @model using the
+ * generic PHY Model mask.
+ */
+static inline bool phy_id_compare_model(u32 id, u32 model_mask)
+{
+ return phy_id_compare(id, model_mask, PHY_ID_MATCH_MODEL_MASK);
+}
+
+/**
* phydev_id_compare - compare @id with the PHY's Clause 22 ID
* @phydev: the PHY device
* @id: the PHY ID to be matched