Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
Show First 20 Lines • Show All 2,142 Lines • ▼ Show 20 Lines | #ifdef notyet | ||||
*/ | */ | ||||
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { | if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { | ||||
callout_drain(&reqp->callout); | callout_drain(&reqp->callout); | ||||
} | } | ||||
#endif | #endif | ||||
ccb->ccb_h.status &= ~CAM_SIM_QUEUED; | ccb->ccb_h.status &= ~CAM_SIM_QUEUED; | ||||
ccb->ccb_h.status &= ~CAM_STATUS_MASK; | ccb->ccb_h.status &= ~CAM_STATUS_MASK; | ||||
int srb_status = SRB_STATUS(vm_srb->srb_status); | |||||
if (vm_srb->scsi_status == SCSI_STATUS_OK) { | if (vm_srb->scsi_status == SCSI_STATUS_OK) { | ||||
const struct scsi_generic *cmd; | const struct scsi_generic *cmd; | ||||
cmd = (const struct scsi_generic *) | cmd = (const struct scsi_generic *) | ||||
((ccb->ccb_h.flags & CAM_CDB_POINTER) ? | ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? | ||||
csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); | csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); | ||||
if (vm_srb->srb_status != SRB_STATUS_SUCCESS) { | if (srb_status != SRB_STATUS_SUCCESS) { | ||||
/* | /* | ||||
* If there are errors, for example, invalid LUN, | * If there are errors, for example, invalid LUN, | ||||
* host will inform VM through SRB status. | * host will inform VM through SRB status. | ||||
*/ | */ | ||||
if (bootverbose) { | if (bootverbose) { | ||||
if (vm_srb->srb_status == SRB_STATUS_INVALID_LUN) { | if (srb_status == SRB_STATUS_INVALID_LUN) { | ||||
xpt_print(ccb->ccb_h.path, | xpt_print(ccb->ccb_h.path, | ||||
"invalid LUN %d for op: %s\n", | "invalid LUN %d for op: %s\n", | ||||
vm_srb->lun, | vm_srb->lun, | ||||
scsi_op_desc(cmd->opcode, NULL)); | scsi_op_desc(cmd->opcode, NULL)); | ||||
} else { | } else { | ||||
xpt_print(ccb->ccb_h.path, | xpt_print(ccb->ccb_h.path, | ||||
"Unknown SRB flag: %d for op: %s\n", | "Unknown SRB flag: %d for op: %s\n", | ||||
vm_srb->srb_status, | srb_status, | ||||
scsi_op_desc(cmd->opcode, NULL)); | scsi_op_desc(cmd->opcode, NULL)); | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* XXX For a selection timeout, all of the LUNs | * XXX For a selection timeout, all of the LUNs | ||||
* on the target will be gone. It works for SCSI | * on the target will be gone. It works for SCSI | ||||
* disks, but does not work for IDE disks. | * disks, but does not work for IDE disks. | ||||
* | * | ||||
* For CAM_DEV_NOT_THERE, CAM will only get | * For CAM_DEV_NOT_THERE, CAM will only get | ||||
* rid of the device(s) specified by the path. | * rid of the device(s) specified by the path. | ||||
*/ | */ | ||||
if (storvsc_get_storage_type(sc->hs_dev) == | if (storvsc_get_storage_type(sc->hs_dev) == | ||||
DRIVER_STORVSC) | DRIVER_STORVSC) | ||||
ccb->ccb_h.status |= CAM_SEL_TIMEOUT; | ccb->ccb_h.status |= CAM_SEL_TIMEOUT; | ||||
else | else | ||||
ccb->ccb_h.status |= CAM_DEV_NOT_THERE; | ccb->ccb_h.status |= CAM_DEV_NOT_THERE; | ||||
} else { | } else { | ||||
ccb->ccb_h.status |= CAM_REQ_CMP; | ccb->ccb_h.status |= CAM_REQ_CMP; | ||||
} | } | ||||
if (cmd->opcode == INQUIRY && | if (cmd->opcode == INQUIRY && | ||||
vm_srb->srb_status == SRB_STATUS_SUCCESS) { | srb_status == SRB_STATUS_SUCCESS) { | ||||
int resp_xfer_len, resp_buf_len, data_len; | int resp_xfer_len, resp_buf_len, data_len; | ||||
uint8_t *resp_buf = (uint8_t *)csio->data_ptr; | uint8_t *resp_buf = (uint8_t *)csio->data_ptr; | ||||
struct scsi_inquiry_data *inq_data = | struct scsi_inquiry_data *inq_data = | ||||
(struct scsi_inquiry_data *)csio->data_ptr; | (struct scsi_inquiry_data *)csio->data_ptr; | ||||
/* Get the buffer length reported by host */ | /* Get the buffer length reported by host */ | ||||
resp_xfer_len = vm_srb->transfer_len; | resp_xfer_len = vm_srb->transfer_len; | ||||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |