diff options
author | smh <smh@FreeBSD.org> | 2016-01-22 17:03:32 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-01-22 17:03:32 +0000 |
commit | 130dafc3086e3c5dbde01a9ff799fa24b3fa0569 (patch) | |
tree | a0ca419c36503628f4dd14de0a5dd9ae50dba180 /sys/dev/ixgbe | |
parent | 230837c0171d83159edbb6b0e8a4bf5c98815b14 (diff) | |
download | FreeBSD-src-130dafc3086e3c5dbde01a9ff799fa24b3fa0569.zip FreeBSD-src-130dafc3086e3c5dbde01a9ff799fa24b3fa0569.tar.gz |
Fix ix advertise value after media change
When ifconfig sets media then the values displayed by the advertise_speed
value are invalidated.
Fix this by setting the bits correctly including setting advertise to 0 for
media = auto.
Reviewed by: sbruno
MFC after: 1 week
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D5034
Diffstat (limited to 'sys/dev/ixgbe')
-rw-r--r-- | sys/dev/ixgbe/if_ix.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 67cc4ba..8d96c9a 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1948,10 +1948,16 @@ ixgbe_media_change(struct ifnet * ifp) hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - adapter->advertise = - ((speed & IXGBE_LINK_SPEED_10GB_FULL) << 2) | - ((speed & IXGBE_LINK_SPEED_1GB_FULL) << 1) | - ((speed & IXGBE_LINK_SPEED_100_FULL) << 0); + if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) { + adapter->advertise = 0; + } else { + if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0) + adapter->advertise |= 1 << 2; + if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0) + adapter->advertise |= 1 << 1; + if ((speed & IXGBE_LINK_SPEED_100_FULL) != 0) + adapter->advertise |= 1 << 0; + } return (0); |