Home | History | Annotate | Download | only in ic

Lines Matching defs:scb

58 			       struct scsipi_xfer *xs, struct scb *scb);
59 static void ahc_set_recoveryscb(struct ahc_softc *ahc, struct scb *scb);
194 * We have an scb which has been processed by the
199 ahc_done(struct ahc_softc *ahc, struct scb *scb)
205 xs = scb->xs;
207 LIST_REMOVE(scb, pending_links);
208 if ((scb->flags & SCB_UNTAGGEDQ) != 0) {
212 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
214 TAILQ_REMOVE(untagged_q, scb, links.tqe);
215 scb->flags &= ~SCB_UNTAGGEDQ;
219 callout_stop(&scb->xs->xs_callout);
228 bus_dmamap_sync(ahc->parent_dmat, scb->dmamap, 0,
229 scb->dmamap->dm_mapsize, op);
230 bus_dmamap_unload(ahc->parent_dmat, scb->dmamap);
234 * If the recovery SCB completes, we have to be
237 if ((scb->flags & SCB_RECOVERY_SCB) != 0) {
238 struct scb *list_scb;
255 if (ahc_get_transaction_status(scb) == CAM_BDR_SENT
256 || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED)
257 ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT);
270 } else if ((scb->flags & SCB_SENSE) != 0) {
283 ahc_get_sense_buf(ahc, scb),
287 if (scb->flags & SCB_FREEZE_QUEUE) {
289 scb->flags &= ~SCB_FREEZE_QUEUE;
293 ahc_free_scb(ahc, scb);
339 struct scb *scb;
354 * get an scb to use.
357 if ((scb = ahc_get_scb(ahc)) == NULL) {
365 hscb = scb->hscb;
367 SC_DEBUG(periph, SCSIPI_DB3, ("start scb(%p)\n", scb));
368 scb->xs = xs;
371 * Put all the arguments for the xfer in the scb
378 scb->flags |= SCB_DEVICE_RESET;
380 ahc_execute_scb(scb, NULL, 0);
383 ahc_setup_data(ahc, xs, scb);
520 struct scb *scb;
529 scb = (struct scb *)arg;
530 xs = scb->xs;
545 sg = scb->sg_list;
563 scb->hscb->sgptr = ahc_htole32(scb->sg_list_phys|SG_FULL_RESID);
570 bus_dmamap_sync(ahc->parent_dmat, scb->dmamap, 0,
571 scb->dmamap->dm_mapsize, op);
577 scb->hscb->dataptr = scb->sg_list->addr;
578 scb->hscb->datacnt = scb->sg_list->len;
580 scb->hscb->sgptr = ahc_htole32(SG_LIST_NULL);
581 scb->hscb->dataptr = 0;
582 scb->hscb->datacnt = 0;
585 scb->sg_count = nsegments;
590 * Last time we need to check if this SCB needs to
595 bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
596 ahc_free_scb(ahc, scb);
603 SCSIID_OUR_ID(scb->hscb->scsiid),
604 SCSIID_TARGET(ahc, scb->hscb->scsiid),
607 mask = SCB_GET_TARGET_MASK(ahc, scb);
608 scb
609 scb->hscb->scsioffset = tinfo->curr.offset;
612 scb->hscb->control |= ULTRAENB;
615 scb->hscb->control |= DISCENB;
618 scb->hscb->control |= xs->xs_tag_type;
624 scb->flags |= SCB_NEGOTIATE;
625 scb->hscb->control |= MK_MESSAGE;
629 scb->flags |= SCB_AUTO_NEGOTIATE;
630 scb->hscb->control |= MK_MESSAGE;
633 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links);
636 callout_reset(&scb->xs->xs_callout, xs->timeout > 1000000 ?
638 ahc_timeout, scb);
645 * table in SCB space.
647 if ((scb->hscb->control & (TARGET_SCB|TAG_ENB)) == 0
652 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
654 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe);
655 scb->flags |= SCB_UNTAGGEDQ;
656 if (TAILQ_FIRST(untagged_q) != scb) {
661 scb->flags |= SCB_ACTIVE;
663 if ((scb->flags & SCB_TARGET_IMMEDIATE) != 0) {
664 /* Define a mapping from our tag to the SCB. */
665 ahc->scb_data->scbindex[scb->hscb->tag] = scb;
668 ahc_outb(ahc, SCBPTR, scb->hscb->tag);
669 ahc_outb(ahc, TARG_IMMEDIATE_SCB, scb->hscb->tag);
672 ahc_queue_scb(ahc, scb);
689 ahc_timeout(scb);
718 struct scb *scb)
722 hscb = scb->hscb;
729 ahc_set_transaction_status(scb, CAM_REQ_INVALID);
731 ahc_free_scb(ahc, scb);
739 scb->flags |= SCB_CDB32_PTR;
749 scb->dmamap, xs->data,
766 ahc_execute_scb(scb,
767 scb->dmamap->dm_segs,
768 scb->dmamap->dm_nsegs);
770 ahc_execute_scb(scb, NULL, 0);
775 ahc_set_recoveryscb(struct ahc_softc *ahc, struct scb *scb) {
777 if ((scb->flags & SCB_RECOVERY_SCB) == 0) {
778 struct scb *list_scb;
780 scb->flags |= SCB_RECOVERY_SCB;
805 struct scb *scb;
815 scb = arg;
816 ahc = scb->ahc_softc;
822 if ((scb->flags & SCB_ACTIVE) == 0) {
824 printf("%s: Timedout SCB already complete. "
831 target = SCB_GET_TARGET(ahc, scb);
832 channel = SCB_GET_CHANNEL(ahc, scb);
833 lun = SCB_GET_LUN(scb);
835 ahc_print_path(ahc, scb);
836 printf("SCB 0x%x - timed out\n", scb->hscb->tag);
839 if (scb->sg_count > 0) {
840 for (i = 0; i < scb->sg_count; i++) {
843 scb->sg_list[i].addr,
844 scb->sg_list[i].len & AHC_SG_LEN_MASK);
847 if (scb->flags & (SCB_DEVICE_RESET|SCB_ABORT)) {
853 ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT);
888 struct scb *active_scb;
891 * If the active SCB is not us, assume that
892 * the active SCB has a longer timeout than
893 * the timedout SCB, and wait for the active
894 * SCB to timeout.
897 if (active_scb != scb) {
900 ahc_print_path(ahc, scb);
901 printf("Other SCB Timeout%s",
902 (scb->flags & SCB_OTHERTCL_TIMEOUT) != 0
904 scb->flags |= SCB_OTHERTCL_TIMEOUT;
906 scb->xs->timeout);
907 callout_reset(&scb->xs->xs_callout,
911 ahc_timeout, scb);
918 if ((scb->flags & SCB_TARGET_SCB) != 0) {
924 ahc_abort_scbs(ahc, SCB_GET_TARGET(ahc, scb),
925 SCB_GET_CHANNEL(ahc, scb),
926 SCB_GET_LUN(scb),
927 scb->hscb->tag,
950 if ((scb->flags & SCB_TARGET_SCB) != 0)
951 panic("Timed-out target SCB but bus idle");
955 /* XXX What happened to the SCB? */
965 scb->hscb->tag, ROLE_INITIATOR,
974 ahc_set_recoveryscb(ahc, scb);
976 * Actually re-queue this SCB in an attempt
986 * that our SCB control byte matches the
991 scb->hscb->control |= MK_MESSAGE|DISCONNECTED;
992 scb->flags |= SCB_DEVICE_RESET;
995 * Remove any cached copy of this SCB in the
997 * queuing of our abort SCB. We use the
998 * same element in the SCB, SCB_NEXT, for
1002 lun, scb->hscb->tag,
1009 * never re-reference the in-core SCB.
1012 * the card's copy of the SCB.
1015 ahc_outb(ahc, SCBPTR, scb->hscb->tag);
1023 * so we are the next SCB for this target
1027 SCB_GET_TARGET(ahc, scb),
1028 channel, SCB_GET_LUN(scb),
1033 ahc_print_path(ahc, scb);
1034 printf("Queuing a BDR SCB\n");
1035 ahc_qinfifo_requeue_tail(ahc, scb);
1037 callout_reset(&scb->xs->xs_callout, 2 * hz,
1038 ahc_timeout, scb);
1043 ahc_set_recoveryscb(ahc, scb);
1044 ahc_print_path(ahc, scb);
1045 printf("SCB %d: Immediate reset. "
1046 "Flags = 0x%x\n", scb->hscb->tag,
1047 scb->flags);