aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/recv.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2008-12-15 10:10:46 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:23:26 -0500
commit9bf9fca8dea70116016d32c2bf3f83170c8fba76 (patch)
tree11840327a8e491e397e7980bb7f36aa80b3ae951 /drivers/net/wireless/ath9k/recv.c
parentf7a276a625e0b980185d2eb8e8e3e9425a708bee (diff)
ath9k: Synchronize DMA transfer with CPU at right place
This patch does pci_dma_sync_single_for_cpu() before accessing the header of the frame and queueing the same buffer into h/w. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/recv.c')
-rw-r--r--drivers/net/wireless/ath9k/recv.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index cc160fe9f817..462e08c3d09d 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -520,6 +520,15 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
520 continue; 520 continue;
521 521
522 /* 522 /*
523 * Synchronize the DMA transfer with CPU before
524 * 1. accessing the frame
525 * 2. requeueing the same buffer to h/w
526 */
527 pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr,
528 sc->rx.bufsize,
529 PCI_DMA_FROMDEVICE);
530
531 /*
523 * If we're asked to flush receive queue, directly 532 * If we're asked to flush receive queue, directly
524 * chain it back at the queue without processing it. 533 * chain it back at the queue without processing it.
525 */ 534 */
@@ -547,10 +556,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
547 if (!requeue_skb) 556 if (!requeue_skb)
548 goto requeue; 557 goto requeue;
549 558
550 /* Sync and unmap the frame */ 559 /* Unmap the frame */
551 pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr,
552 sc->rx.bufsize,
553 PCI_DMA_FROMDEVICE);
554 pci_unmap_single(sc->pdev, bf->bf_buf_addr, 560 pci_unmap_single(sc->pdev, bf->bf_buf_addr,
555 sc->rx.bufsize, 561 sc->rx.bufsize,
556 PCI_DMA_FROMDEVICE); 562 PCI_DMA_FROMDEVICE);