diff options
author | gibbs <gibbs@FreeBSD.org> | 1999-02-11 07:10:20 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1999-02-11 07:10:20 +0000 |
commit | 806b785adbcdac0a1078c14d79e945d682617d3a (patch) | |
tree | b366dcac251cb1367a61a77baca097fb3c593714 /sys/dev/aic7xxx | |
parent | 4a6d37ea75f2c980a2334e80fee95e1288ac3eaa (diff) | |
download | FreeBSD-src-806b785adbcdac0a1078c14d79e945d682617d3a.zip FreeBSD-src-806b785adbcdac0a1078c14d79e945d682617d3a.tar.gz |
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.
Diffstat (limited to 'sys/dev/aic7xxx')
-rw-r--r-- | sys/dev/aic7xxx/aic7xxx.seq | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index 3377449..5abe1b6 100644 --- a/sys/dev/aic7xxx/aic7xxx.seq +++ b/sys/dev/aic7xxx/aic7xxx.seq @@ -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; |