Lines Matching refs:ir
84 struct fw_xferq *ir; member
239 if (d->ir != NULL) { in fw_free()
240 struct fw_xferq *ir = d->ir; in fw_free() local
242 if ((ir->flag & FWXFERQ_OPEN) == 0) in fw_free()
244 if (ir->flag & FWXFERQ_RUNNING) { in fw_free()
245 ir->flag &= ~FWXFERQ_RUNNING; in fw_free()
246 fc->irx_disable(fc, ir->dmach); in fw_free()
249 fwdev_freebuf(ir); in fw_free()
251 for (xfer = STAILQ_FIRST(&ir->q); in fw_free()
252 xfer != NULL; xfer = STAILQ_FIRST(&ir->q)) { in fw_free()
253 ir->queued --; in fw_free()
254 STAILQ_REMOVE_HEAD(&ir->q, link); in fw_free()
259 ir->flag &= ~(FWXFERQ_OPEN | in fw_free()
261 d->ir = NULL; in fw_free()
364 struct fw_xferq *ir; in fw_read() local
375 ir = d->ir; in fw_read()
377 if (ir == NULL) in fw_read()
380 if (ir->buf == NULL) in fw_read()
385 if (ir->stproc == NULL) { in fw_read()
387 ir->stproc = STAILQ_FIRST(&ir->stvalid); in fw_read()
388 if (ir->stproc != NULL) { in fw_read()
390 STAILQ_REMOVE_HEAD(&ir->stvalid, link); in fw_read()
392 ir->queued = 0; in fw_read()
395 if (ir->stproc == NULL) { in fw_read()
399 ir->flag |= FWXFERQ_WAKEUP; in fw_read()
402 err = acquire_sem_etc(ir->Sem, 1, B_CAN_INTERRUPT | B_TIMEOUT, 1000000); in fw_read()
405 ir->flag &= ~FWXFERQ_WAKEUP; in fw_read()
412 } else if (ir->stproc != NULL) { in fw_read()
415 fp = (struct fw_pkt *)fwdma_v_addr(ir->buf, in fw_read()
416 ir->stproc->poffset + ir->queued); in fw_read()
432 ir->queued ++; in fw_read()
433 if (ir->queued >= ir->bnpacket) { in fw_read()
435 STAILQ_INSERT_TAIL(&ir->stfree, ir->stproc, link); in fw_read()
437 fc->irx_enable(fc, ir->dmach); in fw_read()
438 ir->stproc = NULL; in fw_read()
440 if (pbytes >= ir->psize) { in fw_read()
663 struct fw_xferq *ir, *it; in fw_ioctl() local
681 ir = d->ir; in fw_ioctl()
712 if (ir == NULL) { in fw_ioctl()
718 ir = fc->ir[i]; in fw_ioctl()
719 err = fwdev_allocbuf(ir, &d->bufreq.rx); in fw_ioctl()
721 ir->flag &= ~FWXFERQ_OPEN; in fw_ioctl()
725 ir->flag &= ~0xff; in fw_ioctl()
726 ir->flag |= (0x3f & ichreq->ch); in fw_ioctl()
727 ir->flag |= ((0x3 & ichreq->tag) << 6); in fw_ioctl()
728 d->ir = ir; in fw_ioctl()
729 err = fc->irx_enable(fc, ir->dmach); in fw_ioctl()
732 if (d->ir != NULL) { in fw_ioctl()
733 ichreq->ch = ir->flag & 0x3f; in fw_ioctl()
734 ichreq->tag = ir->flag >> 2 & 0x3; in fw_ioctl()
743 if (ir != NULL) { in fw_ioctl()
744 ibufreq->rx.nchunk = ir->bnchunk; in fw_ioctl()
745 ibufreq->rx.npacket = ir->bnpacket; in fw_ioctl()
746 ibufreq->rx.psize = ir->psize; in fw_ioctl()