Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265736
b: refs/heads/master
c: 938fa48
h: refs/heads/master
v: v3
  • Loading branch information
Rasesh Mody authored and David S. Miller committed Sep 15, 2011
1 parent c793e00 commit 1496ce7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 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: 41eb5ba42d6108029ccc0cdb0c95dfc6a9e348e7
refs/heads/master: 938fa48843b8d020a1dfc9cf340e09347132b7c4
35 changes: 8 additions & 27 deletions trunk/drivers/net/ethernet/brocade/bna/bnad.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,39 +137,20 @@ bnad_free_all_txbufs(struct bnad *bnad,
struct bnad_unmap_q *unmap_q = tcb->unmap_q;
struct bnad_skb_unmap *unmap_array;
struct sk_buff *skb = NULL;
int i;
int q;

unmap_array = unmap_q->unmap_array;

unmap_cons = 0;
while (unmap_cons < unmap_q->q_depth) {
skb = unmap_array[unmap_cons].skb;
if (!skb) {
unmap_cons++;
for (q = 0; q < unmap_q->q_depth; q++) {
skb = unmap_array[q].skb;
if (!skb)
continue;
}
unmap_array[unmap_cons].skb = NULL;

dma_unmap_single(&bnad->pcidev->dev,
dma_unmap_addr(&unmap_array[unmap_cons],
dma_addr), skb_headlen(skb),
DMA_TO_DEVICE);

dma_unmap_addr_set(&unmap_array[unmap_cons], dma_addr, 0);
if (++unmap_cons >= unmap_q->q_depth)
break;
unmap_cons = q;
unmap_cons = bnad_pci_unmap_skb(&bnad->pcidev->dev, unmap_array,
unmap_cons, unmap_q->q_depth, skb,
skb_shinfo(skb)->nr_frags);

for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
dma_unmap_page(&bnad->pcidev->dev,
dma_unmap_addr(&unmap_array[unmap_cons],
dma_addr),
skb_shinfo(skb)->frags[i].size,
DMA_TO_DEVICE);
dma_unmap_addr_set(&unmap_array[unmap_cons], dma_addr,
0);
if (++unmap_cons >= unmap_q->q_depth)
break;
}
dev_kfree_skb_any(skb);
}
}
Expand Down

0 comments on commit 1496ce7

Please sign in to comment.