Lines Matching refs:ccb
329 struct st_ccb *ccb; member
423 struct req_msg *req, struct st_ccb *ccb) in stex_map_sg() argument
431 cmd = ccb->cmd; in stex_map_sg()
437 ccb->sg_count = nseg; in stex_map_sg()
455 struct req_msg *req, struct st_ccb *ccb) in stex_ss_map_sg() argument
463 cmd = ccb->cmd; in stex_ss_map_sg()
469 ccb->sg_count = nseg; in stex_ss_map_sg()
487 static void stex_controller_info(struct st_hba *hba, struct st_ccb *ccb) in stex_controller_info() argument
493 scsi_sg_copy_to_buffer(ccb->cmd, p, count); in stex_controller_info()
511 scsi_sg_copy_from_buffer(ccb->cmd, p, count); in stex_controller_info()
519 hba->ccb[tag].req = req; in stex_send_cmd()
536 hba->ccb[tag].req = req; in stex_ss_send_cmd()
539 cmd = hba->ccb[tag].cmd; in stex_ss_send_cmd()
546 addr += (hba->ccb[tag].sg_count+4)/11; in stex_ss_send_cmd()
564 struct st_ccb *ccb; in return_abnormal_state() local
570 ccb = &hba->ccb[tag]; in return_abnormal_state()
571 if (ccb->req == NULL) in return_abnormal_state()
573 ccb->req = NULL; in return_abnormal_state()
574 if (ccb->cmd) { in return_abnormal_state()
575 scsi_dma_unmap(ccb->cmd); in return_abnormal_state()
576 ccb->cmd->result = status << 16; in return_abnormal_state()
577 ccb->cmd->scsi_done(ccb->cmd); in return_abnormal_state()
578 ccb->cmd = NULL; in return_abnormal_state()
713 hba->ccb[tag].cmd = cmd; in stex_queuecommand_lck()
714 hba->ccb[tag].sense_bufflen = SCSI_SENSE_BUFFERSIZE; in stex_queuecommand_lck()
715 hba->ccb[tag].sense_buffer = cmd->sense_buffer; in stex_queuecommand_lck()
717 if (!hba->map_sg(hba, req, &hba->ccb[tag])) { in stex_queuecommand_lck()
718 hba->ccb[tag].sg_count = 0; in stex_queuecommand_lck()
728 static void stex_scsi_done(struct st_ccb *ccb) in DEF_SCSI_QCMD()
730 struct scsi_cmnd *cmd = ccb->cmd; in DEF_SCSI_QCMD()
733 if (ccb->srb_status == SRB_STATUS_SUCCESS || ccb->srb_status == 0) { in DEF_SCSI_QCMD()
734 result = ccb->scsi_status; in DEF_SCSI_QCMD()
735 switch (ccb->scsi_status) { in DEF_SCSI_QCMD()
750 else if (ccb->srb_status & SRB_SEE_SENSE) in DEF_SCSI_QCMD()
752 else switch (ccb->srb_status) { in DEF_SCSI_QCMD()
770 static void stex_copy_data(struct st_ccb *ccb, in stex_copy_data() argument
774 if (ccb->sense_buffer != NULL) in stex_copy_data()
775 memcpy(ccb->sense_buffer, resp->variable, in stex_copy_data()
776 min(variable, ccb->sense_bufflen)); in stex_copy_data()
780 if (ccb->cmd == NULL) in stex_copy_data()
782 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable); in stex_copy_data()
786 struct st_ccb *ccb, struct status_msg *resp) in stex_check_cmd() argument
788 if (ccb->cmd->cmnd[0] == MGT_CMD && in stex_check_cmd()
790 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) - in stex_check_cmd()
798 struct st_ccb *ccb; in stex_mu_intr() local
838 ccb = &hba->ccb[tag]; in stex_mu_intr()
839 if (unlikely(hba->wait_ccb == ccb)) in stex_mu_intr()
841 if (unlikely(ccb->req == NULL)) { in stex_mu_intr()
855 stex_copy_data(ccb, resp, size); in stex_mu_intr()
858 ccb->req = NULL; in stex_mu_intr()
859 ccb->srb_status = resp->srb_status; in stex_mu_intr()
860 ccb->scsi_status = resp->scsi_status; in stex_mu_intr()
862 if (likely(ccb->cmd != NULL)) { in stex_mu_intr()
864 stex_check_cmd(hba, ccb, resp); in stex_mu_intr()
866 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD && in stex_mu_intr()
867 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER)) in stex_mu_intr()
868 stex_controller_info(hba, ccb); in stex_mu_intr()
870 scsi_dma_unmap(ccb->cmd); in stex_mu_intr()
871 stex_scsi_done(ccb); in stex_mu_intr()
873 ccb->req_type = 0; in stex_mu_intr()
912 struct st_ccb *ccb; in stex_ss_mu_intr() local
943 ccb = &hba->ccb[tag]; in stex_ss_mu_intr()
944 if (unlikely(hba->wait_ccb == ccb)) in stex_ss_mu_intr()
946 if (unlikely(ccb->req == NULL)) { in stex_ss_mu_intr()
952 ccb->req = NULL; in stex_ss_mu_intr()
954 ccb->srb_status = SRB_STATUS_SUCCESS; in stex_ss_mu_intr()
955 ccb->scsi_status = SAM_STAT_GOOD; in stex_ss_mu_intr()
957 ccb->srb_status = resp->srb_status; in stex_ss_mu_intr()
958 ccb->scsi_status = resp->scsi_status; in stex_ss_mu_intr()
968 stex_copy_data(ccb, resp, size); in stex_ss_mu_intr()
970 if (likely(ccb->cmd != NULL)) in stex_ss_mu_intr()
971 stex_check_cmd(hba, ccb, resp); in stex_ss_mu_intr()
974 if (likely(ccb->cmd != NULL)) { in stex_ss_mu_intr()
975 scsi_dma_unmap(ccb->cmd); in stex_ss_mu_intr()
976 stex_scsi_done(ccb); in stex_ss_mu_intr()
978 ccb->req_type = 0; in stex_ss_mu_intr()
1260 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd) in stex_abort()
1261 hba->wait_ccb = &hba->ccb[tag]; in stex_abort()
1758 hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL); in stex_probe()
1759 if (!hba->ccb) { in stex_probe()
1835 kfree(hba->ccb); in stex_probe()
1894 hba->ccb[tag].cmd = NULL; in stex_hba_stop()
1895 hba->ccb[tag].sg_count = 0; in stex_hba_stop()
1896 hba->ccb[tag].sense_bufflen = 0; in stex_hba_stop()
1897 hba->ccb[tag].sense_buffer = NULL; in stex_hba_stop()
1898 hba->ccb[tag].req_type = PASSTHRU_REQ_TYPE; in stex_hba_stop()
1902 while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) { in stex_hba_stop()
1904 hba->ccb[tag].req_type = 0; in stex_hba_stop()
1923 kfree(hba->ccb); in stex_hba_free()