Subject: Re: More on se0
To: Matthias Pfaller <leo@klondike.dachau.marco.de>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: port-atari
Date: 08/12/1998 15:04:08
Hi Leo....uhm...Matthias ;-)

On Tue 11 Aug 1998, Matthias Pfaller wrote:
> In article <199808102131.WAA24545@aire.ncl.ac.uk>,
> 	J.D.Coleman@newcastle.ac.uk (Julian Coleman) writes:
> > Aha!  I've just read the notes in ncr5380.doc.  I was wondering if there
> > was something different in the MI code that didn't display the problem
> > with the se code.
> 
> I'm just poking around in the dark, but sys/arch/atari/dev/ncr5380.c
> uses command_size() in information_transfer to determine the size of the
> SCSI command (and not like sys/dev/ic/ncr5380sbc.c xs->cmdlen). The
> EA41x's receive command is a *one byte* command. I think the atari code
> would think that this command is 12 bytes long... I don't know if this
> would hurt.

You might have a point of failure here. As a temporary workaround the piece
of code in information_transfer() might be changed to read:
       case PH_CMD :
            if (reqp->xcmd.opcode == REQUEST_SENSE)
                /* Probably 12, but I'm too lazy to look it up ;-) */
		len = command_size(reqp->xcmd.opcode);
	    else len = reqp->xs->cmdlen;
            transfer_pio(&phase, (u_char *)&reqp->xcmd, &len, 0);
            ......

Side note:
  The sbc code is a bit strange wrt. sense commands either! Around line
2027 in ncr5380sbc.c, the check 'if (len != xs->cmdlen)' looks suspicious
in the 'if (sr->sr_flags & SR_SENSE)' case.....

Leo.