diff options
Diffstat (limited to 'drivers/char/ip2/ip2main.c')
-rw-r--r-- | drivers/char/ip2/ip2main.c | 69 |
1 files changed, 45 insertions, 24 deletions
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 2124dce38f2..e04e66cf2c6 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c @@ -752,7 +752,7 @@ retry: continue; rc = request_irq( ip2config.irq[i], ip2_interrupt, IP2_SA_FLAGS | (ip2config.type[i] == PCI ? IRQF_SHARED : 0), - pcName, (void *)&pcName); + pcName, i2BoardPtrTable[i]); if (rc) { printk(KERN_ERR "IP2: an request_irq failed: error %d\n",rc); ip2config.irq[i] = CIR_POLL; @@ -1166,12 +1166,37 @@ ip2_interrupt_bh(struct work_struct *work) /* */ /* */ /******************************************************************************/ -static irqreturn_t -ip2_interrupt(int irq, void *dev_id) +static void +ip2_irq_work(i2eBordStrPtr pB) +{ +#ifdef USE_IQI + if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) { +// Disable his interrupt (will be enabled when serviced) +// This is mostly to protect from reentrancy. + iiDisableMailIrq(pB); + +// Park the board on the immediate queue for processing. + schedule_work(&pB->tqueue_interrupt); + +// Make sure the immediate queue is flagged to fire. + } +#else + +// We are using immediate servicing here. This sucks and can +// cause all sorts of havoc with ppp and others. The failsafe +// check on iiSendPendingMail could also throw a hairball. + + i2ServiceBoard( pB ); + +#endif /* USE_IQI */ +} + +static void +ip2_polled_interrupt(void) { int i; i2eBordStrPtr pB; - int handled = 0; + const int irq = 0; ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq ); @@ -1183,32 +1208,28 @@ ip2_interrupt(int irq, void *dev_id) // IRQ = 0 for polled boards, we won't poll "IRQ" boards if ( pB && (pB->i2eUsingIrq == irq) ) { - handled = 1; -#ifdef USE_IQI + ip2_irq_work(pB); + } + } - if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) { -// Disable his interrupt (will be enabled when serviced) -// This is mostly to protect from reentrancy. - iiDisableMailIrq(pB); + ++irq_counter; -// Park the board on the immediate queue for processing. - schedule_work(&pB->tqueue_interrupt); + ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 ); +} -// Make sure the immediate queue is flagged to fire. - } -#else -// We are using immediate servicing here. This sucks and can -// cause all sorts of havoc with ppp and others. The failsafe -// check on iiSendPendingMail could also throw a hairball. - i2ServiceBoard( pB ); -#endif /* USE_IQI */ - } - } +static irqreturn_t +ip2_interrupt(int irq, void *dev_id) +{ + i2eBordStrPtr pB = dev_id; + + ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, pB->i2eUsingIrq ); + + ip2_irq_work(pB); ++irq_counter; ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 ); - return IRQ_RETVAL(handled); + return IRQ_HANDLED; } /******************************************************************************/ @@ -1231,7 +1252,7 @@ ip2_poll(unsigned long arg) // Just polled boards, IRQ = 0 will hit all non-interrupt boards. // It will NOT poll boards handled by hard interrupts. // The issue of queued BH interrups is handled in ip2_interrupt(). - ip2_interrupt(0, NULL); + ip2_polled_interrupt(); PollTimer.expires = POLL_TIMEOUT; add_timer( &PollTimer ); |