static irqreturn_t c2_interrupt(int irq, void *dev_id) { unsigned int netisr0, dmaisr; int handled = 0; struct c2_dev *c2dev = (struct c2_dev *) dev_id; netisr0 = readl(c2dev->regs + C2_NISR0); if (netisr0) { c2_rx_interrupt(c2dev->netdev); c2_tx_interrupt(c2dev->netdev); writel(netisr0, c2dev->regs + C2_NISR0); handled++; } dmaisr = readl(c2dev->regs + C2_DISR); if (dmaisr) { writel(dmaisr, c2dev->regs + C2_DISR); c2_rnic_interrupt(c2dev); handled++; } if (handled) { return IRQ_HANDLED; } else { return IRQ_NONE; } }
/* * Handle netisr0 TX & RX interrupts. */ static irqreturn_t c2_interrupt(int irq, void *dev_id) { unsigned int netisr0, dmaisr; int handled = 0; struct c2_dev *c2dev = (struct c2_dev *) dev_id; /* Process CCILNET interrupts */ netisr0 = readl(c2dev->regs + C2_NISR0); if (netisr0) { /* * There is an issue with the firmware that always * provides the status of RX for both TX & RX * interrupts. So process both queues here. */ c2_rx_interrupt(c2dev->netdev); c2_tx_interrupt(c2dev->netdev); /* Clear the interrupt */ writel(netisr0, c2dev->regs + C2_NISR0); handled++; } /* Process RNIC interrupts */ dmaisr = readl(c2dev->regs + C2_DISR); if (dmaisr) { writel(dmaisr, c2dev->regs + C2_DISR); c2_rnic_interrupt(c2dev); handled++; } if (handled) { return IRQ_HANDLED; } else { return IRQ_NONE; } }