Lines Matching refs:xfer

202 	struct fw_xfer *xfer;  in fw_close()  local
232 for (xfer = STAILQ_FIRST(&ir->q); in fw_close()
233 xfer != NULL; xfer = STAILQ_FIRST(&ir->q)) { in fw_close()
237 xfer->resp = 0; in fw_close()
238 fw_xfer_done(xfer); in fw_close()
270 struct fw_xfer *xfer; in fw_read_async() local
276 while ((xfer = STAILQ_FIRST(&d->rq)) == NULL && err == 0) in fw_read_async()
286 FW_GUNLOCK(xfer->fc); in fw_read_async()
288 fp = &xfer->recv.hdr; in fw_read_async()
293 tinfo = &xfer->fc->tcode[fp->mode.hdr.tcode]; in fw_read_async()
297 err = uiomove(xfer->recv.payload, xfer->recv.pay_len, uio); in fw_read_async()
301 fwb = (struct fw_bind *)xfer->sc; in fw_read_async()
302 fw_xfer_unload(xfer); in fw_read_async()
303 xfer->recv.pay_len = PAGE_SIZE; in fw_read_async()
304 FW_GLOCK(xfer->fc); in fw_read_async()
305 STAILQ_INSERT_TAIL(&fwb->xferlist, xfer, link); in fw_read_async()
306 FW_GUNLOCK(xfer->fc); in fw_read_async()
393 struct fw_xfer *xfer; in fw_write_async() local
406 if ((xfer = fw_xfer_alloc_buf(M_FWXFER, uio->uio_resid, in fw_write_async()
410 bcopy(&pkt, &xfer->send.hdr, sizeof(struct fw_pkt)); in fw_write_async()
411 xfer->send.pay_len = uio->uio_resid; in fw_write_async()
413 if ((err = uiomove((caddr_t)&xfer->send.payload[0], in fw_write_async()
418 xfer->fc = d->fc; in fw_write_async()
419 xfer->sc = NULL; in fw_write_async()
420 xfer->hand = fw_xferwake; in fw_write_async()
421 xfer->send.spd = 2 /* XXX */; in fw_write_async()
423 if ((err = fw_asyreq(xfer->fc, -1, xfer))) in fw_write_async()
426 if ((err = fw_xferwait(xfer))) in fw_write_async()
429 if (xfer->resp != 0) { in fw_write_async()
430 err = xfer->resp; in fw_write_async()
434 if (xfer->flag & FWXF_RCVD) { in fw_write_async()
435 FW_GLOCK(xfer->fc); in fw_write_async()
436 STAILQ_INSERT_TAIL(&d->rq, xfer, link); in fw_write_async()
437 FW_GUNLOCK(xfer->fc); in fw_write_async()
442 fw_xfer_free(xfer); in fw_write_async()
521 fw_hand(struct fw_xfer *xfer) in fw_hand() argument
526 fwb = (struct fw_bind *)xfer->sc; in fw_hand()
528 FW_GLOCK(xfer->fc); in fw_hand()
529 STAILQ_INSERT_TAIL(&d->rq, xfer, link); in fw_hand()
530 FW_GUNLOCK(xfer->fc); in fw_hand()
546 struct fw_xfer *xfer; in fw_ioctl() local
651 xfer = fw_xfer_alloc_buf(M_FWXFER, pay_len, PAGE_SIZE/*XXX*/); in fw_ioctl()
652 if (xfer == NULL) in fw_ioctl()
677 bcopy(fp, (void *)&xfer->send.hdr, tinfo->hdr_len); in fw_ioctl()
680 xfer->send.payload, pay_len); in fw_ioctl()
681 xfer->send.spd = asyreq->req.sped; in fw_ioctl()
682 xfer->hand = fw_xferwake; in fw_ioctl()
684 if ((err = fw_asyreq(fc, -1, xfer)) != 0) in fw_ioctl()
686 if ((err = fw_xferwait(xfer)) != 0) in fw_ioctl()
688 if (xfer->resp != 0) { in fw_ioctl()
696 tinfo = &fc->tcode[xfer->recv.hdr.mode.hdr.tcode]; in fw_ioctl()
697 if (xfer->recv.hdr.mode.hdr.tcode == FWTCODE_RRESB || in fw_ioctl()
698 xfer->recv.hdr.mode.hdr.tcode == FWTCODE_LRES) { in fw_ioctl()
699 pay_len = xfer->recv.pay_len; in fw_ioctl()
700 if (asyreq->req.len >= xfer->recv.pay_len + tinfo->hdr_len) { in fw_ioctl()
701 asyreq->req.len = xfer->recv.pay_len + in fw_ioctl()
710 bcopy(&xfer->recv.hdr, fp, tinfo->hdr_len); in fw_ioctl()
711 bcopy(xfer->recv.payload, (char *)fp + tinfo->hdr_len, pay_len); in fw_ioctl()
713 fw_xfer_free_buf(xfer); in fw_ioctl()