diff options
-rw-r--r-- | drivers/net/tg3.c | 52 | ||||
-rw-r--r-- | drivers/net/tg3.h | 1 |
2 files changed, 49 insertions, 4 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 96043c5746d0..bc4c62b8e81a 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -64,8 +64,8 @@ | |||
64 | 64 | ||
65 | #define DRV_MODULE_NAME "tg3" | 65 | #define DRV_MODULE_NAME "tg3" |
66 | #define PFX DRV_MODULE_NAME ": " | 66 | #define PFX DRV_MODULE_NAME ": " |
67 | #define DRV_MODULE_VERSION "3.90" | 67 | #define DRV_MODULE_VERSION "3.91" |
68 | #define DRV_MODULE_RELDATE "April 12, 2008" | 68 | #define DRV_MODULE_RELDATE "April 18, 2008" |
69 | 69 | ||
70 | #define TG3_DEF_MAC_MODE 0 | 70 | #define TG3_DEF_MAC_MODE 0 |
71 | #define TG3_DEF_RX_MODE 0 | 71 | #define TG3_DEF_RX_MODE 0 |
@@ -4135,11 +4135,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, | |||
4135 | u32 last_plus_one, u32 *start, | 4135 | u32 last_plus_one, u32 *start, |
4136 | u32 base_flags, u32 mss) | 4136 | u32 base_flags, u32 mss) |
4137 | { | 4137 | { |
4138 | struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC); | 4138 | struct sk_buff *new_skb; |
4139 | dma_addr_t new_addr = 0; | 4139 | dma_addr_t new_addr = 0; |
4140 | u32 entry = *start; | 4140 | u32 entry = *start; |
4141 | int i, ret = 0; | 4141 | int i, ret = 0; |
4142 | 4142 | ||
4143 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) | ||
4144 | new_skb = skb_copy(skb, GFP_ATOMIC); | ||
4145 | else { | ||
4146 | int more_headroom = 4 - ((unsigned long)skb->data & 3); | ||
4147 | |||
4148 | new_skb = skb_copy_expand(skb, | ||
4149 | skb_headroom(skb) + more_headroom, | ||
4150 | skb_tailroom(skb), GFP_ATOMIC); | ||
4151 | } | ||
4152 | |||
4143 | if (!new_skb) { | 4153 | if (!new_skb) { |
4144 | ret = -1; | 4154 | ret = -1; |
4145 | } else { | 4155 | } else { |
@@ -4462,7 +4472,9 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) | |||
4462 | 4472 | ||
4463 | would_hit_hwbug = 0; | 4473 | would_hit_hwbug = 0; |
4464 | 4474 | ||
4465 | if (tg3_4g_overflow_test(mapping, len)) | 4475 | if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG) |
4476 | would_hit_hwbug = 1; | ||
4477 | else if (tg3_4g_overflow_test(mapping, len)) | ||
4466 | would_hit_hwbug = 1; | 4478 | would_hit_hwbug = 1; |
4467 | 4479 | ||
4468 | tg3_set_txd(tp, entry, mapping, len, base_flags, | 4480 | tg3_set_txd(tp, entry, mapping, len, base_flags, |
@@ -11339,6 +11351,38 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
11339 | } | 11351 | } |
11340 | } | 11352 | } |
11341 | 11353 | ||
11354 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) { | ||
11355 | static struct tg3_dev_id { | ||
11356 | u32 vendor; | ||
11357 | u32 device; | ||
11358 | } bridge_chipsets[] = { | ||
11359 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0 }, | ||
11360 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1 }, | ||
11361 | { }, | ||
11362 | }; | ||
11363 | struct tg3_dev_id *pci_id = &bridge_chipsets[0]; | ||
11364 | struct pci_dev *bridge = NULL; | ||
11365 | |||
11366 | while (pci_id->vendor != 0) { | ||
11367 | bridge = pci_get_device(pci_id->vendor, | ||
11368 | pci_id->device, | ||
11369 | bridge); | ||
11370 | if (!bridge) { | ||
11371 | pci_id++; | ||
11372 | continue; | ||
11373 | } | ||
11374 | if (bridge->subordinate && | ||
11375 | (bridge->subordinate->number <= | ||
11376 | tp->pdev->bus->number) && | ||
11377 | (bridge->subordinate->subordinate >= | ||
11378 | tp->pdev->bus->number)) { | ||
11379 | tp->tg3_flags3 |= TG3_FLG3_5701_DMA_BUG; | ||
11380 | pci_dev_put(bridge); | ||
11381 | break; | ||
11382 | } | ||
11383 | } | ||
11384 | } | ||
11385 | |||
11342 | /* The EPB bridge inside 5714, 5715, and 5780 cannot support | 11386 | /* The EPB bridge inside 5714, 5715, and 5780 cannot support |
11343 | * DMA addresses > 40-bit. This bridge may have other additional | 11387 | * DMA addresses > 40-bit. This bridge may have other additional |
11344 | * 57xx devices behind it in some 4-port NIC designs for example. | 11388 | * 57xx devices behind it in some 4-port NIC designs for example. |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index c1075a73d66c..c688c3ac5035 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2476,6 +2476,7 @@ struct tg3 { | |||
2476 | #define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001 | 2476 | #define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001 |
2477 | #define TG3_FLG3_ENABLE_APE 0x00000002 | 2477 | #define TG3_FLG3_ENABLE_APE 0x00000002 |
2478 | #define TG3_FLG3_5761_5784_AX_FIXES 0x00000004 | 2478 | #define TG3_FLG3_5761_5784_AX_FIXES 0x00000004 |
2479 | #define TG3_FLG3_5701_DMA_BUG 0x00000008 | ||
2479 | 2480 | ||
2480 | struct timer_list timer; | 2481 | struct timer_list timer; |
2481 | u16 timer_counter; | 2482 | u16 timer_counter; |