aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkeem G Abodunrin <akeem.g.abodunrin@intel.com>2013-08-27 22:23:04 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-09-04 08:19:30 -0400
commitf1b4d6214b04caed45f0938a1d769b0d8fe79a3b (patch)
treec42e25f18c46e62fff65ccf3fda2352131290a38
parentdb476e85118e2f5b24f4ccc0bdb42f0c00bde83a (diff)
igb: Support to get 2_5G link status for appropriate media type
Since i354 2.5Gb devices are not Copper media type but SerDes, so this patch changes the way we detect speed/duplex link info for this device. Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c25
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_mac.c11
2 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index d796e297e4a7..68dd7c8624c9 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -1217,7 +1217,7 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed,
1217 u16 *duplex) 1217 u16 *duplex)
1218{ 1218{
1219 struct e1000_mac_info *mac = &hw->mac; 1219 struct e1000_mac_info *mac = &hw->mac;
1220 u32 pcs; 1220 u32 pcs, status;
1221 1221
1222 /* Set up defaults for the return values of this function */ 1222 /* Set up defaults for the return values of this function */
1223 mac->serdes_has_link = false; 1223 mac->serdes_has_link = false;
@@ -1238,20 +1238,31 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed,
1238 mac->serdes_has_link = true; 1238 mac->serdes_has_link = true;
1239 1239
1240 /* Detect and store PCS speed */ 1240 /* Detect and store PCS speed */
1241 if (pcs & E1000_PCS_LSTS_SPEED_1000) { 1241 if (pcs & E1000_PCS_LSTS_SPEED_1000)
1242 *speed = SPEED_1000; 1242 *speed = SPEED_1000;
1243 } else if (pcs & E1000_PCS_LSTS_SPEED_100) { 1243 else if (pcs & E1000_PCS_LSTS_SPEED_100)
1244 *speed = SPEED_100; 1244 *speed = SPEED_100;
1245 } else { 1245 else
1246 *speed = SPEED_10; 1246 *speed = SPEED_10;
1247 }
1248 1247
1249 /* Detect and store PCS duplex */ 1248 /* Detect and store PCS duplex */
1250 if (pcs & E1000_PCS_LSTS_DUPLEX_FULL) { 1249 if (pcs & E1000_PCS_LSTS_DUPLEX_FULL)
1251 *duplex = FULL_DUPLEX; 1250 *duplex = FULL_DUPLEX;
1252 } else { 1251 else
1253 *duplex = HALF_DUPLEX; 1252 *duplex = HALF_DUPLEX;
1253
1254 /* Check if it is an I354 2.5Gb backplane connection. */
1255 if (mac->type == e1000_i354) {
1256 status = rd32(E1000_STATUS);
1257 if ((status & E1000_STATUS_2P5_SKU) &&
1258 !(status & E1000_STATUS_2P5_SKU_OVER)) {
1259 *speed = SPEED_2500;
1260 *duplex = FULL_DUPLEX;
1261 hw_dbg("2500 Mbs, ");
1262 hw_dbg("Full Duplex\n");
1263 }
1254 } 1264 }
1265
1255 } 1266 }
1256 1267
1257 return 0; 1268 return 0;
diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c
index bab556a47fcc..f0dfd41dd4bd 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mac.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mac.c
@@ -1171,17 +1171,6 @@ s32 igb_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed,
1171 hw_dbg("Half Duplex\n"); 1171 hw_dbg("Half Duplex\n");
1172 } 1172 }
1173 1173
1174 /* Check if it is an I354 2.5Gb backplane connection. */
1175 if (hw->mac.type == e1000_i354) {
1176 if ((status & E1000_STATUS_2P5_SKU) &&
1177 !(status & E1000_STATUS_2P5_SKU_OVER)) {
1178 *speed = SPEED_2500;
1179 *duplex = FULL_DUPLEX;
1180 hw_dbg("2500 Mbs, ");
1181 hw_dbg("Full Duplex\n");
1182 }
1183 }
1184
1185 return 0; 1174 return 0;
1186} 1175}
1187 1176