Ensure that the ACK from the last information transfer phase has been

de-asserted by the initiator before changing phase or releasing the bus.
Corrects a SCSI specification violation in target mode.
This commit is contained in:
Justin T. Gibbs 1999-02-11 07:10:20 +00:00
parent 11eaafb1f1
commit 03c4f58aa3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43880

View File

@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: aic7xxx.seq,v 1.83 1998/12/17 00:06:52 gibbs Exp $
* $Id: aic7xxx.seq,v 1.84 1999/01/14 06:14:15 gibbs Exp $
*/
#include <dev/aic7xxx/aic7xxx.reg>
@ -485,6 +485,9 @@ target_disconnect:
mvi MSG_SAVEDATAPOINTER call target_outb;
mvi MSG_DISCONNECT call target_outb;
target_busfree_wait:
/* Wait for preceeding I/O session to complete. */
test SCSISIGI, ACKI jnz .;
target_busfree:
clr SCSISIGO;
call complete_target_cmd;
@ -554,7 +557,7 @@ target_sphase:
mvi SCSISIGO, P_MESGIN|BSYO;
/* MSG_CMDCMPLT is 0, but we can't do an immediate of 0 */
mov ALLZEROS call target_outb;
jmp target_busfree;
jmp target_busfree_wait;
complete_target_cmd:
test SEQ_FLAGS, TARG_CMD_PENDING jnz . + 2;
@ -1345,9 +1348,20 @@ if ((ahc->flags & AHC_TARGETMODE) != 0) {
* from out to in, wait an additional data release delay before continuing.
*/
change_phase:
/* Wait for preceeding I/O session to complete. */
test SCSISIGI, ACKI jnz .;
/* Change the phase */
and DINDEX, IOI, SCSISIGI;
mov SCSISIGO, SINDEX;
and A, IOI, SINDEX;
/*
* If the data direction has changed, from
* out (initiator driving) to in (target driving),
* we must waitat least a data release delay plus
* the normal bus settle delay. [SCSI III SPI 10.11.0]
*/
cmp DINDEX, A je change_phase_wait;
test SINDEX, IOI jz change_phase_wait;
call change_phase_wait;