[PARPORT] parport irq handling v2


Andrea Arcangeli (arcangeli@mbox.queen.it)
Mon, 31 Aug 1998 15:47:19 +0200 (CEST)


I modifyed a bit my changes to the parport irq handling to handle the need
of some hardware as requested.

The irq now is owned by the parport highlevel driver. This allow us to
detect irq out of cad and avoiding the many request_irq() free_irq() done
during the parport scheduling.

Hardware for Amiga will need to implement in the lowlevel parport driver a
callback called examine_irq() with this semantic:

return 0 -> the irq is been generated by the parallel port so run the
            irq handler of the current cad (hug, what does it mean cad ? ;-)
return 1 -> the irq is not been generated from the parallel port so
            return ASAP from the main parport irq handler

examine_irq() will have as parameters (int irq, struct parport *port,
struct pt_regs *regs) to be sure you' ll have everything you could need.

If you detect the irq in examine_irq() and you need to ack it, do that
before return 0.

The lines:

        if (parport_examine_irq(irq, port, regs))
                return;

in parport_share.c will produce 0 asm code with parport_pc, if
PARPORT_OTHERS is not #defined.

Everything will remain compatible with the old code (except if somebody
out there has developed a lowlevel driver that implements examine_irq())
so no pardevice will need to be changed.

The code is tested on i386/parport_pc/UP/ppa/lp only.

Here the new parport code against 2.1.119:

        ftp://e-mind.com/pub/linux/parport/parport-arca-2.1.119-3.diff.gz

I have not said this code has to go in 2.2 but at least I just implemented
it ;-)

Comments welcome.

Andrea[s] Arcangeli

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:18:11 EST