Resent-Date: Tue, 3 Nov 1998 05:49:56 +0100 (MET)
Date: Mon, 2 Nov 1998 22:50:24 -0600
From: Chris Lawrence <quango@watervalley.net>
To: Linux/m68k Mailing List <linux-m68k@lists.linux-m68k.org>
Subject: Serial stats for 2.1.x
Mail-Followup-To: Linux/m68k Mailing List <linux-m68k@lists.linux-m68k.org>
Organization: Kathie Lee's Sweatshops
X-Operating-System: Linux/m68k 2.1.124
Resent-From: linux-m68k@phil.uni-sb.de

The following patch enables logging of serial errors in 2.1; these
stats can be read from /proc/tty/driver/serial

Perhaps this should be optional, since serial performance is a
bottleneck on m68k anyway... but I needed the stats to track down some
problems I'm having with the MultiFaceCard III (which are apparently
either hardware or driver bugs; the overrun flags detected by PPP are
being generated by the serial driver).

--- linux-2.1.124/include/asm-m68k/serial.h.old	Mon Nov  2 02:22:07 1998
+++ linux-2.1.124/include/asm-m68k/serial.h	Mon Nov  2 03:24:33 1998
@@ -336,9 +336,21 @@
 	if (tty->flip.count >= TTY_FLIPBUF_SIZE)
 		return;
 	tty->flip.count++;
-	if (err == TTY_BREAK) {
+	switch(err) {
+	case TTY_BREAK:
+		info->icount.brk++;
 		if (info->flags & ASYNC_SAK)
 			do_SAK(tty);
+		break;
+	case TTY_PARITY:
+		info->icount.parity++;
+		break;
+	case TTY_OVERRUN:
+		info->icount.overrun++;
+		break;
+	case TTY_FRAME:
+		info->icount.frame++;
+		break;
 	}
 	*tty->flip.flag_buf_ptr++ = err;
 	*tty->flip.char_buf_ptr++ = ch;


Chris
-- 
=============================================================================
|        Chris Lawrence         |               My home page:               |
|   <quango@watervalley.net>    |     http://www.clark.net/pub/lawrencc/    |
|                               |                                           |
|      Amiga A4000/040 and      |    Are you tired of politics as usual?    |
|     Linux/m68k 2.0.33pl1      |             http://www.lp.org/            |
=============================================================================

