aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index da767d3d5af5..4e7b46e44874 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -56,8 +56,8 @@
56 56
57#define DRV_MODULE_NAME "bnx2" 57#define DRV_MODULE_NAME "bnx2"
58#define PFX DRV_MODULE_NAME ": " 58#define PFX DRV_MODULE_NAME ": "
59#define DRV_MODULE_VERSION "1.6.8" 59#define DRV_MODULE_VERSION "1.6.9"
60#define DRV_MODULE_RELDATE "October 17, 2007" 60#define DRV_MODULE_RELDATE "December 8, 2007"
61 61
62#define RUN_AT(x) (jiffies + (x)) 62#define RUN_AT(x) (jiffies + (x))
63 63
@@ -2387,18 +2387,24 @@ bnx2_reuse_rx_skb(struct bnx2 *bp, struct sk_buff *skb,
2387 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo; 2387 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;
2388} 2388}
2389 2389
2390static inline u16
2391bnx2_get_hw_rx_cons(struct bnx2 *bp)
2392{
2393 u16 cons = bp->status_blk->status_rx_quick_consumer_index0;
2394
2395 if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT))
2396 cons++;
2397 return cons;
2398}
2399
2390static int 2400static int
2391bnx2_rx_int(struct bnx2 *bp, int budget) 2401bnx2_rx_int(struct bnx2 *bp, int budget)
2392{ 2402{
2393 struct status_block *sblk = bp->status_blk;
2394 u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod; 2403 u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod;
2395 struct l2_fhdr *rx_hdr; 2404 struct l2_fhdr *rx_hdr;
2396 int rx_pkt = 0; 2405 int rx_pkt = 0;
2397 2406
2398 hw_cons = bp->hw_rx_cons = sblk->status_rx_quick_consumer_index0; 2407 hw_cons = bnx2_get_hw_rx_cons(bp);
2399 if ((hw_cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT) {
2400 hw_cons++;
2401 }
2402 sw_cons = bp->rx_cons; 2408 sw_cons = bp->rx_cons;
2403 sw_prod = bp->rx_prod; 2409 sw_prod = bp->rx_prod;
2404 2410
@@ -2515,10 +2521,7 @@ next_rx:
2515 2521
2516 /* Refresh hw_cons to see if there is new work */ 2522 /* Refresh hw_cons to see if there is new work */
2517 if (sw_cons == hw_cons) { 2523 if (sw_cons == hw_cons) {
2518 hw_cons = bp->hw_rx_cons = 2524 hw_cons = bnx2_get_hw_rx_cons(bp);
2519 sblk->status_rx_quick_consumer_index0;
2520 if ((hw_cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT)
2521 hw_cons++;
2522 rmb(); 2525 rmb();
2523 } 2526 }
2524 } 2527 }
@@ -2622,7 +2625,7 @@ bnx2_has_work(struct bnx2 *bp)
2622{ 2625{
2623 struct status_block *sblk = bp->status_blk; 2626 struct status_block *sblk = bp->status_blk;
2624 2627
2625 if ((sblk->status_rx_quick_consumer_index0 != bp->hw_rx_cons) || 2628 if ((bnx2_get_hw_rx_cons(bp) != bp->rx_cons) ||
2626 (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons)) 2629 (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons))
2627 return 1; 2630 return 1;
2628 2631
@@ -2655,7 +2658,7 @@ static int bnx2_poll_work(struct bnx2 *bp, int work_done, int budget)
2655 if (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons) 2658 if (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons)
2656 bnx2_tx_int(bp); 2659 bnx2_tx_int(bp);
2657 2660
2658 if (sblk->status_rx_quick_consumer_index0 != bp->hw_rx_cons) 2661 if (bnx2_get_hw_rx_cons(bp) != bp->rx_cons)
2659 work_done += bnx2_rx_int(bp, budget - work_done); 2662 work_done += bnx2_rx_int(bp, budget - work_done);
2660 2663
2661 return work_done; 2664 return work_done;
@@ -4177,7 +4180,6 @@ bnx2_init_rx_ring(struct bnx2 *bp)
4177 4180
4178 ring_prod = prod = bp->rx_prod = 0; 4181 ring_prod = prod = bp->rx_prod = 0;
4179 bp->rx_cons = 0; 4182 bp->rx_cons = 0;
4180 bp->hw_rx_cons = 0;
4181 bp->rx_prod_bseq = 0; 4183 bp->rx_prod_bseq = 0;
4182 4184
4183 for (i = 0; i < bp->rx_max_ring; i++) { 4185 for (i = 0; i < bp->rx_max_ring; i++) {
@@ -6685,8 +6687,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
6685 } else if (CHIP_NUM(bp) == CHIP_NUM_5706 || 6687 } else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
6686 CHIP_NUM(bp) == CHIP_NUM_5708) 6688 CHIP_NUM(bp) == CHIP_NUM_5708)
6687 bp->phy_flags |= PHY_CRC_FIX_FLAG; 6689 bp->phy_flags |= PHY_CRC_FIX_FLAG;
6688 else if (CHIP_ID(bp) == CHIP_ID_5709_A0 || 6690 else if (CHIP_NUM(bp) == CHIP_NUM_5709 &&
6689 CHIP_ID(bp) == CHIP_ID_5709_A1) 6691 (CHIP_REV(bp) == CHIP_REV_Ax ||
6692 CHIP_REV(bp) == CHIP_REV_Bx))
6690 bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG; 6693 bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG;
6691 6694
6692 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || 6695 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||