diff mbox series

[net-next,v4,02/11] net: stmmac: provide allow_switch_interface flag

Message ID 20240129130253.1400707-3-yong.liang.choong@linux.intel.com (mailing list archive)
State Changes Requested
Headers show
Series Enable SGMII and 2500BASEX interface mode switching for Intel platforms | expand

Commit Message

Choong Yong Liang Jan. 29, 2024, 1:02 p.m. UTC
Provide the allow_switch_interface flag to indicate the platform supports
interface mode switching.

Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++-
 include/linux/stmmac.h                            | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a0e46369ae15..d1ec075ae10a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1222,9 +1222,12 @@  static int stmmac_phy_setup(struct stmmac_priv *priv)
 	priv->phylink_config.mac_managed_pm = true;
 
 	mdio_bus_data = priv->plat->mdio_bus_data;
-	if (mdio_bus_data)
+	if (mdio_bus_data) {
 		priv->phylink_config.ovr_an_inband =
 			mdio_bus_data->xpcs_an_inband;
+		priv->phylink_config.allow_switch_interface =
+			mdio_bus_data->allow_switch_interface;
+	}
 
 	/* Set the platform/firmware specified interface mode. Note, phylink
 	 * deals with the PHY interface mode, not the MAC interface mode.
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index dee5ad6e48c5..b99d11f4ff26 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -87,6 +87,7 @@  struct stmmac_mdio_bus_data {
 	int *irqs;
 	int probed_phy_irq;
 	bool needs_reset;
+	bool allow_switch_interface;
 };
 
 struct stmmac_dma_cfg {