-/* $OpenBSD: ncr53c9x.c,v 1.80 2022/04/16 19:19:59 naddy Exp $ */
+/* $OpenBSD: ncr53c9x.c,v 1.81 2024/04/03 18:41:38 miod Exp $ */
/* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */
/*
* always possible that the interrupt may never happen.
*/
if ((ecb->xs->flags & SCSI_POLL) == 0) {
- int timeout = ecb->timeout;
+ int timeout = ecb->xs->timeout;
if (timeout > 1000000)
timeout = (timeout / 1000) * hz;
else
timeout = (timeout * hz) / 1000;
- timeout_add(&ecb->to, timeout);
+ timeout_add(&ecb->xs->stimeout, timeout);
}
/*
if (ecb == NULL)
return (NULL);
- timeout_set(&ecb->to, ncr53c9x_timeout, ecb);
ecb->flags |= ECB_ALLOC;
return (ecb);
/* Initialize ecb */
ecb = xs->io;
ecb->xs = xs;
- ecb->timeout = xs->timeout;
+ timeout_set(&xs->stimeout, ncr53c9x_timeout, ecb);
if (flags & SCSI_RESET) {
ecb->flags |= ECB_RESET;
return;
/* Not allowed to use interrupts, use polling instead */
- if (ncr53c9x_poll(sc, xs, ecb->timeout)) {
+ if (ncr53c9x_poll(sc, xs, xs->timeout)) {
ncr53c9x_timeout(ecb);
- if (ncr53c9x_poll(sc, xs, ecb->timeout))
+ if (ncr53c9x_poll(sc, xs, xs->timeout))
ncr53c9x_timeout(ecb);
}
}
ecb->daddr = (char *)&xs->sense;
ecb->dleft = sizeof(struct scsi_sense_data);
ecb->flags |= ECB_SENSE;
- ecb->timeout = NCR_SENSE_TIMEOUT;
+ xs->timeout = NCR_SENSE_TIMEOUT;
ti->senses++;
li = TINFO_LUN(ti, lun);
if (li->busy) li->busy = 0;
NCR_TRACE(("[ncr53c9x_done(error:%x)] ", xs->error));
- timeout_del(&ecb->to);
+ timeout_del(&ecb->xs->stimeout);
if (ecb->stat == SCSI_QUEUE_FULL) {
/*
goto reset;
}
printf("sending REQUEST SENSE\n");
- timeout_del(&ecb->to);
+ timeout_del(&ecb->xs->stimeout);
ncr53c9x_sense(sc, ecb);
goto out;
}
*/
if (sc->sc_state == NCR_SELECTING) {
NCR_MISC(("backoff selector "));
- timeout_del(&ecb->to);
+ timeout_del(&ecb->xs->stimeout);
ncr53c9x_dequeue(sc, ecb);
TAILQ_INSERT_HEAD(&sc->ready_list, ecb, chain);
ecb->flags |= ECB_READY;
{
/* 2 secs for the abort */
- ecb->timeout = NCR_ABORT_TIMEOUT;
+ ecb->xs->timeout = NCR_ABORT_TIMEOUT;
ecb->flags |= ECB_ABORT;
if (ecb == sc->sc_nexus) {
- int timeout = ecb->timeout;
+ int timeout = ecb->xs->timeout;
/*
* If we're still selecting, the message will be scheduled
timeout = (timeout / 1000) * hz;
else
timeout = (timeout * hz) / 1000;
- timeout_add(&ecb->to, timeout);
+ timeout_add(&ecb->xs->stimeout, timeout);
} else {
/*
* Just leave the command where it is.
-/* $OpenBSD: ncr53c9xvar.h,v 1.24 2020/07/22 13:16:04 krw Exp $ */
+/* $OpenBSD: ncr53c9xvar.h,v 1.25 2024/04/03 18:41:38 miod Exp $ */
/* $NetBSD: ncr53c9xvar.h,v 1.13 1998/05/26 23:17:34 thorpej Exp $ */
/*-
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/timeout.h>
-
/* Set this to 1 for normal debug, or 2 for per-target tracing. */
#if !defined(SMALL_KERNEL)
#define NCR53C9X_DEBUG 1
#define ECB_ABORT 0x40
#define ECB_RESET 0x80
#define ECB_TENTATIVE_DONE 0x100
- int timeout;
- struct timeout to;
struct {
u_char msg[3]; /* Selection Id msg */