aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_82598.c
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2009-04-09 18:28:50 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-11 05:48:02 -0400
commit04193058c1005551af93f04a4b975fbd7f95cad5 (patch)
tree2c6292e6cc7e277c9ff579eb99a51ee19123cc1b /drivers/net/ixgbe/ixgbe_82598.c
parent1eb99d5ac44e2a9ac0b2856c579ba4d7cc349ada (diff)
ixgbe: Update get_physical_layer() calls, plus a version bump
Not all physical connection types are being correctly identified. This fixes that issue, and cleans up the logic to make it more maintainable. Also clean up the code for device capabilities from the EEPROM to support multiple SKUs of the same hardware. Bump the version to reflect all the updates since the 82599 merge. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_82598.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_82598.c85
1 files changed, 59 insertions, 26 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index 361c9d1d0117..a7ae4d45b53d 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -1089,35 +1089,56 @@ out:
1089static u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw) 1089static u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw)
1090{ 1090{
1091 u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN; 1091 u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1092 u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
1093 u32 pma_pmd_10g = autoc & IXGBE_AUTOC_10G_PMA_PMD_MASK;
1094 u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
1095 u16 ext_ability = 0;
1096
1097 hw->phy.ops.identify(hw);
1098
1099 /* Copper PHY must be checked before AUTOC LMS to determine correct
1100 * physical layer because 10GBase-T PHYs use LMS = KX4/KX */
1101 if (hw->phy.type == ixgbe_phy_tn ||
1102 hw->phy.type == ixgbe_phy_cu_unknown) {
1103 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
1104 IXGBE_MDIO_PMA_PMD_DEV_TYPE, &ext_ability);
1105 if (ext_ability & IXGBE_MDIO_PHY_10GBASET_ABILITY)
1106 physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
1107 if (ext_ability & IXGBE_MDIO_PHY_1000BASET_ABILITY)
1108 physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
1109 if (ext_ability & IXGBE_MDIO_PHY_100BASETX_ABILITY)
1110 physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
1111 goto out;
1112 }
1092 1113
1093 switch (hw->device_id) { 1114 switch (autoc & IXGBE_AUTOC_LMS_MASK) {
1094 case IXGBE_DEV_ID_82598: 1115 case IXGBE_AUTOC_LMS_1G_AN:
1095 /* Default device ID is mezzanine card KX/KX4 */ 1116 case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
1096 physical_layer = (IXGBE_PHYSICAL_LAYER_10GBASE_KX4 | 1117 if (pma_pmd_1g == IXGBE_AUTOC_1G_KX)
1097 IXGBE_PHYSICAL_LAYER_1000BASE_KX); 1118 physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX;
1098 break; 1119 else
1099 case IXGBE_DEV_ID_82598_BX: 1120 physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_BX;
1100 physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_BX;
1101 case IXGBE_DEV_ID_82598EB_CX4:
1102 case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
1103 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_CX4;
1104 break;
1105 case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
1106 physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
1107 break; 1121 break;
1108 case IXGBE_DEV_ID_82598AF_DUAL_PORT: 1122 case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
1109 case IXGBE_DEV_ID_82598AF_SINGLE_PORT: 1123 if (pma_pmd_10g == IXGBE_AUTOC_10G_CX4)
1110 case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM: 1124 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_CX4;
1111 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR; 1125 else if (pma_pmd_10g == IXGBE_AUTOC_10G_KX4)
1126 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
1127 else /* XAUI */
1128 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1112 break; 1129 break;
1113 case IXGBE_DEV_ID_82598EB_XF_LR: 1130 case IXGBE_AUTOC_LMS_KX4_AN:
1114 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR; 1131 case IXGBE_AUTOC_LMS_KX4_AN_1G_AN:
1132 if (autoc & IXGBE_AUTOC_KX_SUPP)
1133 physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_KX;
1134 if (autoc & IXGBE_AUTOC_KX4_SUPP)
1135 physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
1115 break; 1136 break;
1116 case IXGBE_DEV_ID_82598AT: 1137 default:
1117 physical_layer = (IXGBE_PHYSICAL_LAYER_10GBASE_T |
1118 IXGBE_PHYSICAL_LAYER_1000BASE_T);
1119 break; 1138 break;
1120 case IXGBE_DEV_ID_82598EB_SFP_LOM: 1139 }
1140
1141 if (hw->phy.type == ixgbe_phy_nl) {
1121 hw->phy.ops.identify_sfp(hw); 1142 hw->phy.ops.identify_sfp(hw);
1122 1143
1123 switch (hw->phy.sfp_type) { 1144 switch (hw->phy.sfp_type) {
@@ -1134,13 +1155,25 @@ static u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw)
1134 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN; 1155 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1135 break; 1156 break;
1136 } 1157 }
1137 break; 1158 }
1138 1159
1160 switch (hw->device_id) {
1161 case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
1162 physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
1163 break;
1164 case IXGBE_DEV_ID_82598AF_DUAL_PORT:
1165 case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
1166 case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
1167 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
1168 break;
1169 case IXGBE_DEV_ID_82598EB_XF_LR:
1170 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
1171 break;
1139 default: 1172 default:
1140 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1141 break; 1173 break;
1142 } 1174 }
1143 1175
1176out:
1144 return physical_layer; 1177 return physical_layer;
1145} 1178}
1146 1179