-/* $OpenBSD: bwi.c,v 1.110 2014/09/14 14:17:24 jsg Exp $ */
+/* $OpenBSD: bwi.c,v 1.111 2014/12/16 18:03:17 miod Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
{
struct bwi_softc *sc = arg;
struct ifnet *ifp = &sc->sc_ic.ic_if;
- int i;
+ int s, i;
bwi_stop(sc, 1);
ieee80211_ifdetach(ifp);
for (i = 0; i < sc->sc_nmac; ++i)
bwi_mac_detach(&sc->sc_mac[i]);
+ s = splvm();
bwi_dma_free(sc);
+ splx(s);
bwi_dma_mbuf_destroy(sc, BWI_TX_NRING, 1);
return (0);
int error, i, has_txstats;
bus_size_t tx_ring_sz, rx_ring_sz, desc_sz = 0;
uint32_t txrx_ctrl_step = 0;
+ int s;
has_txstats = 0;
for (i = 0; i < sc->sc_nmac; ++i) {
tx_ring_sz = roundup(desc_sz * BWI_TX_NDESC, BWI_RING_ALIGN);
rx_ring_sz = roundup(desc_sz * BWI_RX_NDESC, BWI_RING_ALIGN);
+ s = splvm();
+
#define TXRX_CTRL(idx) (BWI_TXRX_CTRL_BASE + (idx) * txrx_ctrl_step)
/*
* Create TX ring DMA stuffs
printf("%s: %dth TX ring DMA alloc failed\n",
sc->sc_dev.dv_xname, i);
bwi_dma_free(sc);
+ splx(s);
return (error);
}
}
if (error) {
printf("%s: RX ring DMA alloc failed\n", sc->sc_dev.dv_xname);
bwi_dma_free(sc);
+ splx(s);
return (error);
}
printf("%s: TX stats DMA alloc failed\n",
sc->sc_dev.dv_xname);
bwi_dma_free(sc);
+ splx(s);
return (error);
}
}
if (error)
bwi_dma_free(sc);
+ splx(s);
+
return (error);
}