diff options
author | bschmidt <bschmidt@FreeBSD.org> | 2011-04-16 10:38:27 +0000 |
---|---|---|
committer | bschmidt <bschmidt@FreeBSD.org> | 2011-04-16 10:38:27 +0000 |
commit | 5e7a436f9a59d0acae71f8506a02f154f1319458 (patch) | |
tree | 7928cd56e93df18da04979b7e34ddb342e1d1c73 | |
parent | ebcc30282ef329fde579a7276090b2a4e2fe6e4b (diff) | |
download | FreeBSD-src-5e7a436f9a59d0acae71f8506a02f154f1319458.zip FreeBSD-src-5e7a436f9a59d0acae71f8506a02f154f1319458.tar.gz |
Unify TX/RX ring allocation, finish the descriptior DMA stuff before
starting with data.
-rw-r--r-- | sys/dev/iwn/if_iwn.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 8d7959a..5f3fb14 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -1250,23 +1250,24 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) goto fail; } - error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - IWN_RBUF_SIZE, 1, IWN_RBUF_SIZE, BUS_DMA_NOWAIT, NULL, NULL, - &ring->data_dmat); + /* Allocate RX status area (16-byte aligned). */ + error = iwn_dma_contig_alloc(sc, &ring->stat_dma, (void **)&ring->stat, + sizeof (struct iwn_rx_status), 16); if (error != 0) { device_printf(sc->sc_dev, - "%s: bus_dma_tag_create_failed, error %d\n", + "%s: could not allocate Rx status DMA memory, error %d\n", __func__, error); goto fail; } - /* Allocate RX status area (16-byte aligned). */ - error = iwn_dma_contig_alloc(sc, &ring->stat_dma, (void **)&ring->stat, - sizeof (struct iwn_rx_status), 16); + /* Create RX buffer DMA tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + IWN_RBUF_SIZE, 1, IWN_RBUF_SIZE, BUS_DMA_NOWAIT, NULL, NULL, + &ring->data_dmat); if (error != 0) { device_printf(sc->sc_dev, - "%s: could not allocate Rx status DMA memory, error %d\n", + "%s: bus_dma_tag_create_failed, error %d\n", __func__, error); goto fail; } |