Commit 76226787 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Paolo Abeni
Browse files

net: phylink: remove legacy mac_an_restart() method



The mac_an_restart() method is now completely unused, and has been
superseded by phylink_pcs support. Remove this method.

Since phylink_pcs_mac_an_restart() now only deals with the PCS, rename
the function to remove the _mac infix.

Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 8f42c07f
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
@@ -1079,17 +1079,13 @@ static void phylink_mac_config(struct phylink *pl,
	pl->mac_ops->mac_config(pl->config, pl->cur_link_an_mode, state);
}

static void phylink_mac_pcs_an_restart(struct phylink *pl)
static void phylink_pcs_an_restart(struct phylink *pl)
{
	if (linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
	if (pl->pcs && linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
					 pl->link_config.advertising) &&
	    phy_interface_mode_is_8023z(pl->link_config.interface) &&
	    phylink_autoneg_inband(pl->cur_link_an_mode)) {
		if (pl->pcs)
	    phylink_autoneg_inband(pl->cur_link_an_mode))
		pl->pcs->ops->pcs_an_restart(pl->pcs);
		else if (pl->config->legacy_pre_march2020)
			pl->mac_ops->mac_an_restart(pl->config);
	}
}

static void phylink_major_config(struct phylink *pl, bool restart,
@@ -1169,7 +1165,7 @@ static void phylink_major_config(struct phylink *pl, bool restart,
		restart = true;

	if (restart)
		phylink_mac_pcs_an_restart(pl);
		phylink_pcs_an_restart(pl);

	if (pl->mac_ops->mac_finish) {
		err = pl->mac_ops->mac_finish(pl->config, pl->cur_link_an_mode,
@@ -1205,7 +1201,7 @@ static int phylink_change_inband_advert(struct phylink *pl)
	if (!pl->pcs && pl->config->legacy_pre_march2020) {
		/* Legacy method */
		phylink_mac_config(pl, &pl->link_config);
		phylink_mac_pcs_an_restart(pl);
		phylink_pcs_an_restart(pl);
		return 0;
	}

@@ -1234,7 +1230,7 @@ static int phylink_change_inband_advert(struct phylink *pl)
		return ret;

	if (ret > 0)
		phylink_mac_pcs_an_restart(pl);
		phylink_pcs_an_restart(pl);

	return 0;
}
@@ -2533,7 +2529,7 @@ int phylink_ethtool_nway_reset(struct phylink *pl)

	if (pl->phydev)
		ret = phy_restart_aneg(pl->phydev);
	phylink_mac_pcs_an_restart(pl);
	phylink_pcs_an_restart(pl);

	return ret;
}
+0 −12
Original line number Diff line number Diff line
@@ -234,7 +234,6 @@ struct phylink_config {
 * @mac_prepare: prepare for a major reconfiguration of the interface.
 * @mac_config: configure the MAC for the selected mode and state.
 * @mac_finish: finish a major reconfiguration of the interface.
 * @mac_an_restart: restart 802.3z BaseX autonegotiation.
 * @mac_link_down: take the link down.
 * @mac_link_up: allow the link to come up.
 *
@@ -254,7 +253,6 @@ struct phylink_mac_ops {
			   const struct phylink_link_state *state);
	int (*mac_finish)(struct phylink_config *config, unsigned int mode,
			  phy_interface_t iface);
	void (*mac_an_restart)(struct phylink_config *config);
	void (*mac_link_down)(struct phylink_config *config, unsigned int mode,
			      phy_interface_t interface);
	void (*mac_link_up)(struct phylink_config *config,
@@ -459,16 +457,6 @@ void mac_config(struct phylink_config *config, unsigned int mode,
int mac_finish(struct phylink_config *config, unsigned int mode,
		phy_interface_t iface);

/**
 * mac_an_restart() - restart 802.3z BaseX autonegotiation
 * @config: a pointer to a &struct phylink_config.
 *
 * Note: This is a legacy method. This function will not be called unless
 * legacy_pre_march2020 is set in &struct phylink_config and there is no
 * PCS attached.
 */
void mac_an_restart(struct phylink_config *config);

/**
 * mac_link_down() - take the link down
 * @config: a pointer to a &struct phylink_config.