Lines Matching full:scp
38 * @scp: SCSI command associated with the AFU command in error.
42 static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) in process_cmd_err() argument
54 scsi_set_resid(scp, resid); in process_cmd_err()
55 dev_dbg(dev, "%s: cmd underrun cmd = %p scp = %p, resid = %d\n", in process_cmd_err()
56 __func__, cmd, scp, resid); in process_cmd_err()
60 dev_dbg(dev, "%s: cmd underrun cmd = %p scp = %p\n", in process_cmd_err()
61 __func__, cmd, scp); in process_cmd_err()
62 scp->result = (DID_ERROR << 16); in process_cmd_err()
73 memcpy(scp->sense_buffer, ioasa->sense_data, in process_cmd_err()
75 scp->result = ioasa->rc.scsi_rc; in process_cmd_err()
77 scp->result = ioasa->rc.scsi_rc | (DID_ERROR << 16); in process_cmd_err()
81 * We encountered an error. Set scp->result based on nature in process_cmd_err()
88 scp->result = (DID_REQUEUE << 16); in process_cmd_err()
98 scp->result = (DID_ERROR << 16); in process_cmd_err()
111 scp->result = (DID_ERROR << 16); in process_cmd_err()
120 scp->result = (DID_NO_CONNECT << 16); in process_cmd_err()
126 scp->result = (DID_IMM_RETRY << 16); in process_cmd_err()
130 scp->result = (DID_ERROR << 16); in process_cmd_err()
135 scp->result = (DID_ERROR << 16); in process_cmd_err()
138 scp->result = (DID_ERROR << 16); in process_cmd_err()
154 struct scsi_cmnd *scp; in cmd_complete() local
165 if (cmd->scp) { in cmd_complete()
166 scp = cmd->scp; in cmd_complete()
168 process_cmd_err(cmd, scp); in cmd_complete()
170 scp->result = (DID_OK << 16); in cmd_complete()
172 dev_dbg_ratelimited(dev, "%s:scp=%p result=%08x ioasc=%08x\n", in cmd_complete()
173 __func__, scp, scp->result, cmd->sa.ioasc); in cmd_complete()
174 scsi_done(scp); in cmd_complete()
195 struct scsi_cmnd *scp; in flush_pending_cmds() local
205 if (cmd->scp) { in flush_pending_cmds()
206 scp = cmd->scp; in flush_pending_cmds()
207 scp->result = (DID_IMM_RETRY << 16); in flush_pending_cmds()
208 scsi_done(scp); in flush_pending_cmds()
415 * @scp: SCSI command to send.
422 static u32 cmd_to_target_hwq(struct Scsi_Host *host, struct scsi_cmnd *scp, in cmd_to_target_hwq() argument
436 tag = blk_mq_unique_tag(scsi_cmd_to_rq(scp)); in cmd_to_target_hwq()
556 * @scp: SCSI command to send.
560 static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp) in cxlflash_queuecommand() argument
565 struct afu_cmd *cmd = sc_to_afuci(scp); in cxlflash_queuecommand()
566 struct scatterlist *sg = scsi_sglist(scp); in cxlflash_queuecommand()
567 int hwq_index = cmd_to_target_hwq(host, scp, afu); in cxlflash_queuecommand()
573 dev_dbg_ratelimited(dev, "%s: (scp=%p) %d/%d/%d/%llu " in cxlflash_queuecommand()
575 __func__, scp, host->host_no, scp->device->channel, in cxlflash_queuecommand()
576 scp->device->id, scp->device->lun, in cxlflash_queuecommand()
577 get_unaligned_be32(&((u32 *)scp->cmnd)[0]), in cxlflash_queuecommand()
578 get_unaligned_be32(&((u32 *)scp->cmnd)[1]), in cxlflash_queuecommand()
579 get_unaligned_be32(&((u32 *)scp->cmnd)[2]), in cxlflash_queuecommand()
580 get_unaligned_be32(&((u32 *)scp->cmnd)[3])); in cxlflash_queuecommand()
603 scp->result = (DID_NO_CONNECT << 16); in cxlflash_queuecommand()
604 scsi_done(scp); in cxlflash_queuecommand()
617 cmd->scp = scp; in cxlflash_queuecommand()
624 cmd->rcb.port_sel = CHAN2PORTMASK(scp->device->channel); in cxlflash_queuecommand()
625 cmd->rcb.lun_id = lun_to_lunid(scp->device->lun); in cxlflash_queuecommand()
627 if (scp->sc_data_direction == DMA_TO_DEVICE) in cxlflash_queuecommand()
631 memcpy(cmd->rcb.cdb, scp->cmnd, sizeof(cmd->rcb.cdb)); in cxlflash_queuecommand()
2393 * @scp: SCSI command to abort.
2401 static int cxlflash_eh_abort_handler(struct scsi_cmnd *scp) in cxlflash_eh_abort_handler() argument
2404 struct Scsi_Host *host = scp->device->host; in cxlflash_eh_abort_handler()
2406 struct afu_cmd *cmd = sc_to_afuc(scp); in cxlflash_eh_abort_handler()
2411 dev_dbg(dev, "%s: (scp=%p) %d/%d/%d/%llu " in cxlflash_eh_abort_handler()
2412 "cdb=(%08x-%08x-%08x-%08x)\n", __func__, scp, host->host_no, in cxlflash_eh_abort_handler()
2413 scp->device->channel, scp->device->id, scp->device->lun, in cxlflash_eh_abort_handler()
2414 get_unaligned_be32(&((u32 *)scp->cmnd)[0]), in cxlflash_eh_abort_handler()
2415 get_unaligned_be32(&((u32 *)scp->cmnd)[1]), in cxlflash_eh_abort_handler()
2416 get_unaligned_be32(&((u32 *)scp->cmnd)[2]), in cxlflash_eh_abort_handler()
2417 get_unaligned_be32(&((u32 *)scp->cmnd)[3])); in cxlflash_eh_abort_handler()
2441 * @scp: SCSI command to send.
2447 static int cxlflash_eh_device_reset_handler(struct scsi_cmnd *scp) in cxlflash_eh_device_reset_handler() argument
2450 struct scsi_device *sdev = scp->device; in cxlflash_eh_device_reset_handler()
2479 * @scp: SCSI command from stack identifying host.
2490 static int cxlflash_eh_host_reset_handler(struct scsi_cmnd *scp) in cxlflash_eh_host_reset_handler() argument
2494 struct Scsi_Host *host = scp->device->host; in cxlflash_eh_host_reset_handler()