summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorfvdl <fvdl@NetBSD.org>2003-04-21 19:59:48 +0000
committerfvdl <fvdl@NetBSD.org>2003-04-21 19:59:48 +0000
commit11e1ebb8dda0c26a595576fc4ec5f7986394a8d5 (patch)
tree03126ceef6e71080b434ef3dc912dd5a53711a97 /sys/dev
parent1adc1699977c81f2d058d9d7586ebe5f04542c49 (diff)
Reset channel(s) in ahc_attach, rather than at first access.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/aic7xxx_osm.c20
-rw-r--r--sys/dev/ic/aic7xxxvar.h3
2 files changed, 7 insertions, 16 deletions
diff --git a/sys/dev/ic/aic7xxx_osm.c b/sys/dev/ic/aic7xxx_osm.c
index 7a2a43651b4..063c3d24d59 100644
--- a/sys/dev/ic/aic7xxx_osm.c
+++ b/sys/dev/ic/aic7xxx_osm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aic7xxx_osm.c,v 1.6 2003/04/21 16:52:07 fvdl Exp $ */
+/* $NetBSD: aic7xxx_osm.c,v 1.7 2003/04/21 19:59:48 fvdl Exp $ */
/*
* Bus independent FreeBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -113,6 +113,11 @@ ahc_attach(struct ahc_softc *ahc)
ahc_intr_enable(ahc, TRUE);
+ if (ahc->flags & AHC_RESET_BUS_A)
+ ahc_reset_channel(ahc, 'A', TRUE);
+ if ((ahc->features & AHC_TWIN) && ahc->flags & AHC_RESET_BUS_B)
+ ahc_reset_channel(ahc, 'B', TRUE);
+
ahc_unlock(ahc, &s);
return (1);
}
@@ -262,22 +267,9 @@ ahc_action(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *arg)
int s;
struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate;
- char channel;
ahc = (void *)chan->chan_adapter->adapt_dev;
- channel = chan->chan_channel == 0 ? 'A' : 'B';
-
- if (ahc->inited_channels[channel - 'A'] == 0) {
- if ((channel == 'A' && (ahc->flags & AHC_RESET_BUS_A)) ||
- (channel == 'B' && (ahc->flags & AHC_RESET_BUS_B))) {
- s = splbio();
- ahc_reset_channel(ahc, channel, TRUE);
- splx(s);
- }
- ahc->inited_channels[channel - 'A'] = 1;
- }
-
switch (req) {
case ADAPTER_REQ_RUN_XFER:
diff --git a/sys/dev/ic/aic7xxxvar.h b/sys/dev/ic/aic7xxxvar.h
index f60a98b89fb..2e4548e4235 100644
--- a/sys/dev/ic/aic7xxxvar.h
+++ b/sys/dev/ic/aic7xxxvar.h
@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: aic7xxxvar.h,v 1.36 2003/04/20 19:49:45 fvdl Exp $
+ * $Id: aic7xxxvar.h,v 1.37 2003/04/21 19:59:48 fvdl Exp $
*
* $FreeBSD: /repoman/r/ncvs/src/sys/dev/aic7xxx/aic7xxx.h,v 1.44 2003/01/20 20:44:55 gibbs Exp $
*/
@@ -1079,7 +1079,6 @@ struct ahc_softc {
struct ahc_tmode_tstate *enabled_targets[AHC_NUM_TARGETS];
char inited_target[AHC_NUM_TARGETS];
- char inited_channels[2];
/*
* The black hole device responsible for handling requests for