Lines Matching refs:ccb

334 	struct st_ccb *ccb;  member
431 struct req_msg *req, struct st_ccb *ccb) in stex_map_sg() argument
439 cmd = ccb->cmd; in stex_map_sg()
445 ccb->sg_count = nseg; in stex_map_sg()
463 struct req_msg *req, struct st_ccb *ccb) in stex_ss_map_sg() argument
471 cmd = ccb->cmd; in stex_ss_map_sg()
477 ccb->sg_count = nseg; in stex_ss_map_sg()
495 static void stex_controller_info(struct st_hba *hba, struct st_ccb *ccb) in stex_controller_info() argument
501 scsi_sg_copy_to_buffer(ccb->cmd, p, count); in stex_controller_info()
519 scsi_sg_copy_from_buffer(ccb->cmd, p, count); in stex_controller_info()
527 hba->ccb[tag].req = req; in stex_send_cmd()
544 hba->ccb[tag].req = req; in stex_ss_send_cmd()
547 cmd = hba->ccb[tag].cmd; in stex_ss_send_cmd()
554 addr += (hba->ccb[tag].sg_count+4)/11; in stex_ss_send_cmd()
572 struct st_ccb *ccb; in return_abnormal_state() local
578 ccb = &hba->ccb[tag]; in return_abnormal_state()
579 if (ccb->req == NULL) in return_abnormal_state()
581 ccb->req = NULL; in return_abnormal_state()
582 if (ccb->cmd) { in return_abnormal_state()
583 scsi_dma_unmap(ccb->cmd); in return_abnormal_state()
584 ccb->cmd->result = status << 16; in return_abnormal_state()
585 ccb->cmd->scsi_done(ccb->cmd); in return_abnormal_state()
586 ccb->cmd = NULL; in return_abnormal_state()
719 hba->ccb[tag].cmd = cmd; in stex_queuecommand_lck()
720 hba->ccb[tag].sense_bufflen = SCSI_SENSE_BUFFERSIZE; in stex_queuecommand_lck()
721 hba->ccb[tag].sense_buffer = cmd->sense_buffer; in stex_queuecommand_lck()
723 if (!hba->map_sg(hba, req, &hba->ccb[tag])) { in stex_queuecommand_lck()
724 hba->ccb[tag].sg_count = 0; in stex_queuecommand_lck()
734 static void stex_scsi_done(struct st_ccb *ccb) in DEF_SCSI_QCMD()
736 struct scsi_cmnd *cmd = ccb->cmd; in DEF_SCSI_QCMD()
739 if (ccb->srb_status == SRB_STATUS_SUCCESS || ccb->srb_status == 0) { in DEF_SCSI_QCMD()
740 result = ccb->scsi_status; in DEF_SCSI_QCMD()
741 switch (ccb->scsi_status) { in DEF_SCSI_QCMD()
756 else if (ccb->srb_status & SRB_SEE_SENSE) in DEF_SCSI_QCMD()
758 else switch (ccb->srb_status) { in DEF_SCSI_QCMD()
776 static void stex_copy_data(struct st_ccb *ccb, in stex_copy_data() argument
780 if (ccb->sense_buffer != NULL) in stex_copy_data()
781 memcpy(ccb->sense_buffer, resp->variable, in stex_copy_data()
782 min(variable, ccb->sense_bufflen)); in stex_copy_data()
786 if (ccb->cmd == NULL) in stex_copy_data()
788 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable); in stex_copy_data()
792 struct st_ccb *ccb, struct status_msg *resp) in stex_check_cmd() argument
794 if (ccb->cmd->cmnd[0] == MGT_CMD && in stex_check_cmd()
796 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) - in stex_check_cmd()
804 struct st_ccb *ccb; in stex_mu_intr() local
844 ccb = &hba->ccb[tag]; in stex_mu_intr()
845 if (unlikely(hba->wait_ccb == ccb)) in stex_mu_intr()
847 if (unlikely(ccb->req == NULL)) { in stex_mu_intr()
861 stex_copy_data(ccb, resp, size); in stex_mu_intr()
864 ccb->req = NULL; in stex_mu_intr()
865 ccb->srb_status = resp->srb_status; in stex_mu_intr()
866 ccb->scsi_status = resp->scsi_status; in stex_mu_intr()
868 if (likely(ccb->cmd != NULL)) { in stex_mu_intr()
870 stex_check_cmd(hba, ccb, resp); in stex_mu_intr()
872 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD && in stex_mu_intr()
873 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER)) in stex_mu_intr()
874 stex_controller_info(hba, ccb); in stex_mu_intr()
876 scsi_dma_unmap(ccb->cmd); in stex_mu_intr()
877 stex_scsi_done(ccb); in stex_mu_intr()
879 ccb->req_type = 0; in stex_mu_intr()
918 struct st_ccb *ccb; in stex_ss_mu_intr() local
949 ccb = &hba->ccb[tag]; in stex_ss_mu_intr()
950 if (unlikely(hba->wait_ccb == ccb)) in stex_ss_mu_intr()
952 if (unlikely(ccb->req == NULL)) { in stex_ss_mu_intr()
958 ccb->req = NULL; in stex_ss_mu_intr()
960 ccb->srb_status = SRB_STATUS_SUCCESS; in stex_ss_mu_intr()
961 ccb->scsi_status = SAM_STAT_GOOD; in stex_ss_mu_intr()
963 ccb->srb_status = resp->srb_status; in stex_ss_mu_intr()
964 ccb->scsi_status = resp->scsi_status; in stex_ss_mu_intr()
974 stex_copy_data(ccb, resp, size); in stex_ss_mu_intr()
976 if (likely(ccb->cmd != NULL)) in stex_ss_mu_intr()
977 stex_check_cmd(hba, ccb, resp); in stex_ss_mu_intr()
980 if (likely(ccb->cmd != NULL)) { in stex_ss_mu_intr()
981 scsi_dma_unmap(ccb->cmd); in stex_ss_mu_intr()
982 stex_scsi_done(ccb); in stex_ss_mu_intr()
984 ccb->req_type = 0; in stex_ss_mu_intr()
1266 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd) in stex_abort()
1267 hba->wait_ccb = &hba->ccb[tag]; in stex_abort()
1774 hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL); in stex_probe()
1775 if (!hba->ccb) { in stex_probe()
1851 kfree(hba->ccb); in stex_probe()
1910 hba->ccb[tag].cmd = NULL; in stex_hba_stop()
1911 hba->ccb[tag].sg_count = 0; in stex_hba_stop()
1912 hba->ccb[tag].sense_bufflen = 0; in stex_hba_stop()
1913 hba->ccb[tag].sense_buffer = NULL; in stex_hba_stop()
1914 hba->ccb[tag].req_type = PASSTHRU_REQ_TYPE; in stex_hba_stop()
1918 while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) { in stex_hba_stop()
1920 hba->ccb[tag].req_type = 0; in stex_hba_stop()
1939 kfree(hba->ccb); in stex_hba_free()