summaryrefslogtreecommitdiffstats
path: root/dma.c
diff options
context:
space:
mode:
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;