summaryrefslogtreecommitdiffstats
path: root/dma/nwl_buffers.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-12 14:51:11 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-12 14:51:11 +0200
commit6c922712fd8ee7e75a1b45c4980be22d36d0d1d9 (patch)
treef10f58ea417b269447f3c3db805e7a5269e845cf /dma/nwl_buffers.h
parent493958c9cf11eaa25251d91e9ecab9a28bd6d68f (diff)
downloadpcitool-6c922712fd8ee7e75a1b45c4980be22d36d0d1d9.tar.gz
pcitool-6c922712fd8ee7e75a1b45c4980be22d36d0d1d9.tar.bz2
pcitool-6c922712fd8ee7e75a1b45c4980be22d36d0d1d9.tar.xz
pcitool-6c922712fd8ee7e75a1b45c4980be22d36d0d1d9.zip
Another reorganization of NWL sources
Diffstat (limited to 'dma/nwl_buffers.h')
-rw-r--r--dma/nwl_buffers.h11
1 files changed, 11 insertions, 0 deletions
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;