Re: [PARPORT] parport_pc_epp_write broken?

From: stef (svoltz@wanadoo.fr)
Date: Tue Aug 13 2002 - 13:44:29 EDT

  • Next message: Ken Hahn: "[PARPORT] BACKPACK USB (and USB2.0) now working in Linux"

    On Mon, Aug 12, 2002 at 01:56:42PM +0100, Tim Waugh wrote:
    > On Sat, Aug 10, 2002 at 02:10:08PM +0200, VOLTZ Stéphane wrote:
    >
    > > >> It seems that when doing EPP read (using ppdev) some data are
    > > >>losts, and some subsequent reads seem to give part of these datas.
    > > >>
    > > The bug shows itself when reading 5100*66 bytes in the following
    > > piece of code:
    > >
    > > mode = 1; /* data_reverse */
    > > rc = ioctl (fd, PPDATADIR, &mode);
    > > #ifdef PPSETFLAGS
    > > mode = PP_FASTREAD;
    > > rc = ioctl (fd, PPSETFLAGS, &mode);
    > > #endif
    > > mode = IEEE1284_MODE_EPP | IEEE1284_DATA;
    > > rc = ioctl (fd, PPSETMODE, &mode);
    > > rc = read (fd, dest, size - 4);
    > >
    > > It seems that 1024 bytes are read OK, but then there is 671 zeroes,
    > > then 1024 bytes from
    > > the scan, 671 zeroes, and so on. All is done within one read. Some other
    > > tests showed that when
    > > scan lines are shorter than 1024, there is no trouble, but when longer,
    > > data is corrupted.
    >
    > Could you show me a strace from this code? I can't see anything wrong
    > in ppdev.c:pp_read at a quick glance.

            Well, from the strace, it appears that reading the parport only brings back
    1024 bytes out of the 1696 asked. Since the code does not check the return code,
    things go wrong. But it is a new behaviour which is not exhibited by 2.4.18,
    which allways returned all the data.

    >
    > > 2.4.19 with parport code from 2.4.18 has still a problem. So must
    > > not come from there.
    > >
    > > I tried to set parport to EPP only in BIOS, and then things failed
    > > earlier. Some EPP read failed:
    > >
    > > mode = IEEE1284_MODE_EPP | IEEE1284_DATA;
    > > rc = ioctl (fd, PPSETMODE, &mode);
    > > rc = read (fd, &bval, 1);
    > > value = bval;
    > >
    > > returned a value of -512
    >
    > Well this is -ERESTARTSYS. I guess you caught a signal for which
    > SA_RESTART wasn't set?

            The SANE backend does not catch any signal, nor does the little test program
    that use it. So I'm a bit puzzled.

    Regards,
            Stef

    -- 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 : Tue Aug 13 2002 - 13:47:32 EDT