aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c52
1 files changed, 48 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.