diff options
Diffstat (limited to 'sys/dev/mwl/if_mwl.c')
-rw-r--r-- | sys/dev/mwl/if_mwl.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index 67fba35..b50e1a9 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -2041,13 +2041,6 @@ mwl_desc_setup(struct mwl_softc *sc, const char *name, } /* allocate descriptors */ - error = bus_dmamap_create(dd->dd_dmat, BUS_DMA_NOWAIT, &dd->dd_dmamap); - if (error != 0) { - if_printf(ifp, "unable to create dmamap for %s descriptors, " - "error %u\n", dd->dd_name, error); - goto fail0; - } - error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); @@ -2077,8 +2070,6 @@ mwl_desc_setup(struct mwl_softc *sc, const char *name, fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); fail1: - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -2090,7 +2081,6 @@ mwl_desc_cleanup(struct mwl_softc *sc, struct mwl_descdma *dd) { bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); @@ -2229,9 +2219,8 @@ mwl_rxdma_setup(struct mwl_softc *sc) NULL, /* lockfunc */ NULL, /* lockarg */ &sc->sc_rxdmat); - error = bus_dmamap_create(sc->sc_rxdmat, BUS_DMA_NOWAIT, &sc->sc_rxmap); if (error != 0) { - if_printf(ifp, "could not create rx DMA map\n"); + if_printf(ifp, "could not create rx DMA tag\n"); return error; } @@ -2292,16 +2281,14 @@ mwl_rxdma_setup(struct mwl_softc *sc) static void mwl_rxdma_cleanup(struct mwl_softc *sc) { - if (sc->sc_rxmap != NULL) + if (sc->sc_rxmem_paddr != 0) { bus_dmamap_unload(sc->sc_rxdmat, sc->sc_rxmap); + sc->sc_rxmem_paddr = 0; + } if (sc->sc_rxmem != NULL) { bus_dmamem_free(sc->sc_rxdmat, sc->sc_rxmem, sc->sc_rxmap); sc->sc_rxmem = NULL; } - if (sc->sc_rxmap != NULL) { - bus_dmamap_destroy(sc->sc_rxdmat, sc->sc_rxmap); - sc->sc_rxmap = NULL; - } if (sc->sc_rxdma.dd_bufptr != NULL) { free(sc->sc_rxdma.dd_bufptr, M_MWLDEV); sc->sc_rxdma.dd_bufptr = NULL; |