Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41426
b: refs/heads/master
c: 9c434f5
h: refs/heads/master
v: v3
  • Loading branch information
James K Lewis authored and Jeff Garzik committed Nov 30, 2006
1 parent 4a8ad22 commit 465dbd5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 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: 418e8f3d7ef4a30d4b5c84440641c9792a7f83f1
refs/heads/master: 9c434f5e2181097e1d22d9b3e381ca6d693e5188
18 changes: 5 additions & 13 deletions trunk/drivers/net/spider_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,20 +644,12 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
struct spider_net_descr *descr;
dma_addr_t buf;
unsigned long flags;
int length;

length = skb->len;
if (length < ETH_ZLEN) {
if (skb_pad(skb, ETH_ZLEN-length))
return 0;
length = ETH_ZLEN;
}

buf = pci_map_single(card->pdev, skb->data, length, PCI_DMA_TODEVICE);
buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
if (pci_dma_mapping_error(buf)) {
if (netif_msg_tx_err(card) && net_ratelimit())
pr_err("could not iommu-map packet (%p, %i). "
"Dropping packet\n", skb->data, length);
"Dropping packet\n", skb->data, skb->len);
card->spider_stats.tx_iommu_map_error++;
return -ENOMEM;
}
Expand All @@ -667,7 +659,7 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
card->tx_chain.head = descr->next;

descr->buf_addr = buf;
descr->buf_size = length;
descr->buf_size = skb->len;
descr->next_descr_addr = 0;
descr->skb = skb;
descr->data_status = 0;
Expand Down Expand Up @@ -802,8 +794,8 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)

/* unmap the skb */
if (skb) {
int len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len;
pci_unmap_single(card->pdev, buf_addr, len, PCI_DMA_TODEVICE);
pci_unmap_single(card->pdev, buf_addr, skb->len,
PCI_DMA_TODEVICE);
dev_kfree_skb(skb);
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/spider_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef _SPIDER_NET_H
#define _SPIDER_NET_H

#define VERSION "1.1 A"
#define VERSION "1.5 A"

#include "sungem_phy.h"

Expand Down

0 comments on commit 465dbd5

Please sign in to comment.