netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: qcom: qca808x: Add .get_rate_matching support
@ 2025-09-14 15:06 Mohd Ayaan Anwar
  2025-09-14 18:10 ` Russell King (Oracle)
  0 siblings, 1 reply; 10+ messages in thread
From: Mohd Ayaan Anwar @ 2025-09-14 15:06 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-arm-msm, linux-kernel, Mohd Ayaan Anwar

Add support for rate matching to the QCA8081 PHY driver to correctly
report its capabilities. Some boards[0][1] with this PHY currently
report support only for 2.5G.

Implement the .get_rate_matching callback to allow phylink to determine
the actual PHY capabilities and report them accurately.

Before:
 # ethtool eth0
  Settings for eth0:
         Supported ports: [  ]
         Supported link modes:   2500baseT/Full
         Supported pause frame use: Symmetric Receive-only
         ...

After:
 # ethtool eth0
  Settings for eth0:
         Supported ports: [  ]
         Supported link modes:   10baseT/Half 10baseT/Full
                                 100baseT/Half 100baseT/Full
                                 1000baseT/Full
                                 2500baseT/Full
         Supported pause frame use: Symmetric Receive-only
         ...

[0] https://lore.kernel.org/all/20250905192350.1223812-3-umang.chheda@oss.qualcomm.com/
[1] https://lore.kernel.org/all/20250908-lemans-evk-bu-v4-12-5c319c696a7d@oss.qualcomm.com/

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
 drivers/net/phy/qcom/qca808x.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c
index 8eb51b1a006c4c68ddce26c97d7d4f87a68158b0..9d9e93d2fa8f57b1535bc83e169eb011ae549040 100644
--- a/drivers/net/phy/qcom/qca808x.c
+++ b/drivers/net/phy/qcom/qca808x.c
@@ -643,6 +643,15 @@ static void qca808x_get_phy_stats(struct phy_device *phydev,
 	qcom_phy_get_stats(stats, priv->hw_stats);
 }
 
+static int qca808x_get_rate_matching(struct phy_device *phydev,
+				     phy_interface_t iface)
+{
+	if (iface == PHY_INTERFACE_MODE_2500BASEX)
+		return RATE_MATCH_PAUSE;
+
+	return RATE_MATCH_NONE;
+}
+
 static struct phy_driver qca808x_driver[] = {
 {
 	/* Qualcomm QCA8081 */
@@ -674,6 +683,7 @@ static struct phy_driver qca808x_driver[] = {
 	.led_polarity_set	= qca808x_led_polarity_set,
 	.update_stats		= qca808x_update_stats,
 	.get_phy_stats		= qca808x_get_phy_stats,
+	.get_rate_matching	= qca808x_get_rate_matching,
 }, };
 
 module_phy_driver(qca808x_driver);

---
base-commit: 5adf6f2b9972dbb69f4dd11bae52ba251c64ecb7
change-id: 20250912-qca808x_rate_match-570d44f510b2

Best regards,
-- 
Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>


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

end of thread, other threads:[~2025-09-16 22:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-14 15:06 [PATCH net-next] net: phy: qcom: qca808x: Add .get_rate_matching support Mohd Ayaan Anwar
2025-09-14 18:10 ` Russell King (Oracle)
2025-09-14 18:37   ` Andrew Lunn
2025-09-15  8:55   ` Mohd Ayaan Anwar
2025-09-15 11:58     ` Mohd Ayaan Anwar
2025-09-15 12:09     ` Russell King (Oracle)
2025-09-15 14:54       ` Mohd Ayaan Anwar
2025-09-15 15:11         ` Russell King (Oracle)
2025-09-15 15:41           ` Mohd Ayaan Anwar
2025-09-16 22:19           ` Russell King (Oracle)

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).