Skip to content

Commit

Permalink
net: dsa: mark DSA phylink as legacy_pre_march2020
Browse files Browse the repository at this point in the history
The majority of DSA drivers do not make use of the PCS support, and
thus operate in legacy mode. In order to preserve this behaviour in
future, we need to set the legacy_pre_march2020 flag so phylink knows
this may require the legacy calls.

There are some DSA drivers that do make use of PCS support, and these
will continue operating as before - legacy_pre_march2020 will not
prevent split-PCS support enabling the newer phylink behaviour.

Signed-off-by: Russell King (Oracle) <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Russell King (Oracle) authored and kuba-moo committed Dec 9, 2021
1 parent 3e5b1fe commit 0a9f079
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/dsa/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,13 @@ int dsa_port_phylink_create(struct dsa_port *dp)
if (err)
mode = PHY_INTERFACE_MODE_NA;

/* Presence of phylink_mac_link_state or phylink_mac_an_restart is
* an indicator of a legacy phylink driver.
*/
if (ds->ops->phylink_mac_link_state ||
ds->ops->phylink_mac_an_restart)
dp->pl_config.legacy_pre_march2020 = true;

if (ds->ops->phylink_get_caps)
ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);

Expand Down

0 comments on commit 0a9f079

Please sign in to comment.