aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEliezer Tamir <eliezert@broadcom.com>2008-02-28 14:53:13 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-28 14:53:13 -0500
commit49d66772112f40554ba18d037e0601ac3da0bf79 (patch)
treee10b03f7e3ca5bf24fe05ba60dff5de342175cb4 /drivers/net
parentf14106478e372e64be54a3cdab1e2fa83a5c8a35 (diff)
[BNX2X]: Correct RX filtering and MC configuration
The configuration of RX filtering needed the following corrections: Drop flags need to be set per Rx queue. Have to tell the microcode to collect drop stats, and properly wait for them to complete when going down. Sometimes we failed to detect proper completion due to a logical error in the wait loop. Signed-off-by: Eliezer Tamir <eliezert@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnx2x.c165
-rw-r--r--drivers/net/bnx2x.h5
2 files changed, 92 insertions, 78 deletions
diff --git a/drivers/net/bnx2x.c b/drivers/net/bnx2x.c
index 5cd785064ba3..103d3e0f24ba 100644
--- a/drivers/net/bnx2x.c
+++ b/drivers/net/bnx2x.c
@@ -298,8 +298,7 @@ static void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32)
298 298
299static int bnx2x_mc_assert(struct bnx2x *bp) 299static int bnx2x_mc_assert(struct bnx2x *bp)
300{ 300{
301 int i, j; 301 int i, j, rc = 0;
302 int rc = 0;
303 char last_idx; 302 char last_idx;
304 const char storm[] = {"XTCU"}; 303 const char storm[] = {"XTCU"};
305 const u32 intmem_base[] = { 304 const u32 intmem_base[] = {
@@ -313,8 +312,9 @@ static int bnx2x_mc_assert(struct bnx2x *bp)
313 for (i = 0; i < 4; i++) { 312 for (i = 0; i < 4; i++) {
314 last_idx = REG_RD8(bp, XSTORM_ASSERT_LIST_INDEX_OFFSET + 313 last_idx = REG_RD8(bp, XSTORM_ASSERT_LIST_INDEX_OFFSET +
315 intmem_base[i]); 314 intmem_base[i]);
316 BNX2X_ERR("DATA %cSTORM_ASSERT_LIST_INDEX 0x%x\n", 315 if (last_idx)
317 storm[i], last_idx); 316 BNX2X_LOG("DATA %cSTORM_ASSERT_LIST_INDEX 0x%x\n",
317 storm[i], last_idx);
318 318
319 /* print the asserts */ 319 /* print the asserts */
320 for (j = 0; j < STROM_ASSERT_ARRAY_SIZE; j++) { 320 for (j = 0; j < STROM_ASSERT_ARRAY_SIZE; j++) {
@@ -330,7 +330,7 @@ static int bnx2x_mc_assert(struct bnx2x *bp)
330 intmem_base[i]); 330 intmem_base[i]);
331 331
332 if (row0 != COMMON_ASM_INVALID_ASSERT_OPCODE) { 332 if (row0 != COMMON_ASM_INVALID_ASSERT_OPCODE) {
333 BNX2X_ERR("DATA %cSTORM_ASSERT_INDEX 0x%x =" 333 BNX2X_LOG("DATA %cSTORM_ASSERT_INDEX 0x%x ="
334 " 0x%08x 0x%08x 0x%08x 0x%08x\n", 334 " 0x%08x 0x%08x 0x%08x 0x%08x\n",
335 storm[i], j, row3, row2, row1, row0); 335 storm[i], j, row3, row2, row1, row0);
336 rc++; 336 rc++;
@@ -349,21 +349,22 @@ static void bnx2x_fw_dump(struct bnx2x *bp)
349 int word; 349 int word;
350 350
351 mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); 351 mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104);
352 printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n", mark); 352 mark = ((mark + 0x3) & ~0x3);
353 printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n" KERN_ERR, mark);
353 354
354 for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) { 355 for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) {
355 for (word = 0; word < 8; word++) 356 for (word = 0; word < 8; word++)
356 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + 357 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH +
357 offset + 4*word)); 358 offset + 4*word));
358 data[8] = 0x0; 359 data[8] = 0x0;
359 printk(KERN_ERR PFX "%s", (char *)data); 360 printk(KERN_CONT "%s", (char *)data);
360 } 361 }
361 for (offset = 0xF108; offset <= mark - 0x08000000; offset += 0x8*4) { 362 for (offset = 0xF108; offset <= mark - 0x08000000; offset += 0x8*4) {
362 for (word = 0; word < 8; word++) 363 for (word = 0; word < 8; word++)
363 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + 364 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH +
364 offset + 4*word)); 365 offset + 4*word));
365 data[8] = 0x0; 366 data[8] = 0x0;
366 printk(KERN_ERR PFX "%s", (char *)data); 367 printk(KERN_CONT "%s", (char *)data);
367 } 368 }
368 printk("\n" KERN_ERR PFX "end of fw dump\n"); 369 printk("\n" KERN_ERR PFX "end of fw dump\n");
369} 370}
@@ -428,10 +429,10 @@ static void bnx2x_panic_dump(struct bnx2x *bp)
428 } 429 }
429 } 430 }
430 431
431 BNX2X_ERR("def_c_idx(%u) def_u_idx(%u) def_t_idx(%u)" 432 BNX2X_ERR("def_c_idx(%u) def_u_idx(%u) def_x_idx(%u)"
432 " def_x_idx(%u) def_att_idx(%u) attn_state(%u)" 433 " def_t_idx(%u) def_att_idx(%u) attn_state(%u)"
433 " spq_prod_idx(%u)\n", 434 " spq_prod_idx(%u)\n",
434 bp->def_c_idx, bp->def_u_idx, bp->def_t_idx, bp->def_x_idx, 435 bp->def_c_idx, bp->def_u_idx, bp->def_x_idx, bp->def_t_idx,
435 bp->def_att_idx, bp->attn_state, bp->spq_prod_idx); 436 bp->def_att_idx, bp->attn_state, bp->spq_prod_idx);
436 437
437 438
@@ -789,20 +790,20 @@ static void bnx2x_sp_event(struct bnx2x_fastpath *fp,
789 fp->state = BNX2X_FP_STATE_HALTED; 790 fp->state = BNX2X_FP_STATE_HALTED;
790 break; 791 break;
791 792
792 case (RAMROD_CMD_ID_ETH_PORT_DEL | BNX2X_STATE_CLOSING_WAIT4_DELETE):
793 DP(NETIF_MSG_IFDOWN, "got delete ramrod\n");
794 bp->state = BNX2X_STATE_CLOSING_WAIT4_UNLOAD;
795 break;
796
797 case (RAMROD_CMD_ID_ETH_CFC_DEL | BNX2X_STATE_CLOSING_WAIT4_HALT): 793 case (RAMROD_CMD_ID_ETH_CFC_DEL | BNX2X_STATE_CLOSING_WAIT4_HALT):
798 DP(NETIF_MSG_IFDOWN, "got delete ramrod for MULTI[%d]\n", cid); 794 DP(NETIF_MSG_IFDOWN, "got delete ramrod for MULTI[%d]\n",
799 bnx2x_fp(bp, cid, state) = BNX2X_FP_STATE_DELETED; 795 cid);
796 bnx2x_fp(bp, cid, state) = BNX2X_FP_STATE_CLOSED;
800 break; 797 break;
801 798
802 case (RAMROD_CMD_ID_ETH_SET_MAC | BNX2X_STATE_OPEN): 799 case (RAMROD_CMD_ID_ETH_SET_MAC | BNX2X_STATE_OPEN):
803 DP(NETIF_MSG_IFUP, "got set mac ramrod\n"); 800 DP(NETIF_MSG_IFUP, "got set mac ramrod\n");
804 break; 801 break;
805 802
803 case (RAMROD_CMD_ID_ETH_SET_MAC | BNX2X_STATE_CLOSING_WAIT4_HALT):
804 DP(NETIF_MSG_IFUP, "got (un)set mac ramrod\n");
805 break;
806
806 default: 807 default:
807 BNX2X_ERR("unexpected ramrod (%d) state is %x\n", 808 BNX2X_ERR("unexpected ramrod (%d) state is %x\n",
808 command, bp->state); 809 command, bp->state);
@@ -5236,6 +5237,9 @@ static void bnx2x_init_def_sb(struct bnx2x *bp,
5236 atten_status_block); 5237 atten_status_block);
5237 def_sb->atten_status_block.status_block_id = id; 5238 def_sb->atten_status_block.status_block_id = id;
5238 5239
5240 bp->def_att_idx = 0;
5241 bp->attn_state = 0;
5242
5239 reg_offset = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 : 5243 reg_offset = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 :
5240 MISC_REG_AEU_ENABLE1_FUNC_0_OUT_0); 5244 MISC_REG_AEU_ENABLE1_FUNC_0_OUT_0);
5241 5245
@@ -5270,6 +5274,8 @@ static void bnx2x_init_def_sb(struct bnx2x *bp,
5270 u_def_status_block); 5274 u_def_status_block);
5271 def_sb->u_def_status_block.status_block_id = id; 5275 def_sb->u_def_status_block.status_block_id = id;
5272 5276
5277 bp->def_u_idx = 0;
5278
5273 REG_WR(bp, BAR_USTRORM_INTMEM + 5279 REG_WR(bp, BAR_USTRORM_INTMEM +
5274 USTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section)); 5280 USTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section));
5275 REG_WR(bp, BAR_USTRORM_INTMEM + 5281 REG_WR(bp, BAR_USTRORM_INTMEM +
@@ -5287,6 +5293,8 @@ static void bnx2x_init_def_sb(struct bnx2x *bp,
5287 c_def_status_block); 5293 c_def_status_block);
5288 def_sb->c_def_status_block.status_block_id = id; 5294 def_sb->c_def_status_block.status_block_id = id;
5289 5295
5296 bp->def_c_idx = 0;
5297
5290 REG_WR(bp, BAR_CSTRORM_INTMEM + 5298 REG_WR(bp, BAR_CSTRORM_INTMEM +
5291 CSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section)); 5299 CSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section));
5292 REG_WR(bp, BAR_CSTRORM_INTMEM + 5300 REG_WR(bp, BAR_CSTRORM_INTMEM +
@@ -5304,6 +5312,8 @@ static void bnx2x_init_def_sb(struct bnx2x *bp,
5304 t_def_status_block); 5312 t_def_status_block);
5305 def_sb->t_def_status_block.status_block_id = id; 5313 def_sb->t_def_status_block.status_block_id = id;
5306 5314
5315 bp->def_t_idx = 0;
5316
5307 REG_WR(bp, BAR_TSTRORM_INTMEM + 5317 REG_WR(bp, BAR_TSTRORM_INTMEM +
5308 TSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section)); 5318 TSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section));
5309 REG_WR(bp, BAR_TSTRORM_INTMEM + 5319 REG_WR(bp, BAR_TSTRORM_INTMEM +
@@ -5321,6 +5331,8 @@ static void bnx2x_init_def_sb(struct bnx2x *bp,
5321 x_def_status_block); 5331 x_def_status_block);
5322 def_sb->x_def_status_block.status_block_id = id; 5332 def_sb->x_def_status_block.status_block_id = id;
5323 5333
5334 bp->def_x_idx = 0;
5335
5324 REG_WR(bp, BAR_XSTRORM_INTMEM + 5336 REG_WR(bp, BAR_XSTRORM_INTMEM +
5325 XSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section)); 5337 XSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(port), U64_LO(section));
5326 REG_WR(bp, BAR_XSTRORM_INTMEM + 5338 REG_WR(bp, BAR_XSTRORM_INTMEM +
@@ -5333,6 +5345,8 @@ static void bnx2x_init_def_sb(struct bnx2x *bp,
5333 REG_WR16(bp, BAR_XSTRORM_INTMEM + 5345 REG_WR16(bp, BAR_XSTRORM_INTMEM +
5334 XSTORM_DEF_SB_HC_DISABLE_OFFSET(port, index), 0x1); 5346 XSTORM_DEF_SB_HC_DISABLE_OFFSET(port, index), 0x1);
5335 5347
5348 bp->stat_pending = 0;
5349
5336 bnx2x_ack_sb(bp, id, CSTORM_ID, 0, IGU_INT_ENABLE, 0); 5350 bnx2x_ack_sb(bp, id, CSTORM_ID, 0, IGU_INT_ENABLE, 0);
5337} 5351}
5338 5352
@@ -5476,7 +5490,6 @@ static void bnx2x_init_sp_ring(struct bnx2x *bp)
5476 5490
5477 bp->spq_left = MAX_SPQ_PENDING; 5491 bp->spq_left = MAX_SPQ_PENDING;
5478 bp->spq_prod_idx = 0; 5492 bp->spq_prod_idx = 0;
5479 bp->dsb_sp_prod_idx = 0;
5480 bp->dsb_sp_prod = BNX2X_SP_DSB_INDEX; 5493 bp->dsb_sp_prod = BNX2X_SP_DSB_INDEX;
5481 bp->spq_prod_bd = bp->spq; 5494 bp->spq_prod_bd = bp->spq;
5482 bp->spq_last_bd = bp->spq_prod_bd + MAX_SP_DESC_CNT; 5495 bp->spq_last_bd = bp->spq_prod_bd + MAX_SP_DESC_CNT;
@@ -5553,6 +5566,42 @@ static void bnx2x_init_ind_table(struct bnx2x *bp)
5553 REG_WR(bp, PRS_REG_A_PRSU_20, 0xf); 5566 REG_WR(bp, PRS_REG_A_PRSU_20, 0xf);
5554} 5567}
5555 5568
5569static void bnx2x_set_client_config(struct bnx2x *bp)
5570{
5571#ifdef BCM_VLAN
5572 int mode = bp->rx_mode;
5573#endif
5574 int i, port = bp->port;
5575 struct tstorm_eth_client_config tstorm_client = {0};
5576
5577 tstorm_client.mtu = bp->dev->mtu;
5578 tstorm_client.statistics_counter_id = 0;
5579 tstorm_client.config_flags =
5580 TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE;
5581#ifdef BCM_VLAN
5582 if (mode && bp->vlgrp) {
5583 tstorm_client.config_flags |=
5584 TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE;
5585 DP(NETIF_MSG_IFUP, "vlan removal enabled\n");
5586 }
5587#endif
5588 if (mode != BNX2X_RX_MODE_PROMISC)
5589 tstorm_client.drop_flags =
5590 TSTORM_ETH_CLIENT_CONFIG_DROP_MAC_ERR;
5591
5592 for_each_queue(bp, i) {
5593 REG_WR(bp, BAR_TSTRORM_INTMEM +
5594 TSTORM_CLIENT_CONFIG_OFFSET(port, i),
5595 ((u32 *)&tstorm_client)[0]);
5596 REG_WR(bp, BAR_TSTRORM_INTMEM +
5597 TSTORM_CLIENT_CONFIG_OFFSET(port, i) + 4,
5598 ((u32 *)&tstorm_client)[1]);
5599 }
5600
5601/* DP(NETIF_MSG_IFUP, "tstorm_client: 0x%08x 0x%08x\n",
5602 ((u32 *)&tstorm_client)[0], ((u32 *)&tstorm_client)[1]); */
5603}
5604
5556static void bnx2x_set_storm_rx_mode(struct bnx2x *bp) 5605static void bnx2x_set_storm_rx_mode(struct bnx2x *bp)
5557{ 5606{
5558 int mode = bp->rx_mode; 5607 int mode = bp->rx_mode;
@@ -5592,41 +5641,9 @@ static void bnx2x_set_storm_rx_mode(struct bnx2x *bp)
5592/* DP(NETIF_MSG_IFUP, "tstorm_mac_filter[%d]: 0x%08x\n", i, 5641/* DP(NETIF_MSG_IFUP, "tstorm_mac_filter[%d]: 0x%08x\n", i,
5593 ((u32 *)&tstorm_mac_filter)[i]); */ 5642 ((u32 *)&tstorm_mac_filter)[i]); */
5594 } 5643 }
5595}
5596 5644
5597static void bnx2x_set_client_config(struct bnx2x *bp, int client_id) 5645 if (mode != BNX2X_RX_MODE_NONE)
5598{ 5646 bnx2x_set_client_config(bp);
5599#ifdef BCM_VLAN
5600 int mode = bp->rx_mode;
5601#endif
5602 int port = bp->port;
5603 struct tstorm_eth_client_config tstorm_client = {0};
5604
5605 tstorm_client.mtu = bp->dev->mtu;
5606 tstorm_client.statistics_counter_id = 0;
5607 tstorm_client.config_flags =
5608 TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE;
5609#ifdef BCM_VLAN
5610 if (mode && bp->vlgrp) {
5611 tstorm_client.config_flags |=
5612 TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE;
5613 DP(NETIF_MSG_IFUP, "vlan removal enabled\n");
5614 }
5615#endif
5616 tstorm_client.drop_flags = (TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR |
5617 TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR |
5618 TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR |
5619 TSTORM_ETH_CLIENT_CONFIG_DROP_MAC_ERR);
5620
5621 REG_WR(bp, BAR_TSTRORM_INTMEM +
5622 TSTORM_CLIENT_CONFIG_OFFSET(port, client_id),
5623 ((u32 *)&tstorm_client)[0]);
5624 REG_WR(bp, BAR_TSTRORM_INTMEM +
5625 TSTORM_CLIENT_CONFIG_OFFSET(port, client_id) + 4,
5626 ((u32 *)&tstorm_client)[1]);
5627
5628/* DP(NETIF_MSG_IFUP, "tstorm_client: 0x%08x 0x%08x\n",
5629 ((u32 *)&tstorm_client)[0], ((u32 *)&tstorm_client)[1]); */
5630} 5647}
5631 5648
5632static void bnx2x_init_internal(struct bnx2x *bp) 5649static void bnx2x_init_internal(struct bnx2x *bp)
@@ -5634,7 +5651,6 @@ static void bnx2x_init_internal(struct bnx2x *bp)
5634 int port = bp->port; 5651 int port = bp->port;
5635 struct tstorm_eth_function_common_config tstorm_config = {0}; 5652 struct tstorm_eth_function_common_config tstorm_config = {0};
5636 struct stats_indication_flags stats_flags = {0}; 5653 struct stats_indication_flags stats_flags = {0};
5637 int i;
5638 5654
5639 if (is_multi(bp)) { 5655 if (is_multi(bp)) {
5640 tstorm_config.config_flags = MULTI_FLAGS; 5656 tstorm_config.config_flags = MULTI_FLAGS;
@@ -5651,10 +5667,6 @@ static void bnx2x_init_internal(struct bnx2x *bp)
5651 bp->rx_mode = BNX2X_RX_MODE_NONE; /* no rx until link is up */ 5667 bp->rx_mode = BNX2X_RX_MODE_NONE; /* no rx until link is up */
5652 bnx2x_set_storm_rx_mode(bp); 5668 bnx2x_set_storm_rx_mode(bp);
5653 5669
5654 for_each_queue(bp, i)
5655 bnx2x_set_client_config(bp, i);
5656
5657
5658 stats_flags.collect_eth = cpu_to_le32(1); 5670 stats_flags.collect_eth = cpu_to_le32(1);
5659 5671
5660 REG_WR(bp, BAR_XSTRORM_INTMEM + XSTORM_STATS_FLAGS_OFFSET(port), 5672 REG_WR(bp, BAR_XSTRORM_INTMEM + XSTORM_STATS_FLAGS_OFFSET(port),
@@ -6961,7 +6973,7 @@ static int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
6961 6973
6962 mb(); /* state is changed by bnx2x_sp_event()*/ 6974 mb(); /* state is changed by bnx2x_sp_event()*/
6963 6975
6964 if (*state_p != state) 6976 if (*state_p == state)
6965 return 0; 6977 return 0;
6966 6978
6967 timeout--; 6979 timeout--;
@@ -6970,9 +6982,10 @@ static int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
6970 } 6982 }
6971 6983
6972 /* timeout! */ 6984 /* timeout! */
6973 BNX2X_ERR("timeout waiting for ramrod %d on %d\n", state, idx); 6985 BNX2X_ERR("timeout %s for state %x on IDX [%d]\n",
6974 return -EBUSY; 6986 poll ? "polling" : "waiting", state, idx);
6975 6987
6988 return -EBUSY;
6976} 6989}
6977 6990
6978static int bnx2x_setup_leading(struct bnx2x *bp) 6991static int bnx2x_setup_leading(struct bnx2x *bp)
@@ -7239,7 +7252,7 @@ static int bnx2x_stop_multi(struct bnx2x *bp, int index)
7239 /* delete cfc entry */ 7252 /* delete cfc entry */
7240 bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_CFC_DEL, index, 0, 0, 1); 7253 bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_CFC_DEL, index, 0, 0, 1);
7241 7254
7242 return bnx2x_wait_ramrod(bp, BNX2X_FP_STATE_DELETED, index, 7255 return bnx2x_wait_ramrod(bp, BNX2X_FP_STATE_CLOSED, index,
7243 &(bp->fp[index].state), 1); 7256 &(bp->fp[index].state), 1);
7244 7257
7245} 7258}
@@ -7247,7 +7260,7 @@ static int bnx2x_stop_multi(struct bnx2x *bp, int index)
7247 7260
7248static void bnx2x_stop_leading(struct bnx2x *bp) 7261static void bnx2x_stop_leading(struct bnx2x *bp)
7249{ 7262{
7250 7263 u16 dsb_sp_prod_idx;
7251 /* if the other port is handling traffic, 7264 /* if the other port is handling traffic,
7252 this can take a lot of time */ 7265 this can take a lot of time */
7253 int timeout = 500; 7266 int timeout = 500;
@@ -7262,23 +7275,29 @@ static void bnx2x_stop_leading(struct bnx2x *bp)
7262 &(bp->fp[0].state), 1)) 7275 &(bp->fp[0].state), 1))
7263 return; 7276 return;
7264 7277
7265 bp->dsb_sp_prod_idx = *bp->dsb_sp_prod; 7278 dsb_sp_prod_idx = *bp->dsb_sp_prod;
7266 7279
7267 /* Send CFC_DELETE ramrod */ 7280 /* Send CFC_DELETE ramrod */
7268 bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_PORT_DEL, 0, 0, 0, 1); 7281 bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_PORT_DEL, 0, 0, 0, 1);
7269 7282
7270 /* 7283 /* Wait for completion to arrive on default status block
7271 Wait for completion.
7272 we are going to reset the chip anyway 7284 we are going to reset the chip anyway
7273 so there is not much to do if this times out 7285 so there is not much to do if this times out
7274 */ 7286 */
7275 while (bp->dsb_sp_prod_idx == *bp->dsb_sp_prod && timeout) { 7287 while ((dsb_sp_prod_idx == *bp->dsb_sp_prod) && timeout) {
7276 timeout--; 7288 timeout--;
7277 msleep(1); 7289 msleep(1);
7278 } 7290 }
7279 7291 if (!timeout) {
7292 DP(NETIF_MSG_IFDOWN, "timeout polling for completion "
7293 "dsb_sp_prod 0x%x != dsb_sp_prod_idx 0x%x\n",
7294 *bp->dsb_sp_prod, dsb_sp_prod_idx);
7295 }
7296 bp->state = BNX2X_STATE_CLOSING_WAIT4_UNLOAD;
7297 bp->fp[0].state = BNX2X_FP_STATE_CLOSED;
7280} 7298}
7281 7299
7300
7282static int bnx2x_nic_unload(struct bnx2x *bp, int fre_irq) 7301static int bnx2x_nic_unload(struct bnx2x *bp, int fre_irq)
7283{ 7302{
7284 u32 reset_code = 0; 7303 u32 reset_code = 0;
@@ -8968,9 +8987,7 @@ static int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state)
8968 * net_device service functions 8987 * net_device service functions
8969 */ 8988 */
8970 8989
8971/* Called with rtnl_lock from vlan functions and also netif_tx_lock 8990/* called with netif_tx_lock from set_multicast */
8972 * from set_multicast.
8973 */
8974static void bnx2x_set_rx_mode(struct net_device *dev) 8991static void bnx2x_set_rx_mode(struct net_device *dev)
8975{ 8992{
8976 struct bnx2x *bp = netdev_priv(dev); 8993 struct bnx2x *bp = netdev_priv(dev);
@@ -9496,7 +9513,7 @@ static void bnx2x_vlan_rx_register(struct net_device *dev,
9496 9513
9497 bp->vlgrp = vlgrp; 9514 bp->vlgrp = vlgrp;
9498 if (netif_running(dev)) 9515 if (netif_running(dev))
9499 bnx2x_set_rx_mode(dev); 9516 bnx2x_set_client_config(bp);
9500} 9517}
9501#endif 9518#endif
9502 9519
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
index dc423e58dad8..d0e5ab1af444 100644
--- a/drivers/net/bnx2x.h
+++ b/drivers/net/bnx2x.h
@@ -1,6 +1,6 @@
1/* bnx2x.h: Broadcom Everest network driver. 1/* bnx2x.h: Broadcom Everest network driver.
2 * 2 *
3 * Copyright (c) 2007 Broadcom Corporation 3 * Copyright (c) 2007-2008 Broadcom Corporation
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -431,8 +431,6 @@ struct bnx2x_fastpath {
431#define BNX2X_FP_STATE_OPEN 0xa0000 431#define BNX2X_FP_STATE_OPEN 0xa0000
432#define BNX2X_FP_STATE_HALTING 0xb0000 432#define BNX2X_FP_STATE_HALTING 0xb0000
433#define BNX2X_FP_STATE_HALTED 0xc0000 433#define BNX2X_FP_STATE_HALTED 0xc0000
434#define BNX2X_FP_STATE_DELETED 0xd0000
435#define BNX2X_FP_STATE_CLOSE_IRQ 0xe0000
436 434
437 int index; 435 int index;
438 436
@@ -513,7 +511,6 @@ struct bnx2x {
513 struct eth_spe *spq; 511 struct eth_spe *spq;
514 dma_addr_t spq_mapping; 512 dma_addr_t spq_mapping;
515 u16 spq_prod_idx; 513 u16 spq_prod_idx;
516 u16 dsb_sp_prod_idx;
517 struct eth_spe *spq_prod_bd; 514 struct eth_spe *spq_prod_bd;
518 struct eth_spe *spq_last_bd; 515 struct eth_spe *spq_last_bd;
519 u16 *dsb_sp_prod; 516 u16 *dsb_sp_prod;