OSDN Git Service

net: stmmac: add new switch to struct plat_stmmacenet_data
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 19 Jun 2023 09:24:00 +0000 (11:24 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 Jun 2023 03:44:38 +0000 (20:44 -0700)
On some platforms, the PCS can be integrated in the MAC so the driver
will not see any PCS link activity. Add a switch that allows the platform
drivers to let the core code know.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
include/linux/stmmac.h

index 5c645b6..10e8a56 100644 (file)
@@ -5798,7 +5798,7 @@ static void stmmac_common_interrupt(struct stmmac_priv *priv)
                }
 
                /* PCS link status */
-               if (priv->hw->pcs) {
+               if (priv->hw->pcs && !priv->plat->has_integrated_pcs) {
                        if (priv->xstats.pcs_link)
                                netif_carrier_on(priv->dev);
                        else
index 225751a..0609053 100644 (file)
@@ -293,5 +293,6 @@ struct plat_stmmacenet_data {
        bool sph_disable;
        bool serdes_up_after_phy_linkup;
        const struct dwmac4_addrs *dwmac4_addrs;
+       bool has_integrated_pcs;
 };
 #endif