[PATCH net-next 1/2] net: stmmac: Add support for multiple phy interface for integrated PCS

From: Sneh Shah
Date: Fri May 24 2024 - 09:08:29 EST


In case of integrated PCS ethernet does't have external PCS driver.
Currently stmmac supports multiple phy interfaces if there is external PCS.
Add a function to support mupliple phy interfaces when PCS is integrated.

Signed-off-by: Sneh Shah <quic_snehshah@xxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++
include/linux/stmmac.h | 1 +
2 files changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fe3498e86de9..765332627ad0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1231,6 +1231,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
*/
__set_bit(mode, priv->phylink_config.supported_interfaces);

+ if (priv->plat->get_interfaces)
+ priv->plat->get_interfaces(priv);
+
/* If we have an xpcs, it defines which PHY interfaces are supported. */
if (priv->hw->xpcs)
xpcs_get_interfaces(priv->hw->xpcs,
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index dfa1828cd756..66f8205b331e 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -278,6 +278,7 @@ struct plat_stmmacenet_data {
void (*serdes_powerdown)(struct net_device *ndev, void *priv);
void (*speed_mode_2500)(struct net_device *ndev, void *priv);
void (*ptp_clk_freq_config)(struct stmmac_priv *priv);
+ void (*get_interfaces)(struct stmmac_priv *priv);
int (*init)(struct platform_device *pdev, void *priv);
void (*exit)(struct platform_device *pdev, void *priv);
struct mac_device_info *(*setup)(void *priv);
--
2.17.1