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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index c1a31f0cea61..066d60f185d5 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -3555,21 +3555,12 @@ static void phylink_sfp_link_up(void *upstream)
phylink_enable_and_run_resolve(pl, PHYLINK_DISABLE_LINK);
}
-/* The Broadcom BCM84881 in the Methode DM7052 is unable to provide a SGMII
- * or 802.3z control word, so inband will not work.
- */
-static bool phylink_phy_no_inband(struct phy_device *phy)
-{
- return phy->is_c45 && phy_id_compare(phy->c45_ids.device_ids[1],
- 0xae025150, 0xfffffff0);
-}
-
static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
{
DECLARE_PHY_INTERFACE_MASK(interfaces);
struct phylink *pl = upstream;
phy_interface_t interface;
- int ret;
+ int link_inband, ret;
/*
* This is the new way of dealing with flow control for PHYs,
@@ -3610,7 +3601,14 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
phylink_dbg(pl, "copper SFP: chosen %s interface\n",
phy_modes(interface));
- if (phylink_phy_no_inband(phy))
+ link_inband = phy_query_inband(phy, interface);
+ phylink_dbg(pl, "copper SFP: PHY link in-band modes 0x%x\n",
+ link_inband);
+
+ /* If the link inband is valid but the PHY doesn't support
+ * inband, then we have to use PHY mode. E.g. BCM84881.
+ */
+ if (link_inband == LINK_INBAND_VALID)
pl->sfp_link_an_mode = MLO_AN_PHY;
if (pl->cur_link_an_mode != pl->sfp_link_an_mode ||