/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_engine.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:
77
77
    if (info->reused) {
78
78
        info->preserve = 1;
79
79
 
80
 
            // Acknowledge asserted engine interrupts    
81
 
        nwl_read_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS);
82
 
        if (val & DMA_ENG_INT_ACTIVE_MASK) {
83
 
            val |= DMA_ENG_ALLINT_MASK;
84
 
            nwl_write_register(val, ctx, base, REG_DMA_ENG_CTRL_STATUS);
85
 
        }
 
80
        dma_nwl_acknowledge_irq(ctx, PCILIB_DMA_IRQ, dma);
86
81
 
87
82
#ifdef NWL_GENERATE_DMA_IRQ
88
83
        dma_nwl_enable_engine_irq(ctx, dma);
131
126
            return PCILIB_ERROR_TIMEOUT;
132
127
        }
133
128
    
134
 
            // Acknowledge asserted engine interrupts    
135
 
        if (val & DMA_ENG_INT_ACTIVE_MASK) {
136
 
            val |= DMA_ENG_ALLINT_MASK;
137
 
            nwl_write_register(val, ctx, base, REG_DMA_ENG_CTRL_STATUS);
138
 
        }
 
129
        dma_nwl_acknowledge_irq(ctx, PCILIB_DMA_IRQ, dma);
139
130
 
140
131
        ring_pa = pcilib_kmem_get_pa(ctx->pcilib, info->ring);
141
132
        nwl_write_register(ring_pa, ctx, info->base_addr, REG_DMA_ENG_NEXT_BD);
206
197
            nwl_write_register(ring_pa, ctx, info->base_addr, REG_SW_NEXT_BD);
207
198
        }
208
199
    }
209
 
 
210
 
        // Acknowledge asserted engine interrupts    
211
 
    if (val & DMA_ENG_INT_ACTIVE_MASK) {
212
 
        val |= DMA_ENG_ALLINT_MASK;
213
 
        nwl_write_register(val, ctx, base, REG_DMA_ENG_CTRL_STATUS);
214
 
    }
 
200
    
 
201
    dma_nwl_acknowledge_irq(ctx, PCILIB_DMA_IRQ, dma);
215
202
 
216
203
    if (info->preserve) {
217
204
        flags = PCILIB_KMEM_FLAG_REUSE;