Back most (not all) of the previous delay-related changes now that

delay is calibrated properly.
This commit is contained in:
thorpej 1996-05-18 23:56:59 +00:00
parent 62f7f3ad57
commit f969979dea
3 changed files with 22 additions and 22 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fhpib.c,v 1.10 1996/05/17 15:12:34 thorpej Exp $ */ /* $NetBSD: fhpib.c,v 1.11 1996/05/18 23:56:59 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1990, 1993 * Copyright (c) 1982, 1990, 1993
@ -55,7 +55,7 @@
* Inline version of fhpibwait to be used in places where * Inline version of fhpibwait to be used in places where
* we don't worry about getting hung. * we don't worry about getting hung.
*/ */
#define FHPIBWAIT(hd, m) while (((hd)->hpib_intr & (m)) == 0) DELAY(5) #define FHPIBWAIT(hd, m) while (((hd)->hpib_intr & (m)) == 0) DELAY(1)
#ifdef DEBUG #ifdef DEBUG
int fhpibdebugunit = -1; int fhpibdebugunit = -1;
@ -211,7 +211,7 @@ fhpibsend(unit, slave, sec, ptr, origcnt)
while ((hd->hpib_intr & IM_ROOM) == 0) { while ((hd->hpib_intr & IM_ROOM) == 0) {
if (--timo <= 0) if (--timo <= 0)
goto senderr; goto senderr;
DELAY(5); DELAY(1);
} }
} }
hd->hpib_stat = ST_EOI; hd->hpib_stat = ST_EOI;
@ -278,7 +278,7 @@ fhpibrecv(unit, slave, sec, ptr, origcnt)
while ((hd->hpib_intr & IM_BYTE) == 0) { while ((hd->hpib_intr & IM_BYTE) == 0) {
if (--timo == 0) if (--timo == 0)
goto recvbyteserror; goto recvbyteserror;
DELAY(5); DELAY(1);
} }
*addr++ = hd->hpib_data; *addr++ = hd->hpib_data;
} }
@ -578,7 +578,7 @@ fhpibwait(hd, x)
register int timo = hpibtimeout; register int timo = hpibtimeout;
while ((hd->hpib_intr & x) == 0 && --timo) while ((hd->hpib_intr & x) == 0 && --timo)
DELAY(5); DELAY(1);
if (timo == 0) { if (timo == 0) {
#ifdef DEBUG #ifdef DEBUG
if (fhpibdebug & FDB_FAIL) if (fhpibdebug & FDB_FAIL)

View File

@ -1,4 +1,4 @@
/* $NetBSD: nhpib.c,v 1.10 1996/05/17 15:12:30 thorpej Exp $ */ /* $NetBSD: nhpib.c,v 1.11 1996/05/18 23:57:01 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1990, 1993 * Copyright (c) 1982, 1990, 1993
@ -472,7 +472,7 @@ nhpibwait(hd, x)
register int timo = hpibtimeout; register int timo = hpibtimeout;
while ((hd->hpib_mis & x) == 0 && --timo) while ((hd->hpib_mis & x) == 0 && --timo)
DELAY(5); DELAY(1);
if (timo == 0) { if (timo == 0) {
#ifdef DEBUG #ifdef DEBUG
if (nhpibreporttimo) if (nhpibreporttimo)

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsi.c,v 1.9 1996/05/17 15:15:29 thorpej Exp $ */ /* $NetBSD: scsi.c,v 1.10 1996/05/18 23:57:03 thorpej Exp $ */
/* /*
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
@ -145,7 +145,7 @@ scsiabort(target, hs, hd, where)
while ((hd->scsi_psns & PSNS_REQ) == 0) { while ((hd->scsi_psns & PSNS_REQ) == 0) {
if (! (hd->scsi_ssts & SSTS_INITIATOR)) if (! (hd->scsi_ssts & SSTS_INITIATOR))
goto out; goto out;
DELAY(5); DELAY(1);
if (--maxtries == 0) { if (--maxtries == 0) {
printf("-- scsiabort gave up after 1000 tries (startlen = %d len = %d)\n", printf("-- scsiabort gave up after 1000 tries (startlen = %d len = %d)\n",
startlen, len); startlen, len);
@ -162,7 +162,7 @@ out2:
hd->scsi_scmd = SCMD_SET_ACK; hd->scsi_scmd = SCMD_SET_ACK;
if (hd->scsi_tmod == 0) if (hd->scsi_tmod == 0)
while (hd->scsi_psns & PSNS_REQ) while (hd->scsi_psns & PSNS_REQ)
DELAY(5); DELAY(1);
junk = hd->scsi_temp; junk = hd->scsi_temp;
} else { } else {
/* one of the output phases - send an abort msg */ /* one of the output phases - send an abort msg */
@ -170,7 +170,7 @@ out2:
hd->scsi_scmd = SCMD_SET_ACK; hd->scsi_scmd = SCMD_SET_ACK;
if (hd->scsi_tmod == 0) if (hd->scsi_tmod == 0)
while (hd->scsi_psns & PSNS_REQ) while (hd->scsi_psns & PSNS_REQ)
DELAY(5); DELAY(1);
} }
hd->scsi_scmd = SCMD_RST_ACK; hd->scsi_scmd = SCMD_RST_ACK;
} }
@ -186,7 +186,7 @@ out:
if (! ((junk = hd->scsi_ints) & INTS_RESEL)) { if (! ((junk = hd->scsi_ints) & INTS_RESEL)) {
hd->scsi_sctl |= SCTL_CTRLRST; hd->scsi_sctl |= SCTL_CTRLRST;
DELAY(5); DELAY(2);
hd->scsi_sctl &=~ SCTL_CTRLRST; hd->scsi_sctl &=~ SCTL_CTRLRST;
hd->scsi_hconf = 0; hd->scsi_hconf = 0;
hd->scsi_ints = hd->scsi_ints; hd->scsi_ints = hd->scsi_ints;
@ -467,7 +467,7 @@ wait_for_select(hd)
u_char ints; u_char ints;
while ((ints = hd->scsi_ints) == 0) while ((ints = hd->scsi_ints) == 0)
DELAY(5); DELAY(1);
hd->scsi_ints = ints; hd->scsi_ints = ints;
return (!(hd->scsi_ssts & SSTS_INITIATOR)); return (!(hd->scsi_ssts & SSTS_INITIATOR));
} }
@ -498,7 +498,7 @@ ixfer_start(hd, len, phase, wait)
HIST(ixstart_wait, wait) HIST(ixstart_wait, wait)
return (0); return (0);
} }
DELAY(5); DELAY(1);
} }
HIST(ixstart_wait, wait) HIST(ixstart_wait, wait)
return (1); return (1);
@ -523,7 +523,7 @@ ixfer_out(hd, len, buf)
HIST(ixout_wait, wait) HIST(ixout_wait, wait)
return (len); return (len);
} }
DELAY(5); DELAY(1);
} }
hd->scsi_dreg = *buf++; hd->scsi_dreg = *buf++;
} }
@ -554,7 +554,7 @@ ixfer_in(hd, len, buf)
HIST(ixin_wait, wait) HIST(ixin_wait, wait)
return; return;
} }
DELAY(5); DELAY(1);
} }
*buf++ = hd->scsi_dreg; *buf++ = hd->scsi_dreg;
} }
@ -592,7 +592,7 @@ mxfer_in(hd, len, buf, phase)
(hd->scsi_ssts & SSTS_INITIATOR) == 0) (hd->scsi_ssts & SSTS_INITIATOR) == 0)
goto out; goto out;
DELAY(5); DELAY(1);
} }
/* /*
* set ack (which says we're ready for the data, wait for * set ack (which says we're ready for the data, wait for
@ -606,7 +606,7 @@ mxfer_in(hd, len, buf, phase)
HIST(mxin_wait, wait) HIST(mxin_wait, wait)
return (-2); return (-2);
} }
DELAY(5); DELAY(1);
} }
*buf++ = hd->scsi_temp; *buf++ = hd->scsi_temp;
hd->scsi_scmd = SCMD_RST_ACK; hd->scsi_scmd = SCMD_RST_ACK;
@ -622,7 +622,7 @@ out:
while ((hd->scsi_ssts & SSTS_ACTIVE) == SSTS_INITIATOR) { while ((hd->scsi_ssts & SSTS_ACTIVE) == SSTS_INITIATOR) {
if (--wait < 0) if (--wait < 0)
break; break;
DELAY(5); DELAY(1);
} }
HIST(mxin2_wait, wait) HIST(mxin2_wait, wait)
return (i); return (i);
@ -729,7 +729,7 @@ scsiicmd(hs, target, cbuf, clen, buf, len, xferphase)
HIST(cxin_wait, wait) HIST(cxin_wait, wait)
goto abort; goto abort;
} }
DELAY(5); DELAY(1);
} }
HIST(cxin_wait, wait) HIST(cxin_wait, wait)
hd->scsi_ints = ints; hd->scsi_ints = ints;
@ -789,7 +789,7 @@ finishxfer(hs, hd, target)
} }
hd->scsi_scmd |= SCMD_PROG_XFR; hd->scsi_scmd |= SCMD_PROG_XFR;
hd->scsi_sctl |= SCTL_CTRLRST; hd->scsi_sctl |= SCTL_CTRLRST;
DELAY(5); DELAY(2);
hd->scsi_sctl &=~ SCTL_CTRLRST; hd->scsi_sctl &=~ SCTL_CTRLRST;
hd->scsi_hconf = 0; hd->scsi_hconf = 0;
/* /*
@ -1056,7 +1056,7 @@ scsigo(ctlr, slave, unit, bp, cdb, pad)
HIST(sgo_wait, wait) HIST(sgo_wait, wait)
goto abort; goto abort;
} }
DELAY(5); DELAY(1);
} }
HIST(sgo_wait, wait) HIST(sgo_wait, wait)
hd->scsi_ints = ints; hd->scsi_ints = ints;