diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-05 17:25:59 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-05 17:25:59 +0000 |
commit | 85530efaf7a6a42f72dd88dd2812fc34f33a931e (patch) | |
tree | fe27ed806015eba36ede599b284de31066d02abb /sys/dev/i2o | |
parent | 6278fb02068a0fc75a8a6ecb4ed0a3292aad76ab (diff) |
Switch everything to the new bus_dmamap_sync API.
Most work by Wilbern Cobb <vedge@csoft.org> with some fixes from me, mickey@
and drahn@.
Diffstat (limited to 'sys/dev/i2o')
-rw-r--r-- | sys/dev/i2o/iop.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c index 834ecf43578..a3c20855c8f 100644 --- a/sys/dev/i2o/iop.c +++ b/sys/dev/i2o/iop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iop.c,v 1.19 2001/10/27 20:54:24 mickey Exp $ */ +/* $OpenBSD: iop.c,v 1.20 2001/11/05 17:25:58 art Exp $ */ /* $NetBSD: iop.c,v 1.12 2001/03/21 14:27:05 ad Exp $ */ /*- @@ -914,15 +914,16 @@ iop_status_get(struct iop_softc *sc, int nosleep) mf.length = sizeof(*st); bzero(st, sizeof(*st)); - bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*st), + BUS_DMASYNC_PREREAD); if ((rv = iop_post(sc, (u_int32_t *)&mf))) return (rv); /* XXX */ POLL(2500, - (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, - BUS_DMASYNC_POSTREAD), st->syncbyte == 0xff)); + (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, + sizeof(*st), BUS_DMASYNC_POSTREAD), st->syncbyte == 0xff)); if (st->syncbyte != 0xff) return (EIO); @@ -957,7 +958,8 @@ iop_ofifo_init(struct iop_softc *sc) mb[0] += 2 << 16; *sw = 0; - bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), + BUS_DMASYNC_PREREAD); /* * The I2O spec says that there are two SGLs: one for the status @@ -970,7 +972,7 @@ iop_ofifo_init(struct iop_softc *sc) /* XXX */ POLL(5000, - (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, + (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), BUS_DMASYNC_POSTREAD), *sw == htole32(I2O_EXEC_OUTBOUND_INIT_COMPLETE))); if (*sw != htole32(I2O_EXEC_OUTBOUND_INIT_COMPLETE)) { @@ -1367,14 +1369,15 @@ iop_reset(struct iop_softc *sc) mf.statushigh = sizeof pa > sizeof mf.statuslow ? pa >> 32 : 0; *sw = htole32(0); - bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), + BUS_DMASYNC_PREREAD); if ((rv = iop_post(sc, (u_int32_t *)&mf))) return (rv); /* XXX */ POLL(2500, - (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, + (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), BUS_DMASYNC_POSTREAD), *sw != htole32(0))); if (*sw != htole32(I2O_RESET_IN_PROGRESS)) { printf("%s: reset rejected, status 0x%x\n", @@ -1462,10 +1465,11 @@ iop_handle_reply(struct iop_softc *sc, u_int32_t rmfa) rb = (struct i2o_reply *)(sc->sc_rep + off); /* Perform reply queue DMA synchronisation. XXX This is rubbish. */ - bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, off, + sc->sc_rep_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD); if (--sc->sc_curib != 0) - bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, 0, + sc->sc_rep_size, BUS_DMASYNC_PREREAD); #ifdef I2ODEBUG if ((letoh32(rb->msgflags) & I2O_MSGFLAGS_64BIT) != 0) @@ -1761,7 +1765,7 @@ iop_msg_map(struct iop_softc *sc, struct iop_msg *im, u_int32_t *mb, /* Fix up the transfer record, and sync the map. */ ix->ix_flags = (out ? IX_OUT : IX_IN); ix->ix_size = xfersize; - bus_dmamap_sync(sc->sc_dmat, ix->ix_map, + bus_dmamap_sync(sc->sc_dmat, ix->ix_map, 0, xfersize, out ? BUS_DMASYNC_POSTWRITE : BUS_DMASYNC_POSTREAD); /* @@ -1866,7 +1870,8 @@ iop_msg_map_bio(struct iop_softc *sc, struct iop_msg *im, u_int32_t *mb, /* Fix up the transfer record, and sync the map. */ ix->ix_flags = (out ? IX_OUT : IX_IN); ix->ix_size = xfersize; - bus_dmamap_sync(sc->sc_dmat, ix->ix_map, + bus_dmamap_sync(sc->sc_dmat, ix->ix_map, 0, + ix->ix_map->dm_mapsize, out ? BUS_DMASYNC_POSTWRITE : BUS_DMASYNC_POSTREAD); /* @@ -1892,7 +1897,7 @@ iop_msg_unmap(struct iop_softc *sc, struct iop_msg *im) #endif for (ix = im->im_xfer, i = 0;;) { - bus_dmamap_sync(sc->sc_dmat, ix->ix_map, + bus_dmamap_sync(sc->sc_dmat, ix->ix_map, 0, ix->ix_size, ix->ix_flags & IX_OUT ? BUS_DMASYNC_POSTWRITE : BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->sc_dmat, ix->ix_map); @@ -1948,8 +1953,8 @@ iop_post(struct iop_softc *sc, u_int32_t *mb) /* Perform reply buffer DMA synchronisation. XXX This is rubbish. */ if (sc->sc_curib++ == 0) - bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, 0, + sc->sc_rep_size, BUS_DMASYNC_PREREAD); /* Copy out the message frame. */ bus_space_write_region_4(sc->sc_iot, sc->sc_ioh, mfa, mb, |