Lines Matching defs:acb
213 struct sbic_acb *acb;
243 acb = dev->sc_nexus;
244 acb->sc_dmacmd = dev->sc_dmacmd;
271 acb->sc_tcnt = count;
277 dev->sc_tcnt = acb->sc_tcnt;
282 acb->sc_kv.dc_addr += count;
283 acb->sc_kv.dc_count -= count;
284 acb->sc_pa.dc_addr += count;
285 acb->sc_pa.dc_count -= count >> 1;
304 struct sbic_acb *acb = dev->sc_nexus;
307 if (acb->sc_kv.dc_count == 0) {
319 dev->sc_last = dev->sc_cur = &acb->sc_pa;
324 dev->sc_tcnt = acb->sc_tcnt;
325 dev->sc_dmacmd = acb->sc_dmacmd;
344 vaddr = acb->sc_kv.dc_addr;
345 paddr = acb->sc_pa.dc_addr = (char *)kvtop((void *)vaddr);
348 count < acb->sc_kv.dc_count &&
357 if (count > acb->sc_kv.dc_count) {
358 count = acb->sc_kv.dc_count;
368 acb->sc_tcnt = count;
369 acb->sc_pa.dc_count = count >> 1;
374 acb->sc_kv.dc_addr,
375 acb->sc_kv.dc_count,
376 acb->sc_pa.dc_addr,
377 acb->sc_tcnt);
399 struct sbic_acb *acb;
416 if ((acb = dev->free_list.tqh_first) != NULL)
417 TAILQ_REMOVE(&dev->free_list, acb, chain);
421 if (acb == NULL) {
435 acb->flags = ACB_ACTIVE | ACB_DATAIN;
437 acb->flags = ACB_ACTIVE;
439 acb->xs = xs;
440 acb->clen = xs->cmdlen;
441 acb->sc_kv.dc_addr = xs->data;
442 acb->sc_kv.dc_count = xs->datalen;
443 acb->pa_addr = xs->data ?
445 memcpy(&acb->cmd, xs->cmd, xs->cmdlen);
474 dev->sc_nexus = acb;
479 stat = sbicicmd(dev, &acb->cmd, acb->clen,
480 acb->sc_kv.dc_addr, acb->sc_kv.dc_count);
482 } while (dev->sc_nexus != acb);
484 sbic_scsidone(acb, stat);
492 TAILQ_INSERT_TAIL(&dev->ready_list, acb, chain);
522 struct sbic_acb *acb;
536 for (acb = dev->ready_list.tqh_first; acb; acb = acb->chain.tqe_next) {
539 periph = acb->xs->xs_periph;
551 TAILQ_REMOVE(&dev->ready_list, acb, chain);
552 dev->sc_nexus = acb;
553 acb->sc_pa.dc_addr = acb->pa_addr; /* XXXX check */
558 if (acb == NULL) {
569 dev->sc_xs = xs = acb->xs;
581 stat = sbicicmd(dev, &acb->cmd, acb->clen,
582 acb->sc_kv.dc_addr, acb->sc_kv.dc_count);
588 sbic_scsidone(acb, stat);
592 sbic_scsidone(struct sbic_acb *acb, int stat)
594 struct scsipi_xfer *xs = acb->xs;
601 if (acb == NULL || xs == NULL) {
637 if (acb == dev->sc_nexus ) {
648 } else if (dev->ready_list.tqh_last == &acb->chain.tqe_next) {
650 TAILQ_REMOVE(&dev->ready_list, acb, chain);
658 if (a == acb) {
659 TAILQ_REMOVE(&dev->nexus_list, acb, chain);
668 else if ( acb->chain.tqe_next ) {
669 TAILQ_REMOVE(&dev->ready_list, acb, chain);
671 printf("%s: can't find matching acb\n",
682 acb->flags = ACB_FREE;
683 TAILQ_INSERT_HEAD(&dev->free_list, acb, chain);
831 struct sbic_acb *acb;
841 acb = dev->sc_acb;
842 memset(acb, 0, sizeof(dev->sc_acb));
844 for (i = 0; i < sizeof(dev->sc_acb) / sizeof(*acb); i++) {
845 TAILQ_INSERT_TAIL(&dev->free_list, acb, chain);
846 acb++;
1298 struct sbic_acb *acb = dev->sc_nexus;
1305 dev->sc_last = dev->sc_cur = &acb->sc_pa;
1306 dev->sc_tcnt = acb->sc_tcnt = 0;
1308 acb->sc_dmacmd = 0;
1309 acb->sc_pa.dc_count = 0; /* No DMA */
1310 acb->sc_kv.dc_addr = buf;
1311 acb->sc_kv.dc_count = len;
1316 dev->target, dev->lun, acb->sc_kv.dc_count);
1471 acb->sc_kv.dc_count, dev->sc_stat[0]);
1532 struct sbic_acb *acb = dev->sc_nexus;
1559 if (acb->flags & ACB_DATAIN)
1564 addr = acb->sc_kv.dc_addr;
1565 count = acb->sc_kv.dc_count;
1567 if (count && ((char *)kvtop((void *)addr) != acb->sc_pa.dc_addr)) {
1569 acb->sc_pa.dc_addr, kvtop((void *)addr));
1583 acb->sc_tcnt = dev->sc_tcnt = 0;
1584 acb->sc_pa.dc_count = 0;
1595 dev->sc_tcnt = dev->sc_dmago(dev, acb->sc_pa.dc_addr,
1596 acb->sc_pa.dc_count, dmaflags);
1603 acb->sc_dmacmd = dev->sc_dmacmd;
2102 struct sbic_acb *acb = dev->sc_nexus;
2112 if ( sbicxfout(regs, acb->clen, &acb->cmd) )
2147 sbic_scsidone(acb, dev->sc_stat[0]);
2162 if (acb->sc_kv.dc_count <= 0) {
2165 acb->sc_kv.dc_count, asr, csr);
2174 acb->sc_dmacmd == 0 ) {
2184 acb->sc_kv.dc_addr,
2185 acb->sc_kv.dc_count);
2192 i = sbicxfin(regs, acb->sc_kv.dc_count,
2193 acb->sc_kv.dc_addr);
2198 i = sbicxfout(regs, acb->sc_kv.dc_count,
2199 acb->sc_kv.dc_addr);
2201 acb->sc_kv.dc_addr += (acb->sc_kv.dc_count - i);
2202 acb->sc_kv.dc_count = i;
2207 acb->sc_tcnt = dev->sc_tcnt = i;
2308 TAILQ_INSERT_HEAD(&dev->nexus_list, acb, chain);
2315 if (acb->xs->xs_control & XS_CTL_POLL ||
2457 for (acb = dev->nexus_list.tqh_first; acb;
2458 acb = acb->chain.tqe_next) {
2460 if ( acb->xs->xs_periph->periph_target == newtarget &&
2461 acb->xs->xs_periph->periph_lun == newlun) {
2466 TAILQ_REMOVE(&dev->nexus_list, acb, chain);
2468 dev->sc_nexus = acb;
2469 dev->sc_xs = acb->xs;
2477 if (acb == NULL) {
2525 sbic_scsidone(acb, -1);