/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to dma.c

  • Committer: Suren A. Chilingaryan
  • Date: 2011-07-18 14:42:51 UTC
  • Revision ID: csa@dside.dyndns.org-20110718144251-nmbl7xhcq00mfx1p
IRQ acknowledgement support in the engine API

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    }
115
115
    
116
116
    if (!ctx->model_info.dma_api->enable_irq) {
117
 
        //pcilib_error("The IRQs are not supported by configured DMA engine");
118
117
        return 0;
119
118
    }
120
119
 
136
135
    }
137
136
    
138
137
    if (!ctx->model_info.dma_api->disable_irq) {
139
 
        //pcilib_error("The IRQs are not supported by configured DMA engine");
140
138
        return 0;
141
139
    }
142
140
    
143
141
    return ctx->model_info.dma_api->disable_irq(ctx->dma_ctx, flags);
144
142
}
145
143
 
 
144
int pcilib_acknowledge_irq(pcilib_t *ctx, pcilib_irq_type_t irq_type, pcilib_irq_source_t irq_source) {
 
145
    int err; 
 
146
 
 
147
    const pcilib_dma_info_t *info =  pcilib_get_dma_info(ctx);
 
148
    if (!info) {
 
149
        pcilib_error("DMA is not supported by the device");
 
150
        return PCILIB_ERROR_NOTSUPPORTED;
 
151
    }
 
152
 
 
153
    if (!ctx->model_info.dma_api) {
 
154
        pcilib_error("DMA Engine is not configured in the current model");
 
155
        return PCILIB_ERROR_NOTAVAILABLE;
 
156
    }
 
157
    
 
158
    if (!ctx->model_info.dma_api->acknowledge_irq) {
 
159
        return 0;
 
160
    }
 
161
 
 
162
    return ctx->model_info.dma_api->acknowledge_irq(ctx->dma_ctx, irq_type, irq_source);
 
163
}
 
164
 
 
165
 
146
166
 
147
167
typedef struct {
148
168
    size_t size;