]> Pileus Git - ~andy/linux/commitdiff
ixgbe: add SFP+ LX module support
authorDon Skidmore <donald.c.skidmore@intel.com>
Thu, 11 Apr 2013 06:23:34 +0000 (06:23 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 25 Apr 2013 00:47:35 +0000 (17:47 -0700)
This patch adds LX support to 82599 devices. This is an alternate patch to
the one suggested by Stefan Behte <s.behte@babiel.com>

In addition this patch includes some cleanups such as:
- removed parenthesis around "x == y ||" lines inside an if statement for
consistency.
- grouped the sx/lx sfp types along with srlr in ixgbe_get_settings() since
they all have the same supported, advertised and port values.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Reported-by: Stefan Behte <s.behte@babiel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

index 6dbdd4f9d254a3563e9983e0ef0fc7f37fc68a35..3f792428ca534be73606f59dfd10826a6baa4576 100644 (file)
@@ -266,6 +266,8 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
        /* Determine 1G link capabilities off of SFP+ type */
        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 c3f1afd869066163f6f2ecc3a1cc7adb158651ce..bbe00bcc75827abc4affeca69827c5ddeafa0b96 100644 (file)
@@ -231,6 +231,10 @@ static int ixgbe_get_settings(struct net_device *netdev,
                case ixgbe_sfp_type_lr:
                case ixgbe_sfp_type_srlr_core0:
                case ixgbe_sfp_type_srlr_core1:
+               case ixgbe_sfp_type_1g_sx_core0:
+               case ixgbe_sfp_type_1g_sx_core1:
+               case ixgbe_sfp_type_1g_lx_core0:
+               case ixgbe_sfp_type_1g_lx_core1:
                        ecmd->supported |= SUPPORTED_FIBRE;
                        ecmd->advertising |= ADVERTISED_FIBRE;
                        ecmd->port = PORT_FIBRE;
@@ -246,12 +250,6 @@ static int ixgbe_get_settings(struct net_device *netdev,
                        ecmd->advertising |= ADVERTISED_TP;
                        ecmd->port = PORT_TP;
                        break;
-               case ixgbe_sfp_type_1g_sx_core0:
-               case ixgbe_sfp_type_1g_sx_core1:
-                       ecmd->supported |= SUPPORTED_FIBRE;
-                       ecmd->advertising |= ADVERTISED_FIBRE;
-                       ecmd->port = PORT_FIBRE;
-                       break;
                case ixgbe_sfp_type_unknown:
                default:
                        ecmd->supported |= SUPPORTED_FIBRE;
index 060d2ad2ac9681054730ee1a1045659be3ce1691..e5691ccbce9dd09eac8caa20120531b5e3ad1a2a 100644 (file)
@@ -956,6 +956,13 @@ s32 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;
                        }
@@ -1043,6 +1050,8 @@ s32 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;
@@ -1058,10 +1067,12 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
 
                hw->mac.ops.get_device_caps(hw, &enforce_sfp);
                if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) &&
-                   !((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_sx_core0) ||
-                     (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1))) {
+                   !(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)) {
                        /* Make sure we're a supported PHY type */
                        if (hw->phy.type == ixgbe_phy_sfp_intel) {
                                status = 0;
@@ -1125,10 +1136,12 @@ s32 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 100dd92de2ddb37345c0e5c40df0a4a196514569..4cbe21952ba8b1003b60c4c2ca8d06f1b5768eb3 100644 (file)
@@ -2611,6 +2611,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
 };