From 920e8af57172dfbf9ac18d0e2f02f1b75efe15af Mon Sep 17 00:00:00 2001 From: dbj Date: Wed, 2 Jan 2002 20:30:45 +0000 Subject: [PATCH] add some error checks in adb_reinit, enabled with ADB_DEBUG and adb_debug --- sys/arch/macppc/dev/adb_direct.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/arch/macppc/dev/adb_direct.c b/sys/arch/macppc/dev/adb_direct.c index c701b79b9708..1d9f4389e050 100644 --- a/sys/arch/macppc/dev/adb_direct.c +++ b/sys/arch/macppc/dev/adb_direct.c @@ -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 @@ adb_reinit(void) 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 @@ adb_reinit(void) 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]) {