Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Reset channel(s) in ahc_attach, rather than at fi...



details:   https://anonhg.NetBSD.org/src/rev/c6e5969ac949
branches:  trunk
changeset: 546171:c6e5969ac949
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Mon Apr 21 19:59:48 2003 +0000

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

diffstat:

 sys/dev/ic/aic7xxx_osm.c |  20 ++++++--------------
 sys/dev/ic/aic7xxxvar.h  |   3 +--
 2 files changed, 7 insertions(+), 16 deletions(-)

diffs (64 lines):

diff -r e68b6eeee99c -r c6e5969ac949 sys/dev/ic/aic7xxx_osm.c
--- a/sys/dev/ic/aic7xxx_osm.c  Mon Apr 21 18:12:22 2003 +0000
+++ b/sys/dev/ic/aic7xxx_osm.c  Mon Apr 21 19:59:48 2003 +0000
@@ -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_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 @@
        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 -r e68b6eeee99c -r c6e5969ac949 sys/dev/ic/aic7xxxvar.h
--- a/sys/dev/ic/aic7xxxvar.h   Mon Apr 21 18:12:22 2003 +0000
+++ b/sys/dev/ic/aic7xxxvar.h   Mon Apr 21 19:59:48 2003 +0000
@@ -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_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



Home | Main Index | Thread Index | Old Index