ixgbe: add support for active DA cables
authorDon Skidmore <donald.c.skidmore@intel.com>
Tue, 18 May 2010 16:00:13 +0000 (16:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 May 2010 02:44:20 +0000 (19:44 -0700)
This patch adds support of active DA cables.  This is
renaming and adding some PHY type enumerations.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbe/ixgbe_82599.c
drivers/net/ixgbe/ixgbe_ethtool.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/ixgbe/ixgbe_phy.c
drivers/net/ixgbe/ixgbe_phy.h
drivers/net/ixgbe/ixgbe_type.h

index dc197a4..e9706eb 100644 (file)
@@ -2155,10 +2155,14 @@ sfp_check:
                goto out;
 
        switch (hw->phy.type) {
-       case ixgbe_phy_tw_tyco:
-       case ixgbe_phy_tw_unknown:
+       case ixgbe_phy_sfp_passive_tyco:
+       case ixgbe_phy_sfp_passive_unknown:
                physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
                break;
+       case ixgbe_phy_sfp_ftl_active:
+       case ixgbe_phy_sfp_active_unknown:
+               physical_layer = IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA;
+               break;
        case ixgbe_phy_sfp_avago:
        case ixgbe_phy_sfp_ftl:
        case ixgbe_phy_sfp_intel:
index 251767d..c50a754 100644 (file)
@@ -212,8 +212,8 @@ static int ixgbe_get_settings(struct net_device *netdev,
                ecmd->port = PORT_FIBRE;
                break;
        case ixgbe_phy_nl:
-       case ixgbe_phy_tw_tyco:
-       case ixgbe_phy_tw_unknown:
+       case ixgbe_phy_sfp_passive_tyco:
+       case ixgbe_phy_sfp_passive_unknown:
        case ixgbe_phy_sfp_ftl:
        case ixgbe_phy_sfp_avago:
        case ixgbe_phy_sfp_intel:
index caf1114..9551cbb 100644 (file)
@@ -3118,8 +3118,10 @@ static inline bool ixgbe_is_sfp(struct ixgbe_hw *hw)
        case ixgbe_phy_sfp_ftl:
        case ixgbe_phy_sfp_intel:
        case ixgbe_phy_sfp_unknown:
-       case ixgbe_phy_tw_tyco:
-       case ixgbe_phy_tw_unknown:
+       case ixgbe_phy_sfp_passive_tyco:
+       case ixgbe_phy_sfp_passive_unknown:
+       case ixgbe_phy_sfp_active_unknown:
+       case ixgbe_phy_sfp_ftl_active:
                return true;
        default:
                return false;
index d6d5b84..22d21af 100644 (file)
@@ -531,6 +531,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
        u8 comp_codes_10g = 0;
        u8 oui_bytes[3] = {0, 0, 0};
        u8 cable_tech = 0;
+       u8 cable_spec = 0;
        u16 enforce_sfp = 0;
 
        if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) {
@@ -580,14 +581,30 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                        else
                                hw->phy.sfp_type = ixgbe_sfp_type_unknown;
                } else if (hw->mac.type == ixgbe_mac_82599EB) {
-                       if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
+                       if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) {
                                if (hw->bus.lan_id == 0)
                                        hw->phy.sfp_type =
                                                     ixgbe_sfp_type_da_cu_core0;
                                else
                                        hw->phy.sfp_type =
                                                     ixgbe_sfp_type_da_cu_core1;
-                       else if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
+                       } else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) {
+                               hw->phy.ops.read_i2c_eeprom(
+                                               hw, IXGBE_SFF_CABLE_SPEC_COMP,
+                                               &cable_spec);
+                               if (cable_spec &
+                                   IXGBE_SFF_DA_SPEC_ACTIVE_LIMITING) {
+                                       if (hw->bus.lan_id == 0)
+                                               hw->phy.sfp_type =
+                                               ixgbe_sfp_type_da_act_lmt_core0;
+                                       else
+                                               hw->phy.sfp_type =
+                                               ixgbe_sfp_type_da_act_lmt_core1;
+                               } else {
+                                       hw->phy.sfp_type =
+                                               ixgbe_sfp_type_unknown;
+                               }
+                       } else if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
                                if (hw->bus.lan_id == 0)
                                        hw->phy.sfp_type =
                                                      ixgbe_sfp_type_srlr_core0;
@@ -637,10 +654,14 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                        switch (vendor_oui) {
                        case IXGBE_SFF_VENDOR_OUI_TYCO:
                                if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
-                                       hw->phy.type = ixgbe_phy_tw_tyco;
+                                       hw->phy.type =
+                                               ixgbe_phy_sfp_passive_tyco;
                                break;
                        case IXGBE_SFF_VENDOR_OUI_FTL:
-                               hw->phy.type = ixgbe_phy_sfp_ftl;
+                               if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
+                                       hw->phy.type = ixgbe_phy_sfp_ftl_active;
+                               else
+                                       hw->phy.type = ixgbe_phy_sfp_ftl;
                                break;
                        case IXGBE_SFF_VENDOR_OUI_AVAGO:
                                hw->phy.type = ixgbe_phy_sfp_avago;
@@ -650,7 +671,11 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                                break;
                        default:
                                if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
-                                       hw->phy.type = ixgbe_phy_tw_unknown;
+                                       hw->phy.type =
+                                               ixgbe_phy_sfp_passive_unknown;
+                               else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
+                                       hw->phy.type =
+                                               ixgbe_phy_sfp_active_unknown;
                                else
                                        hw->phy.type = ixgbe_phy_sfp_unknown;
                                break;
@@ -658,7 +683,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                }
 
                /* All passive DA cables are supported */
-               if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) {
+               if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE |
+                   IXGBE_SFF_DA_ACTIVE_CABLE)) {
                        status = 0;
                        goto out;
                }
index 9cf5f3b..c9c5459 100644 (file)
 #define IXGBE_SFF_1GBE_COMP_CODES    0x6
 #define IXGBE_SFF_10GBE_COMP_CODES   0x3
 #define IXGBE_SFF_CABLE_TECHNOLOGY   0x8
+#define IXGBE_SFF_CABLE_SPEC_COMP    0x3C
 
 /* Bitmasks */
 #define IXGBE_SFF_DA_PASSIVE_CABLE           0x4
+#define IXGBE_SFF_DA_ACTIVE_CABLE            0x8
+#define IXGBE_SFF_DA_SPEC_ACTIVE_LIMITING    0x4
 #define IXGBE_SFF_1GBASESX_CAPABLE           0x1
 #define IXGBE_SFF_1GBASELX_CAPABLE           0x2
 #define IXGBE_SFF_10GBASESR_CAPABLE          0x10
index bd69196..39b9be8 100644 (file)
@@ -2108,6 +2108,7 @@ typedef u32 ixgbe_physical_layer;
 #define IXGBE_PHYSICAL_LAYER_1000BASE_BX  0x0400
 #define IXGBE_PHYSICAL_LAYER_10GBASE_KR   0x0800
 #define IXGBE_PHYSICAL_LAYER_10GBASE_XAUI 0x1000
+#define IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA 0x2000
 
 /* Software ATR hash keys */
 #define IXGBE_ATR_BUCKET_HASH_KEY    0xE214AD3D
@@ -2177,10 +2178,12 @@ enum ixgbe_phy_type {
        ixgbe_phy_qt,
        ixgbe_phy_xaui,
        ixgbe_phy_nl,
-       ixgbe_phy_tw_tyco,
-       ixgbe_phy_tw_unknown,
+       ixgbe_phy_sfp_passive_tyco,
+       ixgbe_phy_sfp_passive_unknown,
+       ixgbe_phy_sfp_active_unknown,
        ixgbe_phy_sfp_avago,
        ixgbe_phy_sfp_ftl,
+       ixgbe_phy_sfp_ftl_active,
        ixgbe_phy_sfp_unknown,
        ixgbe_phy_sfp_intel,
        ixgbe_phy_sfp_unsupported,
@@ -2208,6 +2211,8 @@ enum ixgbe_sfp_type {
        ixgbe_sfp_type_da_cu_core1 = 4,
        ixgbe_sfp_type_srlr_core0 = 5,
        ixgbe_sfp_type_srlr_core1 = 6,
+       ixgbe_sfp_type_da_act_lmt_core0 = 7,
+       ixgbe_sfp_type_da_act_lmt_core1 = 8,
        ixgbe_sfp_type_not_present = 0xFFFE,
        ixgbe_sfp_type_unknown = 0xFFFF
 };