703-13-v5.17-net-dsa-mark-DSA-phylink-as-legacy_pre_march2020.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 0a9f0794d9bd67e590a9488afe87fbb0419d9539 Mon Sep 17 00:00:00 2001
  2. From: "Russell King (Oracle)" <[email protected]>
  3. Date: Thu, 9 Dec 2021 13:11:38 +0000
  4. Subject: [PATCH] net: dsa: mark DSA phylink as legacy_pre_march2020
  5. The majority of DSA drivers do not make use of the PCS support, and
  6. thus operate in legacy mode. In order to preserve this behaviour in
  7. future, we need to set the legacy_pre_march2020 flag so phylink knows
  8. this may require the legacy calls.
  9. There are some DSA drivers that do make use of PCS support, and these
  10. will continue operating as before - legacy_pre_march2020 will not
  11. prevent split-PCS support enabling the newer phylink behaviour.
  12. Signed-off-by: Russell King (Oracle) <[email protected]>
  13. Signed-off-by: Jakub Kicinski <[email protected]>
  14. ---
  15. net/dsa/port.c | 7 +++++++
  16. 1 file changed, 7 insertions(+)
  17. --- a/net/dsa/port.c
  18. +++ b/net/dsa/port.c
  19. @@ -1126,6 +1126,13 @@ int dsa_port_phylink_create(struct dsa_p
  20. if (err)
  21. mode = PHY_INTERFACE_MODE_NA;
  22. + /* Presence of phylink_mac_link_state or phylink_mac_an_restart is
  23. + * an indicator of a legacy phylink driver.
  24. + */
  25. + if (ds->ops->phylink_mac_link_state ||
  26. + ds->ops->phylink_mac_an_restart)
  27. + dp->pl_config.legacy_pre_march2020 = true;
  28. +
  29. if (ds->ops->phylink_get_caps)
  30. ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);