- Test the generic device active flag instead of home grown one.
- Test also it in wdcintr.
This commit is contained in:
parent
d2be696634
commit
83446dedc1
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user