freebsd-skq/sys/i386
David Greenman 57cb71573d Fixes to the aic7xxx sequencer code and device driver from Justin Gibbs:
1) If a target initiated a sync negotiation with us and happened to chose a
value above 15, the old code inadvertantly truncated it with an "& 0x0f".
If the periferal picked something really bad like 0x32, you'd end up with
an offset of 2 which would hang the drive since it didn't expect to ever
get something so low.  We now do a MIN(maxoffset, given_offset).

2) In the case of Wide cards, we were turning on sync transfers after a
sucessfull wide negotiation.  Now we leave the offset alone in the per
target scratch space (which implies asyncronous transfers since we initialize
it that way) until a syncronous negotation occurs.

3) We were advertizing a max offset of 15 instead of 8 for wide devices.

4) If the upper level SCSI code sent down a "SCSI_RESET", it would hang the
system because we would end up sending a null command to the sequencer.  Now
we handle SCSI_RESET correctly by having the sequencer interrupt us when it
is about to fill the message buffer so that we can fill it in ourselves.
The sequencer will also "simulate" a command complete for these "message only"
SCBs so that the kernel driver can finish up properly.  The cdplay utility
will send a "SCSI_REST" to the cdplayer if you use the reset command.

5) The code that handles SCSIINTs was broken in that if more than one type
of error was true at once, we'd do outbs without the card being paused.
The else clause after the busfree case was also an accident waiting to
happen.  I've now turned this into an if, else if, else type of thing, since
in most cases when we handle one type of error, it should be okay to ignore
the rest (ie if we have a SELTO, who cares if there was a parity error on
the transaction?), but the section should really be rewritten after 2.0.5.
This fix was the least obtrusive way to patch the problem.

6) Only tag either SDTR or WDTR negotiation on an SCB.  The real problem is
that I don't account for the case when an SCB that is tagged to do a particular
type of negotiation completes or SELTOs (selection timeout) without the
negotiation taking place, so the accounting of sdtrpending and wdtrpending
gets screwed up.  In the wide case, if we tag it to do both wdtr and sdtr,
it only performs wdtr (since wdtr must occur first and we spread out the
negotiation over two commands) so we always have sdtrpending set for that
target and we never do a real SDTR.  I fill properly fix the accounting
after 2.0.5 goes out the door, but this works (as confirmed by Dan) on
wide targets.

Other stuff that is also included:

1) Don't do a bzero when recycling SCBs.  The only thing that must explicitly
be set to zero is the scb control byte which is done in ahc_get_scb.  We also
need to set the SG_list_pointer and SG_list_count to 0 for commands that do
not transfer data.

2) Mask the interrupt type printout for the aic7870 case.  The bit we were
using to determine interrupt type is only valid for the aic7770.


Submitted by:	Justin Gibbs
1995-05-17 07:06:02 +00:00
..
apm This is the latest version of the APM stuff from HOSOKAWA, I have looked 1995-02-17 02:22:57 +00:00
bios This is the latest version of the APM stuff from HOSOKAWA, I have looked 1995-02-17 02:22:57 +00:00
boot Use spc, not spt, DUH! Thanks Bruce! 1995-05-11 16:19:50 +00:00
conf Changed swap partition handling/allocation so that it doesn't 1995-05-14 03:00:10 +00:00
eisa Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
i386 Changed swap partition handling/allocation so that it doesn't 1995-05-14 03:00:10 +00:00
ibcs2 Fix CHOWN_RESTRICTED and NO_TRUNC to return correct values per POSIX 1995-05-02 17:14:38 +00:00
include Added apersand constraint to make sure that the source and destination 1995-05-14 22:25:11 +00:00
isa Changes to support the "new" bad144. Adds a "BADSCAN" ioctl and support. 1995-05-16 07:52:17 +00:00
pci Correct pcibus_setup() to return as soon as one test succeeds. 1995-03-22 21:35:39 +00:00
scsi Fixes to the aic7xxx sequencer code and device driver from Justin Gibbs: 1995-05-17 07:06:02 +00:00
Makefile Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some 1993-10-16 19:17:18 +00:00