summaryrefslogtreecommitdiffstats
path: root/dma/nwl_engine.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-17 06:25:14 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-17 06:25:14 +0200
commitec5fd54c7559392139fa704a57185f4d4244dfde (patch)
tree05c138b1d5a350f5454a1a18bd051546e7cf8632 /dma/nwl_engine.c
parent112030c40f88dde281073e00e4c24cc48daa99d2 (diff)
downloadpcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.tar.gz
pcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.tar.bz2
pcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.tar.xz
pcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.zip
Few fixes
Diffstat (limited to 'dma/nwl_engine.c')
-rw-r--r--dma/nwl_engine.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/dma/nwl_engine.c b/dma/nwl_engine.c
index 58d5522..68e1805 100644
--- a/dma/nwl_engine.c
+++ b/dma/nwl_engine.c
@@ -161,6 +161,8 @@ int dma_nwl_stop_engine(nwl_dma_t *ctx, pcilib_dma_engine_t dma) {
uint32_t val;
uint32_t ring_pa;
struct timeval start, cur;
+ pcilib_kmem_flags_t flags;
+
pcilib_nwl_engine_description_t *info = ctx->engines + dma;
char *base = ctx->engines[dma].base_addr;
@@ -194,19 +196,25 @@ int dma_nwl_stop_engine(nwl_dma_t *ctx, pcilib_dma_engine_t dma) {
nwl_write_register(val, ctx, base, REG_DMA_ENG_CTRL_STATUS);
}
+ if (info->preserve) {
+ flags = PCILIB_KMEM_FLAG_REUSE;
+ } else {
+ flags = PCILIB_KMEM_FLAG_HARDWARE|PCILIB_KMEM_FLAG_PERSISTENT;
+ }
+
+
+ printf("%lx %i\n", flags, info->preserve);
// Clean buffers
if (info->ring) {
- pcilib_free_kernel_memory(ctx->pcilib, info->ring, info->preserve?PCILIB_KMEM_FLAG_REUSE:0);
+ pcilib_free_kernel_memory(ctx->pcilib, info->ring, flags);
info->ring = NULL;
}
if (info->pages) {
- pcilib_free_kernel_memory(ctx->pcilib, info->pages, info->preserve?PCILIB_KMEM_FLAG_REUSE:0);
+ pcilib_free_kernel_memory(ctx->pcilib, info->pages, flags);
info->pages = NULL;
}
- nwl_read_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS);
-
return 0;
}