summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mpi.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2006-05-29 19:55:38 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2006-05-29 19:55:38 +0000
commit70ee2587ea883149c5cf47942d94d01de080547f (patch)
tree256f7983bc077d52ccc6f0e44c577907b755fd62 /sys/dev/ic/mpi.c
parent93e44f78a8f963aeafd993ebfb79db6fec617a4f (diff)
limit the number of scatter gather entries sent with the scsi_io commands
so it fits in the maximum request frame size. this will do until i can write sgl chaining in a nice way.
Diffstat (limited to 'sys/dev/ic/mpi.c')
-rw-r--r--sys/dev/ic/mpi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 0171c6af9d0..71b6fa3f8fc 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.10 2006/05/29 08:33:36 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.11 2006/05/29 19:55:37 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -374,8 +374,9 @@ mpi_alloc_ccbs(struct mpi_softc *sc)
for (i = 0; i < sc->sc_maxcmds; i++) {
ccb = &sc->sc_ccbs[i];
- if (bus_dmamap_create(sc->sc_dmat, MAXPHYS, MPI_MAX_SGL,
- MAXPHYS, 0, 0, &ccb->ccb_dmamap) != 0) {
+ if (bus_dmamap_create(sc->sc_dmat, MAXPHYS,
+ sc->sc_first_sgl_len, MAXPHYS, 0, 0,
+ &ccb->ccb_dmamap) != 0) {
printf("%s: unable to create dma map\n", DEVNAME(sc));
goto free_maps;
}
@@ -1237,6 +1238,10 @@ mpi_iocfacts(struct mpi_softc *sc)
#endif /* MPI_DEBUG */
sc->sc_maxcmds = letoh16(ifp.global_credits);
+ sc->sc_first_sgl_len = ((letoh16(ifp.request_frame_size) * 4) -
+ sizeof(struct mpi_msg_scsi_io)) / sizeof(struct mpi_sge);
+ DPRINTF("%s: first sgl len: %d\n", DEVNAME(sc),
+ sc->sc_first_sgl_len);
sc->sc_maxchdepth = ifp.max_chain_depth;
sc->sc_buswidth = ifp.max_devices;