diff options
author | gibbs <gibbs@FreeBSD.org> | 1996-06-09 17:33:18 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1996-06-09 17:33:18 +0000 |
commit | 7f880a4a3399287cffa3317a5f87c613f910c894 (patch) | |
tree | 12dbc9f886f063c3b554c48d6363d74badbb3848 /sys/dev/aic7xxx | |
parent | 8b9bc1f5a406e3d6b5f9a905a2ad0fa1053c91f3 (diff) | |
download | FreeBSD-src-7f880a4a3399287cffa3317a5f87c613f910c894.zip FreeBSD-src-7f880a4a3399287cffa3317a5f87c613f910c894.tar.gz |
Detect and report dataphase overruns. Put the adapter into 'Bit Bucket'
mode when this occurs and allow the target to complete the transaction.
Force a retry on overruns since they are usually caused by termination or
cable problems.
Diffstat (limited to 'sys/dev/aic7xxx')
-rw-r--r-- | sys/dev/aic7xxx/aic7xxx.seq | 27 | ||||
-rw-r--r-- | sys/dev/aic7xxx/aic7xxx_reg.h | 7 |
2 files changed, 32 insertions, 2 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index 4613d9f..36ff790 100644 --- a/sys/dev/aic7xxx/aic7xxx.seq +++ b/sys/dev/aic7xxx/aic7xxx.seq @@ -39,7 +39,7 @@ * *-M************************************************************************/ -VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.40 1996/05/31 06:30:15 gibbs Exp $" +VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.41 1996/06/08 06:54:06 gibbs Exp $" #if defined(__NetBSD__) #include "../../../../dev/ic/aic7xxxreg.h" @@ -340,12 +340,29 @@ data_phase_init: or FLAGS, DPHASE /* We have seen a data phase */ data_phase_loop: +/* Guard against overruns */ + test SG_COUNT, 0xff jnz data_phase_inbounds +/* + * Turn on 'Bit Bucket' mode, set the transfer count to + * 16meg and let the target run until it changes phase. + * When the transfer completes, notify the host that we + * had an overrun. + */ + or SXFRCTL1,BITBUCKET + mvi STCNT0,0xff + mvi STCNT1,0xff + mvi STCNT2,0xff + +data_phase_inbounds: /* If we are the last SG block, don't set wideodd. */ cmp SG_COUNT,0x01 jne data_phase_wideodd and DMAPARAMS, 0xbf /* Turn off WIDEODD */ data_phase_wideodd: mov DMAPARAMS call dma +/* Go tell the host about any overruns */ + test SXFRCTL1,BITBUCKET jnz data_phase_overrun + /* Exit if we had an underrun */ test SSTAT0,SDONE jz data_phase_finish /* underrun STCNT != 0 */ @@ -447,6 +464,14 @@ data_phase_finish: mov SCB_RESID_SGCNT, SG_COUNT jmp ITloop +data_phase_overrun: +/* + * Turn off BITBUCKET mode and notify the host + */ + and SXFRCTL1,0x7f /* ~BITBUCKET */ + mvi INTSTAT,DATA_OVERRUN + jmp ITloop + /* * Command phase. Set up the DMA registers and let 'er rip. */ diff --git a/sys/dev/aic7xxx/aic7xxx_reg.h b/sys/dev/aic7xxx/aic7xxx_reg.h index 5226dbb..b9cd5d2 100644 --- a/sys/dev/aic7xxx/aic7xxx_reg.h +++ b/sys/dev/aic7xxx/aic7xxx_reg.h @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx_reg.h,v 1.10 1996/05/10 16:28:00 gibbs Exp $ + * $Id: aic7xxx_reg.h,v 1.11 1996/05/21 18:32:23 gibbs Exp $ */ /* @@ -434,6 +434,11 @@ * when we were expecting * another msgin byte. */ +#define DATA_OVERRUN 0xe1 /* + * Target attempted to write + * beyond the bounds of its + * command. + */ #define BRKADRINT 0x08 #define SCSIINT 0x04 #define CMDCMPLT 0x02 |