Re: [PARPORT] allowing select( ) on a device

From: Tim Waugh (twaugh@redhat.com)
Date: Fri Aug 30 2002 - 03:51:38 EDT

  • Next message: Clay Smith: "[PARPORT] parallel emulator??"

    On Fri, Aug 30, 2002 at 12:20:11AM -0300, Lucas Correia Villa Real wrote:

    > Hi,
    >
    > I'm playing around with a driver, but I would like to let applications
    > based on that device hold on with a select() until some data come to the
    > parport.
    > All I found about implementing this was looking at drivers/char/ppdev.c,
    > but I find myself a little confused: to do that, I just need to add a IRQ
    > handler on parport_register_device() that write_control() and
    > wake_up_interruptible()? Why is there an atomic_inc()? What about
    > irqresponse?

    irqresponse here means 'is pp->irqctl valid', and that's why the
    control line write is guarded by it. If PPWCTLONIRQ hasn't been
    called, no write is needed.

    The irqc atomic variable is a count of how many interrupts have
    occurred since the last call to PPCLRIRQ.

    If you aren't doing either of those things, you don't need the
    atomic_inc or the irqresponse/write_control bit.

    Tim.
    */



    -- 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 2b29 : Fri Aug 30 2002 - 03:53:36 EDT