summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-04-22 13:17:56 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-04-22 13:17:56 +0000
commit5987ee480a561293112502206b291786d96f2cbe (patch)
tree7e461318ff38a521af3493ceab8884484f60b091 /sys
parente07af4355466e6310ade30c208bebebcb6c5ee0b (diff)
this is my previous commit again, but this time it was tested.
dma sync the rx mbuf before we push it to the hardware. technically this isnt necessary cos bus_dmamap_sync is a nop on i386 and amd64. but i like to be correct, and someone might read this as an example of how to write a driver.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_vic.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c
index 164162456d2..80ae8f05634 100644
--- a/sys/dev/pci/if_vic.c
+++ b/sys/dev/pci/if_vic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vic.c,v 1.44 2007/04/21 19:24:59 deraadt Exp $ */
+/* $OpenBSD: if_vic.c,v 1.45 2007/04/22 13:17:55 dlg Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -771,9 +771,13 @@ vic_rx_proc(struct vic_softc *sc)
printf("%s: mbuf alloc failed\n", DEVNAME(sc));
break;
}
+ bus_dmamap_sync(sc->sc_dmat, rxb->rxb_dmamap, 0,
+ rxb->rxb_m->m_pkthdr.len, BUS_DMASYNC_PREREAD);
+
rxd->rx_physaddr = rxb->rxb_dmamap->dm_segs[0].ds_addr;
rxd->rx_buflength = rxb->rxb_m->m_pkthdr.len;
rxd->rx_length = 0;
+ rxd->rx_owner = VIC_OWNER_DRIVER;
ifp->if_ipackets++;