Lines Matching refs:ccb

314 	struct st_ccb *ccb;  member
411 struct req_msg *req, struct st_ccb *ccb) in stex_map_sg() argument
419 cmd = ccb->cmd; in stex_map_sg()
425 ccb->sg_count = nseg; in stex_map_sg()
443 struct req_msg *req, struct st_ccb *ccb) in stex_ss_map_sg() argument
451 cmd = ccb->cmd; in stex_ss_map_sg()
457 ccb->sg_count = nseg; in stex_ss_map_sg()
475 static void stex_controller_info(struct st_hba *hba, struct st_ccb *ccb) in stex_controller_info() argument
481 scsi_sg_copy_to_buffer(ccb->cmd, p, count); in stex_controller_info()
499 scsi_sg_copy_from_buffer(ccb->cmd, p, count); in stex_controller_info()
507 hba->ccb[tag].req = req; in stex_send_cmd()
524 hba->ccb[tag].req = req; in stex_ss_send_cmd()
527 cmd = hba->ccb[tag].cmd; in stex_ss_send_cmd()
534 addr += (hba->ccb[tag].sg_count+4)/11; in stex_ss_send_cmd()
670 hba->ccb[tag].cmd = cmd; in stex_queuecommand_lck()
671 hba->ccb[tag].sense_bufflen = SCSI_SENSE_BUFFERSIZE; in stex_queuecommand_lck()
672 hba->ccb[tag].sense_buffer = cmd->sense_buffer; in stex_queuecommand_lck()
674 if (!hba->map_sg(hba, req, &hba->ccb[tag])) { in stex_queuecommand_lck()
675 hba->ccb[tag].sg_count = 0; in stex_queuecommand_lck()
685 static void stex_scsi_done(struct st_ccb *ccb) in DEF_SCSI_QCMD()
687 struct scsi_cmnd *cmd = ccb->cmd; in DEF_SCSI_QCMD()
690 if (ccb->srb_status == SRB_STATUS_SUCCESS || ccb->srb_status == 0) { in DEF_SCSI_QCMD()
691 result = ccb->scsi_status; in DEF_SCSI_QCMD()
692 switch (ccb->scsi_status) { in DEF_SCSI_QCMD()
707 else if (ccb->srb_status & SRB_SEE_SENSE) in DEF_SCSI_QCMD()
709 else switch (ccb->srb_status) { in DEF_SCSI_QCMD()
727 static void stex_copy_data(struct st_ccb *ccb, in stex_copy_data() argument
731 if (ccb->sense_buffer != NULL) in stex_copy_data()
732 memcpy(ccb->sense_buffer, resp->variable, in stex_copy_data()
733 min(variable, ccb->sense_bufflen)); in stex_copy_data()
737 if (ccb->cmd == NULL) in stex_copy_data()
739 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable); in stex_copy_data()
743 struct st_ccb *ccb, struct status_msg *resp) in stex_check_cmd() argument
745 if (ccb->cmd->cmnd[0] == MGT_CMD && in stex_check_cmd()
747 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) - in stex_check_cmd()
755 struct st_ccb *ccb; in stex_mu_intr() local
795 ccb = &hba->ccb[tag]; in stex_mu_intr()
796 if (unlikely(hba->wait_ccb == ccb)) in stex_mu_intr()
798 if (unlikely(ccb->req == NULL)) { in stex_mu_intr()
812 stex_copy_data(ccb, resp, size); in stex_mu_intr()
815 ccb->req = NULL; in stex_mu_intr()
816 ccb->srb_status = resp->srb_status; in stex_mu_intr()
817 ccb->scsi_status = resp->scsi_status; in stex_mu_intr()
819 if (likely(ccb->cmd != NULL)) { in stex_mu_intr()
821 stex_check_cmd(hba, ccb, resp); in stex_mu_intr()
823 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD && in stex_mu_intr()
824 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER)) in stex_mu_intr()
825 stex_controller_info(hba, ccb); in stex_mu_intr()
827 scsi_dma_unmap(ccb->cmd); in stex_mu_intr()
828 stex_scsi_done(ccb); in stex_mu_intr()
830 ccb->req_type = 0; in stex_mu_intr()
869 struct st_ccb *ccb; in stex_ss_mu_intr() local
900 ccb = &hba->ccb[tag]; in stex_ss_mu_intr()
901 if (unlikely(hba->wait_ccb == ccb)) in stex_ss_mu_intr()
903 if (unlikely(ccb->req == NULL)) { in stex_ss_mu_intr()
909 ccb->req = NULL; in stex_ss_mu_intr()
911 ccb->srb_status = SRB_STATUS_SUCCESS; in stex_ss_mu_intr()
912 ccb->scsi_status = SAM_STAT_GOOD; in stex_ss_mu_intr()
914 ccb->srb_status = resp->srb_status; in stex_ss_mu_intr()
915 ccb->scsi_status = resp->scsi_status; in stex_ss_mu_intr()
925 stex_copy_data(ccb, resp, size); in stex_ss_mu_intr()
927 if (likely(ccb->cmd != NULL)) in stex_ss_mu_intr()
928 stex_check_cmd(hba, ccb, resp); in stex_ss_mu_intr()
931 if (likely(ccb->cmd != NULL)) { in stex_ss_mu_intr()
932 scsi_dma_unmap(ccb->cmd); in stex_ss_mu_intr()
933 stex_scsi_done(ccb); in stex_ss_mu_intr()
935 ccb->req_type = 0; in stex_ss_mu_intr()
1152 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd) in stex_abort()
1153 hba->wait_ccb = &hba->ccb[tag]; in stex_abort()
1269 struct st_ccb *ccb; in stex_do_reset() local
1308 ccb = &hba->ccb[tag]; in stex_do_reset()
1309 if (ccb->req == NULL) in stex_do_reset()
1311 ccb->req = NULL; in stex_do_reset()
1312 if (ccb->cmd) { in stex_do_reset()
1313 scsi_dma_unmap(ccb->cmd); in stex_do_reset()
1314 ccb->cmd->result = DID_RESET << 16; in stex_do_reset()
1315 ccb->cmd->scsi_done(ccb->cmd); in stex_do_reset()
1316 ccb->cmd = NULL; in stex_do_reset()
1604 hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL); in stex_probe()
1605 if (!hba->ccb) { in stex_probe()
1687 kfree(hba->ccb); in stex_probe()
1730 hba->ccb[tag].cmd = NULL; in stex_hba_stop()
1731 hba->ccb[tag].sg_count = 0; in stex_hba_stop()
1732 hba->ccb[tag].sense_bufflen = 0; in stex_hba_stop()
1733 hba->ccb[tag].sense_buffer = NULL; in stex_hba_stop()
1734 hba->ccb[tag].req_type = PASSTHRU_REQ_TYPE; in stex_hba_stop()
1740 while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) { in stex_hba_stop()
1742 hba->ccb[tag].req_type = 0; in stex_hba_stop()
1759 kfree(hba->ccb); in stex_hba_free()