Lines Matching refs:ccb

333 	struct st_ccb *ccb;  member
427 struct req_msg *req, struct st_ccb *ccb) in stex_map_sg() argument
435 cmd = ccb->cmd; in stex_map_sg()
441 ccb->sg_count = nseg; in stex_map_sg()
459 struct req_msg *req, struct st_ccb *ccb) in stex_ss_map_sg() argument
467 cmd = ccb->cmd; in stex_ss_map_sg()
473 ccb->sg_count = nseg; in stex_ss_map_sg()
491 static void stex_controller_info(struct st_hba *hba, struct st_ccb *ccb) in stex_controller_info() argument
497 scsi_sg_copy_to_buffer(ccb->cmd, p, count); in stex_controller_info()
515 scsi_sg_copy_from_buffer(ccb->cmd, p, count); in stex_controller_info()
523 hba->ccb[tag].req = req; in stex_send_cmd()
540 hba->ccb[tag].req = req; in stex_ss_send_cmd()
543 cmd = hba->ccb[tag].cmd; in stex_ss_send_cmd()
550 addr += (hba->ccb[tag].sg_count+4)/11; in stex_ss_send_cmd()
568 struct st_ccb *ccb; in return_abnormal_state() local
574 ccb = &hba->ccb[tag]; in return_abnormal_state()
575 if (ccb->req == NULL) in return_abnormal_state()
577 ccb->req = NULL; in return_abnormal_state()
578 if (ccb->cmd) { in return_abnormal_state()
579 scsi_dma_unmap(ccb->cmd); in return_abnormal_state()
580 ccb->cmd->result = status << 16; in return_abnormal_state()
581 scsi_done(ccb->cmd); in return_abnormal_state()
582 ccb->cmd = NULL; in return_abnormal_state()
716 hba->ccb[tag].cmd = cmd; in stex_queuecommand_lck()
717 hba->ccb[tag].sense_bufflen = SCSI_SENSE_BUFFERSIZE; in stex_queuecommand_lck()
718 hba->ccb[tag].sense_buffer = cmd->sense_buffer; in stex_queuecommand_lck()
720 if (!hba->map_sg(hba, req, &hba->ccb[tag])) { in stex_queuecommand_lck()
721 hba->ccb[tag].sg_count = 0; in stex_queuecommand_lck()
731 static void stex_scsi_done(struct st_ccb *ccb) in DEF_SCSI_QCMD()
733 struct scsi_cmnd *cmd = ccb->cmd; in DEF_SCSI_QCMD()
736 if (ccb->srb_status == SRB_STATUS_SUCCESS || ccb->srb_status == 0) { in DEF_SCSI_QCMD()
737 result = ccb->scsi_status; in DEF_SCSI_QCMD()
738 switch (ccb->scsi_status) { in DEF_SCSI_QCMD()
753 else if (ccb->srb_status & SRB_SEE_SENSE) in DEF_SCSI_QCMD()
755 else switch (ccb->srb_status) { in DEF_SCSI_QCMD()
773 static void stex_copy_data(struct st_ccb *ccb, in stex_copy_data() argument
777 if (ccb->sense_buffer != NULL) in stex_copy_data()
778 memcpy(ccb->sense_buffer, resp->variable, in stex_copy_data()
779 min(variable, ccb->sense_bufflen)); in stex_copy_data()
783 if (ccb->cmd == NULL) in stex_copy_data()
785 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable); in stex_copy_data()
789 struct st_ccb *ccb, struct status_msg *resp) in stex_check_cmd() argument
791 if (ccb->cmd->cmnd[0] == MGT_CMD && in stex_check_cmd()
793 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) - in stex_check_cmd()
801 struct st_ccb *ccb; in stex_mu_intr() local
841 ccb = &hba->ccb[tag]; in stex_mu_intr()
842 if (unlikely(hba->wait_ccb == ccb)) in stex_mu_intr()
844 if (unlikely(ccb->req == NULL)) { in stex_mu_intr()
858 stex_copy_data(ccb, resp, size); in stex_mu_intr()
861 ccb->req = NULL; in stex_mu_intr()
862 ccb->srb_status = resp->srb_status; in stex_mu_intr()
863 ccb->scsi_status = resp->scsi_status; in stex_mu_intr()
865 if (likely(ccb->cmd != NULL)) { in stex_mu_intr()
867 stex_check_cmd(hba, ccb, resp); in stex_mu_intr()
869 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD && in stex_mu_intr()
870 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER)) in stex_mu_intr()
871 stex_controller_info(hba, ccb); in stex_mu_intr()
873 scsi_dma_unmap(ccb->cmd); in stex_mu_intr()
874 stex_scsi_done(ccb); in stex_mu_intr()
876 ccb->req_type = 0; in stex_mu_intr()
915 struct st_ccb *ccb; in stex_ss_mu_intr() local
946 ccb = &hba->ccb[tag]; in stex_ss_mu_intr()
947 if (unlikely(hba->wait_ccb == ccb)) in stex_ss_mu_intr()
949 if (unlikely(ccb->req == NULL)) { in stex_ss_mu_intr()
955 ccb->req = NULL; in stex_ss_mu_intr()
957 ccb->srb_status = SRB_STATUS_SUCCESS; in stex_ss_mu_intr()
958 ccb->scsi_status = SAM_STAT_GOOD; in stex_ss_mu_intr()
960 ccb->srb_status = resp->srb_status; in stex_ss_mu_intr()
961 ccb->scsi_status = resp->scsi_status; in stex_ss_mu_intr()
971 stex_copy_data(ccb, resp, size); in stex_ss_mu_intr()
973 if (likely(ccb->cmd != NULL)) in stex_ss_mu_intr()
974 stex_check_cmd(hba, ccb, resp); in stex_ss_mu_intr()
977 if (likely(ccb->cmd != NULL)) { in stex_ss_mu_intr()
978 scsi_dma_unmap(ccb->cmd); in stex_ss_mu_intr()
979 stex_scsi_done(ccb); in stex_ss_mu_intr()
981 ccb->req_type = 0; in stex_ss_mu_intr()
1263 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd) in stex_abort()
1264 hba->wait_ccb = &hba->ccb[tag]; in stex_abort()
1761 hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL); in stex_probe()
1762 if (!hba->ccb) { in stex_probe()
1838 kfree(hba->ccb); in stex_probe()
1897 hba->ccb[tag].cmd = NULL; in stex_hba_stop()
1898 hba->ccb[tag].sg_count = 0; in stex_hba_stop()
1899 hba->ccb[tag].sense_bufflen = 0; in stex_hba_stop()
1900 hba->ccb[tag].sense_buffer = NULL; in stex_hba_stop()
1901 hba->ccb[tag].req_type = PASSTHRU_REQ_TYPE; in stex_hba_stop()
1905 while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) { in stex_hba_stop()
1907 hba->ccb[tag].req_type = 0; in stex_hba_stop()
1926 kfree(hba->ccb); in stex_hba_free()