netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH 1/3] net: phy: introduce phy_id_compare_model() PHY ID helper
@ 2025-09-09 20:28 Christian Marangi
  2025-09-09 20:28 ` [net-next PATCH 2/3] net: phy: broadcom: Convert to phy_id_compare_model() Christian Marangi
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Christian Marangi @ 2025-09-09 20:28 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
  Cc: Christian Marangi

Similar to phy_id_compare_vendor(), introduce the equivalent
phy_id_compare_model() helper for the generic PHY ID Model mask.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 include/linux/phy.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 04553419adc3..6adf7c5a91c2 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1308,6 +1308,19 @@ static inline bool phy_id_compare_vendor(u32 id, u32 vendor_mask)
 	return phy_id_compare(id, vendor_mask, PHY_ID_MATCH_VENDOR_MASK);
 }
 
+/**
+ * phy_id_compare_model - compare @id with @model mask
+ * @id: PHY ID
+ * @vendor_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
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-09-11 13:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 20:28 [net-next PATCH 1/3] net: phy: introduce phy_id_compare_model() PHY ID helper Christian Marangi
2025-09-09 20:28 ` [net-next PATCH 2/3] net: phy: broadcom: Convert to phy_id_compare_model() Christian Marangi
2025-09-09 21:30   ` Andrew Lunn
2025-09-09 21:35   ` Florian Fainelli
2025-09-09 20:28 ` [net-next PATCH 3/3] net: phy: broadcom: Convert to PHY_ID_MATCH_MODEL macro Christian Marangi
2025-09-09 21:31   ` Andrew Lunn
2025-09-09 21:36   ` Florian Fainelli
2025-09-09 21:27 ` [net-next PATCH 1/3] net: phy: introduce phy_id_compare_model() PHY ID helper Andrew Lunn
2025-09-09 21:35 ` Florian Fainelli
2025-09-11 13:00 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).