From 5154778752e52ba00e274ad53ebff0a5a75e0b81 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Tue, 18 Feb 1997 20:22:52 +0000 Subject: [PATCH] Enlarge the message out buffer from 6 to 8 bytes. Now that sync and wide negotiation messages may be tagged, we were overrunning the old buffer. The variable that was getting squashed is updated before the message goes out, causing corrupted SDTR or WDTR messages. Depending on the phases traversed before message out, this could cause the wrong offset to be negotiated allowing data overruns to occur. The problem is easier to detect with wide targets on the chain since the allowed offset is smaller. Also removed the unnecessary clearing of SPIORDY during the message out phase. We don't rely on SPIORDY any more. --- sys/dev/aic7xxx/aic7xxx.seq | 1 - sys/dev/aic7xxx/aic7xxx_reg.h | 28 +++++++++++----------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index 45719962d923..bc71319ed02a 100644 --- a/sys/dev/aic7xxx/aic7xxx.seq +++ b/sys/dev/aic7xxx/aic7xxx.seq @@ -564,7 +564,6 @@ p_mesgout_dropatn: mvi CLRSINT1,CLRATNO /* drop ATN */ p_mesgout_outb: dec DINDEX - mvi CLRSINT0, CLRSPIORDY mov SCSIDATL,SINDIR jmp p_mesgout_loop diff --git a/sys/dev/aic7xxx/aic7xxx_reg.h b/sys/dev/aic7xxx/aic7xxx_reg.h index 1d8c3ef25d40..520b67749900 100644 --- a/sys/dev/aic7xxx/aic7xxx_reg.h +++ b/sys/dev/aic7xxx/aic7xxx_reg.h @@ -657,11 +657,8 @@ * we can see what is getting thrown away. */ #define REJBYTE 0x030 -/* - * Since the sequencer cannot read QOUTCNT, we use this memory location - * to make sure that we don't overflow the QOUTFIFO when doing SCB Paging. - */ -#define QOUTQCNT 0x031 +#define LASTPHASE 0x031 +#define P_BUSFREE 0x01 /* * Bit vector of targets that have disconnection disabled. @@ -675,7 +672,7 @@ */ #define MSG_LEN 0x034 -/* We reserve 6bytes to store outgoing messages */ +/* We reserve 8bytes to store outgoing messages */ #define MSG0 0x035 #define COMP_MSG0 0xcb /* 2's complement of MSG0 */ #define MSG1 0x036 @@ -683,16 +680,8 @@ #define MSG3 0x038 #define MSG4 0x039 #define MSG5 0x03a - -#define LASTPHASE 0x03b -#define P_BUSFREE 0x01 - -#define ARG_1 0x03c -#define RETURN_1 0x03c -#define SEND_MSG 0x80 -#define SEND_SENSE 0x40 -#define SEND_REJ 0x20 -#define SCB_PAGEDIN 0x10 +#define MSG6 0x03b +#define MSG7 0x03c #define DMAPARAMS 0x03d /* Parameters for DMA Logic */ @@ -774,7 +763,12 @@ #define HSCB_ADDR3 0x057 #define CUR_SCBID 0x058 -#define QFULLCNT 0x059 +#define ARG_1 0x059 +#define RETURN_1 0x059 +#define SEND_MSG 0x80 +#define SEND_SENSE 0x40 +#define SEND_REJ 0x20 +#define SCB_PAGEDIN 0x10 #define SCB_LIST_NULL 0xff