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

From: Choong Yong Liang
Date: Mon Jan 29 2024 - 08:06:13 EST


Provide the allow_switch_interface flag to indicate the platform supports
interface mode switching.

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

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 {
--
2.34.1