Lines Matching refs:scmd
189 static int mvumi_make_sgl(struct mvumi_hba *mhba, struct scsi_cmnd *scmd, in mvumi_make_sgl() argument
195 unsigned int sgnum = scsi_sg_count(scmd); in mvumi_make_sgl()
198 *sg_count = dma_map_sg(&mhba->pdev->dev, scsi_sglist(scmd), sgnum, in mvumi_make_sgl()
199 scmd->sc_data_direction); in mvumi_make_sgl()
204 dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd), sgnum, in mvumi_make_sgl()
205 scmd->sc_data_direction); in mvumi_make_sgl()
208 scsi_for_each_sg(scmd, sg, *sg_count, i) { in mvumi_make_sgl()
338 cmd->scmd = NULL; in mvumi_return_cmd()
698 static int mvumi_host_reset(struct scsi_cmnd *scmd) in mvumi_host_reset() argument
702 mhba = (struct mvumi_hba *) scmd->device->host->hostdata; in mvumi_host_reset()
704 scmd_printk(KERN_NOTICE, scmd, "RESET -%u cmd=%x retries=%x\n", in mvumi_host_reset()
705 scsi_cmd_to_rq(scmd)->tag, scmd->cmnd[0], scmd->retries); in mvumi_host_reset()
788 cmd->scmd = NULL; in mvumi_flush_cache()
1303 struct scsi_cmnd *scmd = cmd->scmd; in mvumi_complete_cmd() local
1305 cmd->scmd->SCp.ptr = NULL; in mvumi_complete_cmd()
1306 scmd->result = ob_frame->req_status; in mvumi_complete_cmd()
1310 scmd->result |= DID_OK << 16; in mvumi_complete_cmd()
1313 scmd->result |= DID_BUS_BUSY << 16; in mvumi_complete_cmd()
1316 scmd->result |= (DID_OK << 16); in mvumi_complete_cmd()
1318 memcpy(cmd->scmd->sense_buffer, ob_frame->payload, in mvumi_complete_cmd()
1323 scmd->result |= (DID_ABORT << 16); in mvumi_complete_cmd()
1327 if (scsi_bufflen(scmd)) in mvumi_complete_cmd()
1328 dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd), in mvumi_complete_cmd()
1329 scsi_sg_count(scmd), in mvumi_complete_cmd()
1330 scmd->sc_data_direction); in mvumi_complete_cmd()
1331 scsi_done(scmd); in mvumi_complete_cmd()
1428 cmd->scmd = NULL; in mvumi_inquiry()
1707 cmd->scmd = NULL; in mvumi_get_event()
1782 if (cmd->scmd) in mvumi_handle_clob()
2026 struct scsi_cmnd *scmd, struct mvumi_cmd *cmd) in mvumi_build_frame() argument
2030 cmd->scmd = scmd; in mvumi_build_frame()
2033 pframe->device_id = ((unsigned short) scmd->device->id) | in mvumi_build_frame()
2034 (((unsigned short) scmd->device->lun) << 8); in mvumi_build_frame()
2037 switch (scmd->sc_data_direction) { in mvumi_build_frame()
2050 "cmd[0x%x]\n", scmd->sc_data_direction, scmd->cmnd[0]); in mvumi_build_frame()
2054 pframe->cdb_length = scmd->cmd_len; in mvumi_build_frame()
2055 memcpy(pframe->cdb, scmd->cmnd, pframe->cdb_length); in mvumi_build_frame()
2057 if (scsi_bufflen(scmd)) { in mvumi_build_frame()
2058 if (mvumi_make_sgl(mhba, scmd, &pframe->payload[0], in mvumi_build_frame()
2062 pframe->data_transfer_length = scsi_bufflen(scmd); in mvumi_build_frame()
2070 scsi_build_sense(scmd, 0, ILLEGAL_REQUEST, 0x24, 0); in mvumi_build_frame()
2080 struct scsi_cmnd *scmd) in mvumi_queue_command() argument
2089 scmd->result = 0; in mvumi_queue_command()
2096 if (unlikely(mvumi_build_frame(mhba, scmd, cmd))) in mvumi_queue_command()
2099 cmd->scmd = scmd; in mvumi_queue_command()
2100 scmd->SCp.ptr = (char *) cmd; in mvumi_queue_command()
2107 scsi_done(scmd); in mvumi_queue_command()
2112 static enum blk_eh_timer_return mvumi_timed_out(struct scsi_cmnd *scmd) in mvumi_timed_out() argument
2114 struct mvumi_cmd *cmd = (struct mvumi_cmd *) scmd->SCp.ptr; in mvumi_timed_out()
2115 struct Scsi_Host *host = scmd->device->host; in mvumi_timed_out()
2130 scmd->result = (DID_ABORT << 16); in mvumi_timed_out()
2131 scmd->SCp.ptr = NULL; in mvumi_timed_out()
2132 if (scsi_bufflen(scmd)) { in mvumi_timed_out()
2133 dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd), in mvumi_timed_out()
2134 scsi_sg_count(scmd), in mvumi_timed_out()
2135 scmd->sc_data_direction); in mvumi_timed_out()