Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18787
b: refs/heads/master
c: 8e0a613
h: refs/heads/master
i:
  18785: 88e88e7
  18783: 72a6b55
v: v3
  • Loading branch information
Arnd Bergmann authored and Jeff Garzik committed Jan 17, 2006
1 parent d180e1b commit 534859e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 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: 030d6753f8b6251927330431a7e5f0ac86bc6da9
refs/heads/master: 8e0a613bf61ccaab376877d7c2ed50315b8ca6d7
13 changes: 8 additions & 5 deletions trunk/drivers/net/spider_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/spider_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ enum spider_net_descr_status {

struct spider_net_descr {
/* as defined by the hardware */
dma_addr_t buf_addr;
u32 buf_addr;
u32 buf_size;
dma_addr_t next_descr_addr;
u32 next_descr_addr;
u32 dmac_cmd_status;
u32 result_size;
u32 valid_size; /* all zeroes for tx */
Expand Down

0 comments on commit 534859e

Please sign in to comment.