diff options
author | mjacob <mjacob@FreeBSD.org> | 2010-06-08 16:17:25 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2010-06-08 16:17:25 +0000 |
commit | dcb98911e2e5ea29226094837697a14d867cecf8 (patch) | |
tree | 5d896e3380a4808ce8a95c2d9f0c057108a3c048 /sys/cam/cam_xpt.c | |
parent | e4e19d26b06529000e3d84472de4c46e4d09e37f (diff) | |
download | FreeBSD-src-dcb98911e2e5ea29226094837697a14d867cecf8.zip FreeBSD-src-dcb98911e2e5ea29226094837697a14d867cecf8.tar.gz |
Implement the usage of Report Luns as part of SCSI probing for SCP3 or
better devices. This can be disabled on a per-device basis using quirks as
well.
This also handles the case where there is actually no connected LUN 0
(which can definitely be the case for storage arrays).
Reviewed by: scsi@
MFC after: 1 month
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r-- | sys/cam/cam_xpt.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 80dee2a..3d33a0f 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -196,8 +196,18 @@ static struct cdevsw xpt_cdevsw = { /* Storage for debugging datastructures */ #ifdef CAMDEBUG struct cam_path *cam_dpath; -u_int32_t cam_dflags; +#ifdef CAM_DEBUG_FLAGS +u_int32_t cam_dflags = CAM_DEBUG_FLAGS; +#else +u_int32_t cam_dflags = CAM_DEBUG_NONE; +#endif +TUNABLE_INT("kern.cam.dflags", &cam_dflags); +SYSCTL_INT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, + &cam_dflags, 0, "Cam Debug Flags"); u_int32_t cam_debug_delay; +TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); +SYSCTL_INT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, + &cam_debug_delay, 0, "Cam Debug Flags"); #endif /* Our boot-time initialization hook */ @@ -4212,6 +4222,7 @@ xpt_alloc_target(struct cam_eb *bus, target_id_t target_id) target->target_id = target_id; target->refcount = 1; target->generation = 0; + target->luns = NULL; timevalclear(&target->last_reset); /* * Hold a reference to our parent bus so it @@ -4243,6 +4254,8 @@ xpt_release_target(struct cam_et *target) TAILQ_REMOVE(&target->bus->et_entries, target, links); target->bus->generation++; xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); free(target, M_CAMXPT); } } @@ -4505,11 +4518,6 @@ xpt_config(void *arg) #ifdef CAMDEBUG /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_FLAGS - cam_dflags = CAM_DEBUG_FLAGS; -#else /* !CAM_DEBUG_FLAGS */ - cam_dflags = CAM_DEBUG_NONE; -#endif /* CAM_DEBUG_FLAGS */ #ifdef CAM_DEBUG_BUS if (cam_dflags != CAM_DEBUG_NONE) { /* |