Lines Matching refs:ccb
329 struct st_ccb *ccb; member
426 struct req_msg *req, struct st_ccb *ccb) in stex_map_sg() argument
434 cmd = ccb->cmd; in stex_map_sg()
440 ccb->sg_count = nseg; in stex_map_sg()
458 struct req_msg *req, struct st_ccb *ccb) in stex_ss_map_sg() argument
466 cmd = ccb->cmd; in stex_ss_map_sg()
472 ccb->sg_count = nseg; in stex_ss_map_sg()
490 static void stex_controller_info(struct st_hba *hba, struct st_ccb *ccb) in stex_controller_info() argument
496 scsi_sg_copy_to_buffer(ccb->cmd, p, count); in stex_controller_info()
514 scsi_sg_copy_from_buffer(ccb->cmd, p, count); in stex_controller_info()
522 hba->ccb[tag].req = req; in stex_send_cmd()
539 hba->ccb[tag].req = req; in stex_ss_send_cmd()
542 cmd = hba->ccb[tag].cmd; in stex_ss_send_cmd()
549 addr += (hba->ccb[tag].sg_count+4)/11; in stex_ss_send_cmd()
567 struct st_ccb *ccb; in return_abnormal_state() local
573 ccb = &hba->ccb[tag]; in return_abnormal_state()
574 if (ccb->req == NULL) in return_abnormal_state()
576 ccb->req = NULL; in return_abnormal_state()
577 if (ccb->cmd) { in return_abnormal_state()
578 scsi_dma_unmap(ccb->cmd); in return_abnormal_state()
579 ccb->cmd->result = status << 16; in return_abnormal_state()
580 ccb->cmd->scsi_done(ccb->cmd); in return_abnormal_state()
581 ccb->cmd = NULL; in return_abnormal_state()
715 hba->ccb[tag].cmd = cmd; in stex_queuecommand_lck()
716 hba->ccb[tag].sense_bufflen = SCSI_SENSE_BUFFERSIZE; in stex_queuecommand_lck()
717 hba->ccb[tag].sense_buffer = cmd->sense_buffer; in stex_queuecommand_lck()
719 if (!hba->map_sg(hba, req, &hba->ccb[tag])) { in stex_queuecommand_lck()
720 hba->ccb[tag].sg_count = 0; in stex_queuecommand_lck()
730 static void stex_scsi_done(struct st_ccb *ccb) in DEF_SCSI_QCMD()
732 struct scsi_cmnd *cmd = ccb->cmd; in DEF_SCSI_QCMD()
735 if (ccb->srb_status == SRB_STATUS_SUCCESS || ccb->srb_status == 0) { in DEF_SCSI_QCMD()
736 result = ccb->scsi_status; in DEF_SCSI_QCMD()
737 switch (ccb->scsi_status) { in DEF_SCSI_QCMD()
752 else if (ccb->srb_status & SRB_SEE_SENSE) in DEF_SCSI_QCMD()
754 else switch (ccb->srb_status) { in DEF_SCSI_QCMD()
772 static void stex_copy_data(struct st_ccb *ccb, in stex_copy_data() argument
776 if (ccb->sense_buffer != NULL) in stex_copy_data()
777 memcpy(ccb->sense_buffer, resp->variable, in stex_copy_data()
778 min(variable, ccb->sense_bufflen)); in stex_copy_data()
782 if (ccb->cmd == NULL) in stex_copy_data()
784 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable); in stex_copy_data()
788 struct st_ccb *ccb, struct status_msg *resp) in stex_check_cmd() argument
790 if (ccb->cmd->cmnd[0] == MGT_CMD && in stex_check_cmd()
792 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) - in stex_check_cmd()
800 struct st_ccb *ccb; in stex_mu_intr() local
840 ccb = &hba->ccb[tag]; in stex_mu_intr()
841 if (unlikely(hba->wait_ccb == ccb)) in stex_mu_intr()
843 if (unlikely(ccb->req == NULL)) { in stex_mu_intr()
857 stex_copy_data(ccb, resp, size); in stex_mu_intr()
860 ccb->req = NULL; in stex_mu_intr()
861 ccb->srb_status = resp->srb_status; in stex_mu_intr()
862 ccb->scsi_status = resp->scsi_status; in stex_mu_intr()
864 if (likely(ccb->cmd != NULL)) { in stex_mu_intr()
866 stex_check_cmd(hba, ccb, resp); in stex_mu_intr()
868 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD && in stex_mu_intr()
869 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER)) in stex_mu_intr()
870 stex_controller_info(hba, ccb); in stex_mu_intr()
872 scsi_dma_unmap(ccb->cmd); in stex_mu_intr()
873 stex_scsi_done(ccb); in stex_mu_intr()
875 ccb->req_type = 0; in stex_mu_intr()
914 struct st_ccb *ccb; in stex_ss_mu_intr() local
945 ccb = &hba->ccb[tag]; in stex_ss_mu_intr()
946 if (unlikely(hba->wait_ccb == ccb)) in stex_ss_mu_intr()
948 if (unlikely(ccb->req == NULL)) { in stex_ss_mu_intr()
954 ccb->req = NULL; in stex_ss_mu_intr()
956 ccb->srb_status = SRB_STATUS_SUCCESS; in stex_ss_mu_intr()
957 ccb->scsi_status = SAM_STAT_GOOD; in stex_ss_mu_intr()
959 ccb->srb_status = resp->srb_status; in stex_ss_mu_intr()
960 ccb->scsi_status = resp->scsi_status; in stex_ss_mu_intr()
970 stex_copy_data(ccb, resp, size); in stex_ss_mu_intr()
972 if (likely(ccb->cmd != NULL)) in stex_ss_mu_intr()
973 stex_check_cmd(hba, ccb, resp); in stex_ss_mu_intr()
976 if (likely(ccb->cmd != NULL)) { in stex_ss_mu_intr()
977 scsi_dma_unmap(ccb->cmd); in stex_ss_mu_intr()
978 stex_scsi_done(ccb); in stex_ss_mu_intr()
980 ccb->req_type = 0; in stex_ss_mu_intr()
1262 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd) in stex_abort()
1263 hba->wait_ccb = &hba->ccb[tag]; in stex_abort()
1760 hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL); in stex_probe()
1761 if (!hba->ccb) { in stex_probe()
1837 kfree(hba->ccb); in stex_probe()
1896 hba->ccb[tag].cmd = NULL; in stex_hba_stop()
1897 hba->ccb[tag].sg_count = 0; in stex_hba_stop()
1898 hba->ccb[tag].sense_bufflen = 0; in stex_hba_stop()
1899 hba->ccb[tag].sense_buffer = NULL; in stex_hba_stop()
1900 hba->ccb[tag].req_type = PASSTHRU_REQ_TYPE; in stex_hba_stop()
1904 while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) { in stex_hba_stop()
1906 hba->ccb[tag].req_type = 0; in stex_hba_stop()
1925 kfree(hba->ccb); in stex_hba_free()