summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/mpi.c12
-rw-r--r--sys/dev/ic/mpivar.h4
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 1cede99bee0..1a587e14c93 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.23 2006/06/01 04:36:19 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.24 2006/06/01 21:32:15 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -243,9 +243,10 @@ mpi_intr(void *arg)
BUS_DMASYNC_POSTREAD);
reply_dva = (reg & MPI_REPLY_QUEUE_ADDRESS_MASK) << 1;
- reply_dva -= (u_int32_t)MPI_DMA_DVA(sc->sc_replies);
- reply_addr = MPI_DMA_KVA(sc->sc_replies) + reply_dva;
+ reply_addr = MPI_DMA_KVA(sc->sc_replies);
+ reply_addr += reply_dva -
+ (u_int32_t)MPI_DMA_DVA(sc->sc_replies);
reply = (struct mpi_msg_reply *)reply_addr;
id = letoh32(reply->msg_context);
@@ -486,9 +487,10 @@ mpi_complete(struct mpi_softc *sc, struct mpi_ccb *nccb, int timeout)
BUS_DMASYNC_POSTREAD);
reply_dva = (reg & MPI_REPLY_QUEUE_ADDRESS_MASK) << 1;
- reply_dva -= (u_int32_t)MPI_DMA_DVA(sc->sc_replies);
- reply_addr = MPI_DMA_KVA(sc->sc_replies) + reply_dva;
+ reply_addr = MPI_DMA_KVA(sc->sc_replies);
+ reply_addr += reply_dva -
+ (u_int32_t)MPI_DMA_DVA(sc->sc_replies);
reply = (struct mpi_msg_reply *)reply_addr;
id = letoh32(reply->msg_context);
diff --git a/sys/dev/ic/mpivar.h b/sys/dev/ic/mpivar.h
index 0abda114695..29eb1caff41 100644
--- a/sys/dev/ic/mpivar.h
+++ b/sys/dev/ic/mpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpivar.h,v 1.6 2006/06/01 04:36:19 dlg Exp $ */
+/* $OpenBSD: mpivar.h,v 1.7 2006/06/01 21:32:15 dlg Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -63,7 +63,7 @@ struct mpi_ccb {
} ccb_state;
void (*ccb_done)(struct mpi_ccb *);
void *ccb_reply;
- paddr_t ccb_reply_dva;
+ u_int32_t ccb_reply_dva;
TAILQ_ENTRY(mpi_ccb) ccb_link;
};