Module Name: src Committed By: msaitoh Date: Fri Jun 23 04:36:48 UTC 2017
Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c Log Message: Use IFM_1000_KX more. To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/dev/pci/ixgbe/ixgbe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.89 src/sys/dev/pci/ixgbe/ixgbe.c:1.90 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.89 Mon Jun 12 03:03:22 2017 +++ src/sys/dev/pci/ixgbe/ixgbe.c Fri Jun 23 04:36:48 2017 @@ -59,7 +59,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/ -/*$NetBSD: ixgbe.c,v 1.89 2017/06/12 03:03:22 msaitoh Exp $*/ +/*$NetBSD: ixgbe.c,v 1.90 2017/06/23 04:36:48 msaitoh Exp $*/ #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -2145,41 +2145,19 @@ ixgbe_media_change(struct ifnet * ifp) ** media types of the adapter; ifmedia will take care of ** that for us. */ -#ifndef IFM_ETH_XTYPE switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: case IFM_10G_T: speed |= IXGBE_LINK_SPEED_100_FULL; case IFM_10G_LRM: - case IFM_10G_SR: /* KR, too */ case IFM_10G_LR: +#ifndef IFM_ETH_XTYPE + case IFM_10G_SR: /* KR, too */ case IFM_10G_CX4: /* KX4 */ - speed |= IXGBE_LINK_SPEED_1GB_FULL; - case IFM_10G_TWINAX: - speed |= IXGBE_LINK_SPEED_10GB_FULL; - break; - case IFM_1000_T: - speed |= IXGBE_LINK_SPEED_100_FULL; - case IFM_1000_LX: - case IFM_1000_SX: - case IFM_1000_CX: /* KX */ - speed |= IXGBE_LINK_SPEED_1GB_FULL; - break; - case IFM_100_TX: - speed |= IXGBE_LINK_SPEED_100_FULL; - break; - default: - goto invalid; - } #else - switch (IFM_SUBTYPE(ifm->ifm_media)) { - case IFM_AUTO: - case IFM_10G_T: - speed |= IXGBE_LINK_SPEED_100_FULL; - case IFM_10G_LRM: case IFM_10G_KR: - case IFM_10G_LR: case IFM_10G_KX4: +#endif speed |= IXGBE_LINK_SPEED_1GB_FULL; case IFM_10G_TWINAX: speed |= IXGBE_LINK_SPEED_10GB_FULL; @@ -2197,7 +2175,6 @@ ixgbe_media_change(struct ifnet * ifp) default: goto invalid; } -#endif hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); @@ -3260,10 +3237,6 @@ ixgbe_add_media_types(struct adapter *ad ADD(AIFM_10G_KX4, 0); ADD(AIFM_10G_KX4 | IFM_FDX, 0); } - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) { - ADD(IFM_1000_KX, 0); - ADD(IFM_1000_KX | IFM_FDX, 0); - } #else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) { device_printf(dev, "Media supported: 10GbaseKR\n"); @@ -3277,13 +3250,11 @@ ixgbe_add_media_types(struct adapter *ad ADD(IFM_10G_CX4, 0); ADD(IFM_10G_CX4 | IFM_FDX, 0); } +#endif if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) { - device_printf(dev, "Media supported: 1000baseKX\n"); - device_printf(dev, "1000baseKX mapped to 1000baseCX\n"); - ADD(IFM_1000_CX, 0); - ADD(IFM_1000_CX | IFM_FDX, 0); + ADD(IFM_1000_KX, 0); + ADD(IFM_1000_KX | IFM_FDX, 0); } -#endif if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) device_printf(dev, "Media supported: 1000baseBX\n"); /* XXX no ifmedia_set? */