summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phylink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r--drivers/net/phy/phylink.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index dccf72d78ea0..4292bc650f2b 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1725,6 +1725,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));