Lines Matching defs:xfer
44 * @chan: Owner channel of this xfer.
67 * @xfer_head: Pointer to the xfer to be next excecuted.
310 /* Delete xfer from the queue */
311 static inline void del_from_queue(struct s3c_pl330_xfer *xfer)
317 if (!xfer)
320 ch = xfer->chan;
322 /* Make sure xfer is in the queue */
325 if (t == xfer) {
333 /* If xfer is last entry in the queue */
334 if (xfer->node.next == &ch->xfer_list)
338 t = list_entry(xfer->node.next,
342 if (t == xfer)
344 else if (ch->xfer_head == xfer)
347 list_del(&xfer->node);
350 /* Provides pointer to the next xfer in the queue.
352 * otherwise the xfer is removed from the list.
358 struct s3c_pl330_xfer *xfer = ch->xfer_head;
360 if (!xfer)
363 /* If xfer is last entry in the queue */
364 if (xfer->node.next == &ch->xfer_list)
368 ch->xfer_head = list_entry(xfer->node.next,
372 del_from_queue(xfer);
374 return xfer;
378 struct s3c_pl330_xfer *xfer, int front)
384 ch->xfer_head = xfer;
390 ch->xfer_head = xfer;
394 ch->xfer_head = xfer;
395 list_add(&xfer->node, &ch->xfer_list);
397 list_add_tail(&xfer->node, &ch->xfer_list);
401 static inline void _finish_off(struct s3c_pl330_xfer *xfer,
406 if (!xfer)
409 ch = xfer->chan;
413 ch->callback_fn(NULL, xfer->token, xfer->px.bytes, res);
417 kmem_cache_free(ch->dmac->kmcache, xfer);
423 struct s3c_pl330_xfer *xfer;
430 xfer = get_from_queue(ch, 0);
431 if (xfer) {
432 r->x = &xfer->px;
436 struct pl330_info *pi = xfer->chan->dmac->pi;
475 add_to_queue(ch, xfer, 1);
480 _finish_off(xfer, S3C2410_RES_ERR, 0);
491 struct s3c_pl330_xfer *xfer;
511 /* If last request had some xfer */
513 xfer = container_of(xl, struct s3c_pl330_xfer, px);
514 _finish_off(xfer, res, 0);
552 struct s3c_pl330_xfer *xfer;
605 /* Abort the current xfer */
607 xfer = container_of(ch->req[idx].x,
610 /* Drop xfer during FLUSH */
612 del_from_queue(xfer);
617 _finish_off(xfer, S3C2410_RES_ABORT,
626 xfer = container_of(ch->req[1 - idx].x,
629 del_from_queue(xfer);
634 _finish_off(xfer, S3C2410_RES_ABORT, 1);
639 xfer = ch->xfer_head;
640 while (xfer) {
642 del_from_queue(xfer);
645 _finish_off(xfer, S3C2410_RES_ABORT, 1);
648 xfer = ch->xfer_head;
663 struct s3c_pl330_xfer *xfer;
683 xfer = kmem_cache_alloc(ch->dmac->kmcache, GFP_ATOMIC);
684 if (!xfer) {
689 xfer->token = token;
690 xfer->chan = ch;
691 xfer->px.bytes = size;
692 xfer->px.next = NULL; /* Single request */
696 xfer->px.src_addr = addr;
697 xfer->px.dst_addr = ch->sdaddr;
699 xfer->px.src_addr = ch->sdaddr;
700 xfer->px.dst_addr = addr;
703 add_to_queue(ch, xfer, 0);
783 /* Reset xfer list */
797 struct s3c_pl330_xfer *xfer;
815 /* Stop any active xfer, Flushe the queue and do callbacks */
822 xfer = container_of(ch->req[idx].x,
826 del_from_queue(xfer);
829 _finish_off(xfer, S3C2410_RES_ABORT, 1);
834 xfer = container_of(ch->req[1 - idx].x,
838 del_from_queue(xfer);
841 _finish_off(xfer, S3C2410_RES_ABORT, 1);
847 xfer = get_from_queue(ch, 1);
850 _finish_off(xfer, S3C2410_RES_ABORT, 1);
852 } while (xfer);
888 /* Max size of xfer can be pcfg.data_bus_width */