Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/dev/scsipi Pull up atapi_wdc.c rev 1.21 and scsipic...



details:   https://anonhg.NetBSD.org/src/rev/a0a956752142
branches:  netbsd-1-4
changeset: 468124:a0a956752142
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Apr 08 15:52:42 1999 +0000

description:
Pull up atapi_wdc.c rev 1.21 and scsipiconf.h rev 1.30:
Fix botch with atapi capability flags, preventing 16 bytes commands to be ever
sent, and interrupt DRQ capable devices to effectively use interrupts for
the CMD_OUT phase. Didn't break until the code was changed to handle shared
interrupts (and I guess nobody has a device that requires 16 bytes commands
yet). Should fix the hangs reported by some users at first access of an ATAPI
device.

diffstat:

 sys/dev/scsipi/atapi_wdc.c  |  9 ++++++---
 sys/dev/scsipi/scsipiconf.h |  9 +++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diffs (49 lines):

diff -r d00b153743fa -r a0a956752142 sys/dev/scsipi/atapi_wdc.c
--- a/sys/dev/scsipi/atapi_wdc.c        Thu Apr 08 15:16:35 1999 +0000
+++ b/sys/dev/scsipi/atapi_wdc.c        Thu Apr 08 15:52:42 1999 +0000
@@ -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.20.2.1 1999/04/08 15:52:42 bouyer Exp $        */
 
 /*
  * Copyright (c) 1998 Manuel Bouyer.
@@ -278,11 +278,14 @@
         * 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 -r d00b153743fa -r a0a956752142 sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h       Thu Apr 08 15:16:35 1999 +0000
+++ b/sys/dev/scsipi/scsipiconf.h       Thu Apr 08 15:52:42 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipiconf.h,v 1.29 1999/01/19 10:57:11 bouyer Exp $   */
+/*     $NetBSD: scsipiconf.h,v 1.29.2.1 1999/04/08 15:52:43 bouyer Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -226,11 +226,8 @@
                                                   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;



Home | Main Index | Thread Index | Old Index