summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/rt2560.c30
-rw-r--r--sys/dev/ic/rt2661.c16
2 files changed, 23 insertions, 23 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index c7ef4a7088f..ca0bef59efc 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.57 2010/09/07 16:21:42 deraadt Exp $ */
+/* $OpenBSD: rt2560.c,v 1.58 2011/02/22 20:05:03 kettenis Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -974,6 +974,13 @@ rt2560_tx_intr(struct rt2560_softc *sc)
ifp->if_oerrors++;
}
+ /* descriptor is no longer valid */
+ desc->flags &= ~htole32(RT2560_TX_VALID);
+
+ bus_dmamap_sync(sc->sc_dmat, sc->txq.map,
+ sc->txq.next * RT2560_TX_DESC_SIZE, RT2560_TX_DESC_SIZE,
+ BUS_DMASYNC_PREWRITE);
+
bus_dmamap_sync(sc->sc_dmat, data->map, 0,
data->map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->sc_dmat, data->map);
@@ -982,13 +989,6 @@ rt2560_tx_intr(struct rt2560_softc *sc)
ieee80211_release_node(ic, data->ni);
data->ni = NULL;
- /* descriptor is no longer valid */
- desc->flags &= ~htole32(RT2560_TX_VALID);
-
- bus_dmamap_sync(sc->sc_dmat, sc->txq.map,
- sc->txq.next * RT2560_TX_DESC_SIZE, RT2560_TX_DESC_SIZE,
- BUS_DMASYNC_PREWRITE);
-
DPRINTFN(15, ("tx done idx=%u\n", sc->txq.next));
sc->txq.queued--;
@@ -1040,6 +1040,13 @@ rt2560_prio_intr(struct rt2560_softc *sc)
sc->sc_dev.dv_xname, letoh32(desc->flags));
}
+ /* descriptor is no longer valid */
+ desc->flags &= ~htole32(RT2560_TX_VALID);
+
+ bus_dmamap_sync(sc->sc_dmat, sc->prioq.map,
+ sc->prioq.next * RT2560_TX_DESC_SIZE, RT2560_TX_DESC_SIZE,
+ BUS_DMASYNC_PREWRITE);
+
bus_dmamap_sync(sc->sc_dmat, data->map, 0,
data->map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->sc_dmat, data->map);
@@ -1048,13 +1055,6 @@ rt2560_prio_intr(struct rt2560_softc *sc)
ieee80211_release_node(ic, data->ni);
data->ni = NULL;
- /* descriptor is no longer valid */
- desc->flags &= ~htole32(RT2560_TX_VALID);
-
- bus_dmamap_sync(sc->sc_dmat, sc->prioq.map,
- sc->prioq.next * RT2560_TX_DESC_SIZE, RT2560_TX_DESC_SIZE,
- BUS_DMASYNC_PREWRITE);
-
DPRINTFN(15, ("prio done idx=%u\n", sc->prioq.next));
sc->prioq.queued--;
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index d329378621e..d8922894ca3 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.63 2010/09/07 16:21:42 deraadt Exp $ */
+/* $OpenBSD: rt2661.c,v 1.64 2011/02/22 20:05:03 kettenis Exp $ */
/*-
* Copyright (c) 2006
@@ -1004,13 +1004,6 @@ rt2661_tx_dma_intr(struct rt2661_softc *sc, struct rt2661_tx_ring *txq)
!(letoh32(desc->flags) & RT2661_TX_VALID))
break;
- bus_dmamap_sync(sc->sc_dmat, data->map, 0,
- data->map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
- bus_dmamap_unload(sc->sc_dmat, data->map);
- m_freem(data->m);
- data->m = NULL;
- /* node reference is released in rt2661_tx_intr() */
-
/* descriptor is no longer valid */
desc->flags &= ~htole32(RT2661_TX_VALID);
@@ -1018,6 +1011,13 @@ rt2661_tx_dma_intr(struct rt2661_softc *sc, struct rt2661_tx_ring *txq)
txq->next * RT2661_TX_DESC_SIZE, RT2661_TX_DESC_SIZE,
BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(sc->sc_dmat, data->map, 0,
+ data->map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(sc->sc_dmat, data->map);
+ m_freem(data->m);
+ data->m = NULL;
+ /* node reference is released in rt2661_tx_intr() */
+
DPRINTFN(15, ("tx dma done q=%p idx=%u\n", txq, txq->next));
if (++txq->next >= txq->count) /* faster than % count */