1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| static void rx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
etrax_dma_descr* dma_d;
unsigned long ireg = *R_IRQ_MASK2_RD;
int i;
DIRQ(printk("RX IRQ\n"));
for (i = 0; i < NBR_OF_PORTS; i++)
{
ext_dma_port* port = &ports[i];
if (ireg & (1 << port->input_dma_descr_bit))
{
dma_d = (etrax_dma_descr*)phys_to_virt(*port->input_dma_descr);
if (!dma_d)
dma_d = port->prev_in_descr;
while (port->next_in_descr != dma_d) {
port->writep += TRANSFER_SIZE;
port->next_in_descr = phys_to_virt(port->next_in_descr->next);
}
wake_up_interruptible(&port->in_wait_q);
*port->output_dma_clr_irq = IO_STATE(R_DMA_CH0_CLR_INTR, clr_descr, do);
}
}
} |
Partager