Home | History | Annotate | Download | only in ic

Lines Matching defs:scb

61 			       struct scb *scb);
64 static void ahd_set_recoveryscb(struct ahd_softc *ahd, struct scb *scb);
195 * We have an scb which has been processed by the
199 ahd_done(struct ahd_softc *ahd, struct scb *scb)
205 LIST_REMOVE(scb, pending_links);
207 xs = scb->xs;
210 callout_stop(&scb->xs->xs_callout);
220 bus_dmamap_sync(ahd->parent_dmat, scb->dmamap, 0,
221 scb->dmamap->dm_mapsize, op);
222 bus_dmamap_unload(ahd->parent_dmat, scb->dmamap);
226 * If the recovery SCB completes, we have to be
229 if ((scb->flags & SCB_RECOVERY_SCB) != 0) {
230 struct scb *list_scb;
249 if (ahd_get_transaction_status(scb) != XS_NOERROR)
250 ahd_set_transaction_status(scb, XS_TIMEOUT);
260 ahd_set_transaction_status(scb, XS_BUSY);
261 printf("%s: drive (ID %d, LUN %d) queue full (SCB 0x%x)\n",
262 ahd_name(ahd), SCB_GET_TARGET(ahd,scb), SCB_GET_LUN(scb), SCB_GET_TAG(scb));
263 } else if ((scb->flags & SCB_SENSE) != 0) {
276 memcpy(&xs->sense.scsi_sense, ahd_get_sense_buf(ahd, scb),
279 ahd_set_transaction_status(scb, XS_SENSE);
280 } else if ((scb->flags & SCB_PKT_SENSE) != 0) {
289 siu = (struct scsi_status_iu_header *)scb->sense_data;
294 scb->sense_data + SIU_SENSE_OFFSET(siu), sense_len);
302 ahd_set_transaction_status(scb, XS_SENSE);
305 if (scb->flags & SCB_FREEZE_QUEUE) {
307 scb->flags &= ~SCB_FREEZE_QUEUE;
310 if (scb->flags & SCB_REQUEUE)
311 ahd_set_transaction_status(scb, XS_REQUEUE);
314 ahd_free_scb(ahd, scb);
335 struct scb *scb;
353 * get an scb to use.
366 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
374 hscb = scb->hscb;
376 SC_DEBUG(periph, SCSIPI_DB3, ("start scb(%p)\n", scb));
377 scb->xs = xs;
380 * Put all the arguments for the xfer in the scb
387 scb->flags |= SCB_DEVICE_RESET;
390 ahd_execute_scb(scb, NULL, 0);
395 ahd_setup_data(ahd, xs, scb);
530 struct scb *scb;
538 scb = arg;
539 xs = scb->xs;
546 scb->sg_count = 0;
552 ahd_setup_data_scb(ahd, scb);
555 for (i = nsegments, sg = scb->sg_list; i > 0; i--) {
557 sg = ahd_sg_setup(ahd, scb, sg, dm_segs->ds_addr,
568 bus_dmamap_sync(ahd->parent_dmat, scb->dmamap, 0,
569 scb->dmamap->dm_mapsize, op);
575 * Last time we need to check if this SCB needs to
578 if (ahd_get_scsi_status(scb) == XS_STS_DONE) {
581 scb->dmamap);
582 ahd_free_scb(ahd, scb);
587 tinfo = ahd_fetch_transinfo(ahd, SCSIID_CHANNEL(ahd, scb->hscb->scsiid),
588 SCSIID_OUR_ID(scb->hscb->scsiid),
589 SCSIID_TARGET(ahd, scb->hscb->scsiid),
592 mask = SCB_GET_TARGET_MASK(ahd, scb);
595 scb->hscb->control |= DISCENB;
598 scb->hscb->control |= xs->xs_tag_type|TAG_ENB;
601 scb->flags |= SCB_PACKETIZED;
602 if (scb->hscb->task_management != 0)
603 scb->hscb->control &= ~MK_MESSAGE;
611 scb->flags |= SCB_NEGOTIATE;
612 scb
616 scb->flags |= SCB_AUTO_NEGOTIATE;
617 scb->hscb->control |= MK_MESSAGE;
620 LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links);
622 scb->flags |= SCB_ACTIVE;
625 callout_reset(&scb->xs->xs_callout, xs->timeout > 1000000 ?
627 ahd_timeout, scb);
630 if ((scb->flags & SCB_TARGET_IMMEDIATE) != 0) {
631 /* Define a mapping from our tag to the SCB. */
632 ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb;
634 ahd_set_scbptr(ahd, SCB_GET_TAG(scb));
638 ahd_queue_scb(ahd, scb);
653 ahd_timeout(scb);
683 struct scb *scb)
687 hscb = scb->hscb;
698 ahd_set_transaction_status(scb,
702 ahd_free_scb(ahd, scb);
713 scb->dmamap, xs->data,
730 ahd_execute_scb(scb,
731 scb->dmamap->dm_segs,
732 scb->dmamap->dm_nsegs);
734 ahd_execute_scb(scb, NULL, 0);
741 struct scb *scb;
745 scb = arg;
746 ahd = scb->ahd_softc;
762 if ((scb->flags & SCB_ACTIVE) == 0) {
764 printf("%s: Timedout SCB already complete. "
771 ahd_print_path(ahd, scb);
772 printf("SCB 0x%x - timed out\n", SCB_GET_TAG(scb));