Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev add some error checks in adb_reinit, ena...



details:   https://anonhg.NetBSD.org/src/rev/75babb4af47c
branches:  trunk
changeset: 520095:75babb4af47c
user:      dbj <dbj%NetBSD.org@localhost>
date:      Wed Jan 02 20:30:45 2002 +0000

description:
add some error checks in adb_reinit, enabled with ADB_DEBUG and adb_debug

diffstat:

 sys/arch/macppc/dev/adb_direct.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 6e9f108559e4 -r 75babb4af47c sys/arch/macppc/dev/adb_direct.c
--- a/sys/arch/macppc/dev/adb_direct.c  Wed Jan 02 20:28:43 2002 +0000
+++ b/sys/arch/macppc/dev/adb_direct.c  Wed Jan 02 20:30:45 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adb_direct.c,v 1.19 2001/08/03 23:09:42 tsubai Exp $   */
+/*     $NetBSD: adb_direct.c,v 1.20 2002/01/02 20:30:45 dbj Exp $      */
 
 /* From: adb_direct.c 2.02 4/18/97 jpw */
 
@@ -1258,9 +1258,15 @@
        delay(1000);
 
        /* send an ADB reset first */
-       adb_op_sync((Ptr)0, (Ptr)0, (Ptr)0, (short)0x00);
+       result = adb_op_sync((Ptr)0, (Ptr)0, (Ptr)0, (short)0x00);
        delay(200000);
 
+#ifdef ADB_DEBUG
+       if (result && adb_debug) {
+               printf_intr("adb_reinit: failed to reset, result = %d\n",result);
+       }
+#endif
+
        /*
         * Probe for ADB devices. Probe devices 1-15 quickly to determine
         * which device addresses are in use and which are free. For each
@@ -1285,6 +1291,13 @@
                result = adb_op_sync((Ptr)send_string, (Ptr)0,
                    (Ptr)0, (short)command);
 
+#ifdef ADB_DEBUG
+               if (result && adb_debug) {
+                       printf_intr("adb_reinit: scan of device %d, result = %d, str = 0x%x\n",
+                                       i,result,send_string[0]);
+               }
+#endif
+
                if (send_string[0] != 0) {
                        /* check for valid device handler */
                        switch (send_string[2]) {



Home | Main Index | Thread Index | Old Index