Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171123
b: refs/heads/master
c: a21771d
h: refs/heads/master
i:
  171121: bfc86b3
  171119: ed6fa04
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Nov 3, 2009
1 parent dd19c1a commit ded8353
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: 52cdf8526fe24f11d300b75458ddee017f3f4c88
refs/heads/master: a21771dd189b340328c573da9e005068e8a74c53
14 changes: 11 additions & 3 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -4426,6 +4426,10 @@ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,

mapping = pci_map_single(tp->pdev, skb->data, skb_size,
PCI_DMA_FROMDEVICE);
if (pci_dma_mapping_error(tp->pdev, mapping)) {
dev_kfree_skb(skb);
return -EIO;
}

map->skb = skb;
pci_unmap_addr_set(map, mapping, mapping);
Expand Down Expand Up @@ -10369,7 +10373,10 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
for (i = 14; i < tx_len; i++)
tx_data[i] = (u8) (i & 0xff);

map = pci_map_single(tp->pdev, skb->data, tx_len, PCI_DMA_TODEVICE);
if (skb_dma_map(&tp->pdev->dev, skb, DMA_TO_DEVICE)) {
dev_kfree_skb(skb);
return -EIO;
}

tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE |
rnapi->coal_now);
Expand All @@ -10380,7 +10387,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)

num_pkts = 0;

tg3_set_txd(tnapi, tnapi->tx_prod, map, tx_len, 0, 1);
tg3_set_txd(tnapi, tnapi->tx_prod,
skb_shinfo(skb)->dma_head, tx_len, 0, 1);

tnapi->tx_prod++;
num_pkts++;
Expand All @@ -10404,7 +10412,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
break;
}

pci_unmap_single(tp->pdev, map, tx_len, PCI_DMA_TODEVICE);
skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE);
dev_kfree_skb(skb);

if (tx_idx != tnapi->tx_prod)
Expand Down

0 comments on commit ded8353

Please sign in to comment.