summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2006-06-15 07:35:45 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2006-06-15 07:35:45 +0000
commite83b30f1b44ee9d686f2ebc165a3464ccde9ca6c (patch)
treec3accda6bcfce3308be8849944aed205c4a4a61d /sys
parent63b77d9e1ff3ab5407e3183d82fcdeb3a5aa22c7 (diff)
Add detection of RAID volume during PPR. Doesn't fan out the ppr to individual
devices yet.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/mpi.c15
-rw-r--r--sys/dev/ic/mpivar.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 9748a59a948..a9a8982a97c 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.42 2006/06/15 06:45:53 marco Exp $ */
+/* $OpenBSD: mpi.c,v 1.43 2006/06/15 07:35:44 marco Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -243,7 +243,7 @@ mpi_run_ppr(struct mpi_softc *sc)
struct device *dev;
struct scsibus_softc *ssc;
struct scsi_link *link;
- int i, tries;
+ int i, r, tries;
if (mpi_cfg_header(sc, MPI_CONFIG_REQ_PAGE_TYPE_SCSI_SPI_PORT, 0, 0x0,
&hdr) != 0) {
@@ -280,6 +280,16 @@ mpi_run_ppr(struct mpi_softc *sc)
if (link == NULL)
continue;
+
+ /* is this a RAID device? */
+ for (r = 0; r < sc->sc_ioc_pg2->max_vols; r++)
+ if (i == sc->sc_ioc_pg2->raid_vol[r].vol_id) {
+ DNPRINTF(MPI_D_PPR, "%s: mpi_run_ppr scsibus "
+ "%d ioc %d target %d RAID\n", DEVNAME(sc),
+ sc->sc_link.scsibus, sc->sc_ioc_number, i);
+ /* XXX fan out ppr */
+ }
+
while (mpi_ppr(sc, link, period, offset, tries) == EAGAIN)
tries++;
}
@@ -1575,6 +1585,7 @@ mpi_iocfacts(struct mpi_softc *sc)
sc->sc_maxcmds = letoh16(ifp.global_credits);
sc->sc_buswidth = (ifp.max_devices == 0) ? 256 : ifp.max_devices;
sc->sc_maxchdepth = ifp.max_chain_depth;
+ sc->sc_ioc_number = ifp.ioc_number;
/*
* you can fit sg elements on the end of the io cmd if they fit in the
diff --git a/sys/dev/ic/mpivar.h b/sys/dev/ic/mpivar.h
index d188ed676d1..ce797a9ecb3 100644
--- a/sys/dev/ic/mpivar.h
+++ b/sys/dev/ic/mpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpivar.h,v 1.13 2006/06/15 06:45:53 marco Exp $ */
+/* $OpenBSD: mpivar.h,v 1.14 2006/06/15 07:35:44 marco Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -108,6 +108,7 @@ struct mpi_softc {
int sc_buswidth;
int sc_target;
+ int sc_ioc_number;
struct mpi_dmamem *sc_requests;
struct mpi_ccb *sc_ccbs;