Lines Matching refs:scb

66 			       struct ccb_scsiio *csio, struct scb *scb);
311 * We have an scb which has been processed by the
316 ahc_done(struct ahc_softc *ahc, struct scb *scb)
320 CAM_DEBUG(scb->io_ctx->ccb_h.path, CAM_DEBUG_TRACE,
321 ("ahc_done - scb %d\n", scb->hscb->tag));
323 ccb = scb->io_ctx;
324 LIST_REMOVE(scb, pending_links);
325 if ((scb->flags & SCB_TIMEDOUT) != 0)
326 LIST_REMOVE(scb, timedout_links);
327 if ((scb->flags & SCB_UNTAGGEDQ) != 0) {
331 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
333 TAILQ_REMOVE(untagged_q, scb, links.tqe);
334 scb->flags &= ~SCB_UNTAGGEDQ;
338 callout_stop(&scb->io_timer);
347 bus_dmamap_sync(ahc->buffer_dmat, scb->dmamap, op);
348 bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
375 if (aic_get_transaction_status(scb) == CAM_REQ_INPROG)
378 ahc_free_scb(ahc, scb);
387 if ((scb->flags & SCB_RECOVERY_SCB) != 0) {
388 struct scb *list_scb;
392 if (aic_get_transaction_status(scb) == CAM_BDR_SENT
393 || aic_get_transaction_status(scb) == CAM_REQ_ABORTED)
394 aic_set_transaction_status(scb, CAM_CMD_TIMEOUT);
406 aic_get_timeout(scb));
409 ahc_print_path(ahc, scb);
416 if (aic_get_transaction_status(scb) == CAM_REQ_INPROG) {
418 } else if ((scb->flags & SCB_SENSE) != 0) {
431 ahc_get_sense_buf(ahc, scb),
432 (aic_le32toh(scb->sg_list->len) & AHC_SG_LEN_MASK)
434 scb->io_ctx->ccb_h.status |= CAM_AUTOSNS_VALID;
437 ahc_free_scb(ahc, scb);
500 struct scb *scb;
512 * get an scb to use.
514 if ((scb = ahc_get_scb(ahc)) == NULL) {
523 hscb = scb->hscb;
526 ("start scb(%p)\n", scb));
527 scb->io_ctx = ccb;
531 ccb->ccb_h.ccb_scb_ptr = scb;
534 * Put all the arguments for the xfer in the scb
541 scb->flags |= SCB_DEVICE_RESET;
543 ahc_execute_scb(scb, NULL, 0, 0);
550 scb->flags |= SCB_TARGET_IMMEDIATE;
552 scb->flags |= SCB_TARGET_SCB;
567 ahc_setup_data(ahc, sim, &ccb->csio, scb);
931 struct scb *scb;
938 scb = (struct scb *)arg;
939 ccb = scb->io_ctx;
940 ahc = scb->ahc_softc;
944 aic_set_transaction_status(scb, CAM_REQ_TOO_BIG);
946 aic_set_transaction_status(scb, CAM_REQ_CMP_ERR);
948 bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
949 ahc_free_scb(ahc, scb);
961 sg = scb->sg_list;
979 scb->hscb->sgptr = aic_htole32(scb->sg_list_phys|SG_FULL_RESID);
986 bus_dmamap_sync(ahc->buffer_dmat, scb->dmamap, op);
991 tdata = &scb->hscb->shared_data.tdata;
1018 aic_set_transaction_status(scb,
1021 scb->dmamap);
1022 ahc_free_scb(ahc, scb);
1035 scb->hscb->dataptr = scb->sg_list->addr;
1036 scb->hscb->datacnt = scb->sg_list->len;
1038 scb->hscb->sgptr = aic_htole32(SG_LIST_NULL);
1039 scb->hscb->dataptr = 0;
1040 scb->hscb->datacnt = 0;
1043 scb->sg_count = nsegments;
1049 if (aic_get_transaction_status(scb) != CAM_REQ_INPROG) {
1051 bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
1052 ahc_free_scb(ahc, scb);
1057 tinfo = ahc_fetch_transinfo(ahc, SCSIID_CHANNEL(ahc, scb->hscb->scsiid),
1058 SCSIID_OUR_ID(scb->hscb->scsiid),
1059 SCSIID_TARGET(ahc, scb->hscb->scsiid),
1062 mask = SCB_GET_TARGET_MASK(ahc, scb);
1063 scb->hscb->scsirate = tinfo->scsirate;
1064 scb->hscb->scsioffset = tinfo->curr.offset;
1066 scb->hscb->control |= ULTRAENB;
1070 scb->hscb->control |= DISCENB;
1076 scb->flags |= SCB_NEGOTIATE;
1077 scb->hscb->control |= MK_MESSAGE;
1079 scb->flags |= SCB_AUTO_NEGOTIATE;
1080 scb->hscb->control |= MK_MESSAGE;
1083 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links);
1093 if ((scb->hscb->control & (TARGET_SCB|TAG_ENB)) == 0
1098 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
1100 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe);
1101 scb->flags |= SCB_UNTAGGEDQ;
1102 if (TAILQ_FIRST(untagged_q) != scb) {
1106 scb->flags |= SCB_ACTIVE;
1111 aic_scb_timer_start(scb);
1113 if ((scb->flags & SCB_TARGET_IMMEDIATE) != 0) {
1115 ahc->scb_data->scbindex[scb->hscb->tag] = scb;
1118 ahc_outb(ahc, SCBPTR, scb->hscb->tag);
1119 ahc_outb(ahc, TARG_IMMEDIATE_SCB, scb->hscb->tag);
1122 ahc_queue_scb(ahc, scb);
1137 struct ccb_scsiio *csio, struct scb *scb)
1143 hscb = scb->hscb;
1154 aic_set_transaction_status(scb,
1156 ahc_free_scb(ahc, scb);
1164 scb->flags |= SCB_CDB32_PTR;
1174 scb->flags |= SCB_CDB32_PTR;
1184 scb->dmamap,
1187 scb,
1197 scb->io_ctx->ccb_h.status |= CAM_RELEASE_SIMQ;