summaryrefslogtreecommitdiffstats
path: root/dma.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-14 01:44:10 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-14 01:44:10 +0200
commitb492b1aac3d12683ccbc973b08b023ba0466cbec (patch)
tree09f6d3d0cc3725b62a5c9210220e14316b737622 /dma.c
parent9f17f71885344d93b16fdc17458aa28ba350a480 (diff)
downloadpcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.tar.gz
pcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.tar.bz2
pcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.tar.xz
pcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.zip
Support modifications of DMA engine and allow DMA customizations by Event engine
Diffstat (limited to 'dma.c')
-rw-r--r--dma.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/dma.c b/dma.c
index 7e06b2e..45466b7 100644
--- a/dma.c
+++ b/dma.c
@@ -20,12 +20,14 @@
const pcilib_dma_info_t *pcilib_get_dma_info(pcilib_t *ctx) {
if (!ctx->dma_ctx) {
- pcilib_model_t model = pcilib_get_model(ctx);
- pcilib_dma_api_description_t *api = pcilib_model[model].dma_api;
-
- if ((api)&&(api->init)) {
+ pcilib_model_description_t *model_info = pcilib_get_model_description(ctx);
+
+ if ((ctx->event_ctx)&&(model_info->event_api->init_dma)) {
+ pcilib_map_register_space(ctx);
+ ctx->dma_ctx = model_info->event_api->init_dma(ctx->event_ctx);
+ } else if ((model_info->dma_api)&&(model_info->dma_api->init)) {
pcilib_map_register_space(ctx);
- ctx->dma_ctx = api->init(ctx);
+ ctx->dma_ctx = model_info->dma_api->init(ctx, PCILIB_DMA_MODIFICATION_DEFAULT, NULL);
}
if (!ctx->dma_ctx) return NULL;