aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index f71b8a5872b3..d95714f780f3 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -8750,18 +8750,17 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up)
8750 8750
8751 if (loopback_mode == BNX2X_MAC_LOOPBACK) { 8751 if (loopback_mode == BNX2X_MAC_LOOPBACK) {
8752 bp->link_params.loopback_mode = LOOPBACK_BMAC; 8752 bp->link_params.loopback_mode = LOOPBACK_BMAC;
8753 bnx2x_acquire_phy_lock(bp);
8754 bnx2x_phy_init(&bp->link_params, &bp->link_vars); 8753 bnx2x_phy_init(&bp->link_params, &bp->link_vars);
8755 bnx2x_release_phy_lock(bp);
8756 8754
8757 } else if (loopback_mode == BNX2X_PHY_LOOPBACK) { 8755 } else if (loopback_mode == BNX2X_PHY_LOOPBACK) {
8756 u16 cnt = 1000;
8758 bp->link_params.loopback_mode = LOOPBACK_XGXS_10; 8757 bp->link_params.loopback_mode = LOOPBACK_XGXS_10;
8759 bnx2x_acquire_phy_lock(bp);
8760 bnx2x_phy_init(&bp->link_params, &bp->link_vars); 8758 bnx2x_phy_init(&bp->link_params, &bp->link_vars);
8761 bnx2x_release_phy_lock(bp);
8762 /* wait until link state is restored */ 8759 /* wait until link state is restored */
8763 bnx2x_wait_for_link(bp, link_up); 8760 if (link_up)
8764 8761 while (cnt-- && bnx2x_test_link(&bp->link_params,
8762 &bp->link_vars))
8763 msleep(10);
8765 } else 8764 } else
8766 return -EINVAL; 8765 return -EINVAL;
8767 8766
@@ -8867,6 +8866,7 @@ static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up)
8867 return BNX2X_LOOPBACK_FAILED; 8866 return BNX2X_LOOPBACK_FAILED;
8868 8867
8869 bnx2x_netif_stop(bp, 1); 8868 bnx2x_netif_stop(bp, 1);
8869 bnx2x_acquire_phy_lock(bp);
8870 8870
8871 if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) { 8871 if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) {
8872 DP(NETIF_MSG_PROBE, "MAC loopback failed\n"); 8872 DP(NETIF_MSG_PROBE, "MAC loopback failed\n");
@@ -8878,6 +8878,7 @@ static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up)
8878 rc |= BNX2X_PHY_LOOPBACK_FAILED; 8878 rc |= BNX2X_PHY_LOOPBACK_FAILED;
8879 } 8879 }
8880 8880
8881 bnx2x_release_phy_lock(bp);
8881 bnx2x_netif_start(bp); 8882 bnx2x_netif_start(bp);
8882 8883
8883 return rc; 8884 return rc;