ipq40xx: fix PHY subsystem compilation (phy_interface_num_ports())
[openwrt/staging/pepe2k.git] / target / linux / ipq40xx / patches-5.15 / 704-net-phy-define-PSGMII-PHY-interface-mode.patch
index c707e5c8ff079a41ca4aaf0e99bfdc6684ff7475..1cc8ec1f0340ca3769a0ff13104c3d482846e0b8 100644 (file)
@@ -30,6 +30,17 @@ Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
        - qsgmii
        - tbi
        - rev-mii
+--- a/drivers/net/phy/phy-core.c
++++ b/drivers/net/phy/phy-core.c
+@@ -140,6 +140,8 @@ int phy_interface_num_ports(phy_interfac
+       case PHY_INTERFACE_MODE_QSGMII:
+       case PHY_INTERFACE_MODE_QUSGMII:
+               return 4;
++      case PHY_INTERFACE_MODE_PSGMII:
++              return 5;
+       case PHY_INTERFACE_MODE_MAX:
+               WARN_ONCE(1, "PHY_INTERFACE_MODE_MAX isn't a valid interface mode");
+               return 0;
 --- a/drivers/net/phy/phylink.c
 +++ b/drivers/net/phy/phylink.c
 @@ -371,6 +371,7 @@ void phylink_get_linkmodes(unsigned long