diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2008-12-15 16:10:46 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-19 21:23:26 +0100 |
commit | 9bf9fca8dea70116016d32c2bf3f83170c8fba76 (patch) | |
tree | 11840327a8e491e397e7980bb7f36aa80b3ae951 | |
parent | ath9k: Remove MAC header pad before reporting TX status (diff) | |
download | linux-9bf9fca8dea70116016d32c2bf3f83170c8fba76.tar.xz linux-9bf9fca8dea70116016d32c2bf3f83170c8fba76.zip |
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>
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 14 |
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) continue; /* + * Synchronize the DMA transfer with CPU before + * 1. accessing the frame + * 2. requeueing the same buffer to h/w + */ + pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr, + sc->rx.bufsize, + PCI_DMA_FROMDEVICE); + + /* * If we're asked to flush receive queue, directly * chain it back at the queue without processing it. */ @@ -547,10 +556,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) if (!requeue_skb) goto requeue; - /* Sync and unmap the frame */ - pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr, - sc->rx.bufsize, - PCI_DMA_FROMDEVICE); + /* Unmap the frame */ pci_unmap_single(sc->pdev, bf->bf_buf_addr, sc->rx.bufsize, PCI_DMA_FROMDEVICE); |