Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18774
b: refs/heads/master
c: cb415d3
h: refs/heads/master
v: v3
  • Loading branch information
Paolo Galtieri authored and Jeff Garzik committed Jan 17, 2006
1 parent 6646c1a commit da826ea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 31 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: 78a5e534758349fd3effc90ce1152b55368f52ee
refs/heads/master: cb415d30048f0c1f80fd2f5340a982e8c9617d0d
49 changes: 19 additions & 30 deletions trunk/drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,27 +353,19 @@ static int mv643xx_eth_free_tx_queue(struct net_device *dev,
stats->tx_errors++;
}

/*
* If return_info is different than 0, release the skb.
* The case where return_info is not 0 is only in case
* when transmitted a scatter/gather packet, where only
* last skb releases the whole chain.
*/
if (pkt_info.return_info) {
if (skb_shinfo(pkt_info.return_info)->nr_frags)
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);
else
dma_unmap_single(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);
if (pkt_info.cmd_sts & ETH_TX_FIRST_DESC)
dma_unmap_single(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);
else
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);

if (pkt_info.return_info) {
dev_kfree_skb_irq(pkt_info.return_info);
released = 0;
} else
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt, DMA_TO_DEVICE);
}
}

spin_unlock(&mp->lock);
Expand Down Expand Up @@ -1024,20 +1016,17 @@ static void mv643xx_tx(struct net_device *dev)
struct pkt_info pkt_info;

while (eth_tx_return_desc(mp, &pkt_info) == ETH_OK) {
if (pkt_info.return_info) {
if (skb_shinfo(pkt_info.return_info)->nr_frags)
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);
else
dma_unmap_single(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);
if (pkt_info.cmd_sts & ETH_TX_FIRST_DESC)
dma_unmap_single(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);
else
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt,
DMA_TO_DEVICE);

if (pkt_info.return_info)
dev_kfree_skb_irq(pkt_info.return_info);
} else
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt, DMA_TO_DEVICE);
}

if (netif_queue_stopped(dev) &&
Expand Down

0 comments on commit da826ea

Please sign in to comment.