Lines Matching refs:scmnd
969 struct scsi_cmnd *scmnd, in storvsc_handle_error() argument
986 set_host_byte(scmnd, DID_REQUEUE); in storvsc_handle_error()
1002 set_host_byte(scmnd, DID_REQUEUE); in storvsc_handle_error()
1019 switch (scmnd->cmnd[0]) { in storvsc_handle_error()
1022 set_host_byte(scmnd, DID_PASSTHROUGH); in storvsc_handle_error()
1032 set_host_byte(scmnd, DID_ERROR); in storvsc_handle_error()
1037 set_host_byte(scmnd, DID_NO_CONNECT); in storvsc_handle_error()
1050 set_host_byte(scmnd, DID_BAD_TARGET); in storvsc_handle_error()
1065 struct scsi_cmnd *scmnd = cmd_request->cmd; in storvsc_command_completion() local
1079 scmnd->result = vm_srb->scsi_status; in storvsc_command_completion()
1081 if (scmnd->result) { in storvsc_command_completion()
1082 sense_ok = scsi_normalize_sense(scmnd->sense_buffer, in storvsc_command_completion()
1086 scsi_print_sense_hdr(scmnd->device, "storvsc", in storvsc_command_completion()
1091 storvsc_handle_error(vm_srb, scmnd, host, sense_hdr.asc, in storvsc_command_completion()
1106 scsi_set_resid(scmnd, in storvsc_command_completion()
1109 scsi_done(scmnd); in storvsc_command_completion()
1288 struct scsi_cmnd *scmnd; in storvsc_on_channel_callback() local
1291 scmnd = scsi_host_find_tag(shost, rqst_id - 1); in storvsc_on_channel_callback()
1292 if (scmnd == NULL) { in storvsc_on_channel_callback()
1296 request = (struct storvsc_cmd_request *)scsi_cmd_priv(scmnd); in storvsc_on_channel_callback()
1297 scsi_dma_unmap(scmnd); in storvsc_on_channel_callback()
1615 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) in storvsc_host_reset_handler() argument
1617 struct hv_host_device *host_dev = shost_priv(scmnd->device->host); in storvsc_host_reset_handler()
1670 static enum scsi_timeout_action storvsc_eh_timed_out(struct scsi_cmnd *scmnd) in storvsc_eh_timed_out() argument
1673 if (scmnd->device->host->transportt == fc_transport_template) in storvsc_eh_timed_out()
1674 return fc_eh_timed_out(scmnd); in storvsc_eh_timed_out()
1679 static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) in storvsc_scsi_cmd_ok() argument
1682 u8 scsi_op = scmnd->cmnd[0]; in storvsc_scsi_cmd_ok()
1692 set_host_byte(scmnd, DID_ERROR); in storvsc_scsi_cmd_ok()
1701 static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) in storvsc_queuecommand() argument
1706 struct storvsc_cmd_request *cmd_request = scsi_cmd_priv(scmnd); in storvsc_queuecommand()
1722 if (!storvsc_scsi_cmd_ok(scmnd)) { in storvsc_queuecommand()
1723 scsi_done(scmnd); in storvsc_queuecommand()
1729 cmd_request->cmd = scmnd; in storvsc_queuecommand()
1738 if (scmnd->device->tagged_supported) { in storvsc_queuecommand()
1746 switch (scmnd->sc_data_direction) { in storvsc_queuecommand()
1765 scmnd->sc_data_direction); in storvsc_queuecommand()
1771 vm_srb->path_id = scmnd->device->channel; in storvsc_queuecommand()
1772 vm_srb->target_id = scmnd->device->id; in storvsc_queuecommand()
1773 vm_srb->lun = scmnd->device->lun; in storvsc_queuecommand()
1775 vm_srb->cdb_length = scmnd->cmd_len; in storvsc_queuecommand()
1777 memcpy(vm_srb->cdb, scmnd->cmnd, vm_srb->cdb_length); in storvsc_queuecommand()
1779 sgl = (struct scatterlist *)scsi_sglist(scmnd); in storvsc_queuecommand()
1781 length = scsi_bufflen(scmnd); in storvsc_queuecommand()
1785 if (scsi_sg_count(scmnd)) { in storvsc_queuecommand()
1804 sg_count = scsi_dma_map(scmnd); in storvsc_queuecommand()
1843 scsi_dma_unmap(scmnd); in storvsc_queuecommand()