summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarco <marco@openbsd.org>2006-06-15 07:35:44 +0000
committermarco <marco@openbsd.org>2006-06-15 07:35:44 +0000
commitcb777b69c9456f78a591cd96fda35f666d2ca575 (patch)
tree6e4bc4fcafdc13d980285ba70c7a6dd40567bc66
parentAdd IOC page 3 support. Needed for RAID and bio. (diff)
downloadwireguard-openbsd-cb777b69c9456f78a591cd96fda35f666d2ca575.tar.xz
wireguard-openbsd-cb777b69c9456f78a591cd96fda35f666d2ca575.zip
Add detection of RAID volume during PPR. Doesn't fan out the ppr to individual
devices yet.
-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;