diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index 76d57f1054a..f3459be17ee 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.47 1996/11/05 07:51:29 gibbs Exp $" +VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.48 1996/11/11 05:16:36 gibbs Exp $" #if defined(__NetBSD__) #include "../../../../dev/ic/aic7xxxreg.h" @@ -508,6 +508,8 @@ p_command: * and store it into the SCB. */ p_status: + call assert + mvi SCB_TARGET_STATUS call inb_first jmp mesgin_done @@ -539,8 +541,9 @@ p_mesgout_loop: cmp DINDEX,1 jne p_mesgout_outb /* last byte? */ mvi CLRSINT1,CLRATNO /* drop ATN */ p_mesgout_outb: + test SSTAT0, SPIORDY jz p_mesgout_outb dec DINDEX - or CLRSINT1, CLRREQINIT + mvi CLRSINT1, CLRREQINIT mov SCSIDATL,SINDIR p_mesgout4: @@ -658,10 +661,12 @@ complete: mov A, QFULLCNT complete_poll: cmp QOUTQCNT, A je complete_poll + mvi SEQCTL,0x50 /* PAUSEDIS|FASTMODE */ inc QOUTQCNT complete_post: /* Post the SCB and issue an interrupt */ mov QOUTFIFO,SCB_TAG + mvi SEQCTL,0x10 /* FASTMODE */ mvi INTSTAT,CMDCMPLT dma_next_scb: @@ -839,12 +844,10 @@ mesgin_reject: /* * Bus free phase. It might be useful to interrupt the device - * driver if we aren't expecting this. For now, make sure that - * ATN isn't being asserted and look for a new command. + * driver if we aren't expecting this. */ p_busfree: - mvi CLRSINT1,CLRATNO - clr LASTPHASE + mvi LASTPHASE, P_BUSFREE /* * if this is an immediate command, perform a psuedo command complete to @@ -901,16 +904,15 @@ mk_mesg1: */ inb_next: - or CLRSINT1, CLRREQINIT - mov NONE,SCSIDATL /*dummy read from latch to ACK*/ + call inb_last /* ACK */ inb_next_wait: - test SSTAT1,REQINIT jz inb_next_wait /* wait for next byte */ -inb_first: + test SSTAT1, REQINIT jz inb_next_wait test SSTAT1,PHASEMIS jnz mesgin_phasemis +inb_first: mov DINDEX,SINDEX mov DINDIR,SCSIBUSL ret /*read byte directly from bus*/ inb_last: - or CLRSINT1, CLRREQINIT + mvi CLRSINT1, CLRREQINIT mov NONE,SCSIDATL ret /*dummy read from latch to ACK*/ mesgin_phasemis: diff --git a/sys/dev/aic7xxx/aic7xxx_reg.h b/sys/dev/aic7xxx/aic7xxx_reg.h index bb039897bf2..841abbfa9d7 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.15 1996/10/28 06:01:08 gibbs Exp $ + * $Id: aic7xxx_reg.h,v 1.16 1996/11/11 05:16:41 gibbs Exp $ */ /* @@ -439,6 +439,7 @@ * beyond the bounds of its * command. */ + #define BRKADRINT 0x08 #define SCSIINT 0x04 #define CMDCMPLT 0x02 @@ -681,6 +682,8 @@ #define MSG5 0x03a #define LASTPHASE 0x03b +#define P_BUSFREE 0x01 + #define ARG_1 0x03c #define RETURN_1 0x03c #define SEND_MSG 0x80