diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-10-12 05:26:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 02:59:07 -0400 |
commit | 767f4a7ca8041442e033dd919b591d00f6901e03 (patch) | |
tree | 6bd88e69a3279f0b4a0d31a80eef58f3cd4bc5ba /drivers/net/mdio.c | |
parent | be926fc4046913d9ad921aeacdf9329978241c38 (diff) |
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: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mdio.c')
-rw-r--r-- | drivers/net/mdio.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/mdio.c b/drivers/net/mdio.c index 21f8754fcf4c..c0db9d753006 100644 --- a/drivers/net/mdio.c +++ b/drivers/net/mdio.c | |||
@@ -344,11 +344,9 @@ void mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio, | |||
344 | 344 | ||
345 | old_adv = mdio->mdio_read(mdio->dev, mdio->prtad, MDIO_MMD_AN, | 345 | old_adv = mdio->mdio_read(mdio->dev, mdio->prtad, MDIO_MMD_AN, |
346 | MDIO_AN_ADVERTISE); | 346 | MDIO_AN_ADVERTISE); |
347 | adv = old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); | 347 | adv = ((old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM)) | |
348 | if (ecmd->autoneg) | 348 | mii_advertise_flowctrl((ecmd->rx_pause ? FLOW_CTRL_RX : 0) | |
349 | adv |= mii_advertise_flowctrl( | 349 | (ecmd->tx_pause ? FLOW_CTRL_TX : 0))); |
350 | (ecmd->rx_pause ? FLOW_CTRL_RX : 0) | | ||
351 | (ecmd->tx_pause ? FLOW_CTRL_TX : 0)); | ||
352 | if (adv != old_adv) { | 350 | if (adv != old_adv) { |
353 | mdio->mdio_write(mdio->dev, mdio->prtad, MDIO_MMD_AN, | 351 | mdio->mdio_write(mdio->dev, mdio->prtad, MDIO_MMD_AN, |
354 | MDIO_AN_ADVERTISE, adv); | 352 | MDIO_AN_ADVERTISE, adv); |