diff options
author | Arnd Bergmann <arnd@arndb.de> | 2006-01-12 17:16:43 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 07:25:00 -0500 |
commit | 8e0a613bf61ccaab376877d7c2ed50315b8ca6d7 (patch) | |
tree | 76964e5d482023c895487a7392a3e3e18d7dc599 /drivers/net/spider_net.c | |
parent | 030d6753f8b6251927330431a7e5f0ac86bc6da9 (diff) | |
download | op-kernel-dev-8e0a613bf61ccaab376877d7c2ed50315b8ca6d7.zip op-kernel-dev-8e0a613bf61ccaab376877d7c2ed50315b8ca6d7.tar.gz |
[PATCH] spidernet: fix HW structures for 64 bit dma_addr_t
The driver incorrectly used dma_addr_t to describe
HW structures and consequently broke when that type
was changed in 2.6.15-rc.
This changed spidernet to use u32 for 32 bit HW defined
structure elements.
From: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
Signed-off-by: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/spider_net.c')
-rw-r--r-- | drivers/net/spider_net.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 94e238f..8696919 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c @@ -480,6 +480,7 @@ static int spider_net_prepare_rx_descr(struct spider_net_card *card, struct spider_net_descr *descr) { + dma_addr_t buf; int error = 0; int offset; int bufsize; @@ -510,10 +511,11 @@ spider_net_prepare_rx_descr(struct spider_net_card *card, if (offset) skb_reserve(descr->skb, SPIDER_NET_RXBUF_ALIGN - offset); /* io-mmu-map the skb */ - descr->buf_addr = pci_map_single(card->pdev, descr->skb->data, + buf = pci_map_single(card->pdev, descr->skb->data, SPIDER_NET_MAX_MTU, PCI_DMA_BIDIRECTIONAL); - if (descr->buf_addr == DMA_ERROR_CODE) { + descr->buf_addr = buf; + if (buf == DMA_ERROR_CODE) { dev_kfree_skb_any(descr->skb); if (netif_msg_rx_err(card)) pr_err("Could not iommu-map rx buffer\n"); @@ -914,15 +916,16 @@ spider_net_prepare_tx_descr(struct spider_net_card *card, struct spider_net_descr *descr, struct sk_buff *skb) { - descr->buf_addr = pci_map_single(card->pdev, skb->data, - skb->len, PCI_DMA_BIDIRECTIONAL); - if (descr->buf_addr == DMA_ERROR_CODE) { + dma_addr_t buf = pci_map_single(card->pdev, skb->data, + skb->len, PCI_DMA_BIDIRECTIONAL); + if (buf == DMA_ERROR_CODE) { if (netif_msg_tx_err(card)) pr_err("could not iommu-map packet (%p, %i). " "Dropping packet\n", skb->data, skb->len); return -ENOMEM; } + descr->buf_addr = buf; descr->buf_size = skb->len; descr->skb = skb; descr->data_status = 0; |