summaryrefslogtreecommitdiff
path: root/sys/dev/ic/gem.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-03-14 11:04:25 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-03-14 11:04:25 +0000
commit8b088944de0049abe3ba91c3d5ec88c88c72e033 (patch)
tree08ee05c47e50f09943ecfc91e4d6f9eb75e2cb45 /sys/dev/ic/gem.c
parent2d885fe86ccebb33f3d9e3c029ca1b6cade18f6b (diff)
use lemtoh64 and htolem64 for reading and writing entries in the rings.
tested on sparc64 and powerpc with and without the MI backends for the lem ops enabled.
Diffstat (limited to 'sys/dev/ic/gem.c')
-rw-r--r--sys/dev/ic/gem.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index 514c6fb2476..eefb6410649 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gem.c,v 1.101 2013/08/08 16:01:34 kettenis Exp $ */
+/* $OpenBSD: gem.c,v 1.102 2014/03/14 11:04:24 dlg Exp $ */
/* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
@@ -1056,7 +1056,7 @@ gem_rint(struct gem_softc *sc)
GEM_CDRXSYNC(sc, i,
BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
- rxstat = GEM_DMA_READ(sc, sc->sc_rxdescs[i].gd_flags);
+ rxstat = GEM_DMA_READ(sc, &sc->sc_rxdescs[i].gd_flags);
if (rxstat & GEM_RD_OWN) {
/* We have processed all of the receive buffers. */
@@ -1086,9 +1086,9 @@ gem_rint(struct gem_softc *sc)
if (ifp->if_flags & IFF_DEBUG) {
printf(" rxsoft %p descriptor %d: ", rxs, i);
printf("gd_flags: 0x%016llx\t", (long long)
- GEM_DMA_READ(sc, sc->sc_rxdescs[i].gd_flags));
+ GEM_DMA_READ(sc, &sc->sc_rxdescs[i].gd_flags));
printf("gd_addr: 0x%016llx\n", (long long)
- GEM_DMA_READ(sc, sc->sc_rxdescs[i].gd_addr));
+ GEM_DMA_READ(sc, &sc->sc_rxdescs[i].gd_addr));
}
#endif
@@ -1811,15 +1811,15 @@ gem_start(struct ifnet *ifp)
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);
+ GEM_DMA_WRITE(sc, &sc->sc_txdescs[frag].gd_addr,
+ map->dm_segs[i].ds_addr);
flags = map->dm_segs[i].ds_len & GEM_TD_BUFSIZE;
if (i == 0)
flags |= GEM_TD_START_OF_PACKET;
if (i == (map->dm_nsegs - 1))
flags |= GEM_TD_END_OF_PACKET;
- sc->sc_txdescs[frag].gd_flags =
- GEM_DMA_WRITE(sc, flags);
+ GEM_DMA_WRITE(sc, &sc->sc_txdescs[frag].gd_flags,
+ flags);
bus_dmamap_sync(sc->sc_dmatag, sc->sc_cddmamap,
GEM_CDTXOFF(frag), sizeof(struct gem_desc),
BUS_DMASYNC_PREWRITE);