mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 06:49:52 +00:00
net: remove phylink_pcs .neg_mode boolean
As all PCS are using the neg_mode parameter rather than the legacy an_mode, remove the ability to use the legacy an_mode. We remove the tests in the phylink code, unconditionally passing the PCS neg_mode parameter to PCS methods, and remove setting the flag from drivers. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1tidPn-0040hd-2R@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
bf1b8e0abc
commit
de38503b74
drivers/net
dsa
ethernet
cadence
freescale/fman
marvell
meta/fbnic
microchip
xilinx
pcs
phy
include/linux
@ -239,7 +239,6 @@ int b53_serdes_init(struct b53_device *dev, int port)
|
||||
pcs->dev = dev;
|
||||
pcs->lane = lane;
|
||||
pcs->pcs.ops = &b53_pcs_ops;
|
||||
pcs->pcs.neg_mode = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -3104,7 +3104,6 @@ mt753x_setup(struct dsa_switch *ds)
|
||||
/* Initialise the PCS devices */
|
||||
for (i = 0; i < priv->ds->num_ports; i++) {
|
||||
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
|
||||
priv->pcs[i].pcs.neg_mode = true;
|
||||
priv->pcs[i].priv = priv;
|
||||
priv->pcs[i].port = i;
|
||||
}
|
||||
|
@ -138,7 +138,6 @@ static int mv88e6185_pcs_init(struct mv88e6xxx_chip *chip, int port)
|
||||
mpcs->chip = chip;
|
||||
mpcs->port = port;
|
||||
mpcs->phylink_pcs.ops = &mv88e6185_phylink_pcs_ops;
|
||||
mpcs->phylink_pcs.neg_mode = true;
|
||||
|
||||
irq = mv88e6xxx_serdes_irq_mapping(chip, port);
|
||||
if (irq) {
|
||||
|
@ -275,7 +275,6 @@ static struct marvell_c22_pcs *marvell_c22_pcs_alloc(struct device *dev,
|
||||
mpcs->mdio.bus = bus;
|
||||
mpcs->mdio.addr = addr;
|
||||
mpcs->phylink_pcs.ops = &marvell_c22_pcs_ops;
|
||||
mpcs->phylink_pcs.neg_mode = true;
|
||||
|
||||
return mpcs;
|
||||
}
|
||||
|
@ -565,9 +565,7 @@ static int mv88e6390_pcs_init(struct mv88e6xxx_chip *chip, int port)
|
||||
return -ENOMEM;
|
||||
|
||||
mpcs->sgmii_pcs.ops = &mv88e639x_sgmii_pcs_ops;
|
||||
mpcs->sgmii_pcs.neg_mode = true;
|
||||
mpcs->xg_pcs.ops = &mv88e6390_xg_pcs_ops;
|
||||
mpcs->xg_pcs.neg_mode = true;
|
||||
|
||||
if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6190X ||
|
||||
chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6390X)
|
||||
@ -945,9 +943,7 @@ static int mv88e6393x_pcs_init(struct mv88e6xxx_chip *chip, int port)
|
||||
return -ENOMEM;
|
||||
|
||||
mpcs->sgmii_pcs.ops = &mv88e6393x_sgmii_pcs_ops;
|
||||
mpcs->sgmii_pcs.neg_mode = true;
|
||||
mpcs->xg_pcs.ops = &mv88e6393x_xg_pcs_ops;
|
||||
mpcs->xg_pcs.neg_mode = true;
|
||||
mpcs->supports_5g = true;
|
||||
|
||||
err = mv88e6393x_erratum_4_6(mpcs);
|
||||
|
@ -1634,7 +1634,6 @@ static void qca8k_setup_pcs(struct qca8k_priv *priv, struct qca8k_pcs *qpcs,
|
||||
int port)
|
||||
{
|
||||
qpcs->pcs.ops = &qca8k_pcs_ops;
|
||||
qpcs->pcs.neg_mode = true;
|
||||
|
||||
/* We don't have interrupts for link changes, so we need to poll */
|
||||
qpcs->pcs.poll = true;
|
||||
|
@ -853,9 +853,7 @@ static int macb_mii_probe(struct net_device *dev)
|
||||
struct macb *bp = netdev_priv(dev);
|
||||
|
||||
bp->phylink_sgmii_pcs.ops = &macb_phylink_pcs_ops;
|
||||
bp->phylink_sgmii_pcs.neg_mode = true;
|
||||
bp->phylink_usx_pcs.ops = &macb_phylink_usx_pcs_ops;
|
||||
bp->phylink_usx_pcs.neg_mode = true;
|
||||
|
||||
bp->phylink_config.dev = &dev->dev;
|
||||
bp->phylink_config.type = PHYLINK_NETDEV;
|
||||
|
@ -1446,7 +1446,6 @@ int dtsec_initialization(struct mac_device *mac_dev,
|
||||
goto _return_fm_mac_free;
|
||||
}
|
||||
dtsec->pcs.ops = &dtsec_pcs_ops;
|
||||
dtsec->pcs.neg_mode = true;
|
||||
dtsec->pcs.poll = true;
|
||||
|
||||
supported = mac_dev->phylink_config.supported_interfaces;
|
||||
|
@ -5557,7 +5557,6 @@ static int mvneta_probe(struct platform_device *pdev)
|
||||
clk_prepare_enable(pp->clk_bus);
|
||||
|
||||
pp->phylink_pcs.ops = &mvneta_phylink_pcs_ops;
|
||||
pp->phylink_pcs.neg_mode = true;
|
||||
|
||||
pp->phylink_config.dev = &dev->dev;
|
||||
pp->phylink_config.type = PHYLINK_NETDEV;
|
||||
|
@ -7024,9 +7024,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
|
||||
dev->dev_port = port->id;
|
||||
|
||||
port->pcs_gmac.ops = &mvpp2_phylink_gmac_pcs_ops;
|
||||
port->pcs_gmac.neg_mode = true;
|
||||
port->pcs_xlg.ops = &mvpp2_phylink_xlg_pcs_ops;
|
||||
port->pcs_xlg.neg_mode = true;
|
||||
|
||||
if (!mvpp2_use_acpi_compat_mode(port_fwnode)) {
|
||||
port->phylink_config.dev = &dev->dev;
|
||||
|
@ -396,7 +396,6 @@ static int prestera_port_sfp_bind(struct prestera_port *port)
|
||||
continue;
|
||||
|
||||
port->phylink_pcs.ops = &prestera_pcs_ops;
|
||||
port->phylink_pcs.neg_mode = true;
|
||||
|
||||
port->phy_config.dev = &port->dev->dev;
|
||||
port->phy_config.type = PHYLINK_NETDEV;
|
||||
|
@ -133,7 +133,6 @@ int fbnic_phylink_init(struct net_device *netdev)
|
||||
struct fbnic_net *fbn = netdev_priv(netdev);
|
||||
struct phylink *phylink;
|
||||
|
||||
fbn->phylink_pcs.neg_mode = true;
|
||||
fbn->phylink_pcs.ops = &fbnic_phylink_pcs_ops;
|
||||
|
||||
fbn->phylink_config.dev = &netdev->dev;
|
||||
|
@ -828,7 +828,6 @@ static int lan966x_probe_port(struct lan966x *lan966x, u32 p,
|
||||
port->phylink_config.type = PHYLINK_NETDEV;
|
||||
port->phylink_pcs.poll = true;
|
||||
port->phylink_pcs.ops = &lan966x_phylink_pcs_ops;
|
||||
port->phylink_pcs.neg_mode = true;
|
||||
|
||||
port->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
|
||||
MAC_10 | MAC_100 | MAC_1000FD | MAC_2500FD;
|
||||
|
@ -338,7 +338,6 @@ static int sparx5_create_port(struct sparx5 *sparx5,
|
||||
spx5_port->custom_etype = 0x8880; /* Vitesse */
|
||||
spx5_port->phylink_pcs.poll = true;
|
||||
spx5_port->phylink_pcs.ops = &sparx5_phylink_pcs_ops;
|
||||
spx5_port->phylink_pcs.neg_mode = true;
|
||||
spx5_port->is_mrouter = false;
|
||||
INIT_LIST_HEAD(&spx5_port->tc_templates);
|
||||
sparx5->ports[config->portno] = spx5_port;
|
||||
|
@ -3073,7 +3073,6 @@ static int axienet_probe(struct platform_device *pdev)
|
||||
}
|
||||
of_node_put(np);
|
||||
lp->pcs.ops = &axienet_pcs_ops;
|
||||
lp->pcs.neg_mode = true;
|
||||
lp->pcs.poll = true;
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,6 @@ static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio)
|
||||
mdio_device_get(mdio);
|
||||
lynx->mdio = mdio;
|
||||
lynx->pcs.ops = &lynx_pcs_phylink_ops;
|
||||
lynx->pcs.neg_mode = true;
|
||||
lynx->pcs.poll = true;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(lynx_interfaces); i++)
|
||||
|
@ -305,7 +305,6 @@ struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev,
|
||||
mpcs->regmap = regmap;
|
||||
mpcs->flags = flags;
|
||||
mpcs->pcs.ops = &mtk_pcs_lynxi_ops;
|
||||
mpcs->pcs.neg_mode = true;
|
||||
mpcs->pcs.poll = true;
|
||||
mpcs->interface = PHY_INTERFACE_MODE_NA;
|
||||
|
||||
|
@ -349,7 +349,6 @@ struct phylink_pcs *miic_create(struct device *dev, struct device_node *np)
|
||||
miic_port->miic = miic;
|
||||
miic_port->port = port - 1;
|
||||
miic_port->pcs.ops = &miic_phylink_ops;
|
||||
miic_port->pcs.neg_mode = true;
|
||||
|
||||
phy_interface_set_rgmii(miic_port->pcs.supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_RMII, miic_port->pcs.supported_interfaces);
|
||||
|
@ -1403,7 +1403,6 @@ static struct dw_xpcs *xpcs_create_data(struct mdio_device *mdiodev)
|
||||
mdio_device_get(mdiodev);
|
||||
xpcs->mdiodev = mdiodev;
|
||||
xpcs->pcs.ops = &xpcs_phylink_ops;
|
||||
xpcs->pcs.neg_mode = true;
|
||||
xpcs->pcs.poll = true;
|
||||
|
||||
return xpcs;
|
||||
|
@ -1365,7 +1365,6 @@ static void phylink_major_config(struct phylink *pl, bool restart,
|
||||
struct phylink_pcs *pcs = NULL;
|
||||
bool pcs_changed = false;
|
||||
unsigned int rate_kbd;
|
||||
unsigned int neg_mode;
|
||||
int err;
|
||||
|
||||
phylink_dbg(pl, "major config, requested %s/%s\n",
|
||||
@ -1428,11 +1427,7 @@ static void phylink_major_config(struct phylink *pl, bool restart,
|
||||
if (pl->pcs_state == PCS_STATE_STARTING || pcs_changed)
|
||||
phylink_pcs_enable(pl->pcs);
|
||||
|
||||
neg_mode = pl->act_link_an_mode;
|
||||
if (pl->pcs && pl->pcs->neg_mode)
|
||||
neg_mode = pl->pcs_neg_mode;
|
||||
|
||||
err = phylink_pcs_config(pl->pcs, neg_mode, state,
|
||||
err = phylink_pcs_config(pl->pcs, pl->pcs_neg_mode, state,
|
||||
!!(pl->link_config.pause & MLO_PAUSE_AN));
|
||||
if (err < 0)
|
||||
phylink_err(pl, "pcs_config failed: %pe\n",
|
||||
@ -1475,7 +1470,6 @@ static void phylink_major_config(struct phylink *pl, bool restart,
|
||||
*/
|
||||
static int phylink_change_inband_advert(struct phylink *pl)
|
||||
{
|
||||
unsigned int neg_mode;
|
||||
int ret;
|
||||
|
||||
if (test_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state))
|
||||
@ -1491,15 +1485,11 @@ static int phylink_change_inband_advert(struct phylink *pl)
|
||||
phylink_pcs_neg_mode(pl, pl->pcs, pl->link_config.interface,
|
||||
pl->link_config.advertising);
|
||||
|
||||
neg_mode = pl->act_link_an_mode;
|
||||
if (pl->pcs->neg_mode)
|
||||
neg_mode = pl->pcs_neg_mode;
|
||||
|
||||
/* Modern PCS-based method; update the advert at the PCS, and
|
||||
* restart negotiation if the pcs_config() helper indicates that
|
||||
* the programmed advertisement has changed.
|
||||
*/
|
||||
ret = phylink_pcs_config(pl->pcs, neg_mode, &pl->link_config,
|
||||
ret = phylink_pcs_config(pl->pcs, pl->pcs_neg_mode, &pl->link_config,
|
||||
!!(pl->link_config.pause & MLO_PAUSE_AN));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@ -1523,13 +1513,7 @@ static void phylink_mac_pcs_get_state(struct phylink *pl,
|
||||
state->an_complete = 0;
|
||||
state->link = 1;
|
||||
|
||||
pcs = pl->pcs;
|
||||
if (!pcs || pcs->neg_mode)
|
||||
autoneg = pl->pcs_neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
|
||||
else
|
||||
autoneg = linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
|
||||
state->advertising);
|
||||
|
||||
autoneg = pl->pcs_neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
|
||||
if (autoneg) {
|
||||
state->speed = SPEED_UNKNOWN;
|
||||
state->duplex = DUPLEX_UNKNOWN;
|
||||
@ -1540,6 +1524,7 @@ static void phylink_mac_pcs_get_state(struct phylink *pl,
|
||||
state->pause = pl->link_config.pause;
|
||||
}
|
||||
|
||||
pcs = pl->pcs;
|
||||
if (pcs)
|
||||
pcs->ops->pcs_get_state(pcs, pl->pcs_neg_mode, state);
|
||||
else
|
||||
@ -1649,7 +1634,6 @@ static void phylink_link_up(struct phylink *pl,
|
||||
struct phylink_link_state link_state)
|
||||
{
|
||||
struct net_device *ndev = pl->netdev;
|
||||
unsigned int neg_mode;
|
||||
int speed, duplex;
|
||||
bool rx_pause;
|
||||
|
||||
@ -1680,11 +1664,7 @@ static void phylink_link_up(struct phylink *pl,
|
||||
|
||||
pl->cur_interface = link_state.interface;
|
||||
|
||||
neg_mode = pl->act_link_an_mode;
|
||||
if (pl->pcs && pl->pcs->neg_mode)
|
||||
neg_mode = pl->pcs_neg_mode;
|
||||
|
||||
phylink_pcs_link_up(pl->pcs, neg_mode, pl->cur_interface, speed,
|
||||
phylink_pcs_link_up(pl->pcs, pl->pcs_neg_mode, pl->cur_interface, speed,
|
||||
duplex);
|
||||
|
||||
pl->mac_ops->mac_link_up(pl->config, pl->phydev, pl->act_link_an_mode,
|
||||
|
@ -442,7 +442,6 @@ struct phylink_pcs_ops;
|
||||
* are supported by this PCS.
|
||||
* @ops: a pointer to the &struct phylink_pcs_ops structure
|
||||
* @phylink: pointer to &struct phylink_config
|
||||
* @neg_mode: provide PCS neg mode via "mode" argument
|
||||
* @poll: poll the PCS for link changes
|
||||
* @rxc_always_on: The MAC driver requires the reference clock
|
||||
* to always be on. Standalone PCS drivers which
|
||||
@ -459,7 +458,6 @@ struct phylink_pcs {
|
||||
DECLARE_PHY_INTERFACE_MASK(supported_interfaces);
|
||||
const struct phylink_pcs_ops *ops;
|
||||
struct phylink *phylink;
|
||||
bool neg_mode;
|
||||
bool poll;
|
||||
bool rxc_always_on;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user