Commit 907476c6 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski
Browse files

net: dsa: sja1105: call PCS config/link_up via pcs_ops structure



Call the PCS operations through the ops structure, which avoids needing
to export xpcs internal functions.

Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1svfMf-005ZId-Mx@rmk-PC.armlinux.org.uk


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a18891b5
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -2377,6 +2377,7 @@ int sja1105_static_config_reload(struct sja1105_private *priv,

	for (i = 0; i < ds->num_ports; i++) {
		struct dw_xpcs *xpcs = priv->xpcs[i];
		struct phylink_pcs *pcs;
		unsigned int neg_mode;

		mac[i].speed = mac_speed[i];
@@ -2387,12 +2388,15 @@ int sja1105_static_config_reload(struct sja1105_private *priv,
		if (!xpcs)
			continue;

		pcs = &xpcs->pcs;

		if (bmcr[i] & BMCR_ANENABLE)
			neg_mode = PHYLINK_PCS_NEG_INBAND_ENABLED;
		else
			neg_mode = PHYLINK_PCS_NEG_OUTBAND;

		rc = xpcs_do_config(xpcs, priv->phy_mode[i], NULL, neg_mode);
		rc = pcs->ops->pcs_config(pcs, neg_mode, priv->phy_mode[i],
					  NULL, true);
		if (rc < 0)
			goto out;

@@ -2408,7 +2412,7 @@ int sja1105_static_config_reload(struct sja1105_private *priv,
			else
				speed = SPEED_10;

			xpcs_link_up(&xpcs->pcs, neg_mode, priv->phy_mode[i],
			pcs->ops->pcs_link_up(pcs, neg_mode, priv->phy_mode[i],
					      speed, DUPLEX_FULL);
		}
	}