summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-08-26 07:21:19 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-08-26 07:21:19 +0000
commit01dec682de0d0eb91db9e358055837917d9f874c (patch)
tree59cd3897d4e364dce3c183087bc625f5a356f001 /sys/scsi
parentb477328ca09c223be9affa07da55bfb75e35a1d2 (diff)
rdac_groupid queries which controller the path is attached to, which we'll
use as the group id later on.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/mpath_rdac.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/scsi/mpath_rdac.c b/sys/scsi/mpath_rdac.c
index 21c7d0692d2..52904778d0e 100644
--- a/sys/scsi/mpath_rdac.c
+++ b/sys/scsi/mpath_rdac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_rdac.c,v 1.7 2011/07/11 01:02:48 dlg Exp $ */
+/* $OpenBSD: mpath_rdac.c,v 1.8 2013/08/26 07:21:18 dlg Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
@@ -154,6 +154,7 @@ const struct mpath_ops rdac_mpath_ops = {
MPATH_ROUNDROBIN
};
+int rdac_groupid(struct rdac_softc *);
int rdac_c8(struct rdac_softc *);
int rdac_c9(struct rdac_softc *);
@@ -271,6 +272,32 @@ rdac_mpath_offline(struct scsi_link *link)
}
int
+rdac_groupid(struct rdac_softc *sc)
+{
+ struct rdac_vpd_subsys *pg;
+ int rv = -1;
+
+ pg = dma_alloc(sizeof(*pg), PR_WAITOK | PR_ZERO);
+
+ if (scsi_inquire_vpd(sc->sc_path.p_link, pg, sizeof(*pg),
+ RDAC_VPD_SUBSYS, scsi_autoconf) != 0) {
+ printf("%s: unable to fetch subsys vpd page\n", DEVNAME(sc));
+ goto done;
+ }
+
+ if (_4btol(pg->pg_id) != RDAC_VPD_ID_SUBSYS) {
+ printf("%s: subsys page is invalid\n", DEVNAME(sc));
+ goto done;
+ }
+
+ rv = _2btol(pg->controller_slot_id);
+
+done:
+ dma_free(pg, sizeof(*pg));
+ return (rv);
+}
+
+int
rdac_c8(struct rdac_softc *sc)
{
struct rdac_vpd_extdevid *pg;