aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-07-21 01:47:22 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-21 14:18:26 -0400
commit279abdf59c766a06db89b50c6d3615b4f2b19ed3 (patch)
tree323b4e730592d764b7a3b49e8cf4a134872fceb7
parent3c2b8d180a47d041e9101ead27e49d237df0f1d1 (diff)
bnx2x: Stop management traffic in loopback test
Since management traffic cannot go on the wire while configured to loopback, simply stop it to avoid race condition when the MAC is set to loopback in the middle of a packet Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bnx2x_main.c11
-rw-r--r--drivers/net/bnx2x_reg.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 6c67be679764..177cb467ba90 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -9691,8 +9691,15 @@ static void bnx2x_self_test(struct net_device *dev,
9691 etest->flags &= ~ETH_TEST_FL_OFFLINE; 9691 etest->flags &= ~ETH_TEST_FL_OFFLINE;
9692 9692
9693 if (etest->flags & ETH_TEST_FL_OFFLINE) { 9693 if (etest->flags & ETH_TEST_FL_OFFLINE) {
9694 int port = BP_PORT(bp);
9695 u32 val;
9694 u8 link_up; 9696 u8 link_up;
9695 9697
9698 /* save current value of input enable for TX port IF */
9699 val = REG_RD(bp, NIG_REG_EGRESS_UMP0_IN_EN + port*4);
9700 /* disable input for TX port IF */
9701 REG_WR(bp, NIG_REG_EGRESS_UMP0_IN_EN + port*4, 0);
9702
9696 link_up = bp->link_vars.link_up; 9703 link_up = bp->link_vars.link_up;
9697 bnx2x_nic_unload(bp, UNLOAD_NORMAL); 9704 bnx2x_nic_unload(bp, UNLOAD_NORMAL);
9698 bnx2x_nic_load(bp, LOAD_DIAG); 9705 bnx2x_nic_load(bp, LOAD_DIAG);
@@ -9712,6 +9719,10 @@ static void bnx2x_self_test(struct net_device *dev,
9712 etest->flags |= ETH_TEST_FL_FAILED; 9719 etest->flags |= ETH_TEST_FL_FAILED;
9713 9720
9714 bnx2x_nic_unload(bp, UNLOAD_NORMAL); 9721 bnx2x_nic_unload(bp, UNLOAD_NORMAL);
9722
9723 /* restore input for TX port IF */
9724 REG_WR(bp, NIG_REG_EGRESS_UMP0_IN_EN + port*4, val);
9725
9715 bnx2x_nic_load(bp, LOAD_NORMAL); 9726 bnx2x_nic_load(bp, LOAD_NORMAL);
9716 /* wait until link state is restored */ 9727 /* wait until link state is restored */
9717 bnx2x_wait_for_link(bp, link_up); 9728 bnx2x_wait_for_link(bp, link_up);
diff --git a/drivers/net/bnx2x_reg.h b/drivers/net/bnx2x_reg.h
index b8ce6fc927a0..6d77730b6b4d 100644
--- a/drivers/net/bnx2x_reg.h
+++ b/drivers/net/bnx2x_reg.h
@@ -1660,6 +1660,8 @@
1660#define NIG_REG_EGRESS_PBF0_IN_EN 0x100cc 1660#define NIG_REG_EGRESS_PBF0_IN_EN 0x100cc
1661/* [RW 1] Input enable for TX PBF user packet port1 IF */ 1661/* [RW 1] Input enable for TX PBF user packet port1 IF */
1662#define NIG_REG_EGRESS_PBF1_IN_EN 0x100d0 1662#define NIG_REG_EGRESS_PBF1_IN_EN 0x100d0
1663/* [RW 1] Input enable for TX UMP management packet port0 IF */
1664#define NIG_REG_EGRESS_UMP0_IN_EN 0x100d4
1663/* [RW 1] Input enable for RX_EMAC0 IF */ 1665/* [RW 1] Input enable for RX_EMAC0 IF */
1664#define NIG_REG_EMAC0_IN_EN 0x100a4 1666#define NIG_REG_EMAC0_IN_EN 0x100a4
1665/* [RW 1] output enable for TX EMAC pause port 0 IF */ 1667/* [RW 1] output enable for TX EMAC pause port 0 IF */