diff options
author | bschmidt <bschmidt@FreeBSD.org> | 2011-04-16 10:52:11 +0000 |
---|---|---|
committer | bschmidt <bschmidt@FreeBSD.org> | 2011-04-16 10:52:11 +0000 |
commit | 7100785646725195f2be5d45e0293b4a9dd0fbf8 (patch) | |
tree | 7bc8cfe24c7cc92fd1d9bffcfbabd8155a1801e0 | |
parent | 5e7a436f9a59d0acae71f8506a02f154f1319458 (diff) | |
download | FreeBSD-src-7100785646725195f2be5d45e0293b4a9dd0fbf8.zip FreeBSD-src-7100785646725195f2be5d45e0293b4a9dd0fbf8.tar.gz |
Add missing bus_dmamap_sync calls as well as remove two duplicate ones.
Obtained from: OpenBSD
-rw-r--r-- | sys/dev/iwn/if_iwn.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 5f3fb14..f25397b 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -1148,6 +1148,8 @@ iwn_dma_contig_alloc(struct iwn_softc *sc, struct iwn_dma_info *dma, goto fail; } + bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); + if (kvap != NULL) *kvap = dma->vaddr; return 0; @@ -1307,8 +1309,6 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) error = ENOMEM; /* XXX unique code */ goto fail; } - bus_dmamap_sync(ring->data_dmat, data->map, - BUS_DMASYNC_PREWRITE); /* Set physical address of RX buffer (256-byte aligned). */ ring->desc[i] = htole32(paddr >> 8); @@ -1436,8 +1436,6 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring, int qid) __func__, error); goto fail; } - bus_dmamap_sync(ring->data_dmat, data->map, - BUS_DMASYNC_PREWRITE); } return 0; fail: @@ -1454,6 +1452,8 @@ iwn_reset_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring) struct iwn_tx_data *data = &ring->data[i]; if (data->m != NULL) { + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ring->data_dmat, data->map); m_freem(data->m); data->m = NULL; @@ -2208,6 +2208,8 @@ iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_compressed_ba *ba = (struct iwn_compressed_ba *)(desc + 1); struct iwn_tx_ring *txq; + bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); + txq = &sc->txq[letoh16(ba->qid)]; /* XXX TBD */ } @@ -2458,6 +2460,8 @@ iwn_cmd_done(struct iwn_softc *sc, struct iwn_rx_desc *desc) /* If the command was mapped in an mbuf, free it. */ if (data->m != NULL) { + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ring->data_dmat, data->map); m_freem(data->m); data->m = NULL; |