diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-11-02 02:15:13 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-11-02 02:15:13 +0000 |
commit | 638d9e85ae9458647ad0e76f8d0e2051a2fbea14 (patch) | |
tree | 8a7ce7154a7055a70c407510ee85dd8e6a54aa75 | |
parent | a6cb8d10f8e3e20ecf47abaf875fd5eb90329056 (diff) |
sync mbuf before unloading in gem_rxdrain().
From NetBSD
-rw-r--r-- | sys/dev/ic/gem.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index ac6e3db5475..fbd38bac50d 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.49 2005/11/02 00:45:15 brad Exp $ */ +/* $OpenBSD: gem.c,v 1.50 2005/11/02 02:15:12 brad Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -450,6 +450,8 @@ gem_rxdrain(struct gem_softc *sc) for (i = 0; i < GEM_NRXDESC; i++) { rxs = &sc->sc_rxsoft[i]; if (rxs->rxs_mbuf != NULL) { + bus_dmamap_sync(sc->sc_dmatag, rxs->rxs_dmamap, 0, + rxs->rxs_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->sc_dmatag, rxs->rxs_dmamap); m_freem(rxs->rxs_mbuf); rxs->rxs_mbuf = NULL; @@ -497,9 +499,8 @@ gem_stop(struct ifnet *ifp, int disable) } sc->sc_tx_cnt = sc->sc_tx_prod = sc->sc_tx_cons = 0; - if (disable) { + if (disable) gem_rxdrain(sc); - } } |