Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Keep track of the current SCSI mode (SE/HVD/LVD) ...



details:   https://anonhg.NetBSD.org/src/rev/a33c65163ec9
branches:  trunk
changeset: 526493:a33c65163ec9
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat May 04 18:43:22 2002 +0000

description:
Keep track of the current SCSI mode (SE/HVD/LVD) and don't start PPR
negotiation if it's not a LVD bus.
Remove write to SIOP_STEST0, it's bogus and I don't know why it's there at
the first place.

diffstat:

 sys/dev/ic/siop_common.c    |  19 ++++++++++---------
 sys/dev/ic/siopvar_common.h |   3 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diffs (89 lines):

diff -r 172aadec2809 -r a33c65163ec9 sys/dev/ic/siop_common.c
--- a/sys/dev/ic/siop_common.c  Sat May 04 18:23:35 2002 +0000
+++ b/sys/dev/ic/siop_common.c  Sat May 04 18:43:22 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siop_common.c,v 1.26 2002/05/04 18:11:06 bouyer Exp $  */
+/*     $NetBSD: siop_common.c,v 1.27 2002/05/04 18:43:22 bouyer Exp $  */
 
 /*
  * Copyright (c) 2000, 2002 Manuel Bouyer.
@@ -33,7 +33,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.26 2002/05/04 18:11:06 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.27 2002/05/04 18:43:22 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -229,6 +229,8 @@
                /* reset SCNTL4 */
                bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_SCNTL4, 0);
        }
+       sc->mode = bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_STEST4) &
+           STEST4_MODE_MASK;
        sc->sc_reset(sc);
 }
 
@@ -281,7 +283,8 @@
        }
        siop_cmd->siop_tables->t_msgout.count= htole32(msgoffset);
        if (sc->targets[target]->status == TARST_ASYNC) {
-               if (sc->targets[target]->flags & TARF_DT) {
+               if ((sc->targets[target]->flags & TARF_DT) &&
+                       (sc->mode == STEST4_MODE_LVD)) {
                        sc->targets[target]->status = TARST_PPR_NEG;
                         siop_ppr_msg(siop_cmd, msgoffset, sc->dt_minsync,
                            sc->maxoff);
@@ -813,7 +816,7 @@
        struct siop_common_softc *sc;
 {
        int retry;
-       int sist0, sist1, stest2, stest4;
+       int sist0, sist1, stest2;
        for (retry = 0; retry < 5; retry++) {
                /*
                 * datasheet says to wait 100ms and re-read SIST1,
@@ -826,10 +829,10 @@
                sist1 = bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_SIST1);
                if (sist1 & SIEN1_SBMC)
                        continue; /* we got an irq again */
-               stest4 = bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_STEST4) &
+               sc->mode = bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_STEST4) &
                    STEST4_MODE_MASK;
                stest2 = bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_STEST2);
-               switch(stest4) {
+               switch(sc->mode) {
                case STEST4_MODE_DIF:
                        printf("%s: switching to differential mode\n",
                            sc->sc_dev.dv_xname);
@@ -850,11 +853,9 @@
                        break;
                default:
                        printf("%s: invalid SCSI mode 0x%x\n",
-                           sc->sc_dev.dv_xname, stest4);
+                           sc->sc_dev.dv_xname, sc->mode);
                        return 0;
                }
-               bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_STEST0,
-                   stest4 >> 2);
                return 1;
        }
        printf("%s: timeout waiting for DIFFSENSE to stabilise\n",
diff -r 172aadec2809 -r a33c65163ec9 sys/dev/ic/siopvar_common.h
--- a/sys/dev/ic/siopvar_common.h       Sat May 04 18:23:35 2002 +0000
+++ b/sys/dev/ic/siopvar_common.h       Sat May 04 18:43:22 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siopvar_common.h,v 1.20 2002/05/04 18:11:06 bouyer Exp $       */
+/*     $NetBSD: siopvar_common.h,v 1.21 2002/05/04 18:43:22 bouyer Exp $       */
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -139,6 +139,7 @@
        int dt_minsync;
        int st_maxsync;                 /* as sent in or PPR messages */
        int dt_maxsync;
+       int mode;                       /* current SE/LVD/HVD mode */
        bus_space_tag_t sc_rt;          /* bus_space registers tag */
        bus_space_handle_t sc_rh;       /* bus_space registers handle */
        bus_addr_t sc_raddr;            /* register adresses */



Home | Main Index | Thread Index | Old Index