Re: [PARPORT] lp select() problem

From: Tim Waugh (twaugh@redhat.com)
Date: Fri Sep 22 2000 - 13:50:34 EDT

  • Next message: Gunther Mayer: "[PARPORT] Patch[2.4.0t9]lp.c: Fix Oops with 4 parallel ports on rmmod"

    On Tue, Sep 19, 2000 at 07:06:26PM -0400, Alexander Stavitsky wrote:

    > Is there any newer patch? Was that patch working? tested?

    No, I never had a working patch with the hardware I had. It probably
    would have worked with non-broken hardware, but since the broken
    hardware seems to be quite widespread, I put the patch away and forgot
    about it.

    Basically the way to do it and still remain compatible with this
    stupid hardware is to periodically switch to reverse mode and check to
    see if there's any data available, and then _switch_ _back_
    (i.e. _don't_ rely on an interrupt). This way it should work even
    without interrupts.

    I don't have a network connection as I'm writing this, so I don't know
    what's in the message you referred to, but the problem I faced was
    with printers that stop _dead_ when in reverse mode, even when they
    have a buffer full of data waiting to go on paper and are _not_
    advertising themselves as busy. Then they carry on when you go back
    to forward mode.

    Patrick Powell occasionally sends me mail pleading with me to get
    select() working, for the reason you mentioned. It just isn't as easy
    as it might sound.

    I'd be very interested to know what other vendors have done to make
    this work, if there are implementations out there that have working
    selectable /dev/lp devices. Does anyone know of any? What does
    Solaris do, for example?

    (A side-issue that Patrick raised was that according to POSIX select
    returning readable means that a read is _guaranteed_ not to block,
    which we can't do without reading a byte from the device first. I
    don't want to do that stuff, it's just too icky. POSIX has nothing to
    say about device special files anyway, AFAIK.)

    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 Sep 22 2000 - 13:55:08 EDT