Home | History | Annotate | Download | only in apbus

Lines Matching refs:scb

75 /* scb flags */
222 struct spifi_scb *scb;
235 scb = spifi_get_scb(sc);
236 if (scb == NULL) {
237 panic("spifi_scsipi_request: no scb");
240 scb->xs = xs;
241 scb->flags = 0;
242 scb->status = 0;
243 scb->daddr = (vaddr_t)xs->data;
244 scb->resid = xs->datalen;
245 memcpy(&scb->cmd, xs->cmd, xs->cmdlen);
246 scb->cmdlen = xs->cmdlen;
248 scb->target = periph->periph_target;
249 scb->lun = periph->periph_lun;
250 scb->lun_targ = scb->target | (scb->lun << 3);
253 scb->flags |= SPIFI_READ;
257 TAILQ_INSERT_TAIL(&sc->ready_scb, scb, chain);
284 struct spifi_scb *scb;
288 scb = TAILQ_FIRST(&sc->free_scb);
289 if (scb)
290 TAILQ_REMOVE(&sc->free_scb, scb, chain);
293 return scb;
297 spifi_free_scb(struct spifi_softc *sc, struct spifi_scb *scb)
302 TAILQ_INSERT_HEAD(&sc->free_scb, scb, chain);
309 struct spifi_scb *scb = sc->sc_nexus;
315 scb->status = SCSI_OK;
316 scb->resid = 0;
323 xs = scb->xs;
351 struct spifi_scb *scb;
353 scb = TAILQ_FIRST(&sc->ready_scb);
355 if (scb == NULL || sc->sc_nexus != NULL)
358 if (sc->sc_targets[scb->target] & (1 << scb->lun))
361 TAILQ_REMOVE(&sc->ready_scb, scb, chain);
367 printf("spifi_sched: ID:LUN = %d:%d, ", scb->target, scb->lun);
368 printf("cmd = 0x%x", scb->cmd.opcode);
370 printf(" 0x%x", scb->cmd.bytes[i]);
376 sc->sc_nexus = scb;
380 scb = scb->chain.tqe_next;
418 struct spifi_scb *scb;
448 scb = sc->sc_nexus;
449 xs = scb->xs;
465 scb->status = reg->cmbuf[scb->target].status;
466 scb->resid = spifi_read_count(reg);
469 xs->datalen, scb->resid, scb->status);
486 if (scb == NULL)
492 scb->target, scb->lun);
575 struct spifi_scb *scb = sc->sc_nexus;
583 if (scb == NULL) {
592 sel = scb->target << 4 | SEL_ISTART | SEL_IRESELEN | SEL_WATN;
600 struct spifi_scb *scb = sc->sc_nexus;
617 lun = scb->xs->xs_periph->periph_lun;
623 ti = &sc->sc_tinfo[scb->target];
641 struct spifi_scb *scb = sc->sc_nexus;
643 int len = scb->cmdlen;
644 uint8_t *cmdp = (uint8_t *)&scb->cmd;
649 reg->cmdpage = scb->lun_targ;
668 struct spifi_scb *scb = sc->sc_nexus;
677 spifi_write_count(reg, scb->resid);
681 scb->flags |= SPIFI_DMA;
691 reg->autodata = ADATA_IN | scb->lun_targ;
692 dmac3_start(sc->sc_dma, scb->daddr, scb->resid, DMAC3_CSR_RECV);
696 reg->autodata = scb->lun_targ;
697 dmac3_start(sc->sc_dma, scb->daddr, scb->resid, DMAC3_CSR_SEND);
716 struct spifi_scb *scb = sc->sc_nexus;
717 struct scsipi_xfer *xs = scb->xs;
721 xs->status = scb->status;
728 xs->resid = scb->resid;
731 spifi_free_scb(sc, scb);
742 struct spifi_scb *scb = sc->sc_nexus;
748 if ((scb->flags & SPIFI_READ) == 0)
756 if (fifo_count > 0 && (scb->flags & SPIFI_DMA)) {