Lines Matching refs:scmd

183  * @scmd:		SCSI command from the mid-layer
189 static int mvumi_make_sgl(struct mvumi_hba *mhba, struct scsi_cmnd *scmd,
195 unsigned int sgnum = scsi_sg_count(scmd);
198 *sg_count = dma_map_sg(&mhba->pdev->dev, scsi_sglist(scmd), sgnum,
199 scmd->sc_data_direction);
204 dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd), sgnum,
205 scmd->sc_data_direction);
208 scsi_for_each_sg(scmd, sg, *sg_count, i) {
338 cmd->scmd = NULL;
698 static int mvumi_host_reset(struct scsi_cmnd *scmd)
702 mhba = (struct mvumi_hba *) scmd->device->host->hostdata;
704 scmd_printk(KERN_NOTICE, scmd, "RESET -%u cmd=%x retries=%x\n",
705 scmd->request->tag, scmd->cmnd[0], scmd->retries);
788 cmd->scmd = NULL;
1302 struct scsi_cmnd *scmd = cmd->scmd;
1304 cmd->scmd->SCp.ptr = NULL;
1305 scmd->result = ob_frame->req_status;
1309 scmd->result |= DID_OK << 16;
1312 scmd->result |= DID_BUS_BUSY << 16;
1315 scmd->result |= (DID_OK << 16);
1317 memcpy(cmd->scmd->sense_buffer, ob_frame->payload,
1319 scmd->result |= (DRIVER_SENSE << 24);
1323 scmd->result |= (DRIVER_INVALID << 24) | (DID_ABORT << 16);
1327 if (scsi_bufflen(scmd))
1328 dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd),
1329 scsi_sg_count(scmd),
1330 scmd->sc_data_direction);
1331 cmd->scmd->scsi_done(scmd);
1428 cmd->scmd = NULL;
1707 cmd->scmd = NULL;
1782 if (cmd->scmd)
2019 * @scmd: SCSI command
2026 struct scsi_cmnd *scmd, struct mvumi_cmd *cmd)
2030 cmd->scmd = scmd;
2033 pframe->device_id = ((unsigned short) scmd->device->id) |
2034 (((unsigned short) scmd->device->lun) << 8);
2037 switch (scmd->sc_data_direction) {
2050 "cmd[0x%x]\n", scmd->sc_data_direction, scmd->cmnd[0]);
2054 pframe->cdb_length = scmd->cmd_len;
2055 memcpy(pframe->cdb, scmd->cmnd, pframe->cdb_length);
2057 if (scsi_bufflen(scmd)) {
2058 if (mvumi_make_sgl(mhba, scmd, &pframe->payload[0],
2062 pframe->data_transfer_length = scsi_bufflen(scmd);
2070 scmd->result = (DID_OK << 16) | (DRIVER_SENSE << 24) |
2072 scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24,
2079 * @scmd: SCSI command to be queued
2083 struct scsi_cmnd *scmd)
2092 scmd->result = 0;
2099 if (unlikely(mvumi_build_frame(mhba, scmd, cmd)))
2102 cmd->scmd = scmd;
2103 scmd->SCp.ptr = (char *) cmd;
2110 scmd->scsi_done(scmd);
2115 static enum blk_eh_timer_return mvumi_timed_out(struct scsi_cmnd *scmd)
2117 struct mvumi_cmd *cmd = (struct mvumi_cmd *) scmd->SCp.ptr;
2118 struct Scsi_Host *host = scmd->device->host;
2133 scmd->result = (DRIVER_INVALID << 24) | (DID_ABORT << 16);
2134 scmd->SCp.ptr = NULL;
2135 if (scsi_bufflen(scmd)) {
2136 dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd),
2137 scsi_sg_count(scmd),
2138 scmd->sc_data_direction);