(commented out) multipath fault injection code.

Some code to make diffs with RELENG_6 easier.
This commit is contained in:
mjacob 2007-01-05 22:49:05 +00:00
parent 2381a2638d
commit 602b5d480d
4 changed files with 21 additions and 2 deletions

View File

@ -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",

View File

@ -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

View File

@ -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;

View File

@ -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