Lines Matching full:scp

43  * @scp:	SCSI command associated with the AFU command in error.
47 static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) in process_cmd_err() argument
59 scsi_set_resid(scp, resid); in process_cmd_err()
60 dev_dbg(dev, "%s: cmd underrun cmd = %p scp = %p, resid = %d\n", in process_cmd_err()
61 __func__, cmd, scp, resid); in process_cmd_err()
65 dev_dbg(dev, "%s: cmd underrun cmd = %p scp = %p\n", in process_cmd_err()
66 __func__, cmd, scp); in process_cmd_err()
67 scp->result = (DID_ERROR << 16); in process_cmd_err()
78 memcpy(scp->sense_buffer, ioasa->sense_data, in process_cmd_err()
80 scp->result = ioasa->rc.scsi_rc; in process_cmd_err()
82 scp->result = ioasa->rc.scsi_rc | (DID_ERROR << 16); in process_cmd_err()
86 * We encountered an error. Set scp->result based on nature in process_cmd_err()
93 scp->result = (DID_REQUEUE << 16); in process_cmd_err()
103 scp->result = (DID_ERROR << 16); in process_cmd_err()
116 scp->result = (DID_ERROR << 16); in process_cmd_err()
125 scp->result = (DID_NO_CONNECT << 16); in process_cmd_err()
131 scp->result = (DID_IMM_RETRY << 16); in process_cmd_err()
135 scp->result = (DID_ERROR << 16); in process_cmd_err()
140 scp->result = (DID_ERROR << 16); in process_cmd_err()
143 scp->result = (DID_ERROR << 16); in process_cmd_err()
159 struct scsi_cmnd *scp; in cmd_complete() local
170 if (cmd->scp) { in cmd_complete()
171 scp = cmd->scp; in cmd_complete()
173 process_cmd_err(cmd, scp); in cmd_complete()
175 scp->result = (DID_OK << 16); in cmd_complete()
177 dev_dbg_ratelimited(dev, "%s:scp=%p result=%08x ioasc=%08x\n", in cmd_complete()
178 __func__, scp, scp->result, cmd->sa.ioasc); in cmd_complete()
179 scsi_done(scp); in cmd_complete()
200 struct scsi_cmnd *scp; in flush_pending_cmds() local
210 if (cmd->scp) { in flush_pending_cmds()
211 scp = cmd->scp; in flush_pending_cmds()
212 scp->result = (DID_IMM_RETRY << 16); in flush_pending_cmds()
213 scsi_done(scp); in flush_pending_cmds()
420 * @scp: SCSI command to send.
427 static u32 cmd_to_target_hwq(struct Scsi_Host *host, struct scsi_cmnd *scp, in cmd_to_target_hwq() argument
441 tag = blk_mq_unique_tag(scsi_cmd_to_rq(scp)); in cmd_to_target_hwq()
561 * @scp: SCSI command to send.
565 static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp) in cxlflash_queuecommand() argument
570 struct afu_cmd *cmd = sc_to_afuci(scp); in cxlflash_queuecommand()
571 struct scatterlist *sg = scsi_sglist(scp); in cxlflash_queuecommand()
572 int hwq_index = cmd_to_target_hwq(host, scp, afu); in cxlflash_queuecommand()
578 dev_dbg_ratelimited(dev, "%s: (scp=%p) %d/%d/%d/%llu " in cxlflash_queuecommand()
580 __func__, scp, host->host_no, scp->device->channel, in cxlflash_queuecommand()
581 scp->device->id, scp->device->lun, in cxlflash_queuecommand()
582 get_unaligned_be32(&((u32 *)scp->cmnd)[0]), in cxlflash_queuecommand()
583 get_unaligned_be32(&((u32 *)scp->cmnd)[1]), in cxlflash_queuecommand()
584 get_unaligned_be32(&((u32 *)scp->cmnd)[2]), in cxlflash_queuecommand()
585 get_unaligned_be32(&((u32 *)scp->cmnd)[3])); in cxlflash_queuecommand()
608 scp->result = (DID_NO_CONNECT << 16); in cxlflash_queuecommand()
609 scsi_done(scp); in cxlflash_queuecommand()
622 cmd->scp = scp; in cxlflash_queuecommand()
629 cmd->rcb.port_sel = CHAN2PORTMASK(scp->device->channel); in cxlflash_queuecommand()
630 cmd->rcb.lun_id = lun_to_lunid(scp->device->lun); in cxlflash_queuecommand()
632 if (scp->sc_data_direction == DMA_TO_DEVICE) in cxlflash_queuecommand()
636 memcpy(cmd->rcb.cdb, scp->cmnd, sizeof(cmd->rcb.cdb)); in cxlflash_queuecommand()
2398 * @scp: SCSI command to abort.
2406 static int cxlflash_eh_abort_handler(struct scsi_cmnd *scp) in cxlflash_eh_abort_handler() argument
2409 struct Scsi_Host *host = scp->device->host; in cxlflash_eh_abort_handler()
2411 struct afu_cmd *cmd = sc_to_afuc(scp); in cxlflash_eh_abort_handler()
2416 dev_dbg(dev, "%s: (scp=%p) %d/%d/%d/%llu " in cxlflash_eh_abort_handler()
2417 "cdb=(%08x-%08x-%08x-%08x)\n", __func__, scp, host->host_no, in cxlflash_eh_abort_handler()
2418 scp->device->channel, scp->device->id, scp->device->lun, in cxlflash_eh_abort_handler()
2419 get_unaligned_be32(&((u32 *)scp->cmnd)[0]), in cxlflash_eh_abort_handler()
2420 get_unaligned_be32(&((u32 *)scp->cmnd)[1]), in cxlflash_eh_abort_handler()
2421 get_unaligned_be32(&((u32 *)scp->cmnd)[2]), in cxlflash_eh_abort_handler()
2422 get_unaligned_be32(&((u32 *)scp->cmnd)[3])); in cxlflash_eh_abort_handler()
2446 * @scp: SCSI command to send.
2452 static int cxlflash_eh_device_reset_handler(struct scsi_cmnd *scp) in cxlflash_eh_device_reset_handler() argument
2455 struct scsi_device *sdev = scp->device; in cxlflash_eh_device_reset_handler()
2484 * @scp: SCSI command from stack identifying host.
2495 static int cxlflash_eh_host_reset_handler(struct scsi_cmnd *scp) in cxlflash_eh_host_reset_handler() argument
2499 struct Scsi_Host *host = scp->device->host; in cxlflash_eh_host_reset_handler()