Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91372
b: refs/heads/master
c: 41588ba
h: refs/heads/master
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Apr 20, 2008
1 parent 30f75fe commit e66382a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 36ef408061da9e012375547d69b27cc1f537b044
refs/heads/master: 41588ba1ae166eaba0a70abf2d7ff064ad9331d3
52 changes: 48 additions & 4 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@

#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.90"
#define DRV_MODULE_RELDATE "April 12, 2008"
#define DRV_MODULE_VERSION "3.91"
#define DRV_MODULE_RELDATE "April 18, 2008"

#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
Expand Down Expand Up @@ -4135,11 +4135,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
u32 last_plus_one, u32 *start,
u32 base_flags, u32 mss)
{
struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC);
struct sk_buff *new_skb;
dma_addr_t new_addr = 0;
u32 entry = *start;
int i, ret = 0;

if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701)
new_skb = skb_copy(skb, GFP_ATOMIC);
else {
int more_headroom = 4 - ((unsigned long)skb->data & 3);

new_skb = skb_copy_expand(skb,
skb_headroom(skb) + more_headroom,
skb_tailroom(skb), GFP_ATOMIC);
}

if (!new_skb) {
ret = -1;
} else {
Expand Down Expand Up @@ -4462,7 +4472,9 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)

would_hit_hwbug = 0;

if (tg3_4g_overflow_test(mapping, len))
if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
would_hit_hwbug = 1;
else if (tg3_4g_overflow_test(mapping, len))
would_hit_hwbug = 1;

tg3_set_txd(tp, entry, mapping, len, base_flags,
Expand Down Expand Up @@ -11339,6 +11351,38 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
}
}

if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) {
static struct tg3_dev_id {
u32 vendor;
u32 device;
} bridge_chipsets[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0 },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1 },
{ },
};
struct tg3_dev_id *pci_id = &bridge_chipsets[0];
struct pci_dev *bridge = NULL;

while (pci_id->vendor != 0) {
bridge = pci_get_device(pci_id->vendor,
pci_id->device,
bridge);
if (!bridge) {
pci_id++;
continue;
}
if (bridge->subordinate &&
(bridge->subordinate->number <=
tp->pdev->bus->number) &&
(bridge->subordinate->subordinate >=
tp->pdev->bus->number)) {
tp->tg3_flags3 |= TG3_FLG3_5701_DMA_BUG;
pci_dev_put(bridge);
break;
}
}
}

/* The EPB bridge inside 5714, 5715, and 5780 cannot support
* DMA addresses > 40-bit. This bridge may have other additional
* 57xx devices behind it in some 4-port NIC designs for example.
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/tg3.h
Original file line number Diff line number Diff line change
Expand Up @@ -2476,6 +2476,7 @@ struct tg3 {
#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
#define TG3_FLG3_ENABLE_APE 0x00000002
#define TG3_FLG3_5761_5784_AX_FIXES 0x00000004
#define TG3_FLG3_5701_DMA_BUG 0x00000008

struct timer_list timer;
u16 timer_counter;
Expand Down

0 comments on commit e66382a

Please sign in to comment.