summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2015-04-30 14:17:26 +0000
committerjsg <jsg@openbsd.org>2015-04-30 14:17:26 +0000
commit4e92f4a13cf16ab488513a556fcc60b6f2c9db35 (patch)
tree1277e3b7aa2a85a2f7548826ebe6f57e2fd3ecc3
parentTweak comment so it doesn't imply line buffering is needed (any will do (diff)
downloadwireguard-openbsd-4e92f4a13cf16ab488513a556fcc60b6f2c9db35.tar.xz
wireguard-openbsd-4e92f4a13cf16ab488513a556fcc60b6f2c9db35.zip
Set the correct media type for 1000baseLX SFPs.
Tested by/ok sthen@, ok mikeb@
-rw-r--r--sys/dev/pci/if_ix.c15
-rw-r--r--sys/dev/pci/ixgbe_82599.c4
-rw-r--r--sys/dev/pci/ixgbe_type.h3
3 files changed, 17 insertions, 5 deletions
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c
index a05c836f9f4..bb90916e2fa 100644
--- a/sys/dev/pci/if_ix.c
+++ b/sys/dev/pci/if_ix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.c,v 1.118 2015/03/20 10:41:15 mikeb Exp $ */
+/* $OpenBSD: if_ix.c,v 1.119 2015/04/30 14:17:26 jsg Exp $ */
/******************************************************************************
@@ -953,8 +953,15 @@ ixgbe_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
ifmr->ifm_active |= IFM_100_TX | IFM_FDX;
break;
case IXGBE_LINK_SPEED_1GB_FULL:
- ifmr->ifm_active |= ((sc->optics == IFM_1000_SX) ?
- IFM_1000_SX : IFM_1000_T) | IFM_FDX;
+ switch (sc->optics) {
+ case IFM_1000_SX:
+ case IFM_1000_LX:
+ ifmr->ifm_active |= sc->optics | IFM_FDX;
+ break;
+ default:
+ ifmr->ifm_active |= IFM_1000_T | IFM_FDX;
+ break;
+ }
break;
case IXGBE_LINK_SPEED_10GB_FULL:
ifmr->ifm_active |= sc->optics | IFM_FDX;
@@ -1407,6 +1414,8 @@ ixgbe_setup_optics(struct ix_softc *sc)
sc->optics = IFM_10G_CX4;
else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX)
sc->optics = IFM_1000_SX;
+ else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_LX)
+ sc->optics = IFM_1000_LX;
}
/*********************************************************************
diff --git a/sys/dev/pci/ixgbe_82599.c b/sys/dev/pci/ixgbe_82599.c
index fd10af1844d..934af1f706b 100644
--- a/sys/dev/pci/ixgbe_82599.c
+++ b/sys/dev/pci/ixgbe_82599.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ixgbe_82599.c,v 1.11 2015/04/30 13:24:36 sthen Exp $ */
+/* $OpenBSD: ixgbe_82599.c,v 1.12 2015/04/30 14:17:26 jsg Exp $ */
/******************************************************************************
@@ -1582,6 +1582,8 @@ sfp_check:
physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T;
else if (comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE)
physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_SX;
+ else if (comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE)
+ physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_LX;
break;
default:
break;
diff --git a/sys/dev/pci/ixgbe_type.h b/sys/dev/pci/ixgbe_type.h
index af09da2bd68..2c9d4937af9 100644
--- a/sys/dev/pci/ixgbe_type.h
+++ b/sys/dev/pci/ixgbe_type.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ixgbe_type.h,v 1.21 2015/04/30 13:24:36 sthen Exp $ */
+/* $OpenBSD: ixgbe_type.h,v 1.22 2015/04/30 14:17:26 jsg Exp $ */
/******************************************************************************
@@ -2591,6 +2591,7 @@ typedef uint32_t ixgbe_physical_layer;
#define IXGBE_PHYSICAL_LAYER_10GBASE_XAUI 0x1000
#define IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA 0x2000
#define IXGBE_PHYSICAL_LAYER_1000BASE_SX 0x4000
+#define IXGBE_PHYSICAL_LAYER_1000BASE_LX 0x8000
/* Flow Control Data Sheet defined values
* Calculation and defines taken from 802.1bb Annex O