diff options
| author | bouyer <bouyer@NetBSD.org> | 1999-04-08 11:29:01 +0000 |
|---|---|---|
| committer | bouyer <bouyer@NetBSD.org> | 1999-04-08 11:29:01 +0000 |
| commit | c2752835f7e6b6bc68f3f5335fb1ab54a42f33be (patch) | |
| tree | ca96e5e891efa3ed6491da18c766764e38544ba6 /sys/dev | |
| parent | 6b39fd9da6437ca87e787b0c94b5a1470ce99484 (diff) | |
Fix a long-standing bug with the ACAP_* flags:
- the cap field is a u_int8_t, so none of the defined flags would fit in.
Looks like nobody had a drive using 16 bytes commands.
- the ACAP_DRQ_* flags are all wrong. Just remove them and use the definitions
from ata/atareg.h, there's no need to duplicate theses. The effect of this
was that we were always polling for the command phase, even for drives
with interrupt DRQ. This didn't break until the code was changed to support
shared interrupts.
Should fix the lookup problems or 'boot hangs' reported by some users, and
kern/7111.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/scsipi/atapi_wdc.c | 9 | ||||
| -rw-r--r-- | sys/dev/scsipi/scsipiconf.h | 9 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/scsipi/atapi_wdc.c b/sys/dev/scsipi/atapi_wdc.c index 57efb270eac..6ad9020a489 100644 --- a/sys/dev/scsipi/atapi_wdc.c +++ b/sys/dev/scsipi/atapi_wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: atapi_wdc.c,v 1.20 1999/04/01 21:46:30 bouyer Exp $ */ +/* $NetBSD: atapi_wdc.c,v 1.21 1999/04/08 11:29:01 bouyer Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -278,11 +278,14 @@ wdc_atapi_start(chp, xfer) * the interrupt routine. If it is a polled command, call the interrupt * routine until command is done. */ - if ((sc_xfer->sc_link->scsipi_atapi.cap & 0x0300) != ACAP_DRQ_INTR || - sc_xfer->flags & SCSI_POLL) { + if ((sc_xfer->sc_link->scsipi_atapi.cap & ATAPI_CFG_DRQ_MASK) != + ATAPI_CFG_IRQ_DRQ || (sc_xfer->flags & SCSI_POLL)) { /* Wait for at last 400ns for status bit to be valid */ DELAY(1); wdc_atapi_intr(chp, xfer, 0); + } else { + chp->ch_flags |= WDCF_IRQ_WAIT; + timeout(wdctimeout, chp, hz); } if (sc_xfer->flags & SCSI_POLL) { while ((sc_xfer->flags & ITSDONE) == 0) { diff --git a/sys/dev/scsipi/scsipiconf.h b/sys/dev/scsipi/scsipiconf.h index dada7872418..1f90fce05d8 100644 --- a/sys/dev/scsipi/scsipiconf.h +++ b/sys/dev/scsipi/scsipiconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: scsipiconf.h,v 1.29 1999/01/19 10:57:11 bouyer Exp $ */ +/* $NetBSD: scsipiconf.h,v 1.30 1999/04/08 11:29:01 bouyer Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -226,11 +226,8 @@ struct scsipi_link { controller */ u_int8_t atapibus; u_int8_t cap; /* drive capability */ -#define ACAP_DRQ_MPROC 0x0000 /* microprocessor DRQ */ -#define ACAP_DRQ_INTR 0x0200 /* interrupt DRQ */ -#define ACAP_DRQ_ACCEL 0x0400 /* accelerated DRQ */ -#define ACAP_DRQ_MASK 0x0600 /* same as in ataparams */ -#define ACAP_LEN 0x0100 /* 16 bit commands */ +/* 0x20-0x40 reserved for ATAPI_CFG_DRQ_MASK */ +#define ACAP_LEN 0x01 /* 16 bit commands */ } scsipi_atapi; } _scsipi_link; TAILQ_HEAD(, scsipi_xfer) pending_xfers; |
