Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296319
b: refs/heads/master
c: ba84525
h: refs/heads/master
i:
  296317: f7af92c
  296315: dfa8b52
  296311: 10e0992
  296303: d1b2024
  296287: 64819df
  296255: 18e66e8
  296191: 1f2fc87
v: v3
  • Loading branch information
Russell King committed Feb 9, 2012
1 parent 26db599 commit b09588a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 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: 885767ca4ce0800c5d02eb66cc10a0494b7bf312
refs/heads/master: ba84525bd9015e7dd20f7c97a2a96b0a238b0223
29 changes: 19 additions & 10 deletions trunk/drivers/net/irda/sa1100_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,7 @@ static void sa1100_irda_txdma_irq(void *id)
{
struct net_device *dev = id;
struct sa1100_irda *si = netdev_priv(dev);
struct sk_buff *skb = si->dma_tx.skb;

si->dma_tx.skb = NULL;
struct sk_buff *skb;

/*
* Wait for the transmission to complete. Unfortunately,
Expand Down Expand Up @@ -636,14 +634,15 @@ static void sa1100_irda_txdma_irq(void *id)
*/
sa1100_irda_rx_dma_start(si);

/*
* Account and free the packet.
*/
/* Account and free the packet. */
skb = si->dma_tx.skb;
if (skb) {
dma_unmap_single(si->dev, si->dma_tx.dma, skb->len, DMA_TO_DEVICE);
dma_unmap_single(si->dev, si->dma_tx.dma, skb->len,
DMA_TO_DEVICE);
dev->stats.tx_packets ++;
dev->stats.tx_bytes += skb->len;
dev_kfree_skb_irq(skb);
si->dma_tx.skb = NULL;
}

/*
Expand Down Expand Up @@ -841,21 +840,31 @@ static int sa1100_irda_start(struct net_device *dev)
static int sa1100_irda_stop(struct net_device *dev)
{
struct sa1100_irda *si = netdev_priv(dev);
struct sk_buff *skb;

disable_irq(dev->irq);
sa1100_irda_shutdown(si);

/*
* If we have been doing DMA receive, make sure we
* If we have been doing any DMA activity, make sure we
* tidy that up cleanly.
*/
if (si->dma_rx.skb) {
skb = si->dma_rx.skb;
if (skb) {
dma_unmap_single(si->dev, si->dma_rx.dma, HPSIR_MAX_RXLEN,
DMA_FROM_DEVICE);
dev_kfree_skb(si->dma_rx.skb);
dev_kfree_skb(skb);
si->dma_rx.skb = NULL;
}

skb = si->dma_tx.skb;
if (skb) {
dma_unmap_single(si->dev, si->dma_tx.dma, skb->len,
DMA_TO_DEVICE);
dev_kfree_skb(skb);
si->dma_tx.skb = NULL;
}

/* Stop IrLAP */
if (si->irlap) {
irlap_close(si->irlap);
Expand Down

0 comments on commit b09588a

Please sign in to comment.