Lines Matching full:scp

719 	struct scsi_cmnd *scp;  in hptiop_finish_scsi_req()  local
729 scp = hba->reqs[tag].scp; in hptiop_finish_scsi_req()
731 if (HPT_SCP(scp)->mapped) in hptiop_finish_scsi_req()
732 scsi_dma_unmap(scp); in hptiop_finish_scsi_req()
736 scsi_set_resid(scp, in hptiop_finish_scsi_req()
737 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); in hptiop_finish_scsi_req()
738 scp->result = (DID_OK<<16); in hptiop_finish_scsi_req()
741 scp->result = (DID_BAD_TARGET<<16); in hptiop_finish_scsi_req()
744 scp->result = (DID_BUS_BUSY<<16); in hptiop_finish_scsi_req()
747 scp->result = (DID_RESET<<16); in hptiop_finish_scsi_req()
750 scp->result = (DID_ERROR<<16); in hptiop_finish_scsi_req()
753 scp->result = (DID_ABORT<<16); in hptiop_finish_scsi_req()
756 scsi_set_resid(scp, in hptiop_finish_scsi_req()
757 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); in hptiop_finish_scsi_req()
758 scp->result = SAM_STAT_CHECK_CONDITION; in hptiop_finish_scsi_req()
759 memcpy(scp->sense_buffer, &req->sg_list, SCSI_SENSE_BUFFERSIZE); in hptiop_finish_scsi_req()
763 scp->result = DID_ABORT << 16; in hptiop_finish_scsi_req()
767 scsi_set_resid(scp, in hptiop_finish_scsi_req()
768 scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); in hptiop_finish_scsi_req()
771 dprintk("scsi_done(%p)\n", scp); in hptiop_finish_scsi_req()
772 scsi_done(scp); in hptiop_finish_scsi_req()
846 static int hptiop_buildsgl(struct scsi_cmnd *scp, struct hpt_iopsg *psg) in hptiop_buildsgl() argument
848 struct Scsi_Host *host = scp->device->host; in hptiop_buildsgl()
853 nseg = scsi_dma_map(scp); in hptiop_buildsgl()
858 HPT_SCP(scp)->sgcnt = nseg; in hptiop_buildsgl()
859 HPT_SCP(scp)->mapped = 1; in hptiop_buildsgl()
861 BUG_ON(HPT_SCP(scp)->sgcnt > hba->max_sg_descriptors); in hptiop_buildsgl()
863 scsi_for_each_sg(scp, sg, HPT_SCP(scp)->sgcnt, idx) { in hptiop_buildsgl()
867 psg[idx].eot = (idx == HPT_SCP(scp)->sgcnt - 1) ? in hptiop_buildsgl()
870 return HPT_SCP(scp)->sgcnt; in hptiop_buildsgl()
996 static int hptiop_queuecommand_lck(struct scsi_cmnd *scp) in hptiop_queuecommand_lck() argument
998 struct Scsi_Host *host = scp->device->host; in hptiop_queuecommand_lck()
1010 _req->scp = scp; in hptiop_queuecommand_lck()
1012 dprintk("hptiop_queuecmd(scp=%p) %d/%d/%d/%llu cdb=(%08x-%08x-%08x-%08x) " in hptiop_queuecommand_lck()
1014 scp, in hptiop_queuecommand_lck()
1015 host->host_no, scp->device->channel, in hptiop_queuecommand_lck()
1016 scp->device->id, scp->device->lun, in hptiop_queuecommand_lck()
1017 cpu_to_be32(((u32 *)scp->cmnd)[0]), in hptiop_queuecommand_lck()
1018 cpu_to_be32(((u32 *)scp->cmnd)[1]), in hptiop_queuecommand_lck()
1019 cpu_to_be32(((u32 *)scp->cmnd)[2]), in hptiop_queuecommand_lck()
1020 cpu_to_be32(((u32 *)scp->cmnd)[3]), in hptiop_queuecommand_lck()
1023 scp->result = 0; in hptiop_queuecommand_lck()
1025 if (scp->device->channel || in hptiop_queuecommand_lck()
1026 (scp->device->id > hba->max_devices) || in hptiop_queuecommand_lck()
1027 ((scp->device->id == (hba->max_devices-1)) && scp->device->lun)) { in hptiop_queuecommand_lck()
1028 scp->result = DID_BAD_TARGET << 16; in hptiop_queuecommand_lck()
1036 sg_count = hptiop_buildsgl(scp, req->sg_list); in hptiop_queuecommand_lck()
1038 HPT_SCP(scp)->mapped = 0; in hptiop_queuecommand_lck()
1043 req->dataxfer_length = cpu_to_le32(scsi_bufflen(scp)); in hptiop_queuecommand_lck()
1044 req->channel = scp->device->channel; in hptiop_queuecommand_lck()
1045 req->target = scp->device->id; in hptiop_queuecommand_lck()
1046 req->lun = scp->device->lun; in hptiop_queuecommand_lck()
1049 memcpy(req->cdb, scp->cmnd, sizeof(req->cdb)); in hptiop_queuecommand_lck()
1054 dprintk("scsi_done(scp=%p)\n", scp); in hptiop_queuecommand_lck()
1055 scsi_done(scp); in hptiop_queuecommand_lck()
1091 static int hptiop_reset(struct scsi_cmnd *scp) in hptiop_reset() argument
1093 struct hptiop_hba * hba = (struct hptiop_hba *)scp->device->host->hostdata; in hptiop_reset()
1096 scp->device->host->host_no, -1, -1); in hptiop_reset()
1220 hba->u.mvfrey.internal_req.scp = NULL; in hptiop_internal_memalloc_mvfrey()