summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1996-11-05 07:57:29 +0000
committergibbs <gibbs@FreeBSD.org>1996-11-05 07:57:29 +0000
commitfd95d6b4791a6e2c35e7d151212bfd1c109afa22 (patch)
tree4b409b44e5e440b724644065badd9007b46fec0d /sys
parenteea6cd21c784a3ec04f23d6759724bd2a5ea6bdc (diff)
downloadFreeBSD-src-fd95d6b4791a6e2c35e7d151212bfd1c109afa22.zip
FreeBSD-src-fd95d6b4791a6e2c35e7d151212bfd1c109afa22.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/scsi/aic7xxx.c37
-rw-r--r--sys/i386/scsi/aic7xxx.h3
2 files changed, 16 insertions, 24 deletions
diff --git a/sys/i386/scsi/aic7xxx.c b/sys/i386/scsi/aic7xxx.c
index af56bb5..ae48976 100644
--- a/sys/i386/scsi/aic7xxx.c
+++ b/sys/i386/scsi/aic7xxx.c
@@ -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; "
diff --git a/sys/i386/scsi/aic7xxx.h b/sys/i386/scsi/aic7xxx.h
index d939535..02d6f3d 100644
--- a/sys/i386/scsi/aic7xxx.h
+++ b/sys/i386/scsi/aic7xxx.h
@@ -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__)
OpenPOWER on IntegriCloud