diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-01-25 16:51:58 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-01-25 16:51:58 +0000 |
commit | 0437fce453ea15645135176b95a1a8b7911398b3 (patch) | |
tree | 177e683d3f7aba387d23817d8a7748b569f46bbd /sys | |
parent | 345c18170d51b9a241881030f228721e80ff78cb (diff) |
In encap, sync mbuf before writing descriptors
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/gem.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 5ada09a56da..e2b03aff40b 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.13 2001/12/13 03:51:10 drahn Exp $ */ +/* $OpenBSD: gem.c,v 1.14 2002/01/25 16:51:57 jason Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -1566,6 +1566,9 @@ gem_encap(sc, mhead, bixp) return (ENOBUFS); } + bus_dmamap_sync(sc->sc_dmatag, map, 0, map->dm_mapsize, + BUS_DMASYNC_PREWRITE); + for (i = 0; i < map->dm_nsegs; i++) { sc->sc_txdescs[frag].gd_addr = GEM_DMA_WRITE(sc, map->dm_segs[i].ds_addr); @@ -1580,8 +1583,7 @@ gem_encap(sc, mhead, bixp) if (++frag == GEM_NTXDESC) frag = 0; } - bus_dmamap_sync(sc->sc_dmatag, map, 0, map->dm_mapsize, - BUS_DMASYNC_PREWRITE); + sc->sc_tx_cnt += map->dm_nsegs; sc->sc_txd[cur].sd_map = map; sc->sc_txd[cur].sd_mbuf = mhead; |