Move the include opt_aic7xxx in aic7xxx.h so that all of the driver files get

it automatically.  The AHC_FORCE_PIO option wasn't having any effect because
the PCI probe code didn't include this file.

Fix some problems with the new sync and wide negotiation code.  First off,
go back to async transfers by using a message reject again.  The SCSI II and
III spec indicate that if a target's response to an initiater does not suit
(i.e. its too low), then performing a message reject is the appropriate
response.  If, on the other hand, the initiator begins the negotiation and
we want to go async, we will send back an SDTR message with a 0 period and
offset.

Also fix a really bad negotiation problem caused by a missing "break".  This
would usually hit people that had "smart" wide devices that immediately
attempt sync negotiation after a successful wide negotiation.

2.2 Candidate.
This commit is contained in:
Justin T. Gibbs 1996-11-05 07:57:29 +00:00
parent 775395aaac
commit bf850955ed
2 changed files with 16 additions and 24 deletions

View File

@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: aic7xxx.c,v 1.80 1996/10/25 06:42:51 gibbs Exp $
* $Id: aic7xxx.c,v 1.81 1996/10/28 06:10:00 gibbs Exp $
*/
/*
* TODO:
@ -116,7 +116,6 @@
#include <vm/pmap.h>
#if defined(__FreeBSD__)
#include "opt_aic7xxx.h"
#include <i386/scsi/aic7xxx.h>
#include <dev/aic7xxx/aic7xxx_reg.h>
@ -961,15 +960,15 @@ ahc_handle_seqint(ahc, intstat)
* and didn't have to fall down to async
* transfers.
*/
if ((ahc->sdtrpending & targ_mask) != 0
&& (saved_offset == offset)) {
/*
* Don't send an SDTR back to
* the target
*/
AHC_OUTB(ahc, RETURN_1, 0);
ahc->needsdtr &= ~targ_mask;
ahc->sdtrpending &= ~targ_mask;
if ((ahc->sdtrpending & targ_mask) != 0) {
if (saved_offset == offset) {
/*
* Don't send an SDTR back to
* the target
*/
AHC_OUTB(ahc, RETURN_1, 0);
} else
AHC_OUTB(ahc, RETURN_1, SEND_REJ;
} else {
/*
* Send our own SDTR in reply
@ -978,18 +977,9 @@ ahc_handle_seqint(ahc, intstat)
ahc_construct_sdtr(ahc, /*start_byte*/0,
period, offset);
AHC_OUTB(ahc, RETURN_1, SEND_MSG);
/*
* If we aren't starting a re-negotiation
* because we had to go async in response
* to a "too low" response from the target
* clear the needsdtr flag for this target.
*/
if ((ahc->sdtrpending & targ_mask) == 0)
ahc->needsdtr &= ~targ_mask;
else
ahc->sdtrpending |= targ_mask;
}
ahc->needsdtr &= ~targ_mask;
ahc->sdtrpending &= ~targ_mask;
break;
}
case MSG_EXT_WDTR:
@ -1077,6 +1067,7 @@ ahc_handle_seqint(ahc, intstat)
/* Unknown extended message. Reject it. */
AHC_OUTB(ahc, RETURN_1, SEND_REJ);
}
break;
}
case REJECT_MSG:
{
@ -1209,6 +1200,7 @@ ahc_handle_seqint(ahc, intstat)
hscb->SG_segment_count = 1;
hscb->SG_list_pointer = vtophys(sg);
hscb->data = sg->addr;
/* Maintain SCB_LINKED_NEXT */
hscb->datalen &= 0xFF000000;
hscb->datalen |= sg->len;
hscb->cmdpointer = vtophys(sc);
@ -1749,7 +1741,6 @@ ahc_init(ahc)
printf("%d SCBs\n", ahc->scb_data->maxhscbs);
}
#ifdef AHC_DEBUG
if (ahc_debug & AHC_SHOWMISC) {
printf("%s: hardware scb %d bytes; kernel scb %d bytes; "

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: aic7xxx.h,v 1.30 1996/10/25 06:42:53 gibbs Exp $
* $Id: aic7xxx.h,v 1.31 1996/10/28 06:10:02 gibbs Exp $
*/
#ifndef _AIC7XXX_H_
@ -38,6 +38,7 @@
#if defined(__FreeBSD__)
#include "ahc.h" /* for NAHC from config */
#include "opt_aic7xxx.h" /* for config options */
#endif
#if defined(__NetBSD__)