static irqreturn_t ems_104m_interrupt(int irq, void *dev_id) #endif { struct ems_104m_card *card = dev_id; struct net_device *dev; irqreturn_t retval = IRQ_NONE; int i, again; do { again = 0; /* Check interrupt for each channel */ for (i = 0; i < EMS_104M_MAX_CHAN; i++) { dev = card->net_dev[i]; if (!dev) continue; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) if (sja1000_interrupt(irq, dev, regs) == IRQ_HANDLED) again = 1; #else if (sja1000_interrupt(irq, dev) == IRQ_HANDLED) again = 1; #endif } /* At least one channel handled the interrupt */ if (again) retval = IRQ_HANDLED; } while (again); return retval; }
static irqreturn_t pcan_isr(int irq, void *dev_id) { struct pcan_pccard *card = dev_id; int irq_handled; for (irq_handled = 0; irq_handled < PCC_ISR_MAX_LOOP; irq_handled++) { int nothing_to_handle = 1; int i; for (i = 0; i < card->chan_count; i++) { struct net_device *netdev; if (!pcan_pccard_present(card)) { return IRQ_NONE; } netdev = card->channel[i].netdev; if (netdev && sja1000_interrupt(irq, netdev) == IRQ_HANDLED) nothing_to_handle = 0; } if (nothing_to_handle) break; } return (irq_handled) ? IRQ_HANDLED : IRQ_NONE; }
static irqreturn_t ems_pcmcia_interrupt(int irq, void *dev_id) { struct ems_pcmcia_card *card = dev_id; struct net_device *dev; irqreturn_t retval = IRQ_NONE; int i, again; /* */ if (readw(card->base_addr) != 0xAA55) return IRQ_HANDLED; do { again = 0; /* */ for (i = 0; i < card->channels; i++) { dev = card->net_dev[i]; if (!dev) continue; if (sja1000_interrupt(irq, dev) == IRQ_HANDLED) again = 1; } /* */ if (again) retval = IRQ_HANDLED; } while (again); return retval; }
/* * interrupt service routine */ static irqreturn_t pcan_isr(int irq, void *dev_id) { struct pcan_pccard *card = dev_id; int irq_handled; /* prevent from infinite loop */ for (irq_handled = 0; irq_handled < PCC_ISR_MAX_LOOP; irq_handled++) { /* handle shared interrupt and next loop */ int nothing_to_handle = 1; int i; /* check interrupt for each channel */ for (i = 0; i < card->chan_count; i++) { struct net_device *netdev; /* * check whether the card is present before calling * sja1000_interrupt() to speed up hotplug detection */ if (!pcan_pccard_present(card)) { /* card unplugged during isr */ return IRQ_NONE; } /* * should check whether all or SJA1000_MAX_IRQ * interrupts have been handled: loop again to be sure. */ netdev = card->channel[i].netdev; if (netdev && sja1000_interrupt(irq, netdev) == IRQ_HANDLED) nothing_to_handle = 0; } if (nothing_to_handle) break; } return (irq_handled) ? IRQ_HANDLED : IRQ_NONE; }