Reset channel(s) in ahc_attach, rather than at first access.

This commit is contained in:
fvdl 2003-04-21 19:59:48 +00:00
parent 1adc169997
commit 11e1ebb8dd
2 changed files with 7 additions and 16 deletions

View File

@ -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:

View File

@ -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