mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 12:28:58 +00:00
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
This commit is contained in:
parent
21ecfd4a44
commit
5cd818b1b7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86940
@ -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;
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
#ifdef CAM_NEW_TRAN_CODE
|
||||
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;
|
||||
|
||||
path->device->flags &=
|
||||
~CAM_DEV_UNCONFIGURED;
|
||||
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;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
xpt_find_quirk(path->device);
|
||||
|
||||
#ifdef CAM_NEW_TRAN_CODE
|
||||
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;
|
||||
|
||||
path->device->flags &= ~CAM_DEV_UNCONFIGURED;
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user