svn commit: r220693 - head/sys/dev/iwn

Bernhard Schmidt bschmidt at FreeBSD.org
Sat Apr 16 09:34:41 UTC 2011


Author: bschmidt
Date: Sat Apr 16 09:34:40 2011
New Revision: 220693
URL: http://svn.freebsd.org/changeset/base/220693

Log:
  In case a new mbuf can't be loaded, reuse the old one.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Sat Apr 16 08:59:21 2011	(r220692)
+++ head/sys/dev/iwn/if_iwn.c	Sat Apr 16 09:34:40 2011	(r220693)
@@ -2108,6 +2108,18 @@ iwn_rx_done(struct iwn_softc *sc, struct
 		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;
 	}


More information about the svn-src-all mailing list