diff --git a/sys/dev/pci/ixgbe/ixgbe.c b/sys/dev/pci/ixgbe/ixgbe.c index 8c26575b593b..ef7e78680513 100644 --- a/sys/dev/pci/ixgbe/ixgbe.c +++ b/sys/dev/pci/ixgbe/ixgbe.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.108 2017/10/26 01:40:33 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.109 2017/11/02 08:41:15 msaitoh Exp $ */ /****************************************************************************** @@ -2689,9 +2689,8 @@ ixgbe_media_change(struct ifnet *ifp) hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) { - adapter->advertise = 0; - } else { + adapter->advertise = 0; + if (IFM_SUBTYPE(ifm->ifm_media) != IFM_AUTO) { if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0) adapter->advertise |= 1 << 2; if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0) @@ -4783,7 +4782,7 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise) return (EINVAL); } - if (advertise < 0x0 || advertise > 0xF) { + if (advertise < 0x0 || advertise > 0x2f) { device_printf(dev, "Invalid advertised speed; valid modes are 0x0 through 0x7\n"); return (EINVAL); diff --git a/sys/dev/pci/ixgbe/ixgbe.h b/sys/dev/pci/ixgbe/ixgbe.h index 9b7b32c7afbb..6ccfa69da89c 100644 --- a/sys/dev/pci/ixgbe/ixgbe.h +++ b/sys/dev/pci/ixgbe/ixgbe.h @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.h,v 1.26 2017/08/30 08:49:18 msaitoh Exp $ */ +/* $NetBSD: ixgbe.h,v 1.27 2017/11/02 08:41:15 msaitoh Exp $ */ /****************************************************************************** @@ -631,11 +631,13 @@ struct adapter { /* Sysctl help messages; displayed with sysctl -d */ #define IXGBE_SYSCTL_DESC_ADV_SPEED \ "\nControl advertised link speed using these flags:\n" \ - "\t0x1 - advertise 100M\n" \ - "\t0x2 - advertise 1G\n" \ - "\t0x4 - advertise 10G\n\n" \ - "\t0x8 - advertise 10M\n\n" \ - "\t100M and 10M are only supported on certain adapters." + "\t0x01 - advertise 100M\n" \ + "\t0x02 - advertise 1G\n" \ + "\t0x04 - advertise 10G\n" \ + "\t0x08 - advertise 10M\n" \ + "\t0x10 - advertise 2.5G\n" \ + "\t0x20 - advertise 5G\n\n" \ + "\t5G, 2.5G, 100M and 10M are only supported on certain adapters." #define IXGBE_SYSCTL_DESC_SET_FC \ "\nSet flow control mode using these values:\n" \