Lines Matching full:scb
61 struct ccb_scsiio *csio, struct scb *scb);
305 ahc_sync_ccb(struct ahc_softc *ahc, struct scb *scb, union ccb *ccb, bool post)
320 bus_dmamap_sync(ahc->buffer_dmat, scb->dmamap, op);
324 * We have an scb which has been processed by the
329 ahc_done(struct ahc_softc *ahc, struct scb *scb)
333 CAM_DEBUG(scb->io_ctx->ccb_h.path, CAM_DEBUG_TRACE,
334 ("ahc_done - scb %d\n", scb->hscb->tag));
336 ccb = scb->io_ctx;
337 LIST_REMOVE(scb, pending_links);
338 if ((scb->flags & SCB_TIMEDOUT) != 0)
339 LIST_REMOVE(scb, timedout_links);
340 if ((scb->flags & SCB_UNTAGGEDQ) != 0) {
344 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
346 TAILQ_REMOVE(untagged_q, scb, links.tqe);
347 scb->flags &= ~SCB_UNTAGGEDQ;
351 callout_stop(&scb->io_timer);
354 ahc_sync_ccb(ahc, scb, ccb, true);
355 bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
381 if (aic_get_transaction_status(scb) == CAM_REQ_INPROG)
384 ahc_free_scb(ahc, scb);
390 * If the recovery SCB completes, we have to be
393 if ((scb->flags & SCB_RECOVERY_SCB) != 0) {
394 struct scb *list_scb;
398 if (aic_get_transaction_status(scb) == CAM_BDR_SENT
399 || aic_get_transaction_status(scb) == CAM_REQ_ABORTED)
400 aic_set_transaction_status(scb, CAM_CMD_TIMEOUT);
411 aic_get_timeout(scb));
414 ahc_print_path(ahc, scb);
421 if (aic_get_transaction_status(scb) == CAM_REQ_INPROG) {
423 } else if ((scb->flags & SCB_SENSE) != 0) {
436 ahc_get_sense_buf(ahc, scb),
437 (aic_le32toh(scb->sg_list->len) & AHC_SG_LEN_MASK)
439 scb->io_ctx->ccb_h.status |= CAM_AUTOSNS_VALID;
442 ahc_free_scb(ahc, scb);
504 struct scb *scb;
516 * get an scb to use.
518 if ((scb = ahc_get_scb(ahc)) == NULL) {
526 hscb = scb->hscb;
529 ("start scb(%p)\n", scb));
530 scb->io_ctx = ccb;
532 * So we can find the SCB when an abort is requested
534 ccb->ccb_h.ccb_scb_ptr = scb;
537 * Put all the arguments for the xfer in the scb
544 scb->flags |= SCB_DEVICE_RESET;
546 ahc_execute_scb(scb, NULL, 0, 0);
553 scb->flags |= SCB_TARGET_IMMEDIATE;
555 scb->flags |= SCB_TARGET_SCB;
570 ahc_setup_data(ahc, sim, &ccb->csio, scb);
933 struct scb *scb;
940 scb = (struct scb *)arg;
941 ccb = scb->io_ctx;
942 ahc = scb->ahc_softc;
946 aic_set_transaction_status(scb, CAM_REQ_TOO_BIG);
948 aic_set_transaction_status(scb, CAM_REQ_CMP_ERR);
950 bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
951 ahc_free_scb(ahc, scb);
962 sg = scb->sg_list;
980 scb->hscb->sgptr = aic_htole32(scb->sg_list_phys|SG_FULL_RESID);
982 ahc_sync_ccb(ahc, scb, ccb, false);
987 tdata = &scb->hscb->shared_data.tdata;
1012 aic_set_transaction_status(scb,
1015 scb->dmamap);
1016 ahc_free_scb(ahc, scb);
1029 scb->hscb->dataptr = scb->sg_list->addr;
1030 scb->hscb->datacnt = scb->sg_list->len;
1032 scb->hscb->sgptr = aic_htole32(SG_LIST_NULL);
1033 scb->hscb->dataptr = 0;
1034 scb->hscb->datacnt = 0;
1037 scb->sg_count = nsegments;
1040 * Last time we need to check if this SCB needs to
1043 if (aic_get_transaction_status(scb) != CAM_REQ_INPROG) {
1045 bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
1046 ahc_free_scb(ahc, scb);
1051 tinfo = ahc_fetch_transinfo(ahc, SCSIID_CHANNEL(ahc, scb->hscb->scsiid),
1052 SCSIID_OUR_ID(scb->hscb->scsiid),
1053 SCSIID_TARGET(ahc, scb->hscb->scsiid),
1056 mask = SCB_GET_TARGET_MASK(ahc, scb);
1057 scb->hscb->scsirate = tinfo->scsirate;
1058 scb->hscb->scsioffset = tinfo->curr.offset;
1060 scb->hscb->control |= ULTRAENB;
1064 scb->hscb->control |= DISCENB;
1070 scb->flags |= SCB_NEGOTIATE;
1071 scb->hscb->control |= MK_MESSAGE;
1073 scb->flags |= SCB_AUTO_NEGOTIATE;
1074 scb->hscb->control |= MK_MESSAGE;
1077 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links);
1085 * table in SCB space.
1087 if ((scb->hscb->control & (TARGET_SCB|TAG_ENB)) == 0
1092 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
1094 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe);
1095 scb->flags |= SCB_UNTAGGEDQ;
1096 if (TAILQ_FIRST(untagged_q) != scb) {
1100 scb->flags |= SCB_ACTIVE;
1105 aic_scb_timer_start(scb);
1107 if ((scb->flags & SCB_TARGET_IMMEDIATE) != 0) {
1108 /* Define a mapping from our tag to the SCB. */
1109 ahc->scb_data->scbindex[scb->hscb->tag] = scb;
1112 ahc_outb(ahc, SCBPTR, scb->hscb->tag);
1113 ahc_outb(ahc, TARG_IMMEDIATE_SCB, scb->hscb->tag);
1116 ahc_queue_scb(ahc, scb);
1131 struct ccb_scsiio *csio, struct scb *scb)
1137 hscb = scb->hscb;
1147 aic_set_transaction_status(scb,
1149 ahc_free_scb(ahc, scb);
1157 scb->flags |= SCB_CDB32_PTR;
1167 scb->flags |= SCB_CDB32_PTR;
1177 scb->dmamap,
1180 scb,
1190 scb->io_ctx->ccb_h.status |= CAM_RELEASE_SIMQ;