Lines Matching refs:scmd
226 struct scsi_cmnd *scmd);
354 cmd->scmd = NULL; in megasas_return_cmd()
1684 if (!cmd->scmd) in megasas_dump_pending_frames()
1687 if (megasas_cmd_type(cmd->scmd) == READ_WRITE_LDIO) { in megasas_dump_pending_frames()
1732 struct scsi_cmnd *scmd) in megasas_build_and_issue_cmd() argument
1744 if (megasas_cmd_type(scmd) == READ_WRITE_LDIO) in megasas_build_and_issue_cmd()
1745 frame_count = megasas_build_ldio(instance, scmd, cmd); in megasas_build_and_issue_cmd()
1747 frame_count = megasas_build_dcdb(instance, scmd, cmd); in megasas_build_and_issue_cmd()
1752 cmd->scmd = scmd; in megasas_build_and_issue_cmd()
1753 scmd->SCp.ptr = (char *)cmd; in megasas_build_and_issue_cmd()
1776 megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) in megasas_queue_command() argument
1783 scmd->device->host->hostdata; in megasas_queue_command()
1786 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1787 scmd->scsi_done(scmd); in megasas_queue_command()
1797 if (megasas_check_mpio_paths(instance, scmd) == in megasas_queue_command()
1801 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1802 scmd->scsi_done(scmd); in megasas_queue_command()
1807 mr_device_priv_data = scmd->device->hostdata; in megasas_queue_command()
1810 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1811 scmd->scsi_done(scmd); in megasas_queue_command()
1815 if (MEGASAS_IS_LOGICAL(scmd->device)) { in megasas_queue_command()
1816 ld_tgt_id = MEGASAS_TARGET_ID(scmd->device); in megasas_queue_command()
1818 scmd->result = DID_NO_CONNECT << 16; in megasas_queue_command()
1819 scmd->scsi_done(scmd); in megasas_queue_command()
1831 scmd->result = 0; in megasas_queue_command()
1833 if (MEGASAS_IS_LOGICAL(scmd->device) && in megasas_queue_command()
1834 (scmd->device->id >= instance->fw_supported_vd_count || in megasas_queue_command()
1835 scmd->device->lun)) { in megasas_queue_command()
1836 scmd->result = DID_BAD_TARGET << 16; in megasas_queue_command()
1840 if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && in megasas_queue_command()
1841 MEGASAS_IS_LOGICAL(scmd->device) && in megasas_queue_command()
1843 scmd->result = DID_OK << 16; in megasas_queue_command()
1847 return instance->instancet->build_and_issue_cmd(instance, scmd); in megasas_queue_command()
1850 scmd->scsi_done(scmd); in megasas_queue_command()
2777 if (reset_cmd->scmd) { in megasas_wait_for_outstanding()
2778 reset_cmd->scmd->result = DID_REQUEUE << 16; in megasas_wait_for_outstanding()
2781 reset_cmd->scmd->cmnd[0]); in megasas_wait_for_outstanding()
2783 reset_cmd->scmd->scsi_done(reset_cmd->scmd); in megasas_wait_for_outstanding()
2889 static int megasas_generic_reset(struct scsi_cmnd *scmd) in megasas_generic_reset() argument
2894 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_generic_reset()
2896 scmd_printk(KERN_NOTICE, scmd, "megasas: RESET cmd=%x retries=%x\n", in megasas_generic_reset()
2897 scmd->cmnd[0], scmd->retries); in megasas_generic_reset()
2921 blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd) in megasas_reset_timer() argument
2926 if (time_after(jiffies, scmd->jiffies_at_alloc + in megasas_reset_timer()
2931 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_reset_timer()
2990 megasas_dump_fusion_io(struct scsi_cmnd *scmd) in megasas_dump_fusion_io() argument
2996 cmd = (struct megasas_cmd_fusion *)scmd->SCp.ptr; in megasas_dump_fusion_io()
2997 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_dump_fusion_io()
2999 scmd_printk(KERN_INFO, scmd, in megasas_dump_fusion_io()
3001 scmd, scmd->retries, scmd->allowed); in megasas_dump_fusion_io()
3002 scsi_print_command(scmd); in megasas_dump_fusion_io()
3006 scmd_printk(KERN_INFO, scmd, "Request descriptor details:\n"); in megasas_dump_fusion_io()
3007 scmd_printk(KERN_INFO, scmd, in megasas_dump_fusion_io()
3051 static int megasas_reset_bus_host(struct scsi_cmnd *scmd) in megasas_reset_bus_host() argument
3056 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_reset_bus_host()
3058 scmd_printk(KERN_INFO, scmd, in megasas_reset_bus_host()
3061 scmd_printk(KERN_INFO, scmd, in megasas_reset_bus_host()
3063 scmd->device->host->shost_state, in megasas_reset_bus_host()
3064 scsi_host_busy(scmd->device->host), in megasas_reset_bus_host()
3070 ret = megasas_generic_reset(scmd); in megasas_reset_bus_host()
3072 megasas_dump_fusion_io(scmd); in megasas_reset_bus_host()
3073 ret = megasas_reset_fusion(scmd->device->host, in megasas_reset_bus_host()
3085 static int megasas_task_abort(struct scsi_cmnd *scmd) in megasas_task_abort() argument
3090 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_task_abort()
3093 ret = megasas_task_abort_fusion(scmd); in megasas_task_abort()
3095 sdev_printk(KERN_NOTICE, scmd->device, "TASK ABORT not supported\n"); in megasas_task_abort()
3107 static int megasas_reset_target(struct scsi_cmnd *scmd) in megasas_reset_target() argument
3112 instance = (struct megasas_instance *)scmd->device->host->hostdata; in megasas_reset_target()
3115 ret = megasas_reset_target_fusion(scmd); in megasas_reset_target()
3117 sdev_printk(KERN_NOTICE, scmd->device, "TARGET RESET not supported\n"); in megasas_reset_target()
3574 if (cmd->scmd) in megasas_complete_cmd()
3575 cmd->scmd->SCp.ptr = NULL; in megasas_complete_cmd()
3607 cmd->scmd->result = alt_status << 16; in megasas_complete_cmd()
3615 scsi_dma_unmap(cmd->scmd); in megasas_complete_cmd()
3616 cmd->scmd->scsi_done(cmd->scmd); in megasas_complete_cmd()
3625 cmd->scmd->result = DID_OK << 16; in megasas_complete_cmd()
3630 cmd->scmd->result = in megasas_complete_cmd()
3636 cmd->scmd->result = (DID_OK << 16) | hdr->scsi_status; in megasas_complete_cmd()
3639 memset(cmd->scmd->sense_buffer, 0, in megasas_complete_cmd()
3641 memcpy(cmd->scmd->sense_buffer, cmd->sense, in megasas_complete_cmd()
3644 cmd->scmd->result |= DRIVER_SENSE << 24; in megasas_complete_cmd()
3651 cmd->scmd->result = DID_BAD_TARGET << 16; in megasas_complete_cmd()
3657 cmd->scmd->result = DID_ERROR << 16; in megasas_complete_cmd()
3663 scsi_dma_unmap(cmd->scmd); in megasas_complete_cmd()
3664 cmd->scmd->scsi_done(cmd->scmd); in megasas_complete_cmd()
3799 if (cmd->sync_cmd || cmd->scmd) { in megasas_issue_pending_cmds_again()
3802 cmd, cmd->scmd, cmd->sync_cmd); in megasas_issue_pending_cmds_again()
3810 cmd, cmd->scmd, cmd->sync_cmd); in megasas_issue_pending_cmds_again()
3819 if (cmd->scmd) { in megasas_issue_pending_cmds_again()
3830 } else if (cmd->scmd) { in megasas_issue_pending_cmds_again()
3833 cmd, cmd->scmd->cmnd[0]); in megasas_issue_pending_cmds_again()
3886 if (cmd->sync_cmd == 1 || cmd->scmd) { in megasas_internal_reset_defer_cmds()
3889 defer_index, cmd, cmd->sync_cmd, cmd->scmd); in megasas_internal_reset_defer_cmds()
3895 cmd, cmd->sync_cmd, cmd->scmd); in megasas_internal_reset_defer_cmds()
4464 cmd->scmd = NULL; in megasas_alloc_cmds()