Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic - Test the generic device active flag instead of ...



details:   https://anonhg.NetBSD.org/src/rev/17657ccaa4d0
branches:  trunk
changeset: 483919:17657ccaa4d0
user:      enami <enami%NetBSD.org@localhost>
date:      Mon Mar 20 22:53:36 2000 +0000

description:
- Test the generic device active flag instead of home grown one.
- Test also it in wdcintr.

diffstat:

 sys/dev/ic/aic6360.c    |  13 +++++--------
 sys/dev/ic/aic6360var.h |   3 +--
 sys/dev/ic/wdc.c        |  15 +++++++++------
 sys/dev/ic/wdcvar.h     |   3 +--
 4 files changed, 16 insertions(+), 18 deletions(-)

diffs (135 lines):

diff -r 408bbd237cc9 -r 17657ccaa4d0 sys/dev/ic/aic6360.c
--- a/sys/dev/ic/aic6360.c      Mon Mar 20 22:27:16 2000 +0000
+++ b/sys/dev/ic/aic6360.c      Mon Mar 20 22:53:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic6360.c,v 1.65 1999/10/30 00:58:32 enami Exp $       */
+/*     $NetBSD: aic6360.c,v 1.66 2000/03/20 22:53:36 enami Exp $       */
 
 #include "opt_ddb.h"
 #ifdef DDB
@@ -322,11 +322,8 @@
                break;
 
        case DVACT_DEACTIVATE:
-               if (sc->sc_child != NULL && !sc->sc_dying) {
+               if (sc->sc_child != NULL)
                        rv = config_deactivate(sc->sc_child);
-                       if (rv == 0)
-                               sc->sc_dying = 1;
-               }
                break;
        }
        splx(s);
@@ -566,7 +563,7 @@
        AIC_CMDS(("[0x%x, %d]->%d ", (int)xs->cmd->opcode, xs->cmdlen,
            sc_link->scsipi_scsi.target));
 
-       if (sc->sc_dying) {
+       if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0) {
                xs->xs_status |= XS_STS_DONE;
                xs->error = XS_DRIVER_STUFFUP;
                scsipi_done(xs);
@@ -814,7 +811,7 @@
        bus_space_tag_t iot = sc->sc_iot;
        bus_space_handle_t ioh = sc->sc_ioh;
 
-       if (sc->sc_dying)
+       if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0)
                return;
 
        /*
@@ -1726,7 +1723,7 @@
        struct aic_tinfo *ti;
        int n;
 
-       if (sc->sc_dying)
+       if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0)
                return (0);
 
        /*
diff -r 408bbd237cc9 -r 17657ccaa4d0 sys/dev/ic/aic6360var.h
--- a/sys/dev/ic/aic6360var.h   Mon Mar 20 22:27:16 2000 +0000
+++ b/sys/dev/ic/aic6360var.h   Mon Mar 20 22:53:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic6360var.h,v 1.6 2000/01/07 08:12:15 nisimura Exp $  */
+/*     $NetBSD: aic6360var.h,v 1.7 2000/03/20 22:53:36 enami Exp $     */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Charles M. Hannum.  All rights reserved.
@@ -149,7 +149,6 @@
 #define AIC_DOINGDMA   0x04    /* The FIFO data path is active! */
        u_char  sc_selid;       /* Reselection ID */
        struct device *sc_child;/* Our child */
-       u_char  sc_dying;       /* true if device is going */
 
        /* Message stuff */
        u_char  sc_msgpriq;     /* Messages we want to send */
diff -r 408bbd237cc9 -r 17657ccaa4d0 sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Mon Mar 20 22:27:16 2000 +0000
+++ b/sys/dev/ic/wdc.c  Mon Mar 20 22:53:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc.c,v 1.79 2000/02/14 12:37:35 bouyer Exp $ */
+/*     $NetBSD: wdc.c,v 1.80 2000/03/20 22:53:36 enami Exp $ */
 
 
 /*
@@ -484,8 +484,6 @@
                break;
 
        case DVACT_DEACTIVATE:
-               if (wdc->sc_dying != 0)
-                       goto out;
                for (i = 0; i < wdc->nchannels; i++) {
                        chp = wdc->channels[i];
 
@@ -516,7 +514,6 @@
                                }
                        }
                }
-               wdc->sc_dying = 1;
                break;
        }
 
@@ -664,9 +661,14 @@
        struct wdc_xfer *xfer;
        int ret;
 
+       if ((chp->wdc->sc_dev.dv_flags & DVF_ACTIVE) == 0) {
+               WDCDEBUG_PRINT(("wdcintr: deactivated controller\n"),
+                   DEBUG_INTR);
+               return (0);
+       }
        if ((chp->ch_flags & WDCF_IRQ_WAIT) == 0) {
                WDCDEBUG_PRINT(("wdcintr: inactive controller\n"), DEBUG_INTR);
-               return 0;
+               return (0);
        }
 
        WDCDEBUG_PRINT(("wdcintr\n"), DEBUG_INTR);
@@ -1314,7 +1316,8 @@
                wdc_c->r_error = chp->ch_error;
        }
        wdc_c->flags |= AT_DONE;
-       if ((wdc_c->flags & AT_READREG) != 0 && chp->wdc->sc_dying != 0 &&
+       if ((wdc_c->flags & AT_READREG) != 0 &&
+           (chp->wdc->sc_dev.dv_flags & DVF_ACTIVE) != 0 &&
            (wdc_c->flags & (AT_ERROR | AT_DF)) == 0) {
                wdc_c->r_head = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,
                                                 wd_sdh);
diff -r 408bbd237cc9 -r 17657ccaa4d0 sys/dev/ic/wdcvar.h
--- a/sys/dev/ic/wdcvar.h       Mon Mar 20 22:27:16 2000 +0000
+++ b/sys/dev/ic/wdcvar.h       Mon Mar 20 22:53:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdcvar.h,v 1.20 1999/10/20 15:22:26 enami Exp $        */
+/*     $NetBSD: wdcvar.h,v 1.21 2000/03/20 22:53:36 enami Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -103,7 +103,6 @@
         * The reference count here is used for both IDE and ATAPI devices.
         */
        struct scsipi_adapter sc_atapi_adapter;
-       int             sc_dying;
 
        /* if WDC_CAPABILITY_DMA set in 'cap' */
        void            *dma_arg;



Home | Main Index | Thread Index | Old Index