summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2006-06-12 23:25:58 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2006-06-12 23:25:58 +0000
commit61417353838d49fe5ad668231cf368d2dfdc57bd (patch)
tree2a27b2f0512c2f64f2bb8d0ba6e6ddef1b32b55f /sys/dev/ic
parent7a107b9766d6cb62c5028b493be98200024f3d14 (diff)
i stashed the dva and kva of each request space in its ccb, so why am i
recalculating them whenever i want to use them? shorten code a bit by using the stored values.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/mpi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 81f57a725c8..24f2dcf8b8b 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.35 2006/06/12 14:06:05 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.36 2006/06/12 23:25:57 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -1154,8 +1154,8 @@ mpi_load_xs(struct mpi_ccb *ccb)
ce->sg_hdr = htole32(MPI_SGE_FL_TYPE_CHAIN |
MPI_SGE_FL_SIZE_64 | addr);
- ce_dva = MPI_DMA_DVA(sc->sc_requests) + ccb->ccb_offset;
- ce_dva += (u_int8_t *)nsge - (u_int8_t *)mcb;
+ ce_dva = ccb->ccb_cmd_dva +
+ ((u_int8_t *)nsge - (u_int8_t *)mcb);
addr = (u_int32_t)(ce_dva >> 32);
ce->sg_hi_addr = htole32(addr);
@@ -1975,13 +1975,13 @@ mpi_cfg_page(struct mpi_softc *sc, u_int32_t address, struct mpi_cfg_hdr *hdr,
(read ? MPI_SGE_FL_DIR_IN : MPI_SGE_FL_DIR_OUT));
/* bounce the page via the request space to avoid more bus_dma games */
- dva = MPI_DMA_DVA(sc->sc_requests) + ccb->ccb_offset +
- sizeof(struct mpi_msg_config_request);
+ dva = ccb->ccb_cmd_dva + sizeof(struct mpi_msg_config_request);
+
cq->page_buffer.sg_hi_addr = htole32((u_int32_t)(dva >> 32));
cq->page_buffer.sg_lo_addr = htole32((u_int32_t)dva);
- kva = MPI_DMA_KVA(sc->sc_requests);
- kva += ccb->ccb_offset + sizeof(struct mpi_msg_config_request);
+ kva = ccb->ccb_cmd;
+ kva += sizeof(struct mpi_msg_config_request);
if (!read)
bcopy(page, kva, len);