diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-17 23:53:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-17 23:53:52 -0400 |
commit | f205ce83a766c08965ec78342f138cdc00631fba (patch) | |
tree | 7a9d2db6c16594ef7c730ca93a87131cf0abca41 /drivers/net/sky2.c | |
parent | 3dc95666df0e1ae5b7381a8ec97a583bb3ce4306 (diff) | |
parent | b31c50a7f9e93a61d14740dedcbbf2c376998bc7 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (66 commits)
be2net: fix some cmds to use mccq instead of mbox
atl1e: fix 2.6.31-git4 -- ATL1E 0000:03:00.0: DMA-API: device driver frees DMA
pkt_sched: Fix qstats.qlen updating in dump_stats
ipv6: Log the affected address when DAD failure occurs
wl12xx: Fix print_mac() conversion.
af_iucv: fix race when queueing skbs on the backlog queue
af_iucv: do not call iucv_sock_kill() twice
af_iucv: handle non-accepted sockets after resuming from suspend
af_iucv: fix race in __iucv_sock_wait()
iucv: use correct output register in iucv_query_maxconn()
iucv: fix iucv_buffer_cpumask check when calling IUCV functions
iucv: suspend/resume error msg for left over pathes
wl12xx: switch to %pM to print the mac address
b44: the poll handler b44_poll must not enable IRQ unconditionally
ipv6: Ignore route option with ROUTER_PREF_INVALID
bonding: make ab_arp select active slaves as other modes
cfg80211: fix SME connect
rc80211_minstrel: fix contention window calculation
ssb/sdio: fix printk format warnings
p54usb: add Zcomax XG-705A usbid
...
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 00bc65a0aac9..4bb52e9cd371 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -65,8 +65,8 @@ | |||
65 | #define RX_DEF_PENDING RX_MAX_PENDING | 65 | #define RX_DEF_PENDING RX_MAX_PENDING |
66 | 66 | ||
67 | /* This is the worst case number of transmit list elements for a single skb: | 67 | /* This is the worst case number of transmit list elements for a single skb: |
68 | VLAN + TSO + CKSUM + Data + skb_frags * DMA */ | 68 | VLAN:GSO + CKSUM + Data + skb_frags * DMA */ |
69 | #define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) | 69 | #define MAX_SKB_TX_LE (2 + (sizeof(dma_addr_t)/sizeof(u32))*(MAX_SKB_FRAGS+1)) |
70 | #define TX_MIN_PENDING (MAX_SKB_TX_LE+1) | 70 | #define TX_MIN_PENDING (MAX_SKB_TX_LE+1) |
71 | #define TX_MAX_PENDING 4096 | 71 | #define TX_MAX_PENDING 4096 |
72 | #define TX_DEF_PENDING 127 | 72 | #define TX_DEF_PENDING 127 |
@@ -1567,11 +1567,13 @@ static unsigned tx_le_req(const struct sk_buff *skb) | |||
1567 | { | 1567 | { |
1568 | unsigned count; | 1568 | unsigned count; |
1569 | 1569 | ||
1570 | count = sizeof(dma_addr_t) / sizeof(u32); | 1570 | count = (skb_shinfo(skb)->nr_frags + 1) |
1571 | count += skb_shinfo(skb)->nr_frags * count; | 1571 | * (sizeof(dma_addr_t) / sizeof(u32)); |
1572 | 1572 | ||
1573 | if (skb_is_gso(skb)) | 1573 | if (skb_is_gso(skb)) |
1574 | ++count; | 1574 | ++count; |
1575 | else if (sizeof(dma_addr_t) == sizeof(u32)) | ||
1576 | ++count; /* possible vlan */ | ||
1575 | 1577 | ||
1576 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 1578 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
1577 | ++count; | 1579 | ++count; |
@@ -4548,16 +4550,18 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
4548 | if (hw->ports > 1) { | 4550 | if (hw->ports > 1) { |
4549 | struct net_device *dev1; | 4551 | struct net_device *dev1; |
4550 | 4552 | ||
4553 | err = -ENOMEM; | ||
4551 | dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default); | 4554 | dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default); |
4552 | if (!dev1) | 4555 | if (dev1 && (err = register_netdev(dev1)) == 0) |
4553 | dev_warn(&pdev->dev, "allocation for second device failed\n"); | 4556 | sky2_show_addr(dev1); |
4554 | else if ((err = register_netdev(dev1))) { | 4557 | else { |
4555 | dev_warn(&pdev->dev, | 4558 | dev_warn(&pdev->dev, |
4556 | "register of second port failed (%d)\n", err); | 4559 | "register of second port failed (%d)\n", err); |
4557 | hw->dev[1] = NULL; | 4560 | hw->dev[1] = NULL; |
4558 | free_netdev(dev1); | 4561 | hw->ports = 1; |
4559 | } else | 4562 | if (dev1) |
4560 | sky2_show_addr(dev1); | 4563 | free_netdev(dev1); |
4564 | } | ||
4561 | } | 4565 | } |
4562 | 4566 | ||
4563 | setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw); | 4567 | setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw); |