summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorwrstuden <wrstuden@NetBSD.org>1998-03-05 22:03:34 +0000
committerwrstuden <wrstuden@NetBSD.org>1998-03-05 22:03:34 +0000
commit84c6b9dbd7f4ff0b2319c6bede7a69e95c220642 (patch)
tree6572eab256ab01976456d75fa34479b8dd2f12bd /sys/dev
parent15a802993004d308e767951cd5eccc304ed4298a (diff)
Make zs_iflush not loop indefinitly. Some Mac PowerBooks lie about having
two SCC channels, and can get stuck in an infinite loop. This change stops after flushing 4 bytes. Might need upping to 8 bytes if we support 85230 ESCC's. Idea bounced off of scottr & gwr
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/z8530sc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/ic/z8530sc.c b/sys/dev/ic/z8530sc.c
index a3275e10676..9380e368bc5 100644
--- a/sys/dev/ic/z8530sc.c
+++ b/sys/dev/ic/z8530sc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: z8530sc.c,v 1.7 1998/02/19 21:26:10 mycroft Exp $ */
+/* $NetBSD: z8530sc.c,v 1.8 1998/03/05 22:03:34 wrstuden Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -92,8 +92,13 @@ zs_iflush(cs)
struct zs_chanstate *cs;
{
u_char c, rr0, rr1;
+ int i;
- for (;;) {
+ /*
+ * Count how many times we loop. Some systems, such as some
+ * Apple PowerBooks, claim to have SCC's which they really don't.
+ */
+ for (i=0; i<4; i++) {
/* Is there input available? */
rr0 = zs_read_csr(cs);
if ((rr0 & ZSRR0_RX_READY) == 0)