Skip to content

Commit 767f4a7

Browse files
Ben Hutchingsdavem330
authored andcommitted
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>
1 parent be926fc commit 767f4a7

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎drivers/net/mdio.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,9 @@ void mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio,
344344

345345
old_adv = mdio->mdio_read(mdio->dev, mdio->prtad, MDIO_MMD_AN,
346346
MDIO_AN_ADVERTISE);
347-
adv = old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
348-
if (ecmd->autoneg)
349-
adv |= mii_advertise_flowctrl(
350-
(ecmd->rx_pause ? FLOW_CTRL_RX : 0) |
351-
(ecmd->tx_pause ? FLOW_CTRL_TX : 0));
347+
adv = ((old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM)) |
348+
mii_advertise_flowctrl((ecmd->rx_pause ? FLOW_CTRL_RX : 0) |
349+
(ecmd->tx_pause ? FLOW_CTRL_TX : 0)));
352350
if (adv != old_adv) {
353351
mdio->mdio_write(mdio->dev, mdio->prtad, MDIO_MMD_AN,
354352
MDIO_AN_ADVERTISE, adv);

0 commit comments

Comments
 (0)