60
60
int pcilib_stop_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_flags_t flags) {
63
int pcilib_enable_irq(pcilib_t *ctx, pcilib_dma_flags_t flags) {
63
int pcilib_enable_irq(pcilib_t *ctx, pcilib_irq_type_t irq_type, pcilib_dma_flags_t flags) {
66
const pcilib_dma_info_t *info = pcilib_get_dma_info(ctx);
68
pcilib_error("DMA is not supported by the device");
69
return PCILIB_ERROR_NOTSUPPORTED;
72
if (!ctx->model_info.dma_api) {
73
pcilib_error("DMA Engine is not configured in the current model");
74
return PCILIB_ERROR_NOTAVAILABLE;
77
if (!ctx->model_info.dma_api->enable_irq) {
78
pcilib_error("The IRQs are not supported by configured DMA engine");
79
return PCILIB_ERROR_NOTSUPPORTED;
82
return ctx->model_info.dma_api->enable_irq(ctx->dma_ctx, irq_type, flags);
66
85
int pcilib_disable_irq(pcilib_t *ctx, pcilib_dma_flags_t flags) {
88
const pcilib_dma_info_t *info = pcilib_get_dma_info(ctx);
90
pcilib_error("DMA is not supported by the device");
91
return PCILIB_ERROR_NOTSUPPORTED;
94
if (!ctx->model_info.dma_api) {
95
pcilib_error("DMA Engine is not configured in the current model");
96
return PCILIB_ERROR_NOTAVAILABLE;
99
if (!ctx->model_info.dma_api->disable_irq) {
100
pcilib_error("The IRQs are not supported by configured DMA engine");
101
return PCILIB_ERROR_NOTSUPPORTED;
104
return ctx->model_info.dma_api->disable_irq(ctx->dma_ctx, flags);