diff options
author | bschmidt <bschmidt@FreeBSD.org> | 2011-04-16 09:34:40 +0000 |
---|---|---|
committer | bschmidt <bschmidt@FreeBSD.org> | 2011-04-16 09:34:40 +0000 |
commit | aa270ec74701a3ba01ba11ce9a7c1b0b1d34d0aa (patch) | |
tree | 1de6d78a5dc3d1b2ef2208f0acb8b11950ccc7de | |
parent | a6840d80df559b575f6befe8b3657462be8899c7 (diff) | |
download | FreeBSD-src-aa270ec74701a3ba01ba11ce9a7c1b0b1d34d0aa.zip FreeBSD-src-aa270ec74701a3ba01ba11ce9a7c1b0b1d34d0aa.tar.gz |
In case a new mbuf can't be loaded, reuse the old one.
-rw-r--r-- | sys/dev/iwn/if_iwn.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 0d4f75b..384d1ca 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -2108,6 +2108,18 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, device_printf(sc->sc_dev, "%s: bus_dmamap_load failed, error %d\n", __func__, error); m_freem(m1); + + /* Try to reload the old mbuf. */ + error = bus_dmamap_load(ring->data_dmat, data->map, + mtod(data->m, void *), IWN_RBUF_SIZE, iwn_dma_map_addr, + &paddr, BUS_DMA_NOWAIT); + if (error != 0 && error != EFBIG) { + panic("%s: could not load old RX mbuf", __func__); + } + /* Physical address may have changed. */ + ring->desc[ring->cur] = htole32(paddr >> 8); + bus_dmamap_sync(ring->data_dmat, ring->desc_dma.map, + BUS_DMASYNC_PREWRITE); ifp->if_ierrors++; return; } |