Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/marvell Add missing bus_dmamap_sync() for the RX buf...
details: https://anonhg.NetBSD.org/src/rev/178aa0dedc45
branches: trunk
changeset: 781437:178aa0dedc45
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Sep 06 03:45:02 2012 +0000
description:
Add missing bus_dmamap_sync() for the RX buffer.
diffstat:
sys/dev/marvell/if_mvgbe.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diffs (44 lines):
diff -r 74535aca6bfe -r 178aa0dedc45 sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c Thu Sep 06 03:05:41 2012 +0000
+++ b/sys/dev/marvell/if_mvgbe.c Thu Sep 06 03:45:02 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mvgbe.c,v 1.18 2012/07/22 14:32:59 matt Exp $ */
+/* $NetBSD: if_mvgbe.c,v 1.19 2012/09/06 03:45:02 msaitoh Exp $ */
/*
* Copyright (c) 2007, 2008 KIYOHARA Takashi
* All rights reserved.
@@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.18 2012/07/22 14:32:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.19 2012/09/06 03:45:02 msaitoh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -1293,6 +1293,7 @@
struct mvgbe_chain *c;
struct mvgbe_rx_desc *r;
int align;
+ vaddr_t offset;
if (m == NULL) {
void *buf = NULL;
@@ -1335,11 +1336,15 @@
c = &sc->sc_cdata.mvgbe_rx_chain[i];
r = c->mvgbe_desc;
c->mvgbe_mbuf = m_new;
- r->bufptr = dmamap->dm_segs[0].ds_addr +
- (((vaddr_t)m_new->m_data - (vaddr_t)sc->sc_cdata.mvgbe_jumbo_buf));
+ offset = (vaddr_t)m_new->m_data - (vaddr_t)sc->sc_cdata.mvgbe_jumbo_buf;
+ r->bufptr = dmamap->dm_segs[0].ds_addr + offset;
r->bufsize = MVGBE_JLEN & ~MVGBE_RXBUF_MASK;
r->cmdsts = MVGBE_BUFFER_OWNED_BY_DMA | MVGBE_RX_ENABLE_INTERRUPT;
+ /* Invalidate RX buffer */
+ bus_dmamap_sync(sc->sc_dmat, dmamap, offset, r->bufsize,
+ BUS_DMASYNC_PREREAD);
+
MVGBE_CDRXSYNC(sc, i, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
return 0;
Home |
Main Index |
Thread Index |
Old Index