Re: [PARPORT] PPA Zip: unsupported message byte 187 received


grant@torque.net
Mon, 20 Sep 1999 07:25:15 -0400 (EDT)


> > > the latest stable kernel (2.3.13pre9, but the bugs were fixed in 2.2.9
> > ^^^^^^^^^^ 2.2.13pre9, of course I meant.
>
> I've just tried 2.2.12 (RedHat RPM 2.2.12-9) and it does exactly the same :-(

I haven't been following this thread, but it may be useful to point out that
the ZIP drive does not have a SCSI MSG line, so it is not actually
possible for it to pass a message byte.

I just had a look at the current ppa.c and the following code looks
dubious to me (but please remember that while my name still appears on
this driver, I haven't worked on it for about three years, so I may
be confused):

        if (ppa_in(host_no, &l, 1)) { /* read status byte */
            /* Check for optional message byte */
            if (ppa_wait(host_no) == (unsigned char) 0xf0)
/****/ ppa_in(host_no, &h, 1);
            cmd->result = (DID_OK << 16) + (h << 8) + (l & STATUS_MASK);

I'd recommend adding some debugging to see if the line marked with /****/
gets executed. If it does, it will be picking up some random bit pattern
off the bus and claiming that it is a message byte.

By rights, you should be able to just eliminate "+ (h << 8)" from the
last line and get things back in working order.

I believe I know where this came from: the vpi2 protocol (aka IMM)
is a 16 bit protocol - so the "status phase" is not cleared until two
bytes are read from that device. I suspect some code from IMM creeped
into PPA.

If that code does get executed here, it is probably because of a timing
race between the PPA adapter and the driver. PPA doesn't give the
programmer the ability to do full REQ/ACK handshaking :-(

--------------------------------------------------------------------------
Grant R. Guenther grant@torque.net
--------------------------------------------------------------------------

-- 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 2.0b3 on Mon 20 Sep 1999 - 07:27:35 EDT