summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2007-01-05 22:49:05 +0000
committermjacob <mjacob@FreeBSD.org>2007-01-05 22:49:05 +0000
commit602b5d480d0f6eba8d1d90674be9001c8e504212 (patch)
treecf77b25155343946545f43ee85c042b186afbfc6
parent2381a2638d59d94f6a92b35901910f95dd1ee8df (diff)
downloadFreeBSD-src-602b5d480d0f6eba8d1d90674be9001c8e504212.zip
FreeBSD-src-602b5d480d0f6eba8d1d90674be9001c8e504212.tar.gz
(commented out) multipath fault injection code.
Some code to make diffs with RELENG_6 easier.
-rw-r--r--sys/dev/mpt/mpt.c8
-rw-r--r--sys/dev/mpt/mpt.h6
-rw-r--r--sys/dev/mpt/mpt_cam.c2
-rw-r--r--sys/dev/mpt/mpt_pci.c7
4 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/mpt/mpt.c b/sys/dev/mpt/mpt.c
index d246549..0f9b502 100644
--- a/sys/dev/mpt/mpt.c
+++ b/sys/dev/mpt/mpt.c
@@ -2000,6 +2000,11 @@ mpt_sysctl_attach(struct mpt_softc *mpt)
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
"role", CTLFLAG_RD, &mpt->role, 0,
"HBA role");
+#ifdef MPT_TEST_MULTIPATH
+ SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+ "failure_id", CTLFLAG_RW, &mpt->failure_id, -1,
+ "Next Target to Fail");
+#endif
#endif
}
@@ -2120,6 +2125,9 @@ mpt_core_attach(struct mpt_softc *mpt)
}
STAILQ_INIT(&mpt->trt_wildcard.atios);
STAILQ_INIT(&mpt->trt_wildcard.inots);
+#ifdef MPT_TEST_MULTIPATH
+ mpt->failure_id = -1;
+#endif
mpt->scsi_tgt_handler_id = MPT_HANDLER_ID_NONE;
mpt_sysctl_attach(mpt);
mpt_lprt(mpt, MPT_PRT_DEBUG, "doorbell req = %s\n",
diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h
index 725572d..d33d374 100644
--- a/sys/dev/mpt/mpt.h
+++ b/sys/dev/mpt/mpt.h
@@ -159,6 +159,7 @@
#define MPT_U64_2_SCALAR(y) ((((uint64_t)y.High) << 32) | (y.Low))
/****************************** Misc Definitions ******************************/
+/* #define MPT_TEST_MULTIPATH 1 */
#define MPT_OK (0)
#define MPT_FAIL (0x10000)
@@ -514,7 +515,7 @@ struct mpt_softc {
uint32_t
: 8,
unit : 8,
- : 1,
+ ready : 1,
fw_uploaded : 1,
msi_enable : 1,
twildcard : 1,
@@ -535,6 +536,9 @@ struct mpt_softc {
u_int role; /* role: none, ini, target, both */
u_int verbose;
+#ifdef MPT_TEST_MULTIPATH
+ int failure_id;
+#endif
/*
* IOC Facts
diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c
index 36ae9c2..320941f 100644
--- a/sys/dev/mpt/mpt_cam.c
+++ b/sys/dev/mpt/mpt_cam.c
@@ -842,6 +842,7 @@ mpt_cam_ready(struct mpt_softc *mpt)
}
MPT_UNLOCK(mpt);
}
+ mpt->ready = 1;
}
void
@@ -849,6 +850,7 @@ mpt_cam_detach(struct mpt_softc *mpt)
{
mpt_handler_t handler;
+ mpt->ready = 0;
mpt_terminate_recovery_thread(mpt);
handler.reply_handler = mpt_scsi_reply_handler;
diff --git a/sys/dev/mpt/mpt_pci.c b/sys/dev/mpt/mpt_pci.c
index d4df57a..78e3c9b 100644
--- a/sys/dev/mpt/mpt_pci.c
+++ b/sys/dev/mpt/mpt_pci.c
@@ -105,6 +105,12 @@ __FBSDID("$FreeBSD$");
#include <dev/mpt/mpt_cam.h>
#include <dev/mpt/mpt_raid.h>
+#if __FreeBSD_version < 700000
+#define pci_msi_count(x) 0
+#define pci_msi_enable(x) 0
+#define pci_alloc_msi(x, y) 1
+#define pci_release_msi(x) do { ; } while (0)
+#endif
#ifndef PCI_VENDOR_LSI
#define PCI_VENDOR_LSI 0x1000
@@ -327,7 +333,6 @@ mpt_set_options(struct mpt_softc *mpt)
}
mpt->do_cfg_role = 1;
}
-
mpt->msi_enable = 0;
}
#else
OpenPOWER on IntegriCloud