diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2013-08-16 19:11:14 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-08-29 06:36:55 -0400 |
commit | 9a84fea2ecdcdcd61d6efce77cb1152cd500219e (patch) | |
tree | 41a4ec4a9e3cdc7fc1c40b5b49ccc3c861989ac0 | |
parent | 987e1d56b3157592d73f7f6170decada716fc415 (diff) |
ixgbe: add support for older QSFP active DA cables
This patch adds support for QSFP active direct attach (DA) cables which
pre-date SFF-8436 v3.6.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 55 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | 5 |
2 files changed, 50 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c index e89b34eae4db..e4c676006be9 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | |||
@@ -1175,6 +1175,10 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) | |||
1175 | u8 comp_codes_10g = 0; | 1175 | u8 comp_codes_10g = 0; |
1176 | u8 oui_bytes[3] = {0, 0, 0}; | 1176 | u8 oui_bytes[3] = {0, 0, 0}; |
1177 | u16 enforce_sfp = 0; | 1177 | u16 enforce_sfp = 0; |
1178 | u8 connector = 0; | ||
1179 | u8 cable_length = 0; | ||
1180 | u8 device_tech = 0; | ||
1181 | bool active_cable = false; | ||
1178 | 1182 | ||
1179 | if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber_qsfp) { | 1183 | if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber_qsfp) { |
1180 | hw->phy.sfp_type = ixgbe_sfp_type_not_present; | 1184 | hw->phy.sfp_type = ixgbe_sfp_type_not_present; |
@@ -1217,12 +1221,6 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) | |||
1217 | hw->phy.sfp_type = ixgbe_sfp_type_da_cu_core0; | 1221 | hw->phy.sfp_type = ixgbe_sfp_type_da_cu_core0; |
1218 | else | 1222 | else |
1219 | hw->phy.sfp_type = ixgbe_sfp_type_da_cu_core1; | 1223 | hw->phy.sfp_type = ixgbe_sfp_type_da_cu_core1; |
1220 | } else if (comp_codes_10g & IXGBE_SFF_QSFP_DA_ACTIVE_CABLE) { | ||
1221 | hw->phy.type = ixgbe_phy_qsfp_active_unknown; | ||
1222 | if (hw->bus.lan_id == 0) | ||
1223 | hw->phy.sfp_type = ixgbe_sfp_type_da_act_lmt_core0; | ||
1224 | else | ||
1225 | hw->phy.sfp_type = ixgbe_sfp_type_da_act_lmt_core1; | ||
1226 | } else if (comp_codes_10g & (IXGBE_SFF_10GBASESR_CAPABLE | | 1224 | } else if (comp_codes_10g & (IXGBE_SFF_10GBASESR_CAPABLE | |
1227 | IXGBE_SFF_10GBASELR_CAPABLE)) { | 1225 | IXGBE_SFF_10GBASELR_CAPABLE)) { |
1228 | if (hw->bus.lan_id == 0) | 1226 | if (hw->bus.lan_id == 0) |
@@ -1230,10 +1228,47 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) | |||
1230 | else | 1228 | else |
1231 | hw->phy.sfp_type = ixgbe_sfp_type_srlr_core1; | 1229 | hw->phy.sfp_type = ixgbe_sfp_type_srlr_core1; |
1232 | } else { | 1230 | } else { |
1233 | /* unsupported module type */ | 1231 | if (comp_codes_10g & IXGBE_SFF_QSFP_DA_ACTIVE_CABLE) |
1234 | hw->phy.type = ixgbe_phy_sfp_unsupported; | 1232 | active_cable = true; |
1235 | status = IXGBE_ERR_SFP_NOT_SUPPORTED; | 1233 | |
1236 | goto out; | 1234 | if (!active_cable) { |
1235 | /* check for active DA cables that pre-date | ||
1236 | * SFF-8436 v3.6 | ||
1237 | */ | ||
1238 | hw->phy.ops.read_i2c_eeprom(hw, | ||
1239 | IXGBE_SFF_QSFP_CONNECTOR, | ||
1240 | &connector); | ||
1241 | |||
1242 | hw->phy.ops.read_i2c_eeprom(hw, | ||
1243 | IXGBE_SFF_QSFP_CABLE_LENGTH, | ||
1244 | &cable_length); | ||
1245 | |||
1246 | hw->phy.ops.read_i2c_eeprom(hw, | ||
1247 | IXGBE_SFF_QSFP_DEVICE_TECH, | ||
1248 | &device_tech); | ||
1249 | |||
1250 | if ((connector == | ||
1251 | IXGBE_SFF_QSFP_CONNECTOR_NOT_SEPARABLE) && | ||
1252 | (cable_length > 0) && | ||
1253 | ((device_tech >> 4) == | ||
1254 | IXGBE_SFF_QSFP_TRANSMITER_850NM_VCSEL)) | ||
1255 | active_cable = true; | ||
1256 | } | ||
1257 | |||
1258 | if (active_cable) { | ||
1259 | hw->phy.type = ixgbe_phy_qsfp_active_unknown; | ||
1260 | if (hw->bus.lan_id == 0) | ||
1261 | hw->phy.sfp_type = | ||
1262 | ixgbe_sfp_type_da_act_lmt_core0; | ||
1263 | else | ||
1264 | hw->phy.sfp_type = | ||
1265 | ixgbe_sfp_type_da_act_lmt_core1; | ||
1266 | } else { | ||
1267 | /* unsupported module type */ | ||
1268 | hw->phy.type = ixgbe_phy_sfp_unsupported; | ||
1269 | status = IXGBE_ERR_SFP_NOT_SUPPORTED; | ||
1270 | goto out; | ||
1271 | } | ||
1237 | } | 1272 | } |
1238 | 1273 | ||
1239 | if (hw->phy.sfp_type != stored_sfp_type) | 1274 | if (hw->phy.sfp_type != stored_sfp_type) |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h index 138dadd7cf33..24af12e3719e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | |||
@@ -50,8 +50,11 @@ | |||
50 | #define IXGBE_SFF_QSFP_VENDOR_OUI_BYTE0 0xA5 | 50 | #define IXGBE_SFF_QSFP_VENDOR_OUI_BYTE0 0xA5 |
51 | #define IXGBE_SFF_QSFP_VENDOR_OUI_BYTE1 0xA6 | 51 | #define IXGBE_SFF_QSFP_VENDOR_OUI_BYTE1 0xA6 |
52 | #define IXGBE_SFF_QSFP_VENDOR_OUI_BYTE2 0xA7 | 52 | #define IXGBE_SFF_QSFP_VENDOR_OUI_BYTE2 0xA7 |
53 | #define IXGBE_SFF_QSFP_CONNECTOR 0x82 | ||
53 | #define IXGBE_SFF_QSFP_10GBE_COMP 0x83 | 54 | #define IXGBE_SFF_QSFP_10GBE_COMP 0x83 |
54 | #define IXGBE_SFF_QSFP_1GBE_COMP 0x86 | 55 | #define IXGBE_SFF_QSFP_1GBE_COMP 0x86 |
56 | #define IXGBE_SFF_QSFP_CABLE_LENGTH 0x92 | ||
57 | #define IXGBE_SFF_QSFP_DEVICE_TECH 0x93 | ||
55 | 58 | ||
56 | /* Bitmasks */ | 59 | /* Bitmasks */ |
57 | #define IXGBE_SFF_DA_PASSIVE_CABLE 0x4 | 60 | #define IXGBE_SFF_DA_PASSIVE_CABLE 0x4 |
@@ -68,6 +71,8 @@ | |||
68 | #define IXGBE_SFF_ADDRESSING_MODE 0x4 | 71 | #define IXGBE_SFF_ADDRESSING_MODE 0x4 |
69 | #define IXGBE_SFF_QSFP_DA_ACTIVE_CABLE 0x1 | 72 | #define IXGBE_SFF_QSFP_DA_ACTIVE_CABLE 0x1 |
70 | #define IXGBE_SFF_QSFP_DA_PASSIVE_CABLE 0x8 | 73 | #define IXGBE_SFF_QSFP_DA_PASSIVE_CABLE 0x8 |
74 | #define IXGBE_SFF_QSFP_CONNECTOR_NOT_SEPARABLE 0x23 | ||
75 | #define IXGBE_SFF_QSFP_TRANSMITER_850NM_VCSEL 0x0 | ||
71 | #define IXGBE_I2C_EEPROM_READ_MASK 0x100 | 76 | #define IXGBE_I2C_EEPROM_READ_MASK 0x100 |
72 | #define IXGBE_I2C_EEPROM_STATUS_MASK 0x3 | 77 | #define IXGBE_I2C_EEPROM_STATUS_MASK 0x3 |
73 | #define IXGBE_I2C_EEPROM_STATUS_NO_OPERATION 0x0 | 78 | #define IXGBE_I2C_EEPROM_STATUS_NO_OPERATION 0x0 |