Lines Matching defs:scp
719 struct scsi_cmnd *scp;
729 scp = hba->reqs[tag].scp;
731 if (HPT_SCP(scp)->mapped)
732 scsi_dma_unmap(scp);
736 scsi_set_resid(scp,
737 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length));
738 scp->result = (DID_OK<<16);
741 scp->result = (DID_BAD_TARGET<<16);
744 scp->result = (DID_BUS_BUSY<<16);
747 scp->result = (DID_RESET<<16);
750 scp->result = (DID_ERROR<<16);
753 scp->result = (DID_ABORT<<16);
756 scsi_set_resid(scp,
757 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length));
758 scp->result = SAM_STAT_CHECK_CONDITION;
759 memcpy(scp->sense_buffer, &req->sg_list, SCSI_SENSE_BUFFERSIZE);
764 scp->result = DRIVER_INVALID << 24 | DID_ABORT << 16;
768 scsi_set_resid(scp,
769 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length));
772 dprintk("scsi_done(%p)\n", scp);
773 scp->scsi_done(scp);
847 static int hptiop_buildsgl(struct scsi_cmnd *scp, struct hpt_iopsg *psg)
849 struct Scsi_Host *host = scp->device->host;
854 nseg = scsi_dma_map(scp);
859 HPT_SCP(scp)->sgcnt = nseg;
860 HPT_SCP(scp)->mapped = 1;
862 BUG_ON(HPT_SCP(scp)->sgcnt > hba->max_sg_descriptors);
864 scsi_for_each_sg(scp, sg, HPT_SCP(scp)->sgcnt, idx) {
868 psg[idx].eot = (idx == HPT_SCP(scp)->sgcnt - 1) ?
871 return HPT_SCP(scp)->sgcnt;
997 static int hptiop_queuecommand_lck(struct scsi_cmnd *scp,
1000 struct Scsi_Host *host = scp->device->host;
1007 scp->scsi_done = done;
1015 _req->scp = scp;
1017 dprintk("hptiop_queuecmd(scp=%p) %d/%d/%d/%llu cdb=(%08x-%08x-%08x-%08x) "
1019 scp,
1020 host->host_no, scp->device->channel,
1021 scp->device->id, scp->device->lun,
1022 cpu_to_be32(((u32 *)scp->cmnd)[0]),
1023 cpu_to_be32(((u32 *)scp->cmnd)[1]),
1024 cpu_to_be32(((u32 *)scp->cmnd)[2]),
1025 cpu_to_be32(((u32 *)scp->cmnd)[3]),
1028 scp->result = 0;
1030 if (scp->device->channel ||
1031 (scp->device->id > hba->max_devices) ||
1032 ((scp->device->id == (hba->max_devices-1)) && scp->device->lun)) {
1033 scp->result = DID_BAD_TARGET << 16;
1041 sg_count = hptiop_buildsgl(scp, req->sg_list);
1043 HPT_SCP(scp)->mapped = 0;
1048 req->dataxfer_length = cpu_to_le32(scsi_bufflen(scp));
1049 req->channel = scp->device->channel;
1050 req->target = scp->device->id;
1051 req->lun = scp->device->lun;
1057 memcpy(req->cdb, scp->cmnd, sizeof(req->cdb));
1062 dprintk("scsi_done(scp=%p)\n", scp);
1063 scp->scsi_done(scp);
1099 static int hptiop_reset(struct scsi_cmnd *scp)
1101 struct hptiop_hba * hba = (struct hptiop_hba *)scp->device->host->hostdata;
1104 scp->device->host->host_no, -1, -1);
1225 hba->u.mvfrey.internal_req.scp = NULL;