diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2009-11-02 07:33:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-03 02:38:58 -0500 |
commit | 0e1406dd404ce55dbe8d68b4b5e2aed7e5c75fdb (patch) | |
tree | 4af423112c4c0c6afdcdc96350a5d23af54c7455 /drivers | |
parent | 01e6b953ada927093c4d162f634200a20323c537 (diff) |
tg3: Assign flags to fixes in start_xmit_dma_bug
This patch adds a flag for each bug workaround in
tg3_start_xmit_dma_bug(). This is prep work for the following patch.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tg3.c | 26 | ||||
-rw-r--r-- | drivers/net/tg3.h | 2 |
2 files changed, 21 insertions, 7 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index ba5d3fe753b6..da808250c866 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -5124,7 +5124,8 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, | |||
5124 | /* Make sure new skb does not cross any 4G boundaries. | 5124 | /* Make sure new skb does not cross any 4G boundaries. |
5125 | * Drop the packet if it does. | 5125 | * Drop the packet if it does. |
5126 | */ | 5126 | */ |
5127 | if (ret || tg3_4g_overflow_test(new_addr, new_skb->len)) { | 5127 | if (ret || ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) && |
5128 | tg3_4g_overflow_test(new_addr, new_skb->len))) { | ||
5128 | if (!ret) | 5129 | if (!ret) |
5129 | skb_dma_unmap(&tp->pdev->dev, new_skb, | 5130 | skb_dma_unmap(&tp->pdev->dev, new_skb, |
5130 | DMA_TO_DEVICE); | 5131 | DMA_TO_DEVICE); |
@@ -5459,9 +5460,15 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, | |||
5459 | 5460 | ||
5460 | would_hit_hwbug = 0; | 5461 | would_hit_hwbug = 0; |
5461 | 5462 | ||
5462 | if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG) | 5463 | if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) && |
5464 | tg3_4g_overflow_test(mapping, len)) | ||
5465 | would_hit_hwbug = 1; | ||
5466 | |||
5467 | if ((tp->tg3_flags3 & TG3_FLG3_40BIT_DMA_LIMIT_BUG) && | ||
5468 | tg3_40bit_overflow_test(tp, mapping, len)) | ||
5463 | would_hit_hwbug = 1; | 5469 | would_hit_hwbug = 1; |
5464 | else if (tg3_4g_overflow_test(mapping, len)) | 5470 | |
5471 | if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG) | ||
5465 | would_hit_hwbug = 1; | 5472 | would_hit_hwbug = 1; |
5466 | 5473 | ||
5467 | tg3_set_txd(tnapi, entry, mapping, len, base_flags, | 5474 | tg3_set_txd(tnapi, entry, mapping, len, base_flags, |
@@ -5482,10 +5489,12 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, | |||
5482 | 5489 | ||
5483 | tnapi->tx_buffers[entry].skb = NULL; | 5490 | tnapi->tx_buffers[entry].skb = NULL; |
5484 | 5491 | ||
5485 | if (tg3_4g_overflow_test(mapping, len)) | 5492 | if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) && |
5493 | tg3_4g_overflow_test(mapping, len)) | ||
5486 | would_hit_hwbug = 1; | 5494 | would_hit_hwbug = 1; |
5487 | 5495 | ||
5488 | if (tg3_40bit_overflow_test(tp, mapping, len)) | 5496 | if ((tp->tg3_flags3 & TG3_FLG3_40BIT_DMA_LIMIT_BUG) && |
5497 | tg3_40bit_overflow_test(tp, mapping, len)) | ||
5489 | would_hit_hwbug = 1; | 5498 | would_hit_hwbug = 1; |
5490 | 5499 | ||
5491 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 5500 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) |
@@ -12610,12 +12619,15 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12610 | 12619 | ||
12611 | tp->irq_max = 1; | 12620 | tp->irq_max = 1; |
12612 | 12621 | ||
12613 | #ifdef TG3_NAPI | ||
12614 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | 12622 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { |
12615 | tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX; | 12623 | tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX; |
12616 | tp->irq_max = TG3_IRQ_MAX_VECS; | 12624 | tp->irq_max = TG3_IRQ_MAX_VECS; |
12617 | } | 12625 | } |
12618 | #endif | 12626 | |
12627 | if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) { | ||
12628 | tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG; | ||
12629 | tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG; | ||
12630 | } | ||
12619 | 12631 | ||
12620 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || | 12632 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || |
12621 | (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || | 12633 | (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index bab7940158e6..b603810b4e9b 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2759,6 +2759,8 @@ struct tg3 { | |||
2759 | #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000 | 2759 | #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000 |
2760 | #define TG3_FLG3_PHY_IS_FET 0x00010000 | 2760 | #define TG3_FLG3_PHY_IS_FET 0x00010000 |
2761 | #define TG3_FLG3_ENABLE_RSS 0x00020000 | 2761 | #define TG3_FLG3_ENABLE_RSS 0x00020000 |
2762 | #define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000 | ||
2763 | #define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000 | ||
2762 | 2764 | ||
2763 | struct timer_list timer; | 2765 | struct timer_list timer; |
2764 | u16 timer_counter; | 2766 | u16 timer_counter; |