Lines Matching refs:scmnd
923 struct scsi_cmnd *scmnd, in storvsc_handle_error() argument
947 switch (scmnd->cmnd[0]) { in storvsc_handle_error()
950 set_host_byte(scmnd, DID_PASSTHROUGH); in storvsc_handle_error()
960 set_host_byte(scmnd, DID_ERROR); in storvsc_handle_error()
964 set_host_byte(scmnd, DID_NO_CONNECT); in storvsc_handle_error()
976 set_host_byte(scmnd, DID_REQUEUE); in storvsc_handle_error()
989 set_host_byte(scmnd, DID_TARGET_FAILURE); in storvsc_handle_error()
1004 struct scsi_cmnd *scmnd = cmd_request->cmd; in storvsc_command_completion() local
1017 scmnd->result = vm_srb->scsi_status; in storvsc_command_completion()
1019 if (scmnd->result) { in storvsc_command_completion()
1020 if (scsi_normalize_sense(scmnd->sense_buffer, in storvsc_command_completion()
1025 scsi_print_sense_hdr(scmnd->device, "storvsc", in storvsc_command_completion()
1030 storvsc_handle_error(vm_srb, scmnd, host, sense_hdr.asc, in storvsc_command_completion()
1041 scsi_set_resid(scmnd, in storvsc_command_completion()
1044 scmnd->scsi_done(scmnd); in storvsc_command_completion()
1471 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) in storvsc_host_reset_handler() argument
1473 struct hv_host_device *host_dev = shost_priv(scmnd->device->host); in storvsc_host_reset_handler()
1527 static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd) in storvsc_eh_timed_out() argument
1530 if (scmnd->device->host->transportt == fc_transport_template) in storvsc_eh_timed_out()
1531 return fc_eh_timed_out(scmnd); in storvsc_eh_timed_out()
1536 static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) in storvsc_scsi_cmd_ok() argument
1539 u8 scsi_op = scmnd->cmnd[0]; in storvsc_scsi_cmd_ok()
1549 scmnd->result = ILLEGAL_REQUEST << 16; in storvsc_scsi_cmd_ok()
1558 static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) in storvsc_queuecommand() argument
1563 struct storvsc_cmd_request *cmd_request = scsi_cmd_priv(scmnd); in storvsc_queuecommand()
1582 if (!storvsc_scsi_cmd_ok(scmnd)) { in storvsc_queuecommand()
1583 scmnd->scsi_done(scmnd); in storvsc_queuecommand()
1589 cmd_request->cmd = scmnd; in storvsc_queuecommand()
1597 if (scmnd->device->tagged_supported) { in storvsc_queuecommand()
1605 switch (scmnd->sc_data_direction) { in storvsc_queuecommand()
1624 scmnd->sc_data_direction); in storvsc_queuecommand()
1630 vm_srb->path_id = scmnd->device->channel; in storvsc_queuecommand()
1631 vm_srb->target_id = scmnd->device->id; in storvsc_queuecommand()
1632 vm_srb->lun = scmnd->device->lun; in storvsc_queuecommand()
1634 vm_srb->cdb_length = scmnd->cmd_len; in storvsc_queuecommand()
1636 memcpy(vm_srb->cdb, scmnd->cmnd, vm_srb->cdb_length); in storvsc_queuecommand()
1638 sgl = (struct scatterlist *)scsi_sglist(scmnd); in storvsc_queuecommand()
1639 sg_count = scsi_sg_count(scmnd); in storvsc_queuecommand()
1641 length = scsi_bufflen(scmnd); in storvsc_queuecommand()