diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-07-13 10:42:12 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-14 09:51:47 +0200 |
commit | aee6098822ed8a298ad817da8339ba4c7ea381fe (patch) | |
tree | 937641ff15a0def731ade99dd69761b113fae8c9 /drivers/net/phy/phylink.c | |
parent | net: phylink: add pcs_enable()/pcs_disable() methods (diff) | |
download | linux-aee6098822ed8a298ad817da8339ba4c7ea381fe.tar.xz linux-aee6098822ed8a298ad817da8339ba4c7ea381fe.zip |
net: phylink: add pcs_pre_config()/pcs_post_config() methods
Add hooks that are called before and after the mac_config() call,
which will be needed to deal with errata workarounds for the
Marvell 88e639x DSA switches.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r-- | drivers/net/phy/phylink.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 748c62efceb8..9840a2952309 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -998,6 +998,24 @@ static void phylink_resolve_an_pause(struct phylink_link_state *state) } } +static void phylink_pcs_pre_config(struct phylink_pcs *pcs, + phy_interface_t interface) +{ + if (pcs && pcs->ops->pcs_pre_config) + pcs->ops->pcs_pre_config(pcs, interface); +} + +static int phylink_pcs_post_config(struct phylink_pcs *pcs, + phy_interface_t interface) +{ + int err = 0; + + if (pcs && pcs->ops->pcs_post_config) + err = pcs->ops->pcs_post_config(pcs, interface); + + return err; +} + static void phylink_pcs_disable(struct phylink_pcs *pcs) { if (pcs && pcs->ops->pcs_disable) @@ -1122,8 +1140,14 @@ static void phylink_major_config(struct phylink *pl, bool restart, pl->pcs = pcs; } + if (pl->pcs) + phylink_pcs_pre_config(pl->pcs, state->interface); + phylink_mac_config(pl, state); + if (pl->pcs) + phylink_pcs_post_config(pl->pcs, state->interface); + if (pl->pcs_state == PCS_STATE_STARTING || pcs_changed) phylink_pcs_enable(pl->pcs); |