From b492b1aac3d12683ccbc973b08b023ba0466cbec Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 14 Jul 2011 01:44:10 +0200 Subject: Support modifications of DMA engine and allow DMA customizations by Event engine --- dma.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'dma.c') 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; -- cgit v1.2.3