Allow use of 1Gb 1000baseLX SFPs in 82599 ix(4) SFP+ port. Adapted from
authorsthen <sthen@openbsd.org>
Thu, 30 Apr 2015 13:24:36 +0000 (13:24 +0000)
committersthen <sthen@openbsd.org>
Thu, 30 Apr 2015 13:24:36 +0000 (13:24 +0000)
Linux commit 345be204dcbb. ok jsg@ mikeb@

sys/dev/pci/ixgbe_82599.c
sys/dev/pci/ixgbe_phy.c
sys/dev/pci/ixgbe_type.h

index 202b376..fd10af1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ixgbe_82599.c,v 1.10 2013/08/05 19:58:06 mikeb Exp $  */
+/*     $OpenBSD: ixgbe_82599.c,v 1.11 2015/04/30 13:24:36 sthen Exp $  */
 
 /******************************************************************************
 
@@ -372,6 +372,8 @@ int32_t ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
        /* Check if 1G SFP module. */
        if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
            hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
+           hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
+           hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
            hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
            hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) {
                *speed = IXGBE_LINK_SPEED_1GB_FULL;
index 945b60c..f2b94cf 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ixgbe_phy.c,v 1.12 2014/08/25 14:26:25 mikeb Exp $    */
+/*     $OpenBSD: ixgbe_phy.c,v 1.13 2015/04/30 13:24:36 sthen Exp $    */
 
 /******************************************************************************
 
@@ -1112,6 +1112,13 @@ int32_t ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                                else
                                        hw->phy.sfp_type =
                                                ixgbe_sfp_type_1g_sx_core1;
+                       } else if (comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) {
+                               if (hw->bus.lan_id == 0)
+                                       hw->phy.sfp_type =
+                                               ixgbe_sfp_type_1g_lx_core0;
+                               else
+                                       hw->phy.sfp_type =
+                                               ixgbe_sfp_type_1g_lx_core1;
                        } else {
                                hw->phy.sfp_type = ixgbe_sfp_type_unknown;
                        }
@@ -1199,6 +1206,8 @@ int32_t ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                if (comp_codes_10g == 0 &&
                    !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
                      hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
+                     hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
+                     hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
                      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
                      hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
                        hw->phy.type = ixgbe_phy_sfp_unsupported;
@@ -1258,10 +1267,12 @@ int32_t ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
         * SR modules
         */
        if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 ||
+           sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
            sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
            sfp_type == ixgbe_sfp_type_1g_sx_core0)
                sfp_type = ixgbe_sfp_type_srlr_core0;
        else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 ||
+                sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
                 sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
                 sfp_type == ixgbe_sfp_type_1g_sx_core1)
                sfp_type = ixgbe_sfp_type_srlr_core1;
index 9a6710c..af09da2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ixgbe_type.h,v 1.20 2014/08/25 14:26:25 mikeb Exp $   */
+/*     $OpenBSD: ixgbe_type.h,v 1.21 2015/04/30 13:24:36 sthen Exp $   */
 
 /******************************************************************************
 
@@ -2798,6 +2798,8 @@ enum ixgbe_sfp_type {
        ixgbe_sfp_type_1g_cu_core1 = 10,
        ixgbe_sfp_type_1g_sx_core0 = 11,
        ixgbe_sfp_type_1g_sx_core1 = 12,
+       ixgbe_sfp_type_1g_lx_core0 = 13,
+       ixgbe_sfp_type_1g_lx_core1 = 14,
        ixgbe_sfp_type_not_present = 0xFFFE,
        ixgbe_sfp_type_unknown = 0xFFFF
 };