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