aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaniv Rosner <yanivr@broadcom.com>2013-09-22 07:59:24 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-23 02:10:19 -0400
commit0afbd74a1608d9d9dcc8f806e36e283ec83e07d5 (patch)
tree11fece823acfc65b589e51a5c78e5339912808e4
parent4e4b14c9f861e19e560abb4a12eca971568639f5 (diff)
bnx2x: 57840 non-external loopback test fail on 1G
when 1G-optic module was plugged in, internal loopback test failed because the driver used to check the optic module (with no need), and for 1G optic module, the link speed was forced down to 1G, while the XMAC (10G MAC) was enabled. This patch avoid accessing optic module in case internal loopback was selected, and update the link speed in case 1G optic module was detected during init stage. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 84798bb8c020..5c6d46c61942 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -4523,10 +4523,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy,
4523 * enabled transmitter to avoid current leakage in case 4523 * enabled transmitter to avoid current leakage in case
4524 * no module is connected 4524 * no module is connected
4525 */ 4525 */
4526 if (bnx2x_is_sfp_module_plugged(phy, params)) 4526 if ((params->loopback_mode == LOOPBACK_NONE) ||
4527 bnx2x_sfp_module_detection(phy, params); 4527 (params->loopback_mode == LOOPBACK_EXT)) {
4528 else 4528 if (bnx2x_is_sfp_module_plugged(phy, params))
4529 bnx2x_sfp_e3_set_transmitter(params, phy, 1); 4529 bnx2x_sfp_module_detection(phy, params);
4530 else
4531 bnx2x_sfp_e3_set_transmitter(params,
4532 phy, 1);
4533 }
4530 4534
4531 bnx2x_warpcore_config_sfi(phy, params); 4535 bnx2x_warpcore_config_sfi(phy, params);
4532 break; 4536 break;
@@ -6528,6 +6532,11 @@ static int bnx2x_link_initialize(struct link_params *params,
6528 params->phy[INT_PHY].config_init(phy, params, vars); 6532 params->phy[INT_PHY].config_init(phy, params, vars);
6529 } 6533 }
6530 6534
6535 /* Re-read this value in case it was changed inside config_init due to
6536 * limitations of optic module
6537 */
6538 vars->line_speed = params->phy[INT_PHY].req_line_speed;
6539
6531 /* Init external phy*/ 6540 /* Init external phy*/
6532 if (non_ext_phy) { 6541 if (non_ext_phy) {
6533 if (params->phy[INT_PHY].supported & 6542 if (params->phy[INT_PHY].supported &