dff0db5db659ff8972bf85b43f6c19c917442a92
[openwrt/staging/blocktrron.git] /
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
5
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.
10
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.
14
15 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
16 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
17 ---
18 net/dsa/port.c | 7 +++++++
19 1 file changed, 7 insertions(+)
20
21 --- a/net/dsa/port.c
22 +++ b/net/dsa/port.c
23 @@ -1110,6 +1110,13 @@ int dsa_port_phylink_create(struct dsa_p
24 if (err)
25 mode = PHY_INTERFACE_MODE_NA;
26
27 + /* Presence of phylink_mac_link_state or phylink_mac_an_restart is
28 + * an indicator of a legacy phylink driver.
29 + */
30 + if (ds->ops->phylink_mac_link_state ||
31 + ds->ops->phylink_mac_an_restart)
32 + dp->pl_config.legacy_pre_march2020 = true;
33 +
34 if (ds->ops->phylink_get_caps)
35 ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
36