summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordbj <dbj@NetBSD.org>2002-02-26 09:18:54 +0000
committerdbj <dbj@NetBSD.org>2002-02-26 09:18:54 +0000
commit44ab750650167c160cebdfafb3f2be60bdd1566d (patch)
tree356c1eda513b0677fe61a080b7629d2458141399 /sys/dev
parent9820da6ce12e8ff5e208e81d6392ed93fcac353e (diff)
avoid walking full length of unknown stats structure.
this partially addresses pr14385. there is still a byte swapping bug retrieving the stats structure. Since both the type and the length are incorrectly swapped, we would timeout while reading an extra long section (caused by the byteswapped length) of garbage data. turning on WI_DEBUG now just reports the unknown info type which can be seen to be obviously incorrectly swapped on macppc
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/wi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/ic/wi.c b/sys/dev/ic/wi.c
index 9647a595b8d..f86d9a41208 100644
--- a/sys/dev/ic/wi.c
+++ b/sys/dev/ic/wi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wi.c,v 1.42 2002/02/18 14:45:56 yamt Exp $ */
+/* $NetBSD: wi.c,v 1.43 2002/02/26 09:18:54 dbj Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.42 2002/02/18 14:45:56 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.43 2002/02/26 09:18:54 dbj Exp $");
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
@@ -640,15 +640,16 @@ void wi_update_stats(sc)
}
}
default:
-#if 0
- printf("Got info type: %04x\n", gen.wi_type);
+#if WI_DEBUG
+ printf("%s: got info type: 0x%04x len=0x%04x\n",
+ sc->sc_dev.dv_xname, gen.wi_type,gen.wi_len);
#endif
+#if 0
for (i = 0; i < gen.wi_len; i++) {
t = CSR_READ_2(sc, WI_DATA1);
-#if 0
printf("[0x%02x] = 0x%04x\n", i, t);
-#endif
}
+#endif
break;
}
}