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()
714 hba->ccb[tag].cmd = cmd; in stex_queuecommand_lck()
715 hba->ccb[tag].sense_bufflen = SCSI_SENSE_BUFFERSIZE; in stex_queuecommand_lck()
716 hba->ccb[tag].sense_buffer = cmd->sense_buffer; in stex_queuecommand_lck()
718 if (!hba->map_sg(hba, req, &hba->ccb[tag])) { in stex_queuecommand_lck()
719 hba->ccb[tag].sg_count = 0; in stex_queuecommand_lck()
729 static void stex_scsi_done(struct st_ccb *ccb) in DEF_SCSI_QCMD()
731 struct scsi_cmnd *cmd = ccb->cmd; in DEF_SCSI_QCMD()
734 if (ccb->srb_status == SRB_STATUS_SUCCESS || ccb->srb_status == 0) { in DEF_SCSI_QCMD()
735 result = ccb->scsi_status; in DEF_SCSI_QCMD()
736 switch (ccb->scsi_status) { in DEF_SCSI_QCMD()
751 else if (ccb->srb_status & SRB_SEE_SENSE) in DEF_SCSI_QCMD()
753 else switch (ccb->srb_status) { in DEF_SCSI_QCMD()
771 static void stex_copy_data(struct st_ccb *ccb, in stex_copy_data() argument
775 if (ccb->sense_buffer != NULL) in stex_copy_data()
776 memcpy(ccb->sense_buffer, resp->variable, in stex_copy_data()
777 min(variable, ccb->sense_bufflen)); in stex_copy_data()
781 if (ccb->cmd == NULL) in stex_copy_data()
783 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable); in stex_copy_data()
787 struct st_ccb *ccb, struct status_msg *resp) in stex_check_cmd() argument
789 if (ccb->cmd->cmnd[0] == MGT_CMD && in stex_check_cmd()
791 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) - in stex_check_cmd()
799 struct st_ccb *ccb; in stex_mu_intr() local
839 ccb = &hba->ccb[tag]; in stex_mu_intr()
840 if (unlikely(hba->wait_ccb == ccb)) in stex_mu_intr()
842 if (unlikely(ccb->req == NULL)) { in stex_mu_intr()
856 stex_copy_data(ccb, resp, size); in stex_mu_intr()
859 ccb->req = NULL; in stex_mu_intr()
860 ccb->srb_status = resp->srb_status; in stex_mu_intr()
861 ccb->scsi_status = resp->scsi_status; in stex_mu_intr()
863 if (likely(ccb->cmd != NULL)) { in stex_mu_intr()
865 stex_check_cmd(hba, ccb, resp); in stex_mu_intr()
867 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD && in stex_mu_intr()
868 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER)) in stex_mu_intr()
869 stex_controller_info(hba, ccb); in stex_mu_intr()
871 scsi_dma_unmap(ccb->cmd); in stex_mu_intr()
872 stex_scsi_done(ccb); in stex_mu_intr()
874 ccb->req_type = 0; in stex_mu_intr()
913 struct st_ccb *ccb; in stex_ss_mu_intr() local
944 ccb = &hba->ccb[tag]; in stex_ss_mu_intr()
945 if (unlikely(hba->wait_ccb == ccb)) in stex_ss_mu_intr()
947 if (unlikely(ccb->req == NULL)) { in stex_ss_mu_intr()
953 ccb->req = NULL; in stex_ss_mu_intr()
955 ccb->srb_status = SRB_STATUS_SUCCESS; in stex_ss_mu_intr()
956 ccb->scsi_status = SAM_STAT_GOOD; in stex_ss_mu_intr()
958 ccb->srb_status = resp->srb_status; in stex_ss_mu_intr()
959 ccb->scsi_status = resp->scsi_status; in stex_ss_mu_intr()
969 stex_copy_data(ccb, resp, size); in stex_ss_mu_intr()
971 if (likely(ccb->cmd != NULL)) in stex_ss_mu_intr()
972 stex_check_cmd(hba, ccb, resp); in stex_ss_mu_intr()
975 if (likely(ccb->cmd != NULL)) { in stex_ss_mu_intr()
976 scsi_dma_unmap(ccb->cmd); in stex_ss_mu_intr()
977 stex_scsi_done(ccb); in stex_ss_mu_intr()
979 ccb->req_type = 0; in stex_ss_mu_intr()
1261 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd) in stex_abort()
1262 hba->wait_ccb = &hba->ccb[tag]; in stex_abort()
1759 hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL); in stex_probe()
1760 if (!hba->ccb) { in stex_probe()
1836 kfree(hba->ccb); in stex_probe()
1895 hba->ccb[tag].cmd = NULL; in stex_hba_stop()
1896 hba->ccb[tag].sg_count = 0; in stex_hba_stop()
1897 hba->ccb[tag].sense_bufflen = 0; in stex_hba_stop()
1898 hba->ccb[tag].sense_buffer = NULL; in stex_hba_stop()
1899 hba->ccb[tag].req_type = PASSTHRU_REQ_TYPE; in stex_hba_stop()
1903 while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) { in stex_hba_stop()
1905 hba->ccb[tag].req_type = 0; in stex_hba_stop()
1924 kfree(hba->ccb); in stex_hba_free()