From 869ed99dbc3a645fee6de36e97e1e12127068f10 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 8 Dec 2011 03:47:23 +0100 Subject: new event architecture, first trial --- dma.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'dma.c') diff --git a/dma.c b/dma.c index 216aa60..24dd89e 100644 --- a/dma.c +++ b/dma.c @@ -186,12 +186,13 @@ static int pcilib_dma_read_callback(void *arg, pcilib_dma_flags_t flags, size_t if (flags & PCILIB_DMA_FLAG_EOP) { if ((ctx->pos < ctx->size)&&(ctx->flags&PCILIB_DMA_FLAG_MULTIPACKET)) { - if (ctx->flags&PCILIB_DMA_FLAG_WAIT) return 2; - else return 3; + if (ctx->flags&PCILIB_DMA_FLAG_WAIT) return PCILIB_STREAMING_WAIT; + else return PCILIB_STREAMING_CONTINUE; } - return 0; + return PCILIB_STREAMING_STOP; } - return 1; + + return PCILIB_STREAMING_REQ_FRAGMENT; } static int pcilib_dma_skip_callback(void *arg, pcilib_dma_flags_t flags, size_t bufsize, void *buf) { @@ -200,10 +201,10 @@ static int pcilib_dma_skip_callback(void *arg, pcilib_dma_flags_t flags, size_t if (tv) { gettimeofday(&cur, NULL); - if ((cur.tv_sec > tv->tv_sec)||((cur.tv_sec == tv->tv_sec)&&(cur.tv_usec > tv->tv_usec))) return 0; + if ((cur.tv_sec > tv->tv_sec)||((cur.tv_sec == tv->tv_sec)&&(cur.tv_usec > tv->tv_usec))) return PCILIB_STREAMING_STOP; } - return 1; + return PCILIB_STREAMING_REQ_PACKET; } int pcilib_stream_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, pcilib_dma_callback_t cb, void *cbattr) { -- cgit v1.2.3