diff options
| author | Justin T. Gibbs <gibbs@FreeBSD.org> | 1999-02-11 07:16:29 +0000 |
|---|---|---|
| committer | Justin T. Gibbs <gibbs@FreeBSD.org> | 1999-02-11 07:16:29 +0000 |
| commit | eb07a2b09ea5949ea91df3b59d6b4560cd7b1a15 (patch) | |
| tree | 4b20ede49440e964a6597e086b7ff7857335c8ab /sys | |
| parent | b94459869b7d3eac543d8b37ffb71d838f8f2c84 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/aic7xxx/aic7xxx.c | 15 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aic7xxx.seq | 18 |
2 files changed, 24 insertions, 9 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c index e442be536b9e..22aa52def5cb 100644 --- a/sys/dev/aic7xxx/aic7xxx.c +++ b/sys/dev/aic7xxx/aic7xxx.c @@ -36,7 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx.c,v 1.15 1999/01/14 06:14:14 gibbs Exp $ + * $Id: aic7xxx.c,v 1.16 1999/01/15 23:24:23 gibbs Exp $ */ /* * A few notes on features of the driver. @@ -3347,7 +3347,7 @@ ahc_init(struct ahc_softc *ahc) AHC_TERM_ENB_A|AHC_TERM_ENB_B; ahc->discenable = ALL_TARGETS_MASK; if ((ahc->features & AHC_ULTRA) != 0) - ahc->ultraenb = 0xffff; + ahc->ultraenb = ALL_TARGETS_MASK; } else { ahc->discenable = ~((ahc_inb(ahc, DISC_DSB + 1) << 8) | ahc_inb(ahc, DISC_DSB)); @@ -4114,6 +4114,12 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments, op = BUS_DMASYNC_PREWRITE; bus_dmamap_sync(ahc->dmat, scb->dmamap, op); + + if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) { + scb->hscb->cmdpointer |= DPHASE_PENDING; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) + scb->hscb->cmdpointer |= (TARGET_DATA_IN << 8); + } } else { scb->hscb->SG_pointer = 0; scb->hscb->data = 0; @@ -4272,11 +4278,6 @@ ahc_setup_data(struct ahc_softc *ahc, struct ccb_scsiio *csio, segs = (struct bus_dma_segment *)csio->data_ptr; ahc_execute_scb(scb, segs, csio->sglist_cnt, 0); } - if (ccb_h->func_code == XPT_CONT_TARGET_IO) { - hscb->cmdpointer |= DPHASE_PENDING; - if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_IN) - hscb->cmdpointer |= (TARGET_DATA_IN << 8); - } } else { ahc_execute_scb(scb, NULL, 0, 0); } diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index 3377449cd302..5abe1b656a7f 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; |
