Lines Matching defs:ccb
333 struct st_ccb *ccb;
430 struct req_msg *req, struct st_ccb *ccb)
438 cmd = ccb->cmd;
444 ccb->sg_count = nseg;
462 struct req_msg *req, struct st_ccb *ccb)
470 cmd = ccb->cmd;
476 ccb->sg_count = nseg;
494 static void stex_controller_info(struct st_hba *hba, struct st_ccb *ccb)
500 scsi_sg_copy_to_buffer(ccb->cmd, p, count);
518 scsi_sg_copy_from_buffer(ccb->cmd, p, count);
526 hba->ccb[tag].req = req;
543 hba->ccb[tag].req = req;
546 cmd = hba->ccb[tag].cmd;
553 addr += (hba->ccb[tag].sg_count+4)/11;
571 struct st_ccb *ccb;
577 ccb = &hba->ccb[tag];
578 if (ccb->req == NULL)
580 ccb->req = NULL;
581 if (ccb->cmd) {
582 scsi_dma_unmap(ccb->cmd);
583 ccb->cmd->result = status << 16;
584 ccb->cmd->scsi_done(ccb->cmd);
585 ccb->cmd = NULL;
719 hba->ccb[tag].cmd = cmd;
720 hba->ccb[tag].sense_bufflen = SCSI_SENSE_BUFFERSIZE;
721 hba->ccb[tag].sense_buffer = cmd->sense_buffer;
723 if (!hba->map_sg(hba, req, &hba->ccb[tag])) {
724 hba->ccb[tag].sg_count = 0;
734 static void stex_scsi_done(struct st_ccb *ccb)
736 struct scsi_cmnd *cmd = ccb->cmd;
739 if (ccb->srb_status == SRB_STATUS_SUCCESS || ccb->srb_status == 0) {
740 result = ccb->scsi_status;
741 switch (ccb->scsi_status) {
756 else if (ccb->srb_status & SRB_SEE_SENSE)
758 else switch (ccb->srb_status) {
776 static void stex_copy_data(struct st_ccb *ccb,
780 if (ccb->sense_buffer != NULL)
781 memcpy(ccb->sense_buffer, resp->variable,
782 min(variable, ccb->sense_bufflen));
786 if (ccb->cmd == NULL)
788 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable);
792 struct st_ccb *ccb, struct status_msg *resp)
794 if (ccb->cmd->cmnd[0] == MGT_CMD &&
796 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) -
804 struct st_ccb *ccb;
844 ccb = &hba->ccb[tag];
845 if (unlikely(hba->wait_ccb == ccb))
847 if (unlikely(ccb->req == NULL)) {
861 stex_copy_data(ccb, resp, size);
864 ccb->req = NULL;
865 ccb->srb_status = resp->srb_status;
866 ccb->scsi_status = resp->scsi_status;
868 if (likely(ccb->cmd != NULL)) {
870 stex_check_cmd(hba, ccb, resp);
872 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD &&
873 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER))
874 stex_controller_info(hba, ccb);
876 scsi_dma_unmap(ccb->cmd);
877 stex_scsi_done(ccb);
879 ccb->req_type = 0;
918 struct st_ccb *ccb;
949 ccb = &hba->ccb[tag];
950 if (unlikely(hba->wait_ccb == ccb))
952 if (unlikely(ccb->req == NULL)) {
958 ccb->req = NULL;
960 ccb->srb_status = SRB_STATUS_SUCCESS;
961 ccb->scsi_status = SAM_STAT_GOOD;
963 ccb->srb_status = resp->srb_status;
964 ccb->scsi_status = resp->scsi_status;
974 stex_copy_data(ccb, resp, size);
976 if (likely(ccb->cmd != NULL))
977 stex_check_cmd(hba, ccb, resp);
980 if (likely(ccb->cmd != NULL)) {
981 scsi_dma_unmap(ccb->cmd);
982 stex_scsi_done(ccb);
984 ccb->req_type = 0;
1266 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd)
1267 hba->wait_ccb = &hba->ccb[tag];
1764 hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL);
1765 if (!hba->ccb) {
1767 printk(KERN_ERR DRV_NAME "(%s): ccb alloc failed\n",
1841 kfree(hba->ccb);
1900 hba->ccb[tag].cmd = NULL;
1901 hba->ccb[tag].sg_count = 0;
1902 hba->ccb[tag].sense_bufflen = 0;
1903 hba->ccb[tag].sense_buffer = NULL;
1904 hba->ccb[tag].req_type = PASSTHRU_REQ_TYPE;
1908 while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) {
1910 hba->ccb[tag].req_type = 0;
1929 kfree(hba->ccb);