/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to dma.c

  • Committer: Suren A. Chilingaryan
  • Date: 2011-12-08 02:47:23 UTC
  • Revision ID: csa@dside.dyndns.org-20111208024723-ym9uf3uoll6ym2a9
new event architecture, first trial

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
 
187
187
    if (flags & PCILIB_DMA_FLAG_EOP) {
188
188
        if ((ctx->pos < ctx->size)&&(ctx->flags&PCILIB_DMA_FLAG_MULTIPACKET)) {
189
 
            if (ctx->flags&PCILIB_DMA_FLAG_WAIT) return 2;
190
 
            else return 3;
 
189
            if (ctx->flags&PCILIB_DMA_FLAG_WAIT) return PCILIB_STREAMING_WAIT;
 
190
            else return PCILIB_STREAMING_CONTINUE;
191
191
        }
192
 
        return 0;
 
192
        return PCILIB_STREAMING_STOP;
193
193
    }
194
 
    return 1;
 
194
    
 
195
    return PCILIB_STREAMING_REQ_FRAGMENT;
195
196
}
196
197
 
197
198
static int pcilib_dma_skip_callback(void *arg, pcilib_dma_flags_t flags, size_t bufsize, void *buf) {
200
201
    
201
202
    if (tv) {
202
203
        gettimeofday(&cur, NULL);
203
 
        if ((cur.tv_sec > tv->tv_sec)||((cur.tv_sec == tv->tv_sec)&&(cur.tv_usec > tv->tv_usec))) return 0;
 
204
        if ((cur.tv_sec > tv->tv_sec)||((cur.tv_sec == tv->tv_sec)&&(cur.tv_usec > tv->tv_usec))) return PCILIB_STREAMING_STOP;
204
205
    }
205
206
    
206
 
    return 1;
 
207
    return PCILIB_STREAMING_REQ_PACKET;
207
208
}
208
209
 
209
210
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) {