diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2020-02-17 16:23:31 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2020-10-12 21:52:16 +0100 |
commit | 6f85be7ce3fa31f378cda12c46b787dbfd1b6bc7 (patch) | |
tree | 6ecb87c8ba16faf7af2dc27af094aa3a83f0a73e /drivers/net/phy/phylink.c | |
parent | ab2e5046153fad0d9be339e86ca3ae90f7e1dbc5 (diff) |
net: phylink/dsa: fix DSA and CPU links
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r-- | drivers/net/phy/phylink.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 6680de39e338..a32eb56d48f3 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1188,6 +1188,21 @@ void phylink_start(struct phylink *pl) ASSERT_RTNL(); + /* + * If no PHY or SFP attached, and but we're in PHY mode, + * attempt to pick up a default configuration. + */ + if (pl->cfg_link_an_mode == MLO_AN_PHY && !pl->phydev && !pl->sfp_bus) { + if (pl->mac_ops->default_config) { + pl->mac_ops->default_config(pl->config, + &pl->link_config); + pl->cfg_link_an_mode = MLO_AN_FIXED; + pl->cur_link_an_mode = MLO_AN_FIXED; + } else { + phylink_warn(pl, "no default configuration\n"); + } + } + phylink_info(pl, "configuring for %s/%s link mode\n", phylink_an_mode_str(pl->cur_link_an_mode), phy_modes(pl->link_config.interface)); |