From 6c922712fd8ee7e75a1b45c4980be22d36d0d1d9 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 12 Jul 2011 14:51:11 +0200 Subject: Another reorganization of NWL sources --- dma/nwl_buffers.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dma/nwl_buffers.h') diff --git a/dma/nwl_buffers.h b/dma/nwl_buffers.h index e059b97..35f4781 100644 --- a/dma/nwl_buffers.h +++ b/dma/nwl_buffers.h @@ -2,6 +2,17 @@ #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; +} + int dma_nwl_allocate_engine_buffers(nwl_dma_t *ctx, pcilib_nwl_engine_description_t *info) { int err = 0; -- cgit v1.2.3