Re: [PARPORT] parport_pc_epp_write broken?

From: Tim Waugh (twaugh@redhat.com)
Date: Mon Aug 12 2002 - 08:56:42 EDT

  • Next message: myahya@talk21.com: "[PARPORT] urgent help needed ( parallael port access in java)"

    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.

    > 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?

    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 : Mon Aug 12 2002 - 09:02:20 EDT