diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-14 01:44:10 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-14 01:44:10 +0200 |
commit | b492b1aac3d12683ccbc973b08b023ba0466cbec (patch) | |
tree | 09f6d3d0cc3725b62a5c9210220e14316b737622 /dma.c | |
parent | 9f17f71885344d93b16fdc17458aa28ba350a480 (diff) | |
download | pcitool-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.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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; |