summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2001-11-27 03:34:22 +0000
committerken <ken@FreeBSD.org>2001-11-27 03:34:22 +0000
commit33d2e7c7bc018ba78912bcfcc4b4b74f24a1a518 (patch)
tree07116343b9306a20659c1f4126bd71515227e674 /sys/cam
parent158a111b03114700fdc210ce50cd62123f65e670 (diff)
downloadFreeBSD-src-33d2e7c7bc018ba78912bcfcc4b4b74f24a1a518.zip
FreeBSD-src-33d2e7c7bc018ba78912bcfcc4b4b74f24a1a518.tar.gz
Bring the probe inquiry code in line with the SCSI spec.
It is legal to have a device with device type 0x1f, that just means that the device is of unknown type. Instead, only check the peripheral qualifier when deciding whether or not to reject a device based on its inquiry information. Tested by: julian MFC after: 3 weeks
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c78
1 files changed, 35 insertions, 43 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 6efaba7..06d7b02 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -5727,62 +5727,54 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
struct scsi_inquiry_data *inq_buf;
u_int8_t periph_qual;
- u_int8_t periph_dtype;
path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID;
inq_buf = &path->device->inq_data;
periph_qual = SID_QUAL(inq_buf);
- periph_dtype = SID_TYPE(inq_buf);
- if (periph_dtype != T_NODEVICE) {
- switch(periph_qual) {
- case SID_QUAL_LU_CONNECTED:
- {
- u_int8_t alen;
+ switch(periph_qual) {
+ case SID_QUAL_LU_CONNECTED:
+ {
+ u_int8_t alen;
- /*
- * We conservatively request only
- * SHORT_INQUIRY_LEN bytes of inquiry
- * information during our first try
- * at sending an INQUIRY. If the device
- * has more information to give,
- * perform a second request specifying
- * the amount of information the device
- * is willing to give.
- */
- alen = inq_buf->additional_length;
- if (softc->action == PROBE_INQUIRY
- && alen > (SHORT_INQUIRY_LENGTH - 4)) {
- softc->action =
- PROBE_FULL_INQUIRY;
- xpt_release_ccb(done_ccb);
- xpt_schedule(periph, priority);
- return;
- }
+ /*
+ * We conservatively request only
+ * SHORT_INQUIRY_LEN bytes of inquiry
+ * information during our first try
+ * at sending an INQUIRY. If the device
+ * has more information to give,
+ * perform a second request specifying
+ * the amount of information the device
+ * is willing to give.
+ */
+ alen = inq_buf->additional_length;
+ if (softc->action == PROBE_INQUIRY
+ && alen > (SHORT_INQUIRY_LENGTH - 4)) {
+ softc->action = PROBE_FULL_INQUIRY;
+ xpt_release_ccb(done_ccb);
+ xpt_schedule(periph, priority);
+ return;
+ }
- xpt_find_quirk(path->device);
+ xpt_find_quirk(path->device);
#ifdef CAM_NEW_TRAN_CODE
- xpt_devise_transport(path);
+ xpt_devise_transport(path);
#endif /* CAM_NEW_TRAN_CODE */
- if ((inq_buf->flags & SID_CmdQue) != 0)
- softc->action =
- PROBE_MODE_SENSE;
- else
- softc->action =
- PROBE_SERIAL_NUM;
+ if ((inq_buf->flags & SID_CmdQue) != 0)
+ softc->action = PROBE_MODE_SENSE;
+ else
+ softc->action = PROBE_SERIAL_NUM;
- path->device->flags &=
- ~CAM_DEV_UNCONFIGURED;
+ path->device->flags &= ~CAM_DEV_UNCONFIGURED;
- xpt_release_ccb(done_ccb);
- xpt_schedule(periph, priority);
- return;
- }
- default:
- break;
- }
+ xpt_release_ccb(done_ccb);
+ xpt_schedule(periph, priority);
+ return;
+ }
+ default:
+ break;
}
} else if (cam_periph_error(done_ccb, 0,
done_ccb->ccb_h.target_lun > 0
OpenPOWER on IntegriCloud