freebsd-nq/sys/dev
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
..
aic7xxx Fixes to the aic7xxx sequencer code and device driver from Justin Gibbs: 1995-05-17 07:06:02 +00:00
cy CVS: 1995-03-28 12:29:11 +00:00
de Fixed mbuf leak and panic that occurred when packets got too memory 1995-05-05 20:09:51 +00:00
ed After carefully reading three reference documents, and analyzing 1995-05-14 11:01:20 +00:00
eisa files for the eisa specific autoconfiguration.. 1995-04-23 08:55:43 +00:00
ep Add a class field to devconf and mst drivers. 1995-04-12 20:48:13 +00:00
fdc Fix -Wformat warnings, still need to do something about %b and pointer 1995-05-09 12:26:00 +00:00
fe Added `fe' device drive r for Fujitsu MB86960A family. 1995-04-23 18:31:50 +00:00
ic RISCom/8 driver 1995-05-12 15:09:29 +00:00
ie Add a class field to devconf and mst drivers. 1995-04-12 20:48:13 +00:00
joy Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-28 07:58:53 +00:00
kbd Change fkey 63 from ^[[K to ^[[~. 1995-03-28 21:30:13 +00:00
lnc Add a class field to devconf and mst drivers. 1995-04-12 20:48:13 +00:00
mcd Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
mse Add a class field to devconf and mst drivers. 1995-04-12 20:48:13 +00:00
pci bzero the malloced pci_devconf structure. This should fix the problem with 1995-05-04 06:57:11 +00:00
ppbus Added $Id$ 1994-08-02 07:55:43 +00:00
rc RISCom/8 driver 1995-05-12 15:09:29 +00:00
scd Fix -Wformat warnings, still need to do something about %b and pointer 1995-05-09 12:26:00 +00:00
sio Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
snp same 1995-02-27 19:47:53 +00:00
speaker Check for 0 before dividing by it. Patch from Paul Traina, modified 1995-05-05 06:15:11 +00:00
syscons Changed relase number in snake_saver.c from 2.1 to 2.0.5 1995-05-16 19:10:11 +00:00
vn Change dsioctl() interface to allow DIOCSYNCSLICEINFO to update the caller's 1995-04-30 15:14:34 +00:00