aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Skidmore <donald.c.skidmore@intel.com>2013-04-11 02:23:34 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-04-24 20:47:35 -0400
commit345be204dcbb2cc7580a63bc377a185125a6f822 (patch)
treec22322a64182a52e2f834cc2c37d29bd90669174
parent6b92b0ba757342a1489b9400b67de864e6516381 (diff)
ixgbe: add SFP+ LX module support
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>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c10
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c21
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_type.h2
4 files changed, 25 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index 6dbdd4f9d254..3f792428ca53 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -266,6 +266,8 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
266 /* Determine 1G link capabilities off of SFP+ type */ 266 /* Determine 1G link capabilities off of SFP+ type */
267 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || 267 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
268 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || 268 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
269 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
270 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
269 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || 271 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
270 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { 272 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) {
271 *speed = IXGBE_LINK_SPEED_1GB_FULL; 273 *speed = IXGBE_LINK_SPEED_1GB_FULL;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index c3f1afd86906..bbe00bcc7582 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -231,6 +231,10 @@ static int ixgbe_get_settings(struct net_device *netdev,
231 case ixgbe_sfp_type_lr: 231 case ixgbe_sfp_type_lr:
232 case ixgbe_sfp_type_srlr_core0: 232 case ixgbe_sfp_type_srlr_core0:
233 case ixgbe_sfp_type_srlr_core1: 233 case ixgbe_sfp_type_srlr_core1:
234 case ixgbe_sfp_type_1g_sx_core0:
235 case ixgbe_sfp_type_1g_sx_core1:
236 case ixgbe_sfp_type_1g_lx_core0:
237 case ixgbe_sfp_type_1g_lx_core1:
234 ecmd->supported |= SUPPORTED_FIBRE; 238 ecmd->supported |= SUPPORTED_FIBRE;
235 ecmd->advertising |= ADVERTISED_FIBRE; 239 ecmd->advertising |= ADVERTISED_FIBRE;
236 ecmd->port = PORT_FIBRE; 240 ecmd->port = PORT_FIBRE;
@@ -246,12 +250,6 @@ static int ixgbe_get_settings(struct net_device *netdev,
246 ecmd->advertising |= ADVERTISED_TP; 250 ecmd->advertising |= ADVERTISED_TP;
247 ecmd->port = PORT_TP; 251 ecmd->port = PORT_TP;
248 break; 252 break;
249 case ixgbe_sfp_type_1g_sx_core0:
250 case ixgbe_sfp_type_1g_sx_core1:
251 ecmd->supported |= SUPPORTED_FIBRE;
252 ecmd->advertising |= ADVERTISED_FIBRE;
253 ecmd->port = PORT_FIBRE;
254 break;
255 case ixgbe_sfp_type_unknown: 253 case ixgbe_sfp_type_unknown:
256 default: 254 default:
257 ecmd->supported |= SUPPORTED_FIBRE; 255 ecmd->supported |= SUPPORTED_FIBRE;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index 060d2ad2ac96..e5691ccbce9d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -956,6 +956,13 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
956 else 956 else
957 hw->phy.sfp_type = 957 hw->phy.sfp_type =
958 ixgbe_sfp_type_1g_sx_core1; 958 ixgbe_sfp_type_1g_sx_core1;
959 } else if (comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) {
960 if (hw->bus.lan_id == 0)
961 hw->phy.sfp_type =
962 ixgbe_sfp_type_1g_lx_core0;
963 else
964 hw->phy.sfp_type =
965 ixgbe_sfp_type_1g_lx_core1;
959 } else { 966 } else {
960 hw->phy.sfp_type = ixgbe_sfp_type_unknown; 967 hw->phy.sfp_type = ixgbe_sfp_type_unknown;
961 } 968 }
@@ -1043,6 +1050,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
1043 if (comp_codes_10g == 0 && 1050 if (comp_codes_10g == 0 &&
1044 !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || 1051 !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1045 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || 1052 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1053 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1054 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
1046 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || 1055 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1047 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) { 1056 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
1048 hw->phy.type = ixgbe_phy_sfp_unsupported; 1057 hw->phy.type = ixgbe_phy_sfp_unsupported;
@@ -1058,10 +1067,12 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
1058 1067
1059 hw->mac.ops.get_device_caps(hw, &enforce_sfp); 1068 hw->mac.ops.get_device_caps(hw, &enforce_sfp);
1060 if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) && 1069 if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) &&
1061 !((hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0) || 1070 !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1062 (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1) || 1071 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1063 (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0) || 1072 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1064 (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1))) { 1073 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
1074 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1075 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
1065 /* Make sure we're a supported PHY type */ 1076 /* Make sure we're a supported PHY type */
1066 if (hw->phy.type == ixgbe_phy_sfp_intel) { 1077 if (hw->phy.type == ixgbe_phy_sfp_intel) {
1067 status = 0; 1078 status = 0;
@@ -1125,10 +1136,12 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
1125 * SR modules 1136 * SR modules
1126 */ 1137 */
1127 if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 || 1138 if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 ||
1139 sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1128 sfp_type == ixgbe_sfp_type_1g_cu_core0 || 1140 sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1129 sfp_type == ixgbe_sfp_type_1g_sx_core0) 1141 sfp_type == ixgbe_sfp_type_1g_sx_core0)
1130 sfp_type = ixgbe_sfp_type_srlr_core0; 1142 sfp_type = ixgbe_sfp_type_srlr_core0;
1131 else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 || 1143 else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 ||
1144 sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
1132 sfp_type == ixgbe_sfp_type_1g_cu_core1 || 1145 sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1133 sfp_type == ixgbe_sfp_type_1g_sx_core1) 1146 sfp_type == ixgbe_sfp_type_1g_sx_core1)
1134 sfp_type = ixgbe_sfp_type_srlr_core1; 1147 sfp_type = ixgbe_sfp_type_srlr_core1;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 100dd92de2dd..4cbe21952ba8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -2611,6 +2611,8 @@ enum ixgbe_sfp_type {
2611 ixgbe_sfp_type_1g_cu_core1 = 10, 2611 ixgbe_sfp_type_1g_cu_core1 = 10,
2612 ixgbe_sfp_type_1g_sx_core0 = 11, 2612 ixgbe_sfp_type_1g_sx_core0 = 11,
2613 ixgbe_sfp_type_1g_sx_core1 = 12, 2613 ixgbe_sfp_type_1g_sx_core1 = 12,
2614 ixgbe_sfp_type_1g_lx_core0 = 13,
2615 ixgbe_sfp_type_1g_lx_core1 = 14,
2614 ixgbe_sfp_type_not_present = 0xFFFE, 2616 ixgbe_sfp_type_not_present = 0xFFFE,
2615 ixgbe_sfp_type_unknown = 0xFFFF 2617 ixgbe_sfp_type_unknown = 0xFFFF
2616}; 2618};