ixgbe: add support for 1G SX modules
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 8 Jun 2012 06:59:09 +0000 (06:59 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 20 Jun 2012 08:37:04 +0000 (01:37 -0700)
This patch adds support for 1G Fiber PHY modules (SFP+ modules). This support
comes along side support for 1G Copper PHY modules, but uses a different PHY
type (ixgbe_sfp_type_1g_sx_core).

Signed-off-by: Jacob Keller <jacob.e.keller@intel.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_phy.c
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

index dee64d2703f004a73ef6172fd2961a8d33ff9482..e7dddfd97cb996ab0200d82a362be24d00d2a515 100644 (file)
@@ -241,7 +241,9 @@ 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_cu_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;
                *negotiation = true;
                goto out;
index 24117709d6a2164ec47f92b045f3be48fdda3ad5..71659edf81aafc2b1150eb2632f0fa6851cdd889 100644 (file)
@@ -907,6 +907,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                  * 8   SFP_act_lmt_DA_CORE1 - 82599-specific
                  * 9   SFP_1g_cu_CORE0 - 82599-specific
                  * 10  SFP_1g_cu_CORE1 - 82599-specific
+                 * 11  SFP_1g_sx_CORE0 - 82599-specific
+                 * 12  SFP_1g_sx_CORE1 - 82599-specific
                  */
                if (hw->mac.type == ixgbe_mac_82598EB) {
                        if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
@@ -957,6 +959,13 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                                else
                                        hw->phy.sfp_type =
                                                ixgbe_sfp_type_1g_cu_core1;
+                       } else if (comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) {
+                               if (hw->bus.lan_id == 0)
+                                       hw->phy.sfp_type =
+                                               ixgbe_sfp_type_1g_sx_core0;
+                               else
+                                       hw->phy.sfp_type =
+                                               ixgbe_sfp_type_1g_sx_core1;
                        } else {
                                hw->phy.sfp_type = ixgbe_sfp_type_unknown;
                        }
@@ -1049,7 +1058,9 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                /* Verify supported 1G SFP modules */
                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_cu_core0 ||
+                     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;
                        status = IXGBE_ERR_SFP_NOT_SUPPORTED;
                        goto out;
@@ -1064,7 +1075,9 @@ 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_cu_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;
@@ -1128,10 +1141,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_cu_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_cu_core1)
+                sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
+                sfp_type == ixgbe_sfp_type_1g_sx_core1)
                sfp_type = ixgbe_sfp_type_srlr_core1;
 
        /* Read offset to PHY init contents */
index 1085c0739a3cd361298e49a3b13401028a6b3538..7416d22ec2278bed474ed54e05db93b46060f6a9 100644 (file)
@@ -2604,6 +2604,8 @@ enum ixgbe_sfp_type {
        ixgbe_sfp_type_da_act_lmt_core1 = 8,
        ixgbe_sfp_type_1g_cu_core0 = 9,
        ixgbe_sfp_type_1g_cu_core1 = 10,
+       ixgbe_sfp_type_1g_sx_core0 = 11,
+       ixgbe_sfp_type_1g_sx_core1 = 12,
        ixgbe_sfp_type_not_present = 0xFFFE,
        ixgbe_sfp_type_unknown = 0xFFFF
 };