summaryrefslogtreecommitdiff
path: root/sys/dev/ic/xl.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-11-17 02:34:53 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-11-17 02:34:53 +0000
commit0f07a51c5638fea4cf154f7ea29d6ce4f0d2ba7c (patch)
treec89200a73800a41587c3b7468e65a202b8a6b37d /sys/dev/ic/xl.c
parente38b55f2e420c0676b847098577c78b47b6dde2f (diff)
Fix another case (tx this time) where buffers were not unloaded (nor sync'd). (bad bad aaron): 90xB works on sparc64, 90x is probably still broken.
Diffstat (limited to 'sys/dev/ic/xl.c')
-rw-r--r--sys/dev/ic/xl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index ccc37434947..69b32ade286 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.42 2002/11/17 02:06:28 jason Exp $ */
+/* $OpenBSD: xl.c,v 1.43 2002/11/17 02:34:52 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1453,6 +1453,12 @@ xl_txeof_90xB(sc)
cur_tx->xl_mbuf = NULL;
}
+ if (cur_tx->map->dm_nsegs != 0) {
+ bus_dmamap_sync(sc->sc_dmat, cur_tx->map,
+ 0, cur_tx->map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(sc->sc_dmat, cur_tx->map);
+ }
+
ifp->if_opackets++;
sc->xl_cdata.xl_tx_cnt--;
@@ -1899,6 +1905,13 @@ int xl_encap_90xB(sc, c, m_head)
bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize,
BUS_DMASYNC_PREWRITE);
+ /* sync the old map, and unload it (if necessary) */
+ if (c->map->dm_nsegs != 0) {
+ bus_dmamap_sync(sc->sc_dmat, c->map, 0, c->map->dm_mapsize,
+ BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(sc->sc_dmat, c->map);
+ }
+
c->xl_mbuf = m_head;
sc->sc_tx_sparemap = c->map;
c->map = map;