diff options
| author | enami <enami@NetBSD.org> | 2000-03-20 22:53:36 +0000 |
|---|---|---|
| committer | enami <enami@NetBSD.org> | 2000-03-20 22:53:36 +0000 |
| commit | 83446dedc1c953fd4e6b1ac7db02dffc0b284a0d (patch) | |
| tree | 69fbea95965e09ebdcf107a9e66c823ef0856419 /sys/dev | |
| parent | d2be696634a21426928624dd548c5bc0c3cf405c (diff) | |
- Test the generic device active flag instead of home grown one.
- Test also it in wdcintr.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/aic6360.c | 13 | ||||
| -rw-r--r-- | sys/dev/ic/aic6360var.h | 3 | ||||
| -rw-r--r-- | sys/dev/ic/wdc.c | 15 | ||||
| -rw-r--r-- | sys/dev/ic/wdcvar.h | 3 |
4 files changed, 16 insertions, 18 deletions
diff --git a/sys/dev/ic/aic6360.c b/sys/dev/ic/aic6360.c index 2dbb9560e39..215a0a243cd 100644 --- a/sys/dev/ic/aic6360.c +++ b/sys/dev/ic/aic6360.c @@ -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 @@ aic_activate(self, act) 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_scsi_cmd(xs) 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 @@ aic_sched(sc) 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 @@ aicintr(arg) struct aic_tinfo *ti; int n; - if (sc->sc_dying) + if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0) return (0); /* diff --git a/sys/dev/ic/aic6360var.h b/sys/dev/ic/aic6360var.h index 7310b3cd4d7..bd8e6bc9628 100644 --- a/sys/dev/ic/aic6360var.h +++ b/sys/dev/ic/aic6360var.h @@ -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 @@ struct aic_softc { #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 --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 08040d3c400..8517d344d15 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -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 @@ wdcactivate(self, act) 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 @@ wdcactivate(self, act) } } } - wdc->sc_dying = 1; break; } @@ -664,9 +661,14 @@ wdcintr(arg) 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 @@ __wdccommand_done(chp, xfer) 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 --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h index 3fd06a85001..3a021dbb73c 100644 --- a/sys/dev/ic/wdcvar.h +++ b/sys/dev/ic/wdcvar.h @@ -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 @@ struct wdc_softc { /* Per controller state */ * 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; |
