Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amiga/dev Check for an unterminated bus; if yes: co...



details:   https://anonhg.NetBSD.org/src/rev/e30a2d0c9eef
branches:  trunk
changeset: 473575:e30a2d0c9eef
user:      is <is%NetBSD.org@localhost>
date:      Mon Jun 07 21:30:57 1999 +0000

description:
Check for an unterminated bus; if yes: complain and don't try to use this
bus. Without this, cbiiisc used to hang if nothing was connected.
Reported by Matthias Scheler. A similar method to avoid this was suggested
by Ralph Schmidt.

diffstat:

 sys/arch/amiga/dev/cbiiisc.c |   5 ++++-
 sys/arch/amiga/dev/siop2.c   |  19 ++++++++++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diffs (52 lines):

diff -r 97f3f066d7e7 -r e30a2d0c9eef sys/arch/amiga/dev/cbiiisc.c
--- a/sys/arch/amiga/dev/cbiiisc.c      Mon Jun 07 20:31:27 1999 +0000
+++ b/sys/arch/amiga/dev/cbiiisc.c      Mon Jun 07 21:30:57 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cbiiisc.c,v 1.4 1999/06/06 19:58:31 is Exp $   */
+/*     $NetBSD: cbiiisc.c,v 1.5 1999/06/07 21:30:58 is Exp $   */
 
 /*
  * Copyright (c) 1994,1998 Michael L. Hitch
@@ -146,6 +146,9 @@
 
        siopnginitialize(sc);
 
+       if (sc->sc_link.scsipi_scsi.max_target < 0)
+               return;
+
        sc->sc_isr.isr_intr = cbiiisc_dmaintr;
        sc->sc_isr.isr_arg = sc;
        sc->sc_isr.isr_ipl = 2;         /* ?? */
diff -r 97f3f066d7e7 -r e30a2d0c9eef sys/arch/amiga/dev/siop2.c
--- a/sys/arch/amiga/dev/siop2.c        Mon Jun 07 20:31:27 1999 +0000
+++ b/sys/arch/amiga/dev/siop2.c        Mon Jun 07 21:30:57 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siop2.c,v 1.11 1999/04/01 17:27:22 mhitch Exp $        */
+/*     $NetBSD: siop2.c,v 1.12 1999/06/07 21:30:57 is Exp $    */
 
 /*
  * Copyright (c) 1994,1998 Michael L. Hitch
@@ -645,6 +645,23 @@
        splx (s);
 
        delay (siopng_reset_delay * 1000);
+
+       /*
+        * is lower half unterminated?
+        */
+       if ((rp->siop_sbdl & 0x00ff) == 0x00ff) {
+               printf(" no SCSI termination, host adapter deactivated.\n");
+               sc->sc_link.scsipi_scsi.max_target = -1;        /* XXX */
+               sc->sc_flags &= ~(SIOP_ALIVE|SIOP_INTDEFER|SIOP_INTSOFF);
+               /* disable SCSI and DMA interrupts */
+               sc->sc_sien = 0;
+               sc->sc_dien = 0;
+               rp->siop_sien = sc->sc_sien;
+               rp->siop_dien = sc->sc_dien;
+
+               return;
+       }
+
        /*
         * Check if upper half of SCSI bus is unterminated, and disallow
         * disconnections if it appears to be unterminated.



Home | Main Index | Thread Index | Old Index