Commit 767f4a7c authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

mdio: Advertise pause (flow control) settings even if autoneg is off

Currently, if pause autoneg is off we do not set either pause
advertising flag.  If autonegotiation of speed and duplex settings is
enabled, there is no way for the link partner to distinguish this from
our refusing to use pause frames.

We should instead set the advertising flags according to the forced
mode so that the link partner can follow our lead.  This is consistent
with the behaviour of other drivers.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be926fc4
...@@ -344,11 +344,9 @@ void mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio, ...@@ -344,11 +344,9 @@ void mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio,
old_adv = mdio->mdio_read(mdio->dev, mdio->prtad, MDIO_MMD_AN, old_adv = mdio->mdio_read(mdio->dev, mdio->prtad, MDIO_MMD_AN,
MDIO_AN_ADVERTISE); MDIO_AN_ADVERTISE);
adv = old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); adv = ((old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM)) |
if (ecmd->autoneg) mii_advertise_flowctrl((ecmd->rx_pause ? FLOW_CTRL_RX : 0) |
adv |= mii_advertise_flowctrl( (ecmd->tx_pause ? FLOW_CTRL_TX : 0)));
(ecmd->rx_pause ? FLOW_CTRL_RX : 0) |
(ecmd->tx_pause ? FLOW_CTRL_TX : 0));
if (adv != old_adv) { if (adv != old_adv) {
mdio->mdio_write(mdio->dev, mdio->prtad, MDIO_MMD_AN, mdio->mdio_write(mdio->dev, mdio->prtad, MDIO_MMD_AN,
MDIO_AN_ADVERTISE, adv); MDIO_AN_ADVERTISE, adv);
......
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