Lines Matching refs:ccb

348 	struct xbf_ccb *ccb, *nccb;  in xbf_intr()  local
370 TAILQ_FOREACH_SAFE(ccb, &cq, ccb_link, nccb) { in xbf_intr()
371 TAILQ_REMOVE(&cq, ccb, ccb_link); in xbf_intr()
372 xbf_reclaim_cmd(ccb->ccb_xfer); in xbf_intr()
373 scsi_done(ccb->ccb_xfer); in xbf_intr()
449 struct xbf_ccb *ccb = xs->io; in xbf_load_cmd() local
456 map = ccb->ccb_dmap; in xbf_load_cmd()
476 xrd = &sc->sc_xr->xr_desc[ccb->ccb_first]; in xbf_load_cmd()
513 struct xbf_ccb *ccb = xs->io; in xbf_bounce_cmd() local
536 dma = &ccb->ccb_bbuf; in xbf_bounce_cmd()
552 xrd = &sc->sc_xr->xr_desc[ccb->ccb_first]; in xbf_bounce_cmd()
589 struct xbf_ccb *ccb = xs->io; in xbf_reclaim_cmd() local
590 struct xbf_dma_mem *dma = &ccb->ccb_bbuf; in xbf_reclaim_cmd()
598 xbf_dma_free(sc, &ccb->ccb_bbuf); in xbf_reclaim_cmd()
605 struct xbf_ccb *ccb = xs->io; in xbf_submit_cmd() local
666 ccb->ccb_want = ccb->ccb_seen = 0; in xbf_submit_cmd()
671 ccb->ccb_first = desc; in xbf_submit_cmd()
678 ccb->ccb_want |= 1 << ndesc; in xbf_submit_cmd()
682 ccb->ccb_last = desc; in xbf_submit_cmd()
686 "len %d\n", sc->sc_dev.dv_xname, ccb->ccb_first, in xbf_submit_cmd()
687 ccb->ccb_last, operation == XBF_OP_READ ? "read" : in xbf_submit_cmd()
699 ccb->ccb_first, operation == XBF_OP_FLUSH ? "flush" : in xbf_submit_cmd()
705 ccb->ccb_xfer = xs; in xbf_submit_cmd()
707 bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmap, 0, in xbf_submit_cmd()
708 ccb->ccb_dmap->dm_mapsize, BUS_DMASYNC_PREREAD | in xbf_submit_cmd()
712 TAILQ_INSERT_TAIL(&sc->sc_ccb_sq, ccb, ccb_link); in xbf_submit_cmd()
749 struct xbf_ccb *ccb; in xbf_complete_cmd() local
767 TAILQ_FOREACH(ccb, &sc->sc_ccb_sq, ccb_link) { in xbf_complete_cmd()
768 if (((id - ccb->ccb_first) & (sc->sc_xr_ndesc - 1)) <= in xbf_complete_cmd()
769 ((ccb->ccb_last - ccb->ccb_first) & (sc->sc_xr_ndesc - 1))) in xbf_complete_cmd()
772 KASSERT(ccb != NULL); in xbf_complete_cmd()
775 chunk = 1 << ((id - ccb->ccb_first) & (sc->sc_xr_ndesc - 1)); in xbf_complete_cmd()
776 KASSERT((ccb->ccb_want & chunk) != 0); in xbf_complete_cmd()
777 KASSERT((ccb->ccb_seen & chunk) == 0); in xbf_complete_cmd()
780 ccb->ccb_seen |= chunk; in xbf_complete_cmd()
781 if (ccb->ccb_seen == ccb->ccb_want) in xbf_complete_cmd()
782 TAILQ_REMOVE(&sc->sc_ccb_sq, ccb, ccb_link); in xbf_complete_cmd()
793 if (ccb->ccb_seen != ccb->ccb_want) in xbf_complete_cmd()
796 if (ccb->ccb_bbuf.dma_size > 0) in xbf_complete_cmd()
797 map = ccb->ccb_bbuf.dma_map; in xbf_complete_cmd()
799 map = ccb->ccb_dmap; in xbf_complete_cmd()
805 ccb->ccb_xfer->resid = 0; in xbf_complete_cmd()
806 ccb->ccb_xfer->error = error; in xbf_complete_cmd()
807 TAILQ_INSERT_TAIL(cq, ccb, ccb_link); in xbf_complete_cmd()
1221 struct xbf_ccb *ccb, *nccb; in xbf_stop() local
1228 TAILQ_FOREACH_SAFE(ccb, &sc->sc_ccb_sq, ccb_link, nccb) { in xbf_stop()
1229 TAILQ_REMOVE(&sc->sc_ccb_sq, ccb, ccb_link); in xbf_stop()
1231 if (ccb->ccb_bbuf.dma_size > 0) in xbf_stop()
1232 map = ccb->ccb_bbuf.dma_map; in xbf_stop()
1234 map = ccb->ccb_dmap; in xbf_stop()
1239 xbf_reclaim_cmd(ccb->ccb_xfer); in xbf_stop()
1240 xbf_scsi_done(ccb->ccb_xfer, XS_SELTIMEOUT); in xbf_stop()
1296 struct xbf_ccb *ccb; in xbf_free_ccbs() local
1300 ccb = &sc->sc_ccbs[i]; in xbf_free_ccbs()
1301 if (ccb->ccb_dmap == NULL) in xbf_free_ccbs()
1303 bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmap, 0, 0, in xbf_free_ccbs()
1305 bus_dmamap_unload(sc->sc_dmat, ccb->ccb_dmap); in xbf_free_ccbs()
1306 bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmap); in xbf_free_ccbs()
1318 struct xbf_ccb *ccb; in xbf_get_ccb() local
1325 ccb = TAILQ_FIRST(&sc->sc_ccb_fq); in xbf_get_ccb()
1326 if (ccb != NULL) in xbf_get_ccb()
1327 TAILQ_REMOVE(&sc->sc_ccb_fq, ccb, ccb_link); in xbf_get_ccb()
1330 return (ccb); in xbf_get_ccb()
1337 struct xbf_ccb *ccb = io; in xbf_put_ccb() local
1339 ccb->ccb_xfer = NULL; in xbf_put_ccb()
1342 TAILQ_INSERT_HEAD(&sc->sc_ccb_fq, ccb, ccb_link); in xbf_put_ccb()