Lines Matching defs:acb
283 struct sbic_acb* acb;
291 acb = dev->sc_nexus;
292 if (acb == NULL) {
312 dev->sc_dmastop(dev->sc_dmah, dev->sc_dmat, acb);
326 acb->offset += acb->sc_tcnt - count;
330 dev->target, acb->offset, asr), data_pointer_debug >= 1);
332 acb->sc_tcnt = 0;
351 struct sbic_acb *acb;
370 acb = dev->free_list.tqh_first;
371 if (acb)
372 TAILQ_REMOVE(&dev->free_list, acb, chain);
375 if (acb == NULL) {
387 acb->flags = ACB_ACTIVE;
389 acb->flags |= ACB_DATAIN;
390 acb->xs = xs;
391 memcpy(&acb->cmd, xs->cmd, xs->cmdlen);
392 acb->clen = xs->cmdlen;
393 acb->data = xs->data;
394 acb->datalen = xs->datalen;
397 (unsigned) acb->cmd.opcode, acb->clen, xs->data,
410 dev->sc_nexus = acb;
415 periph->periph_lun, acb);
416 } while (dev->sc_nexus != acb);
418 sbic_scsidone(acb, stat);
425 TAILQ_INSERT_TAIL(&dev->ready_list, acb, chain);
458 struct sbic_acb *acb;
466 for (acb = dev->ready_list.tqh_first; acb; acb = acb->chain.tqe_next) {
467 periph = acb->xs->xs_periph;
472 TAILQ_REMOVE(&dev->ready_list, acb, chain);
473 dev->sc_nexus = acb;
474 periph = acb->xs->xs_periph;
482 if (acb == NULL)
485 xs = acb->xs;
494 DBG(if (data_pointer_debug > 1) sbic_dump_acb(acb));
502 && dev->sc_dmaok(dev->sc_dmah, dev->sc_dmat, acb))
503 acb->flags |= ACB_DMA;
506 (!sbic_parallel_operations && (acb->flags & ACB_DMA) == 0))
508 periph->periph_lun, acb);
515 sbic_scsidone(acb, stat);
520 sbic_scsidone(struct sbic_acb *acb, int stat)
528 xs = acb->xs;
533 if (acb == NULL || xs == NULL) {
545 dev->target, dev->lun, stat, acb->flags),
564 if (acb == dev->sc_nexus) {
570 } else if (dev->ready_list.tqh_last == &acb->chain.tqe_next) {
571 TAILQ_REMOVE(&dev->ready_list, acb, chain);
576 if (acb2 == acb) {
577 TAILQ_REMOVE(&dev->nexus_list, acb, chain);
585 else if (acb->chain.tqe_next) {
586 TAILQ_REMOVE(&dev->ready_list, acb, chain);
588 printf("%s: can't find matching acb\n",
596 acb->flags = ACB_FREE;
597 TAILQ_INSERT_HEAD(&dev->free_list, acb, chain);
655 while (acb = dev->nexus_list.tqh_first) {
656 acb->xs->error = XS_DRIVER_STUFFUP;
657 sbic_scsidone(acb, -1 /*acb->stat[0]*/);
720 struct sbic_acb *acb;
736 acb = dev->sc_acb;
737 memset(acb, 0, sizeof(dev->sc_acb));
741 for (i = 0; i < sizeof(dev->sc_acb) / sizeof(*acb); i++) {
742 TAILQ_INSERT_TAIL(&dev->free_list, acb, chain);
743 acb++;
786 /* struct sbic_acb *acb;*/
859 acb = dev->sc_acb;
860 memset(acb, 0, sizeof(dev->sc_acb));
861 for (i = 0; i < sizeof(dev->sc_acb) / sizeof(*acb); i++) {
862 TAILQ_INSERT_TAIL(&dev->free_list, acb, chain);
863 acb++;
871 while (acb = dev->nexus_list.tqh_first) {
872 acb->xs->error = XS_DRIVER_STUFFUP;
873 sbic_scsidone(acb, -1 /*acb->stat[0]*/);
1248 sbicicmd(struct sbic_softc *dev, int target, int lun, struct sbic_acb *acb)
1268 cbuf = &acb->cmd;
1269 clen = acb->clen;
1270 buf = acb->data;
1271 len = acb->datalen;
1276 acb->sc_tcnt = 0;
1371 if (acb->datalen <= 0)
1375 if (sbicxfstart(regs, acb->datalen,
1379 i = sbicxfin(regs, acb->datalen, acb->data);
1381 i = sbicxfout(regs, acb->datalen, acb->data,
1383 acb->data += acb->datalen - i;
1384 acb->datalen = i;
1468 acb->datalen,
1538 struct sbic_acb *acb;
1543 acb = dev->sc_nexus;
1546 usedma = acb->flags & ACB_DMA;
1580 acb->sc_tcnt = 0;
1588 acb->offset = 0;
1589 acb->sc_tcnt = 0;
1591 tcnt = dev->sc_dmasetup(dev->sc_dmah, dev->sc_dmat, acb,
1592 (acb->flags & ACB_DATAIN) != 0);
1651 /* struct sbic_acb *acb;*/
2028 struct sbic_acb *acb;
2035 acb = dev->sc_nexus;
2045 if (sbicxfstart(regs, acb->clen, CMD_PHASE, sbic_cmd_wait))
2046 if (sbicxfout(regs, acb->clen,
2047 &acb->cmd, CMD_PHASE))
2062 if (acb->flags & ACB_DMA) {
2065 dev->sc_dmafinish(dev->sc_dmah, dev->sc_dmat, acb);
2069 sbic_scsidone(acb, dev->sc_stat[0]);
2084 if ((acb->xs->xs_control & XS_CTL_POLL) ||
2086 (acb->flags & ACB_DMA) == 0) {
2089 if (acb->datalen <= 0) {
2091 acb->datalen, asr, csr);
2095 if (sbicxfstart(regs, acb->datalen,
2099 i = sbicxfin(regs, acb->datalen,
2100 acb->data);
2102 i = sbicxfout(regs, acb->datalen,
2103 acb->data, SBIC_PHASE(csr));
2105 acb->data += acb->datalen - i;
2106 acb->datalen = i;
2120 if (acb->offset >= acb->datalen) {
2122 acb->offset, asr, csr);
2126 dev->target, acb->offset),
2130 acb->sc_tcnt =
2132 acb, acb->offset);
2134 acb->sc_tcnt), data_pointer_debug);
2135 SBIC_TC_PUT(regs, (unsigned)acb->sc_tcnt);
2181 TAILQ_INSERT_HEAD(&dev->nexus_list, acb, chain);
2185 if ((acb->xs->xs_control & XS_CTL_POLL)
2262 for (acb = dev->nexus_list.tqh_first; acb;
2263 acb = acb->chain.tqe_next) {
2264 if (acb->xs->xs_periph->periph_target != newtarget ||
2265 acb->xs->xs_periph->periph_lun != newlun)
2267 TAILQ_REMOVE(&dev->nexus_list, acb, chain);
2268 dev->sc_nexus = acb;
2274 if (acb == NULL) {
2298 dev->sc_dmafinish(dev->sc_dmah, dev->sc_dmat, acb);
2305 sbic_scsidone(acb, -1);
2400 sbic_dump_acb(struct sbic_acb *acb)
2402 u_char *b = (u_char *) &acb->cmd;
2405 printf("acb@%p ", acb);
2406 if (acb->xs == NULL) {
2411 acb->xs->xs_periph->periph_target,
2412 acb->xs->xs_periph->periph_lun, acb->flags, acb->clen);
2413 for (i = acb->clen; i; --i)
2416 printf(" xs: %8p data %8p:%04x ", acb->xs, acb->xs->data,
2417 acb->xs->datalen);
2418 printf("tcnt %lx\n", acb->sc_tcnt);
2426 struct sbic_acb *acb;
2541 if ((acb = dev->free_list.tqh_first)) {
2543 while (acb) {
2544 sbic_dump_acb(acb);
2545 acb = acb->chain.tqe_next;
2548 if ((acb = dev->ready_list.tqh_first)) {
2550 while (acb) {
2551 sbic_dump_acb(acb);
2552 acb = acb->chain.tqe_next;
2555 if ((acb = dev->nexus_list.tqh_first)) {
2557 while (acb) {
2558 sbic_dump_acb(acb);
2559 acb = acb->chain.tqe_next;