Lines Matching refs:scmd
235 struct scsi_cmnd *scmd);
363 cmd->scmd = NULL; in megasas_return_cmd()
1693 if (!cmd->scmd) in megasas_dump_pending_frames()
1696 if (megasas_cmd_type(cmd->scmd) == READ_WRITE_LDIO) { in megasas_dump_pending_frames()
1741 struct scsi_cmnd *scmd) in megasas_build_and_issue_cmd() argument
1753 if (megasas_cmd_type(scmd) == READ_WRITE_LDIO) in megasas_build_and_issue_cmd()
1754 frame_count = megasas_build_ldio(instance, scmd, cmd); in megasas_build_and_issue_cmd()
1756 frame_count = megasas_build_dcdb(instance, scmd, cmd); in megasas_build_and_issue_cmd()
1761 cmd->scmd = scmd; in megasas_build_and_issue_cmd()
1762 megasas_priv(scmd)->cmd_priv = cmd; in megasas_build_and_issue_cmd()
1785 megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) in megasas_queue_command() argument
1792 scmd->device->host->hostdata; in megasas_queue_command()
1795 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1796 scsi_done(scmd); in megasas_queue_command()
1806 if (megasas_check_mpio_paths(instance, scmd) == in megasas_queue_command()
1810 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1811 scsi_done(scmd); in megasas_queue_command()
1816 mr_device_priv_data = scmd->device->hostdata; in megasas_queue_command()
1819 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1820 scsi_done(scmd); in megasas_queue_command()
1824 if (MEGASAS_IS_LOGICAL(scmd->device)) { in megasas_queue_command()
1825 ld_tgt_id = MEGASAS_TARGET_ID(scmd->device); in megasas_queue_command()
1827 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1828 scsi_done(scmd); in megasas_queue_command()
1840 scmd->result = 0; in megasas_queue_command()
1842 if (MEGASAS_IS_LOGICAL(scmd->device) && in megasas_queue_command()
1843 (scmd->device->id >= instance->fw_supported_vd_count || in megasas_queue_command()
1844 scmd->device->lun)) { in megasas_queue_command()
1845 scmd->result = DID_BAD_TARGET << 16; in megasas_queue_command()
1849 if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && in megasas_queue_command()
1850 MEGASAS_IS_LOGICAL(scmd->device) && in megasas_queue_command()
1852 scmd->result = DID_OK << 16; in megasas_queue_command()
1856 return instance->instancet->build_and_issue_cmd(instance, scmd); in megasas_queue_command()
1859 scsi_done(scmd); in megasas_queue_command()
2792 if (reset_cmd->scmd) { in megasas_wait_for_outstanding()
2793 reset_cmd->scmd->result = DID_REQUEUE << 16; in megasas_wait_for_outstanding()
2796 reset_cmd->scmd->cmnd[0]); in megasas_wait_for_outstanding()
2798 scsi_done(reset_cmd->scmd); in megasas_wait_for_outstanding()
2904 static int megasas_generic_reset(struct scsi_cmnd *scmd) in megasas_generic_reset() argument
2909 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_generic_reset()
2911 scmd_printk(KERN_NOTICE, scmd, "megasas: RESET cmd=%x retries=%x\n", in megasas_generic_reset()
2912 scmd->cmnd[0], scmd->retries); in megasas_generic_reset()
2935 static enum scsi_timeout_action megasas_reset_timer(struct scsi_cmnd *scmd) in megasas_reset_timer() argument
2940 if (time_after(jiffies, scmd->jiffies_at_alloc + in megasas_reset_timer()
2945 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_reset_timer()
3004 megasas_dump_fusion_io(struct scsi_cmnd *scmd) in megasas_dump_fusion_io() argument
3006 struct megasas_cmd_fusion *cmd = megasas_priv(scmd)->cmd_priv; in megasas_dump_fusion_io()
3010 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_dump_fusion_io()
3012 scmd_printk(KERN_INFO, scmd, in megasas_dump_fusion_io()
3014 scmd, scmd->retries, scmd->allowed); in megasas_dump_fusion_io()
3015 scsi_print_command(scmd); in megasas_dump_fusion_io()
3019 scmd_printk(KERN_INFO, scmd, "Request descriptor details:\n"); in megasas_dump_fusion_io()
3020 scmd_printk(KERN_INFO, scmd, in megasas_dump_fusion_io()
3064 static int megasas_reset_bus_host(struct scsi_cmnd *scmd) in megasas_reset_bus_host() argument
3069 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_reset_bus_host()
3071 scmd_printk(KERN_INFO, scmd, in megasas_reset_bus_host()
3074 scmd_printk(KERN_INFO, scmd, in megasas_reset_bus_host()
3076 scmd->device->host->shost_state, in megasas_reset_bus_host()
3077 scsi_host_busy(scmd->device->host), in megasas_reset_bus_host()
3083 ret = megasas_generic_reset(scmd); in megasas_reset_bus_host()
3085 megasas_dump_fusion_io(scmd); in megasas_reset_bus_host()
3086 ret = megasas_reset_fusion(scmd->device->host, in megasas_reset_bus_host()
3098 static int megasas_task_abort(struct scsi_cmnd *scmd) in megasas_task_abort() argument
3103 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_task_abort()
3106 ret = megasas_task_abort_fusion(scmd); in megasas_task_abort()
3108 sdev_printk(KERN_NOTICE, scmd->device, "TASK ABORT not supported\n"); in megasas_task_abort()
3120 static int megasas_reset_target(struct scsi_cmnd *scmd) in megasas_reset_target() argument
3125 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_reset_target()
3128 ret = megasas_reset_target_fusion(scmd); in megasas_reset_target()
3130 sdev_printk(KERN_NOTICE, scmd->device, "TARGET RESET not supported\n"); in megasas_reset_target()
3612 if (cmd->scmd) in megasas_complete_cmd()
3613 megasas_priv(cmd->scmd)->cmd_priv = NULL; in megasas_complete_cmd()
3645 cmd->scmd->result = alt_status << 16; in megasas_complete_cmd()
3653 scsi_dma_unmap(cmd->scmd); in megasas_complete_cmd()
3654 scsi_done(cmd->scmd); in megasas_complete_cmd()
3663 cmd->scmd->result = DID_OK << 16; in megasas_complete_cmd()
3669 cmd->scmd->result = (DID_ERROR << 16) | SAM_STAT_CHECK_CONDITION; in megasas_complete_cmd()
3671 cmd->scmd->result = (DID_ERROR << 16) | hdr->scsi_status; in megasas_complete_cmd()
3676 cmd->scmd->result = (DID_OK << 16) | hdr->scsi_status; in megasas_complete_cmd()
3679 memset(cmd->scmd->sense_buffer, 0, in megasas_complete_cmd()
3681 memcpy(cmd->scmd->sense_buffer, cmd->sense, in megasas_complete_cmd()
3689 cmd->scmd->result = DID_BAD_TARGET << 16; in megasas_complete_cmd()
3695 cmd->scmd->result = DID_ERROR << 16; in megasas_complete_cmd()
3701 scsi_dma_unmap(cmd->scmd); in megasas_complete_cmd()
3702 scsi_done(cmd->scmd); in megasas_complete_cmd()
3837 if (cmd->sync_cmd || cmd->scmd) { in megasas_issue_pending_cmds_again()
3840 cmd, cmd->scmd, cmd->sync_cmd); in megasas_issue_pending_cmds_again()
3848 cmd, cmd->scmd, cmd->sync_cmd); in megasas_issue_pending_cmds_again()
3857 if (cmd->scmd) { in megasas_issue_pending_cmds_again()
3868 } else if (cmd->scmd) { in megasas_issue_pending_cmds_again()
3871 cmd, cmd->scmd->cmnd[0]); in megasas_issue_pending_cmds_again()
3924 if (cmd->sync_cmd == 1 || cmd->scmd) { in megasas_internal_reset_defer_cmds()
3927 defer_index, cmd, cmd->sync_cmd, cmd->scmd); in megasas_internal_reset_defer_cmds()
3933 cmd, cmd->sync_cmd, cmd->scmd); in megasas_internal_reset_defer_cmds()
4498 cmd->scmd = NULL; in megasas_alloc_cmds()