/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/nwl_irq.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-20 20:01:04 UTC
  • Revision ID: csa@suren.me-20150420200104-b5xny65io8lvoz3w
Big redign of model structures

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    val &= ~(DMA_INT_ENABLE|DMA_USER_INT_ENABLE);
50
50
    nwl_write_register(val, ctx, ctx->base_addr, REG_DMA_CTRL_STATUS);
51
51
    
52
 
    pcilib_clear_irq(ctx->pcilib, NWL_DMA_IRQ_SOURCE);
 
52
    pcilib_clear_irq(ctx->dmactx.pcilib, NWL_DMA_IRQ_SOURCE);
53
53
 
54
54
    if (type & PCILIB_DMA_IRQ) val |= DMA_INT_ENABLE;
55
55
    if (type & PCILIB_EVENT_IRQ) val |= DMA_USER_INT_ENABLE;
104
104
    uint32_t val;
105
105
    
106
106
    nwl_dma_t *ctx = (nwl_dma_t*)vctx;
107
 
    pcilib_nwl_engine_description_t *info = ctx->engines + irq_source;
 
107
    pcilib_nwl_engine_context_t *ectx = ctx->engines + irq_source;
108
108
 
109
109
    if (irq_type != PCILIB_DMA_IRQ) return PCILIB_ERROR_NOTSUPPORTED;
110
 
    if (irq_source >= ctx->n_engines) return PCILIB_ERROR_NOTAVAILABLE;
 
110
    if (irq_source >= ctx->dmactx.pcilib->num_engines) return PCILIB_ERROR_NOTAVAILABLE;
111
111
 
112
 
    nwl_read_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS);
 
112
    nwl_read_register(val, ctx, ectx->base_addr, REG_DMA_ENG_CTRL_STATUS);
113
113
    if (val & DMA_ENG_INT_ACTIVE_MASK) {
114
114
        val |= DMA_ENG_ALLINT_MASK;
115
 
        nwl_write_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS);
 
115
        nwl_write_register(val, ctx, ectx->base_addr, REG_DMA_ENG_CTRL_STATUS);
116
116
    }
117
117
    
118
118
    return 0;