703-05-v5.17-net-dsa-replace-phylink_get_interfaces-with-phylink_.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 072eea6c22b2af680c3949e64f9adde278c71e68 Mon Sep 17 00:00:00 2001
  2. From: "Russell King (Oracle)" <[email protected]>
  3. Date: Tue, 30 Nov 2021 13:10:01 +0000
  4. Subject: [PATCH] net: dsa: replace phylink_get_interfaces() with
  5. phylink_get_caps()
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Phylink needs slightly more information than phylink_get_interfaces()
  10. allows us to get from the DSA drivers - we need the MAC capabilities.
  11. Replace the phylink_get_interfaces() method with phylink_get_caps() to
  12. allow DSA drivers to fill in the phylink_config MAC capabilities field
  13. as well.
  14. Signed-off-by: Russell King (Oracle) <[email protected]>
  15. Reviewed-by: Marek Behún <[email protected]>
  16. Reviewed-by: Andrew Lunn <[email protected]>
  17. Signed-off-by: Jakub Kicinski <[email protected]>
  18. ---
  19. include/net/dsa.h | 4 ++--
  20. net/dsa/port.c | 5 ++---
  21. 2 files changed, 4 insertions(+), 5 deletions(-)
  22. --- a/include/net/dsa.h
  23. +++ b/include/net/dsa.h
  24. @@ -654,8 +654,8 @@ struct dsa_switch_ops {
  25. /*
  26. * PHYLINK integration
  27. */
  28. - void (*phylink_get_interfaces)(struct dsa_switch *ds, int port,
  29. - unsigned long *supported_interfaces);
  30. + void (*phylink_get_caps)(struct dsa_switch *ds, int port,
  31. + struct phylink_config *config);
  32. void (*phylink_validate)(struct dsa_switch *ds, int port,
  33. unsigned long *supported,
  34. struct phylink_link_state *state);
  35. --- a/net/dsa/port.c
  36. +++ b/net/dsa/port.c
  37. @@ -1111,9 +1111,8 @@ int dsa_port_phylink_create(struct dsa_p
  38. if (err)
  39. mode = PHY_INTERFACE_MODE_NA;
  40. - if (ds->ops->phylink_get_interfaces)
  41. - ds->ops->phylink_get_interfaces(ds, dp->index,
  42. - dp->pl_config.supported_interfaces);
  43. + if (ds->ops->phylink_get_caps)
  44. + ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
  45. dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
  46. mode, &dsa_port_phylink_mac_ops);