summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mpt_openbsd.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2004-07-12 23:57:15 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2004-07-12 23:57:15 +0000
commit9a56b40b40039237da13b7998437e9c242a9598a (patch)
tree42a75fa44fe5a93859ff57d4fe1333fc1b6fd773 /sys/dev/ic/mpt_openbsd.c
parent30abce2d0234849c283e4f765a944dbc39079e5a (diff)
Add detection of IM/IS/IME support in mpt_attach(). This is in preparation to add RAID support.
Diffstat (limited to 'sys/dev/ic/mpt_openbsd.c')
-rw-r--r--sys/dev/ic/mpt_openbsd.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/dev/ic/mpt_openbsd.c b/sys/dev/ic/mpt_openbsd.c
index 1aa1d006084..35937147e8a 100644
--- a/sys/dev/ic/mpt_openbsd.c
+++ b/sys/dev/ic/mpt_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpt_openbsd.c,v 1.13 2004/06/30 00:45:04 krw Exp $ */
+/* $OpenBSD: mpt_openbsd.c,v 1.14 2004/07/12 23:57:14 marco Exp $ */
/* $NetBSD: mpt_netbsd.c,v 1.7 2003/07/14 15:47:11 lukem Exp $ */
/*
@@ -398,6 +398,8 @@ void
mpt_attach(mpt_softc_t *mpt)
{
struct scsi_link *lptr = &mpt->sc_link;
+ struct _CONFIG_PAGE_IOC_2 iocp2;
+ int rv;
mpt->bus = 0; /* XXX ?? */
@@ -424,6 +426,31 @@ mpt_attach(mpt_softc_t *mpt)
#ifdef MPT_DEBUG
mpt->verbose = 2;
#endif
+
+ /* Read IOC page 2 to figure out if we have IM */
+ rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_IOC, 2,
+ 0, &iocp2.Header);
+ if (rv) {
+ mpt_prt(mpt, "Could not retrieve IOC PAGE 2 to determine"
+ "RAID capabilities.");
+ }
+ else {
+ mpt->im_support = iocp2.CapabilitiesFlags &
+ (MPI_IOCPAGE2_CAP_FLAGS_IS_SUPPORT |
+ MPI_IOCPAGE2_CAP_FLAGS_IME_SUPPORT |
+ MPI_IOCPAGE2_CAP_FLAGS_IM_SUPPORT);
+
+ if (mpt->verbose > 1) {
+ mpt_prt(mpt, "IOC Page 2: %x %x %x %x %x",
+ iocp2.CapabilitiesFlags,
+ iocp2.NumActiveVolumes,
+ iocp2.MaxVolumes,
+ iocp2.NumActivePhysDisks,
+ iocp2.MaxPhysDisks);
+ mpt_prt(mpt, "IM support: %x", mpt->im_support);
+ }
+ }
+
(void) config_found(&mpt->mpt_dev, lptr, scsiprint);
/* done attaching now walk targets and PPR them */