Commit e05c5181 authored by David S. Miller's avatar David S. Miller

Merge branch 'pcs_get_state-fixes'

Russell King (Oracle) says:

====================
Minor fixes for pcs_get_state() implementations

This series contains a number fixes for minor issues with some
pcs_get_state() implementations, particualrly for the phylink
state->an_enabled member. As they are minor, I'm suggesting we
queue them in net-next as there is follow-on work for these, and
there is no urgency for them to be in -rc.

Just like phylib, state->advertising's Autoneg bit is a copy of
state->an_enabled, and thus it is my intention to remove
state->an_enabled from phylink to simplify things.

This series gets rid of state->an_enabled assignments or
reporting that should never have been there.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents abf36703 ecec0ebb
......@@ -112,11 +112,11 @@ static void lynx_pcs_get_state(struct phylink_pcs *pcs,
}
dev_dbg(&lynx->mdio->dev,
"mode=%s/%s/%s link=%u an_enabled=%u an_complete=%u\n",
"mode=%s/%s/%s link=%u an_complete=%u\n",
phy_modes(state->interface),
phy_speed_to_str(state->speed),
phy_duplex_to_str(state->duplex),
state->link, state->an_enabled, state->an_complete);
state->link, state->an_complete);
}
static int lynx_pcs_config_giga(struct mdio_device *pcs, unsigned int mode,
......
......@@ -321,7 +321,7 @@ static int xpcs_read_fault_c73(struct dw_xpcs *xpcs,
return 0;
}
static int xpcs_read_link_c73(struct dw_xpcs *xpcs, bool an)
static int xpcs_read_link_c73(struct dw_xpcs *xpcs)
{
bool link = true;
int ret;
......@@ -333,15 +333,6 @@ static int xpcs_read_link_c73(struct dw_xpcs *xpcs, bool an)
if (!(ret & MDIO_STAT1_LSTATUS))
link = false;
if (an) {
ret = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_STAT1);
if (ret < 0)
return ret;
if (!(ret & MDIO_STAT1_LSTATUS))
link = false;
}
return link;
}
......@@ -935,7 +926,7 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs,
int ret;
/* Link needs to be read first ... */
state->link = xpcs_read_link_c73(xpcs, state->an_enabled) > 0 ? 1 : 0;
state->link = xpcs_read_link_c73(xpcs) > 0 ? 1 : 0;
/* ... and then we check the faults. */
ret = xpcs_read_fault_c73(xpcs, state);
......
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