diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/mpt/mpt.c | 8 | ||||
-rw-r--r-- | sys/dev/mpt/mpt.h | 6 | ||||
-rw-r--r-- | sys/dev/mpt/mpt_cam.c | 2 | ||||
-rw-r--r-- | sys/dev/mpt/mpt_pci.c | 7 |
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 |