diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-08 03:47:23 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-08 03:47:23 +0100 |
commit | 869ed99dbc3a645fee6de36e97e1e12127068f10 (patch) | |
tree | fa4a4e7ef977a3d3621ff5e96fb664e6fbc9e6fe /dma.c | |
parent | ddc77c1e819eee03a13efff4a9aa3161485f3f1f (diff) | |
download | ipecamera-869ed99dbc3a645fee6de36e97e1e12127068f10.tar.gz ipecamera-869ed99dbc3a645fee6de36e97e1e12127068f10.tar.bz2 ipecamera-869ed99dbc3a645fee6de36e97e1e12127068f10.tar.xz ipecamera-869ed99dbc3a645fee6de36e97e1e12127068f10.zip |
new event architecture, first trial
Diffstat (limited to 'dma.c')
-rw-r--r-- | dma.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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) { |