Commit 75021cf0 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by David S. Miller

net: enetc: use phylink_generic_validate()

enetc has no special behaviour in its validation implementation, so can
be switched to phylink_generic_validate().
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5a94c1ba
...@@ -930,35 +930,6 @@ static void enetc_mdiobus_destroy(struct enetc_pf *pf) ...@@ -930,35 +930,6 @@ static void enetc_mdiobus_destroy(struct enetc_pf *pf)
enetc_imdio_remove(pf); enetc_imdio_remove(pf);
} }
static void enetc_pl_mac_validate(struct phylink_config *config,
unsigned long *supported,
struct phylink_link_state *state)
{
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
phylink_set_port_modes(mask);
phylink_set(mask, Autoneg);
phylink_set(mask, Pause);
phylink_set(mask, Asym_Pause);
phylink_set(mask, 10baseT_Half);
phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Half);
phylink_set(mask, 100baseT_Full);
phylink_set(mask, 100baseT_Half);
phylink_set(mask, 1000baseT_Half);
phylink_set(mask, 1000baseT_Full);
if (state->interface == PHY_INTERFACE_MODE_INTERNAL ||
state->interface == PHY_INTERFACE_MODE_2500BASEX ||
state->interface == PHY_INTERFACE_MODE_USXGMII) {
phylink_set(mask, 2500baseT_Full);
phylink_set(mask, 2500baseX_Full);
}
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);
}
static void enetc_pl_mac_config(struct phylink_config *config, static void enetc_pl_mac_config(struct phylink_config *config,
unsigned int mode, unsigned int mode,
const struct phylink_link_state *state) const struct phylink_link_state *state)
...@@ -1086,7 +1057,7 @@ static void enetc_pl_mac_link_down(struct phylink_config *config, ...@@ -1086,7 +1057,7 @@ static void enetc_pl_mac_link_down(struct phylink_config *config,
} }
static const struct phylink_mac_ops enetc_mac_phylink_ops = { static const struct phylink_mac_ops enetc_mac_phylink_ops = {
.validate = enetc_pl_mac_validate, .validate = phylink_generic_validate,
.mac_config = enetc_pl_mac_config, .mac_config = enetc_pl_mac_config,
.mac_link_up = enetc_pl_mac_link_up, .mac_link_up = enetc_pl_mac_link_up,
.mac_link_down = enetc_pl_mac_link_down, .mac_link_down = enetc_pl_mac_link_down,
...@@ -1101,6 +1072,8 @@ static int enetc_phylink_create(struct enetc_ndev_priv *priv, ...@@ -1101,6 +1072,8 @@ static int enetc_phylink_create(struct enetc_ndev_priv *priv,
pf->phylink_config.dev = &priv->ndev->dev; pf->phylink_config.dev = &priv->ndev->dev;
pf->phylink_config.type = PHYLINK_NETDEV; pf->phylink_config.type = PHYLINK_NETDEV;
pf->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD;
__set_bit(PHY_INTERFACE_MODE_INTERNAL, __set_bit(PHY_INTERFACE_MODE_INTERNAL,
pf->phylink_config.supported_interfaces); pf->phylink_config.supported_interfaces);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment