Commit 459fd2f1 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: pcs: xpcs: use Autoneg bit rather than an_enabled

The Autoneg bit in the advertising bitmap and state->an_enabled are
always identical. Thus, we will be removing state->an_enabled.

Use the Autoneg bit in the advertising bitmap to indicate whether
autonegotiation should be used, rather than using the an_enabled
member which will be going away.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 99d0f3a1
...@@ -923,6 +923,7 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs, ...@@ -923,6 +923,7 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs,
struct phylink_link_state *state, struct phylink_link_state *state,
const struct xpcs_compat *compat) const struct xpcs_compat *compat)
{ {
bool an_enabled;
int ret; int ret;
/* Link needs to be read first ... */ /* Link needs to be read first ... */
...@@ -940,11 +941,13 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs, ...@@ -940,11 +941,13 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs,
return xpcs_do_config(xpcs, state->interface, MLO_AN_INBAND, NULL); return xpcs_do_config(xpcs, state->interface, MLO_AN_INBAND, NULL);
} }
if (state->an_enabled && xpcs_aneg_done_c73(xpcs, state, compat)) { an_enabled = linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
state->advertising);
if (an_enabled && xpcs_aneg_done_c73(xpcs, state, compat)) {
state->an_complete = true; state->an_complete = true;
xpcs_read_lpa_c73(xpcs, state); xpcs_read_lpa_c73(xpcs, state);
xpcs_resolve_lpa_c73(xpcs, state); xpcs_resolve_lpa_c73(xpcs, state);
} else if (state->an_enabled) { } else if (an_enabled) {
state->link = 0; state->link = 0;
} else if (state->link) { } else if (state->link) {
xpcs_resolve_pma(xpcs, state); xpcs_resolve_pma(xpcs, state);
...@@ -999,7 +1002,8 @@ static int xpcs_get_state_c37_1000basex(struct dw_xpcs *xpcs, ...@@ -999,7 +1002,8 @@ static int xpcs_get_state_c37_1000basex(struct dw_xpcs *xpcs,
{ {
int lpa, bmsr; int lpa, bmsr;
if (state->an_enabled) { if (linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
state->advertising)) {
/* Reset link state */ /* Reset link state */
state->link = false; state->link = false;
......
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