/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/ipe.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-06-12 15:24:18 UTC
  • Revision ID: csa@suren.me-20150612152418-b121bqoszonwsqbo
Support streaming mode in IPEDMA

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
            else if ((reuse_desc & PCILIB_KMEM_REUSE_HARDWARE) == 0) pcilib_warning("Lost DMA buffers are found (missing HW reference), reinitializing...");
112
112
            else {
113
113
#ifndef IPEDMA_BUG_DMARD
 
114
# ifndef IPEDMA_STREAMING_MODE
114
115
                RD(IPEDMA_REG_PAGE_COUNT, value);
115
116
 
116
117
                if (value != IPEDMA_DMA_PAGES) pcilib_warning("Inconsistent DMA buffers are found (Number of allocated buffers (%lu) does not match current request (%lu)), reinitializing...", value + 1, IPEDMA_DMA_PAGES);
117
118
                else
 
119
# endif /* IPEDMA_STREAMING_MODE */
118
120
#endif /* IPEDMA_BUG_DMARD */
119
121
                    preserve = 1;
120
122
            }
501
503
        ret = cb(cbattr, packet_flags, ctx->page_size, buf);
502
504
        if (ret < 0) return -ret;
503
505
        
504
 
            // We don't need this because hardwaredoes not intend to read anything from the memory
 
506
            // We don't need this because hardware does not intend to read anything from the memory
505
507
//      pcilib_kmem_sync_block(ctx->dmactx.pcilib, ctx->pages, PCILIB_KMEM_SYNC_TODEVICE, cur_read);
506
508
 
 
509
            // Return buffer into the DMA pool when processed
 
510
#ifdef IPEDMA_STREAMING_MODE
 
511
        uintptr_t buf_ba = pcilib_kmem_get_block_ba(ctx->dmactx.pcilib, ctx->pages, cur_read);
 
512
        WR(IPEDMA_REG_PAGE_ADDR, buf_ba);    
 
513
# ifdef IPEDMA_STREAMING_CHECKS
 
514
        pcilib_register_value_t streaming_status;
 
515
        RD(IPEDMA_REG_STREAMING_STATUS, streaming_status);
 
516
        if (streaming_status)
 
517
            pcilib_error("Invalid status (0x%lx) adding a DMA buffer into the queue", streaming_status);
 
518
# endif /* IPEDMA_STREAMING_MODE */
 
519
#endif /* IPEDMA_STREAMING_MODE */
 
520
 
507
521
            // Numbered from 1
508
522
#ifdef IPEDMA_BUG_LAST_READ
509
523
        WR(IPEDMA_REG_LAST_READ, cur_read?cur_read:IPEDMA_DMA_PAGES);