Re: [PARPORT] [PATCH] 2.4.3 parport/ppdev hacks and fixes

From: Tim Waugh (tim@cyberelk.demon.co.uk)
Date: Sun Apr 22 2001 - 07:08:27 EDT

  • Next message: Tim Waugh: "Re: [PARPORT] [PATCH] 2.4.3 parport/ppdev hacks and fixes"
  • Next message: Fred Barnes: "Re: [PARPORT] [PATCH] 2.4.3 parport/ppdev hacks and fixes"

    On Sun, Apr 22, 2001 at 02:38:29AM +0100, Fred Barnes wrote:

    > Appended to this message is said promised patch for parport/ppdev/etc.
    > In breif, the things it adds/changes/fixes are:
    >
    > * support for fast reads/writes (only in EPP mode at the moment).
    > This makes EPP behave something like the ppa/imm drivers, in
    > that a timeout is only checked for after we've in'd/out'd the
    > data. This assumes that the device can source/sink the required
    > amount. If a timeout happens, -EIO is returned, as (afaik) it's
    > impossible to tell how much was read/written OK (well, maybe 1
    > byte is the exception). To do this, something calls
    > parport_{read,write} with (len | 0x80000000). I guess this is OK
    > since we're not likely to want to transfer >2gb in one go, and
    > the return type of these is signed anyway.

    Excellent. The only thing is that I had already earmarked
    PARPORT_EPP_FAST for this purpose (in parport.h). The idea was to use
    it like this:

    port->ops->epp_write_data (port, buf, len, PARPORT_EPP_FAST);

    What do you think?

    > * various new IOCTLs added to ppdev, to:
    > - get hardware supported modes of parport
    > - get the current IEEE mode/phase
    > - enable/disable fast reads/writes as described above

    All good.

    > * change in ppdev, so that if a device releases the port while
    > in non-compatability mode, it will be put back into compatability
    > mode when close()d. This caused some problems with our
    > hardware, as it was still in EPP/ECP the next time we ran the
    > client software.

    Oh, yes, this is a bug-fix. It should do that.

    > * BYTE mode will be used over preference to NIBBLE for reverse
    [...]
    > * software emulated EPP fixed (and relevant chunks added to
    [...]
    > * added some debugging aids (dump_parport_state) to parport_pc.h

    All good.

    > + unsigned char dcr = inb (CONTROL (p));

    It probably doesn't matter since this is just debug, but some ports
    seem to return funny values when you read from this directly, so it
    might be worth displaying this _and_ the soft copy.

    Also:

    > +/* For fast reads/writes */
    > +#define PPGETFASTR _IOR(PP_IOCTL, 0x9a, int)
    > +#define PPGETFASTW _IOR(PP_IOCTL, 0x9b, int)
    > +#define PPSETFASTR _IOW(PP_IOCTL, 0x9c, int)
    > +#define PPSETFASTW _IOW(PP_IOCTL, 0x9d, int)

    If you prefer the 'flags' method of doing this, these could turn into
    PP[GS]ETFLAGS.

    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 : Sun Apr 22 2001 - 07:09:51 EDT