summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-01-26 13:26:20 +0300
committerDavid S. Miller <davem@davemloft.net>2022-01-26 14:20:37 +0300
commit04a0683f7db446e23cba69ae97706ae63ee5f74e (patch)
tree6cf4a1ff2295a89fa272fc220e73f7e50ba0a716 /drivers/net/ethernet/stmicro
parentf4c296c90976c410df3aec650d291f84b1fff9fc (diff)
downloadlinux-04a0683f7db446e23cba69ae97706ae63ee5f74e.tar.xz
net: stmmac: convert to phylink_generic_validate()
Convert stmmac to use phylink_generic_validate() now that we have the MAC capabilities and supported interfaces filled in, and we have the PCS validation handled via the PCS operations. Tested-by: Wong Vee Khee <vee.khee.wong@linux.intel.com> # Intel EHL 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/ethernet/stmicro')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1b6bba656709..0fd96a98f489 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -936,29 +936,6 @@ static void stmmac_mac_flow_ctrl(struct stmmac_priv *priv, u32 duplex)
priv->pause, tx_cnt);
}
-static void stmmac_validate(struct phylink_config *config,
- unsigned long *supported,
- struct phylink_link_state *state)
-{
- __ETHTOOL_DECLARE_LINK_MODE_MASK(mac_supported) = { 0, };
-
- /* This is very similar to phylink_generic_validate() except that
- * we always use PHY_INTERFACE_MODE_INTERNAL to get all capabilities.
- * This is because we don't always have config->supported_interfaces
- * populated (only when we have the XPCS.)
- *
- * When we do have an XPCS, we could pass state->interface, as XPCS
- * limits to a subset of the ethtool link modes allowed here.
- */
- phylink_set(mac_supported, Autoneg);
- phylink_set_port_modes(mac_supported);
- phylink_get_linkmodes(mac_supported, PHY_INTERFACE_MODE_INTERNAL,
- config->mac_capabilities);
-
- linkmode_and(supported, supported, mac_supported);
- linkmode_and(state->advertising, state->advertising, mac_supported);
-}
-
static void stmmac_mac_config(struct phylink_config *config, unsigned int mode,
const struct phylink_link_state *state)
{
@@ -1095,7 +1072,7 @@ static void stmmac_mac_link_up(struct phylink_config *config,
}
static const struct phylink_mac_ops stmmac_phylink_mac_ops = {
- .validate = stmmac_validate,
+ .validate = phylink_generic_validate,
.mac_config = stmmac_mac_config,
.mac_link_down = stmmac_mac_link_down,
.mac_link_up = stmmac_mac_link_up,