summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1996-03-31 03:02:37 +0000
committergibbs <gibbs@FreeBSD.org>1996-03-31 03:02:37 +0000
commit52d94c6588bb94b0c11097db21dda65c23b06d1b (patch)
tree60abf4a1c8a40a856553a3c99cf1ee9403349f4b /sys/dev
parent9c6e00937fa6655e49bc3a7ec0a2bd3a080af2ad (diff)
downloadFreeBSD-src-52d94c6588bb94b0c11097db21dda65c23b06d1b.zip
FreeBSD-src-52d94c6588bb94b0c11097db21dda65c23b06d1b.tar.gz
aic7xxx.seq:
Fix support for the aic7850 by looking only at the relavent bits of the QINCNT. The 7850 puts random garbage in the high bits and all my attempts to determine the cause of this failed. This approach does seem to work around the problem. Don't trust SCSIPERR to tell us when there is a parity error. On some revs of the 7870 and the 7880, this bit follows the parity of the current byte. Instead of using a SEQINT to tell the kernel, re-enable the standard parity error interrupt since it seems to pause the sequencer right at the time of the error which is the effect we were looking for anyway. aic7xxx_reg.h: Remove PARITY_ERROR seqeuncer interrupt type, its no longer used. Define QCOUNTMASK as the SRAM location for the mask to use on the QINCNT register. QCOUNTMASK is determined by the number of SCBs supported by the device we're working on. aic7xxx_asm.c Properly check the return value of fopen, and define the arg list in getopt correctly. Submitted by: Pete Bentley <pete@demon.net>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/aic7xxx/aic7xxx.seq14
-rw-r--r--sys/dev/aic7xxx/aic7xxx_asm.c8
-rw-r--r--sys/dev/aic7xxx/aic7xxx_reg.h14
-rw-r--r--sys/dev/aic7xxx/aicasm.c8
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm.c8
5 files changed, 21 insertions, 31 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq
index 8a7f559..7f5d8b4 100644
--- a/sys/dev/aic7xxx/aic7xxx.seq
+++ b/sys/dev/aic7xxx/aic7xxx.seq
@@ -41,7 +41,7 @@
*
*-M************************************************************************/
-VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.30 1996/01/29 03:12:02 gibbs Exp $"
+VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.31 1996/03/10 07:02:31 gibbs Exp $"
#include "../../dev/aic7xxx/aic7xxx_reg.h"
@@ -94,7 +94,8 @@ poll_for_work:
start2:
test SSTAT0,SELDI jnz reselect
cmp WAITING_SCBH,SCB_LIST_NULL jne start_waiting
- test QINCNT,0xff jz poll_for_work
+ mov A, QCNTMASK
+ test QINCNT,A jz poll_for_work
/*
* We have at least one queued SCB now and we don't have any
@@ -273,15 +274,6 @@ ITloop:
test SSTAT1,BUSFREE jnz p_busfree
test SSTAT1,REQINIT jz ITloop
-/*
- * If we've had a parity error, let the driver know before
- * we overwrite LASTPHASE.
- */
- test SSTAT1, SCSIPERR jz parity_okay
- or CLRSINT1, CLRSCSIPERR
- mvi INTSTAT, PARITY_ERROR
-
-parity_okay:
and A,PHASE_MASK,SCSISIGI
mov LASTPHASE,A
mov SCSISIGO,A
diff --git a/sys/dev/aic7xxx/aic7xxx_asm.c b/sys/dev/aic7xxx/aic7xxx_asm.c
index 402b337..cd1330e 100644
--- a/sys/dev/aic7xxx/aic7xxx_asm.c
+++ b/sys/dev/aic7xxx/aic7xxx_asm.c
@@ -43,7 +43,7 @@
* are token separators.
*
*-M*************************************************************************/
-static char id[] = "$Id: aic7xxx_asm.c,v 1.10 1996/01/03 06:25:31 gibbs Exp $";
+static char id[] = "$Id: aic7xxx_asm.c,v 1.11 1996/01/05 01:48:07 gibbs Exp $";
#include <ctype.h>
#include <stdio.h>
#include <string.h>
@@ -585,7 +585,7 @@ main(int argc, char **argv)
int fd[2];
ofile = NULL;
- while ((c = getopt(argc, argv, "dho:vD")) != EOF) {
+ while ((c = getopt(argc, argv, "dho:vD:")) != EOF) {
switch (c) {
case 'd':
debug = !0;
@@ -603,7 +603,7 @@ main(int argc, char **argv)
}
case 'o':
- if ((ofile = fopen(optarg, "w")) < 0) {
+ if ((ofile = fopen(optarg, "w")) == NULL) {
perror(optarg);
exit(EXIT_FAILURE);
}
@@ -636,7 +636,7 @@ main(int argc, char **argv)
}
if (!ofile) {
- if ((ofile = fopen(ADOTOUT, "w")) < 0) {
+ if ((ofile = fopen(ADOTOUT, "w")) == NULL) {
perror(ADOTOUT);
exit(EXIT_FAILURE);
}
diff --git a/sys/dev/aic7xxx/aic7xxx_reg.h b/sys/dev/aic7xxx/aic7xxx_reg.h
index 4c421c5..f45e409 100644
--- a/sys/dev/aic7xxx/aic7xxx_reg.h
+++ b/sys/dev/aic7xxx/aic7xxx_reg.h
@@ -18,7 +18,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: aic7xxx_reg.h,v 1.5 1996/01/29 03:12:06 gibbs Exp $
+ * $Id: aic7xxx_reg.h,v 1.6 1996/03/10 07:02:32 gibbs Exp $
*/
/*
@@ -424,10 +424,6 @@
* when we were expecting
* another msgin byte.
*/
-#define PARITY_ERROR 0xe1 /*
- * Sequencer detected a parity
- * error.
- */
#define BRKADRINT 0x08
#define SCSIINT 0x04
#define CMDCMPLT 0x02
@@ -705,9 +701,11 @@
* head of list of SCBs awaiting
* selection
*/
-#define WAITING_SCBT 0x058 /*
- * tail of list of SCBs awaiting
- * selection
+#define QCNTMASK 0x058 /*
+ * Mask of bits to test against
+ * when looking at the Queue Count
+ * registers. Works around a bug
+ * on aic7850 chips.
*/
#define COMP_SCBCOUNT 0x059
#define SCB_LIST_NULL 0xff
diff --git a/sys/dev/aic7xxx/aicasm.c b/sys/dev/aic7xxx/aicasm.c
index 402b337..cd1330e 100644
--- a/sys/dev/aic7xxx/aicasm.c
+++ b/sys/dev/aic7xxx/aicasm.c
@@ -43,7 +43,7 @@
* are token separators.
*
*-M*************************************************************************/
-static char id[] = "$Id: aic7xxx_asm.c,v 1.10 1996/01/03 06:25:31 gibbs Exp $";
+static char id[] = "$Id: aic7xxx_asm.c,v 1.11 1996/01/05 01:48:07 gibbs Exp $";
#include <ctype.h>
#include <stdio.h>
#include <string.h>
@@ -585,7 +585,7 @@ main(int argc, char **argv)
int fd[2];
ofile = NULL;
- while ((c = getopt(argc, argv, "dho:vD")) != EOF) {
+ while ((c = getopt(argc, argv, "dho:vD:")) != EOF) {
switch (c) {
case 'd':
debug = !0;
@@ -603,7 +603,7 @@ main(int argc, char **argv)
}
case 'o':
- if ((ofile = fopen(optarg, "w")) < 0) {
+ if ((ofile = fopen(optarg, "w")) == NULL) {
perror(optarg);
exit(EXIT_FAILURE);
}
@@ -636,7 +636,7 @@ main(int argc, char **argv)
}
if (!ofile) {
- if ((ofile = fopen(ADOTOUT, "w")) < 0) {
+ if ((ofile = fopen(ADOTOUT, "w")) == NULL) {
perror(ADOTOUT);
exit(EXIT_FAILURE);
}
diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c
index 402b337..cd1330e 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm.c
+++ b/sys/dev/aic7xxx/aicasm/aicasm.c
@@ -43,7 +43,7 @@
* are token separators.
*
*-M*************************************************************************/
-static char id[] = "$Id: aic7xxx_asm.c,v 1.10 1996/01/03 06:25:31 gibbs Exp $";
+static char id[] = "$Id: aic7xxx_asm.c,v 1.11 1996/01/05 01:48:07 gibbs Exp $";
#include <ctype.h>
#include <stdio.h>
#include <string.h>
@@ -585,7 +585,7 @@ main(int argc, char **argv)
int fd[2];
ofile = NULL;
- while ((c = getopt(argc, argv, "dho:vD")) != EOF) {
+ while ((c = getopt(argc, argv, "dho:vD:")) != EOF) {
switch (c) {
case 'd':
debug = !0;
@@ -603,7 +603,7 @@ main(int argc, char **argv)
}
case 'o':
- if ((ofile = fopen(optarg, "w")) < 0) {
+ if ((ofile = fopen(optarg, "w")) == NULL) {
perror(optarg);
exit(EXIT_FAILURE);
}
@@ -636,7 +636,7 @@ main(int argc, char **argv)
}
if (!ofile) {
- if ((ofile = fopen(ADOTOUT, "w")) < 0) {
+ if ((ofile = fopen(ADOTOUT, "w")) == NULL) {
perror(ADOTOUT);
exit(EXIT_FAILURE);
}
OpenPOWER on IntegriCloud