fix debug info dumps.
authorRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Tue, 9 Mar 1993 10:52:39 +0000 (02:52 -0800)
committerRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Tue, 9 Mar 1993 10:52:39 +0000 (02:52 -0800)
SCCS-vsn: sys/pmax/dev/asc.c 7.10

usr/src/sys/pmax/dev/asc.c

index a59a5f9..152a1cd 100644 (file)
@@ -7,7 +7,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)asc.c       7.9 (Berkeley) %G%
+ *     @(#)asc.c       7.10 (Berkeley) %G%
  */
 
 /* 
  */
 
 /* 
@@ -244,7 +244,7 @@ script_t asc_scripts[] = {
                asc_last_dma_in, ASC_CMD_I_COMPLETE,
                &asc_scripts[SCRIPT_GET_STATUS]},
 
                asc_last_dma_in, ASC_CMD_I_COMPLETE,
                &asc_scripts[SCRIPT_GET_STATUS]},
 
-       /* continue data in after a chuck is finished */
+       /* continue data in after a chunk is finished */
        {SCRIPT_MATCH(ASC_INT_BS, ASC_PHASE_DATAI),                     /*  2 */
                asc_dma_in, ASC_CMD_XFER_INFO | ASC_CMD_DMA,
                &asc_scripts[SCRIPT_DATA_IN + 1]},
        {SCRIPT_MATCH(ASC_INT_BS, ASC_PHASE_DATAI),                     /*  2 */
                asc_dma_in, ASC_CMD_XFER_INFO | ASC_CMD_DMA,
                &asc_scripts[SCRIPT_DATA_IN + 1]},
@@ -257,7 +257,7 @@ script_t asc_scripts[] = {
                asc_last_dma_out, ASC_CMD_I_COMPLETE,
                &asc_scripts[SCRIPT_GET_STATUS]},
 
                asc_last_dma_out, ASC_CMD_I_COMPLETE,
                &asc_scripts[SCRIPT_GET_STATUS]},
 
-       /* continue data out after a chuck is finished */
+       /* continue data out after a chunk is finished */
        {SCRIPT_MATCH(ASC_INT_BS, ASC_PHASE_DATAO),                     /*  5 */
                asc_dma_out, ASC_CMD_XFER_INFO | ASC_CMD_DMA,
                &asc_scripts[SCRIPT_DATA_OUT + 1]},
        {SCRIPT_MATCH(ASC_INT_BS, ASC_PHASE_DATAO),                     /*  5 */
                asc_dma_out, ASC_CMD_XFER_INFO | ASC_CMD_DMA,
                &asc_scripts[SCRIPT_DATA_OUT + 1]},
@@ -841,7 +841,6 @@ again:
                                        state->dmalen, len, fifo); /* XXX */
                        regs->asc_cmd = ASC_CMD_FLUSH;
                        readback(regs->asc_cmd);
                                        state->dmalen, len, fifo); /* XXX */
                        regs->asc_cmd = ASC_CMD_FLUSH;
                        readback(regs->asc_cmd);
-                       MachEmptyWriteBuffer();
                        DELAY(2);
                }
                if (len) {
                        DELAY(2);
                }
                if (len) {
@@ -1205,7 +1204,6 @@ asc_last_dma_in(asc, status, ss, ir)
                /* device must be trying to send more than we expect */
                regs->asc_cmd = ASC_CMD_FLUSH;
                readback(regs->asc_cmd);
                /* device must be trying to send more than we expect */
                regs->asc_cmd = ASC_CMD_FLUSH;
                readback(regs->asc_cmd);
-               MachEmptyWriteBuffer();
        }
        state->flags &= ~DMA_IN_PROGRESS;
        len = state->dmalen - len;
        }
        state->flags &= ~DMA_IN_PROGRESS;
        len = state->dmalen - len;
@@ -1354,7 +1352,6 @@ asc_last_dma_out(asc, status, ss, ir)
                len += fifo;
                regs->asc_cmd = ASC_CMD_FLUSH;
                readback(regs->asc_cmd);
                len += fifo;
                regs->asc_cmd = ASC_CMD_FLUSH;
                readback(regs->asc_cmd);
-               MachEmptyWriteBuffer();
        }
        state->flags &= ~DMA_IN_PROGRESS;
        len = state->dmalen - len;
        }
        state->flags &= ~DMA_IN_PROGRESS;
        len = state->dmalen - len;
@@ -1571,7 +1568,6 @@ asc_msg_in(asc, status, ss, ir)
                        if (!(state->flags & TRY_SYNC)) {
                                regs->asc_cmd = ASC_CMD_SET_ATN;
                                readback(regs->asc_cmd);
                        if (!(state->flags & TRY_SYNC)) {
                                regs->asc_cmd = ASC_CMD_SET_ATN;
                                readback(regs->asc_cmd);
-                               MachEmptyWriteBuffer();
 
                                if (state->sync_period < asc->min_period)
                                        state->sync_period =
 
                                if (state->sync_period < asc->min_period)
                                        state->sync_period =
@@ -1670,7 +1666,6 @@ asc_msg_in(asc, status, ss, ir)
                state->msg_out = SCSI_MESSAGE_REJECT;
                regs->asc_cmd = ASC_CMD_SET_ATN;
                readback(regs->asc_cmd);
                state->msg_out = SCSI_MESSAGE_REJECT;
                regs->asc_cmd = ASC_CMD_SET_ATN;
                readback(regs->asc_cmd);
-               MachEmptyWriteBuffer();
        }
 
 done:
        }
 
 done:
@@ -1835,10 +1830,8 @@ asc_DumpLog(str)
 
        printf("asc: %s: cmd %x bn %d cnt %d\n", str, asc_debug_cmd,
                asc_debug_bn, asc_debug_sz);
 
        printf("asc: %s: cmd %x bn %d cnt %d\n", str, asc_debug_cmd,
                asc_debug_bn, asc_debug_sz);
-       lp = asc_logp + 1;
-       if (lp > &asc_log[NLOG])
-               lp = asc_log;
-       while (lp != asc_logp) {
+       lp = asc_logp;
+       do {
                status = lp->status;
                printf("asc%d tgt %d status %x ss %x ir %x cond %d:%x msg %x\n",
                        status >> 24,
                status = lp->status;
                printf("asc%d tgt %d status %x ss %x ir %x cond %d:%x msg %x\n",
                        status >> 24,
@@ -1851,7 +1844,7 @@ asc_DumpLog(str)
                        lp->msg);
                if (++lp >= &asc_log[NLOG])
                        lp = asc_log;
                        lp->msg);
                if (++lp >= &asc_log[NLOG])
                        lp = asc_log;
-       }
+       } while (lp != asc_logp);
 }
 #endif
 
 }
 #endif