Lines Matching refs:scp
727 struct scsi_cmnd *scp; in hptiop_finish_scsi_req() local
737 scp = hba->reqs[tag].scp; in hptiop_finish_scsi_req()
739 if (HPT_SCP(scp)->mapped) in hptiop_finish_scsi_req()
740 scsi_dma_unmap(scp); in hptiop_finish_scsi_req()
744 scsi_set_resid(scp, in hptiop_finish_scsi_req()
745 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); in hptiop_finish_scsi_req()
746 scp->result = (DID_OK<<16); in hptiop_finish_scsi_req()
749 scp->result = (DID_BAD_TARGET<<16); in hptiop_finish_scsi_req()
752 scp->result = (DID_BUS_BUSY<<16); in hptiop_finish_scsi_req()
755 scp->result = (DID_RESET<<16); in hptiop_finish_scsi_req()
758 scp->result = (DID_ERROR<<16); in hptiop_finish_scsi_req()
761 scp->result = (DID_ABORT<<16); in hptiop_finish_scsi_req()
764 scsi_set_resid(scp, in hptiop_finish_scsi_req()
765 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); in hptiop_finish_scsi_req()
766 scp->result = SAM_STAT_CHECK_CONDITION; in hptiop_finish_scsi_req()
767 memcpy(scp->sense_buffer, &req->sg_list, in hptiop_finish_scsi_req()
774 scp->result = DRIVER_INVALID << 24 | DID_ABORT << 16; in hptiop_finish_scsi_req()
778 scsi_set_resid(scp, in hptiop_finish_scsi_req()
779 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); in hptiop_finish_scsi_req()
782 dprintk("scsi_done(%p)\n", scp); in hptiop_finish_scsi_req()
783 scp->scsi_done(scp); in hptiop_finish_scsi_req()
857 static int hptiop_buildsgl(struct scsi_cmnd *scp, struct hpt_iopsg *psg) in hptiop_buildsgl() argument
859 struct Scsi_Host *host = scp->device->host; in hptiop_buildsgl()
864 nseg = scsi_dma_map(scp); in hptiop_buildsgl()
869 HPT_SCP(scp)->sgcnt = nseg; in hptiop_buildsgl()
870 HPT_SCP(scp)->mapped = 1; in hptiop_buildsgl()
872 BUG_ON(HPT_SCP(scp)->sgcnt > hba->max_sg_descriptors); in hptiop_buildsgl()
874 scsi_for_each_sg(scp, sg, HPT_SCP(scp)->sgcnt, idx) { in hptiop_buildsgl()
878 psg[idx].eot = (idx == HPT_SCP(scp)->sgcnt - 1) ? in hptiop_buildsgl()
881 return HPT_SCP(scp)->sgcnt; in hptiop_buildsgl()
1007 static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, in hptiop_queuecommand_lck() argument
1010 struct Scsi_Host *host = scp->device->host; in hptiop_queuecommand_lck()
1017 scp->scsi_done = done; in hptiop_queuecommand_lck()
1025 _req->scp = scp; in hptiop_queuecommand_lck()
1029 scp, in hptiop_queuecommand_lck()
1030 host->host_no, scp->device->channel, in hptiop_queuecommand_lck()
1031 scp->device->id, scp->device->lun, in hptiop_queuecommand_lck()
1032 cpu_to_be32(((u32 *)scp->cmnd)[0]), in hptiop_queuecommand_lck()
1033 cpu_to_be32(((u32 *)scp->cmnd)[1]), in hptiop_queuecommand_lck()
1034 cpu_to_be32(((u32 *)scp->cmnd)[2]), in hptiop_queuecommand_lck()
1035 cpu_to_be32(((u32 *)scp->cmnd)[3]), in hptiop_queuecommand_lck()
1038 scp->result = 0; in hptiop_queuecommand_lck()
1040 if (scp->device->channel || scp->device->lun || in hptiop_queuecommand_lck()
1041 scp->device->id > hba->max_devices) { in hptiop_queuecommand_lck()
1042 scp->result = DID_BAD_TARGET << 16; in hptiop_queuecommand_lck()
1050 sg_count = hptiop_buildsgl(scp, req->sg_list); in hptiop_queuecommand_lck()
1052 HPT_SCP(scp)->mapped = 0; in hptiop_queuecommand_lck()
1057 req->dataxfer_length = cpu_to_le32(scsi_bufflen(scp)); in hptiop_queuecommand_lck()
1058 req->channel = scp->device->channel; in hptiop_queuecommand_lck()
1059 req->target = scp->device->id; in hptiop_queuecommand_lck()
1060 req->lun = scp->device->lun; in hptiop_queuecommand_lck()
1066 memcpy(req->cdb, scp->cmnd, sizeof(req->cdb)); in hptiop_queuecommand_lck()
1071 dprintk("scsi_done(scp=%p)\n", scp); in hptiop_queuecommand_lck()
1072 scp->scsi_done(scp); in hptiop_queuecommand_lck()
1108 static int hptiop_reset(struct scsi_cmnd *scp) in hptiop_reset() argument
1110 struct Scsi_Host * host = scp->device->host; in hptiop_reset()
1114 scp->device->host->host_no, scp->device->channel, in hptiop_reset()
1115 scp->device->id, scp); in hptiop_reset()
1229 hba->u.mvfrey.internal_req.scp = NULL; in hptiop_internal_memalloc_mvfrey()