diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2008-11-22 18:16:56 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2008-11-22 18:16:56 +0000 |
commit | 718715af35f0748d71b82e2c5316f626ebe15fa3 (patch) | |
tree | 59f150afbd5e0618298d43dfe8c64a9c0563867b /sys/dev/pci/if_bge.c | |
parent | f07a23983af2457f65451652e0339f0d8d29515e (diff) |
perform bus_dmamap_syncs on the rx mbufs. this is obviously maintained by
monkeys.
found by toby's bounce buffers.
ok krw deraadt uwe fwk matthieu, drahn, mbalmer, robert, yuo, ratchov,
claudio, rainer, art.
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r-- | sys/dev/pci/if_bge.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index dd768e6507d..88a1deb0fbd 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.255 2008/11/09 15:08:26 naddy Exp $ */ +/* $OpenBSD: if_bge.c,v 1.256 2008/11/22 18:16:55 dlg Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -915,6 +915,9 @@ bge_newbuf_std(struct bge_softc *sc, int i, struct mbuf *m, r->bge_len = m_new->m_len; r->bge_idx = i; + bus_dmamap_sync(sc->bge_dmatag, dmamap, 0, dmamap->dm_mapsize, + BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_rx_std_ring) + i * sizeof (struct bge_rx_bd), @@ -2494,6 +2497,8 @@ bge_rxeof(struct bge_softc *sc) stdcnt++; dmamap = sc->bge_cdata.bge_rx_std_map[rxidx]; sc->bge_cdata.bge_rx_std_map[rxidx] = 0; + bus_dmamap_sync(sc->bge_dmatag, dmamap, 0, + dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->bge_dmatag, dmamap); if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { ifp->if_ierrors++; |