diff options
Diffstat (limited to 'dma')
-rw-r--r-- | dma/nwl_engine.c | 4 | ||||
-rw-r--r-- | dma/nwl_engine_buffers.h | 14 |
2 files changed, 2 insertions, 16 deletions
diff --git a/dma/nwl_engine.c b/dma/nwl_engine.c index 0b5924d..d90dbef 100644 --- a/dma/nwl_engine.c +++ b/dma/nwl_engine.c @@ -289,10 +289,10 @@ int dma_nwl_stream_read(pcilib_dma_context_t *vctx, pcilib_dma_engine_t dma, uin } #endif /* NWL_FIX_EOP_FOR_BIG_PACKETS */ - pcilib_sync_kernel_memory(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_FROMDEVICE); + pcilib_kmem_sync_block(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_FROMDEVICE, bufnum); void *buf = pcilib_kmem_get_block_ua(ctx->pcilib, info->pages, bufnum); ret = cb(cbattr, eop?PCILIB_DMA_FLAG_EOP:0, bufsize, buf); - pcilib_sync_kernel_memory(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_TODEVICE); + pcilib_kmem_sync_block(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_TODEVICE, bufnum); dma_nwl_return_buffer(ctx, info); diff --git a/dma/nwl_engine_buffers.h b/dma/nwl_engine_buffers.h index 517e690..8f31bb6 100644 --- a/dma/nwl_engine_buffers.h +++ b/dma/nwl_engine_buffers.h @@ -2,17 +2,6 @@ #define NWL_RING_SET(data, offset, val) *(uint32_t*)(((char*)(data)) + (offset)) = (val) #define NWL_RING_UPDATE(data, offset, mask, val) *(uint32_t*)(((char*)(data)) + (offset)) = ((*(uint32_t*)(((char*)(data)) + (offset)))&(mask))|(val) -int dma_nwl_sync_buffers(nwl_dma_t *ctx, pcilib_nwl_engine_description_t *info, pcilib_kmem_handle_t *kmem) { - switch (info->desc.direction) { - case PCILIB_DMA_FROM_DEVICE: - return pcilib_sync_kernel_memory(ctx->pcilib, kmem, PCILIB_KMEM_SYNC_FROMDEVICE); - case PCILIB_DMA_TO_DEVICE: - return pcilib_sync_kernel_memory(ctx->pcilib, kmem, PCILIB_KMEM_SYNC_TODEVICE); - } - - return 0; -} - static int dma_nwl_compute_read_s2c_pointers(nwl_dma_t *ctx, pcilib_nwl_engine_description_t *info, unsigned char *ring, uint32_t ring_pa) { size_t pos; uint32_t val; @@ -109,9 +98,6 @@ static int dma_nwl_allocate_engine_buffers(nwl_dma_t *ctx, pcilib_nwl_engine_des pcilib_kmem_handle_t *ring = pcilib_alloc_kernel_memory(ctx->pcilib, PCILIB_KMEM_TYPE_CONSISTENT, 1, PCILIB_NWL_DMA_PAGES * PCILIB_NWL_DMA_DESCRIPTOR_SIZE, PCILIB_NWL_ALIGNMENT, PCILIB_KMEM_USE(PCILIB_KMEM_USE_DMA_RING, sub_use), flags); pcilib_kmem_handle_t *pages = pcilib_alloc_kernel_memory(ctx->pcilib, type, PCILIB_NWL_DMA_PAGES, 0, 0, PCILIB_KMEM_USE(PCILIB_KMEM_USE_DMA_PAGES, sub_use), flags); -// if ((ring)&&(pages)) err = dma_nwl_sync_buffers(ctx, info, pages); -// else err = PCILIB_ERROR_FAILED; - if (err) { if (pages) pcilib_free_kernel_memory(ctx->pcilib, pages, 0); if (ring) pcilib_free_kernel_memory(ctx->pcilib, ring, 0); |