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


Ian Cameron (I.A.Cameron@open.ac.uk)
Mon, 20 Sep 1999 14:24:39 +0100


> > > > 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 :-(

I have modified ppa.c as follows:

        if (ppa_in(host_no, &l, 1)) { /* read status byte */
            /* Check for optional message byte */
            if (ppa_wait(host_no) == (unsigned char) 0xf0)
                printk("ppa.c: line 907\n");
                ppa_in(host_no, &h, 1);
                printk("ppa.c: line 910\n");

/* cmd->result = (DID_OK << 16) + (h << 8) + (l & STATUS_MASK); */

            cmd->result = (DID_OK << 16) + (l & STATUS_MASK);

        }

With the following result...

ppa: Version 2.03 (for Linux 2.2.x)
ppa: Found device at ID 6, Attempting to use EPP 16 bit
ppa: Found device at ID 6, Attempting to use PS/2
ppa: Communication established with ID 6 using PS/2
scsi0 : Iomega VPI0 (ppa) interface
scsi : 1 host.
ppa.c: line 907
ppa.c: line 910
Internal error scsi_obsolete.c 518
status byte = 29

-- 
Cheers, Ian.

-- 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 - 09:27:21 EDT