From 10f6f13e425f14349baf61a1e51f837b2e0f84bb Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Wed, 10 Feb 2010 12:48:01 +0100 Subject: [PATCH] DMA sync fix in Tx and Rx processing loops --- rt2860.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rt2860.c b/rt2860.c index 3da8422..1b8456e 100644 --- a/rt2860.c +++ b/rt2860.c @@ -4882,11 +4882,11 @@ static int rt2860_rx_eof(struct rt2860_softc *sc, int limit) nframes = 0; - bus_dmamap_sync(ring->desc_dma_tag, ring->desc_dma_map, - BUS_DMASYNC_POSTREAD); - while (limit != 0) { + bus_dmamap_sync(ring->desc_dma_tag, ring->desc_dma_map, + BUS_DMASYNC_POSTREAD); + index = rt2860_io_mac_read(sc, RT2860_REG_SCHDMA_RX_DRX_IDX); if (ring->cur == index) break; @@ -5146,11 +5146,11 @@ static void rt2860_tx_eof(struct rt2860_softc *sc, ndescs = 0; nframes = 0; - bus_dmamap_sync(ring->desc_dma_tag, ring->desc_dma_map, - BUS_DMASYNC_POSTREAD); - for (;;) { + bus_dmamap_sync(ring->desc_dma_tag, ring->desc_dma_map, + BUS_DMASYNC_POSTREAD); + index = rt2860_io_mac_read(sc, RT2860_REG_SCHDMA_TX_DTX_IDX(ring->qid)); if (ring->desc_next == index) break; -- 2.11.4.GIT