summaryrefslogtreecommitdiffstats
path: root/sys/dev/mwl
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mwl')
-rw-r--r--sys/dev/mwl/if_mwl.c21
-rw-r--r--sys/dev/mwl/mwlhal.c13
2 files changed, 6 insertions, 28 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;
diff --git a/sys/dev/mwl/mwlhal.c b/sys/dev/mwl/mwlhal.c
index 4547fe5..092f5f8 100644
--- a/sys/dev/mwl/mwlhal.c
+++ b/sys/dev/mwl/mwlhal.c
@@ -309,19 +309,12 @@ mwl_hal_attach(device_t dev, uint16_t devid,
NULL, /* lockarg */
&mh->mh_dmat);
if (error != 0) {
- device_printf(dev, "unable to allocate memory for cmd buffer, "
+ device_printf(dev, "unable to allocate memory for cmd tag, "
"error %u\n", error);
goto fail0;
}
/* allocate descriptors */
- error = bus_dmamap_create(mh->mh_dmat, BUS_DMA_NOWAIT, &mh->mh_dmamap);
- if (error != 0) {
- device_printf(dev, "unable to create dmamap for cmd buffers, "
- "error %u\n", error);
- goto fail0;
- }
-
error = bus_dmamem_alloc(mh->mh_dmat, (void**) &mh->mh_cmdbuf,
BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
&mh->mh_dmamap);
@@ -365,9 +358,8 @@ mwl_hal_attach(device_t dev, uint16_t devid,
fail2:
bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap);
fail1:
- bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap);
-fail0:
bus_dma_tag_destroy(mh->mh_dmat);
+fail0:
mtx_destroy(&mh->mh_mtx);
free(mh, M_DEVBUF);
return NULL;
@@ -379,7 +371,6 @@ mwl_hal_detach(struct mwl_hal *mh0)
struct mwl_hal_priv *mh = MWLPRIV(mh0);
bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap);
- bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap);
bus_dma_tag_destroy(mh->mh_dmat);
mtx_destroy(&mh->mh_mtx);
free(mh, M_DEVBUF);
OpenPOWER on IntegriCloud