Skip to contentSkip to conversation

net: dsa: lantiq_gswip: support model-specific mac_select_pcs()

RFC PATCH In review Daniel Golle 1 participant 1 message Aug 16, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 13/23 net: dsa: lantiq_gswip: support model-specific mac_select_pcs()

Implement calling mac_select_pcs() function if provided in struct gswip_hwinfo.

---
 drivers/net/dsa/lantiq_gswip.c | 13 +++++++++++++
 drivers/net/dsa/lantiq_gswip.h |  3 +++
 2 files changed, 16 insertions(+)
drivers/net/dsa/lantiq_gswip.c +13 -0
index 5a5e85b1b32f..671f7b92b4aa 100644
@@ -1675,12 +1675,25 @@ static bool gswip_support_eee(struct dsa_switch *ds, int port)
 	return false;
 }
 
+static struct phylink_pcs *gswip_phylink_mac_select_pcs(struct phylink_config *config,
+							phy_interface_t interface)
+{
+	struct dsa_port *dp = dsa_phylink_to_port(config);
+	struct gswip_priv *priv = dp->ds->priv;
+
+	if (priv->hw_info->mac_select_pcs)
+		return priv->hw_info->mac_select_pcs(config, interface);
+
+	return NULL;
+}
+
 const struct phylink_mac_ops gswip_phylink_mac_ops = {
 	.mac_config		= gswip_phylink_mac_config,
 	.mac_link_down		= gswip_phylink_mac_link_down,
 	.mac_link_up		= gswip_phylink_mac_link_up,
 	.mac_disable_tx_lpi	= gswip_phylink_mac_disable_tx_lpi,
 	.mac_enable_tx_lpi	= gswip_phylink_mac_enable_tx_lpi,
+	.mac_select_pcs		= gswip_phylink_mac_select_pcs,
 };
 
 static const struct dsa_switch_ops gswip_switch_ops = {
drivers/net/dsa/lantiq_gswip.h +3 -0
index 00a786d374b1..24f6a94dd971 100644
@@ -5,6 +5,7 @@
 #include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/mutex.h>
+#include <linux/phylink.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
@@ -246,6 +247,8 @@ struct gswip_hw_info {
 	enum dsa_tag_protocol tag_protocol;
 	void (*phylink_get_caps)(struct dsa_switch *ds, int port,
 				 struct phylink_config *config);
+	struct phylink_pcs *(*mac_select_pcs)(struct phylink_config *config,
+					      phy_interface_t interface);
 };
 
 struct gswip_gphy_fw {
Signature · 1 line
2.50.1