Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
Show First 20 Lines • Show All 2,204 Lines • ▼ Show 20 Lines | if (cmd->opcode == INQUIRY && | ||||
resp_buf_len : resp_xfer_len; | resp_buf_len : resp_xfer_len; | ||||
if (bootverbose && data_len >= 5) { | if (bootverbose && data_len >= 5) { | ||||
xpt_print(ccb->ccb_h.path, "storvsc inquiry " | xpt_print(ccb->ccb_h.path, "storvsc inquiry " | ||||
"(%d) [%x %x %x %x %x ... ]\n", data_len, | "(%d) [%x %x %x %x %x ... ]\n", data_len, | ||||
resp_buf[0], resp_buf[1], resp_buf[2], | resp_buf[0], resp_buf[1], resp_buf[2], | ||||
resp_buf[3], resp_buf[4]); | resp_buf[3], resp_buf[4]); | ||||
} | } | ||||
/* | /* | ||||
* XXX: Hyper-V (since win2012r2) responses inquiry with | |||||
* unknown version (0) for GEN-2 DVD device. | |||||
* Manually set the version number to SPC3 in order to | |||||
* ask CAM to continue probing with "PROBE_REPORT_LUNS". | |||||
* see probedone() in scsi_xpt.c | |||||
*/ | |||||
if (SID_TYPE(inq_data) == T_CDROM && | |||||
inq_data->version == 0 && | |||||
(vmstor_proto_version >= VMSTOR_PROTOCOL_VERSION_WIN8)) { | |||||
inq_data->version = SCSI_REV_SPC3; | |||||
if (bootverbose) { | |||||
xpt_print(ccb->ccb_h.path, | |||||
"set version from 0 to %d\n", | |||||
inq_data->version); | |||||
} | |||||
} | |||||
/* | |||||
* XXX: Manually fix the wrong response returned from WS2012 | * XXX: Manually fix the wrong response returned from WS2012 | ||||
*/ | */ | ||||
if (!is_scsi_valid(inq_data) && | if (!is_scsi_valid(inq_data) && | ||||
(vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8_1 || | (vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8_1 || | ||||
vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8 || | vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8 || | ||||
vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN7)) { | vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN7)) { | ||||
if (data_len >= 4 && | if (data_len >= 4 && | ||||
(resp_buf[2] == 0 || resp_buf[3] == 0)) { | (resp_buf[2] == 0 || resp_buf[3] == 0)) { | ||||
resp_buf[2] = 5; // verion=5 means SPC-3 | resp_buf[2] = SCSI_REV_SPC3; | ||||
resp_buf[3] = 2; // resp fmt must be 2 | resp_buf[3] = 2; // resp fmt must be 2 | ||||
if (bootverbose) | if (bootverbose) | ||||
xpt_print(ccb->ccb_h.path, | xpt_print(ccb->ccb_h.path, | ||||
"fix version and resp fmt for 0x%x\n", | "fix version and resp fmt for 0x%x\n", | ||||
vmstor_proto_version); | vmstor_proto_version); | ||||
} | } | ||||
} else if (data_len >= SHORT_INQUIRY_LENGTH) { | } else if (data_len >= SHORT_INQUIRY_LENGTH) { | ||||
char vendor[16]; | char vendor[16]; | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |