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