aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/spider_net.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-12-05 09:37:56 -0500
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-12-05 09:37:56 -0500
commit4c1ac1b49122b805adfa4efc620592f68dccf5db (patch)
tree87557f4bc2fd4fe65b7570489c2f610c45c0adcd /drivers/net/spider_net.c
parentc4028958b6ecad064b1a6303a6a5906d4fe48d73 (diff)
parentd916faace3efc0bf19fe9a615a1ab8fa1a24cd93 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/infiniband/core/iwcm.c drivers/net/chelsio/cxgb2.c drivers/net/wireless/bcm43xx/bcm43xx_main.c drivers/net/wireless/prism54/islpci_eth.c drivers/usb/core/hub.h drivers/usb/input/hid-core.c net/core/netpoll.c Fix up merge failures with Linus's head and fix new compilation failures. Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/net/spider_net.c')
-rw-r--r--drivers/net/spider_net.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index f88fcac0e46a..f16f696c1ff2 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -644,20 +644,12 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
644 struct spider_net_descr *descr; 644 struct spider_net_descr *descr;
645 dma_addr_t buf; 645 dma_addr_t buf;
646 unsigned long flags; 646 unsigned long flags;
647 int length;
648 647
649 length = skb->len; 648 buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
650 if (length < ETH_ZLEN) {
651 if (skb_pad(skb, ETH_ZLEN-length))
652 return 0;
653 length = ETH_ZLEN;
654 }
655
656 buf = pci_map_single(card->pdev, skb->data, length, PCI_DMA_TODEVICE);
657 if (pci_dma_mapping_error(buf)) { 649 if (pci_dma_mapping_error(buf)) {
658 if (netif_msg_tx_err(card) && net_ratelimit()) 650 if (netif_msg_tx_err(card) && net_ratelimit())
659 pr_err("could not iommu-map packet (%p, %i). " 651 pr_err("could not iommu-map packet (%p, %i). "
660 "Dropping packet\n", skb->data, length); 652 "Dropping packet\n", skb->data, skb->len);
661 card->spider_stats.tx_iommu_map_error++; 653 card->spider_stats.tx_iommu_map_error++;
662 return -ENOMEM; 654 return -ENOMEM;
663 } 655 }
@@ -667,7 +659,7 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
667 card->tx_chain.head = descr->next; 659 card->tx_chain.head = descr->next;
668 660
669 descr->buf_addr = buf; 661 descr->buf_addr = buf;
670 descr->buf_size = length; 662 descr->buf_size = skb->len;
671 descr->next_descr_addr = 0; 663 descr->next_descr_addr = 0;
672 descr->skb = skb; 664 descr->skb = skb;
673 descr->data_status = 0; 665 descr->data_status = 0;
@@ -802,8 +794,8 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
802 794
803 /* unmap the skb */ 795 /* unmap the skb */
804 if (skb) { 796 if (skb) {
805 int len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; 797 pci_unmap_single(card->pdev, buf_addr, skb->len,
806 pci_unmap_single(card->pdev, buf_addr, len, PCI_DMA_TODEVICE); 798 PCI_DMA_TODEVICE);
807 dev_kfree_skb(skb); 799 dev_kfree_skb(skb);
808 } 800 }
809 } 801 }
@@ -1641,7 +1633,7 @@ spider_net_enable_card(struct spider_net_card *card)
1641 SPIDER_NET_INT2_MASK_VALUE); 1633 SPIDER_NET_INT2_MASK_VALUE);
1642 1634
1643 spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR, 1635 spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR,
1644 SPIDER_NET_GDTBSTA | SPIDER_NET_GDTDCEIDIS); 1636 SPIDER_NET_GDTBSTA);
1645} 1637}
1646 1638
1647/** 1639/**