Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Allow e?siop_dump_script() to work with on-chip R...



details:   https://anonhg.NetBSD.org/src/rev/14ed37c42e72
branches:  trunk
changeset: 757652:14ed37c42e72
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Thu Sep 09 14:50:25 2010 +0000

description:
Allow e?siop_dump_script() to work with on-chip RAM.  Prefix
DUMP_SCRIPT with SIOP_.  Additionally, avoid undefining DEBUG,
condition on SIOP_DEBUG instead.

diffstat:

 sys/dev/ic/esiop.c |  26 +++++++++++---------------
 sys/dev/ic/siop.c  |  27 +++++++++++----------------
 2 files changed, 22 insertions(+), 31 deletions(-)

diffs (177 lines):

diff -r 3cc1781d25d5 -r 14ed37c42e72 sys/dev/ic/esiop.c
--- a/sys/dev/ic/esiop.c        Thu Sep 09 12:23:06 2010 +0000
+++ b/sys/dev/ic/esiop.c        Thu Sep 09 14:50:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: esiop.c,v 1.53 2010/05/02 17:37:52 jakllsch Exp $      */
+/*     $NetBSD: esiop.c,v 1.54 2010/09/09 14:50:25 jakllsch Exp $      */
 
 /*
  * Copyright (c) 2002 Manuel Bouyer.
@@ -28,7 +28,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esiop.c,v 1.53 2010/05/02 17:37:52 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esiop.c,v 1.54 2010/09/09 14:50:25 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,15 +56,12 @@
 
 #include "opt_siop.h"
 
-#ifndef DEBUG
-#undef DEBUG
-#endif
 /*
 #define SIOP_DEBUG
 #define SIOP_DEBUG_DR
 #define SIOP_DEBUG_INTR
 #define SIOP_DEBUG_SCHED
-#define DUMP_SCRIPT
+#define SIOP_DUMP_SCRIPT
 */
 
 #define SIOP_STATS
@@ -197,7 +194,7 @@
         * siop_reset() will reset the chip, thus clearing pending interrupts
         */
        esiop_reset(sc);
-#ifdef DUMP_SCRIPT
+#ifdef SIOP_DUMP_SCRIPT
        esiop_dump_script(sc);
 #endif
 
@@ -575,7 +572,7 @@
                        printf("scsi gross error\n");
                        if (esiop_target)
                                esiop_target->target_c.flags &= ~TARF_DT;
-#ifdef DEBUG
+#ifdef SIOP_DEBUG
                        printf("DSA=0x%x DSP=0x%lx\n",
                            bus_space_read_4(sc->sc_c.sc_rt, sc->sc_c.sc_rh,
                            SIOP_DSA),
@@ -1859,12 +1856,11 @@
 
        for (i = 0; i < PAGE_SIZE / 4; i += 2) {
                printf("0x%04x: 0x%08x 0x%08x", i * 4,
-                   le32toh(sc->sc_c.sc_script[i]),
-                   le32toh(sc->sc_c.sc_script[i + 1]));
-               if ((le32toh(sc->sc_c.sc_script[i]) & 0xe0000000) ==
-                   0xc0000000) {
+                   esiop_script_read(sc, i),
+                   esiop_script_read(sc, i + 1));
+               if ((esiop_script_read(sc, i) & 0xe0000000) == 0xc0000000) {
                        i++;
-                       printf(" 0x%08x", le32toh(sc->sc_c.sc_script[i + 1]));
+                       printf(" 0x%08x", esiop_script_read(sc, i + 1));
                }
                printf("\n");
        }
@@ -1927,7 +1923,7 @@
                    "unable to load cbd DMA map, error = %d\n", error);
                goto bad0;
        }
-#ifdef DEBUG
+#ifdef SIOP_DEBUG
        aprint_debug_dev(sc->sc_c.sc_dev, "alloc newcdb at PHY addr 0x%lx\n",
            (unsigned long)newcbd->xferdma->dm_segs[0].ds_addr);
 #endif
@@ -2056,7 +2052,7 @@
                    "unable to load tbl DMA map, error = %d\n", error);
                goto bad0;
        }
-#ifdef DEBUG
+#ifdef SIOP_DEBUG
        printf("%s: alloc new tag DSA table at PHY addr 0x%lx\n",
            device_xname(sc->sc_c.sc_dev),
            (unsigned long)newtblblk->blkmap->dm_segs[0].ds_addr);
diff -r 3cc1781d25d5 -r 14ed37c42e72 sys/dev/ic/siop.c
--- a/sys/dev/ic/siop.c Thu Sep 09 12:23:06 2010 +0000
+++ b/sys/dev/ic/siop.c Thu Sep 09 14:50:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siop.c,v 1.96 2010/05/02 17:37:52 jakllsch Exp $       */
+/*     $NetBSD: siop.c,v 1.97 2010/09/09 14:50:25 jakllsch Exp $       */
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -28,7 +28,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.96 2010/05/02 17:37:52 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.97 2010/09/09 14:50:25 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,15 +56,12 @@
 
 #include "opt_siop.h"
 
-#ifndef DEBUG
-#undef DEBUG
-#endif
 /*
 #define SIOP_DEBUG
 #define SIOP_DEBUG_DR
 #define SIOP_DEBUG_INTR
 #define SIOP_DEBUG_SCHED
-#define DUMP_SCRIPT
+#define SIOP_DUMP_SCRIPT
 */
 
 #define SIOP_STATS
@@ -174,7 +171,7 @@
         * siop_reset() will reset the chip, thus clearing pending interrupts
         */
        siop_reset(sc);
-#ifdef DUMP_SCRIPT
+#ifdef SIOP_DUMP_SCRIPT
        siop_dump_script(sc);
 #endif
 
@@ -1604,13 +1601,11 @@
 
        for (i = 0; i < PAGE_SIZE / 4; i += 2) {
                printf("0x%04x: 0x%08x 0x%08x", i * 4,
-                   siop_ctoh32(&sc->sc_c, sc->sc_c.sc_script[i]),
-                   siop_ctoh32(&sc->sc_c, sc->sc_c.sc_script[i + 1]));
-               if ((siop_ctoh32(&sc->sc_c,
-                   sc->sc_c.sc_script[i]) & 0xe0000000) == 0xc0000000) {
+                   siop_script_read(sc, i),
+                   siop_script_read(sc, i + 1));
+               if ((siop_script_read(sc, i) & 0xe0000000) == 0xc0000000) {
                        i++;
-                       printf(" 0x%08x", siop_ctoh32(&sc->sc_c,
-                            sc->sc_c.sc_script[i + 1]));
+                       printf(" 0x%08x", siop_script_read(sc, i + 1));
                }
                printf("\n");
        }
@@ -1675,7 +1670,7 @@
                    error);
                goto bad0;
        }
-#ifdef DEBUG
+#ifdef SIOP_DEBUG
        printf("%s: alloc newcdb at PHY addr 0x%lx\n",
            device_xname(sc->sc_c.sc_dev),
            (unsigned long)newcbd->xferdma->dm_segs[0].ds_addr);
@@ -1907,7 +1902,7 @@
                 * can't extend this slot. Probably not worth trying to deal
                 * with this case
                 */
-#ifdef DEBUG
+#ifdef SIOP_DEBUG
                aprint_error_dev(sc->sc_c.sc_dev,
                    "%d:%d: can't allocate a lun sw slot\n", target, lun);
 #endif
@@ -1931,7 +1926,7 @@
                 * not enough space, probably not worth dealing with it.
                 * We can hold 13 tagged-queuing capable devices in the 4k RAM.
                 */
-#ifdef DEBUG
+#ifdef SIOP_DEBUG
                aprint_error_dev(sc->sc_c.sc_dev,
                    "%d:%d: not enough memory for a lun sw slot\n",
                    target, lun);



Home | Main Index | Thread Index | Old Index