powerpc/mpc5200: Make PSC UART driver update serial errors counters

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Sunday, December 28, 2008 - 6:05 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b65149...
Commit:     b65149880d0467287fa4c7b4f19953392323f4ac
Parent:     e51f47a5c695b76905aadc2be47c7dc774f3e5af
Author:     René Bürgel <r.buergel@unicontrol.de>
AuthorDate: Sun Dec 21 02:54:31 2008 -0700
Committer:  Grant Likely <grant.likely@secretlab.ca>
CommitDate: Sun Dec 21 02:54:31 2008 -0700

    powerpc/mpc5200: Make PSC UART driver update serial errors counters
    
    This patch adds the capability to the mpc52xx-uart to report framing
    errors, parity errors, breaks and overruns to userspace. These values
    may be requested in userspace by using the ioctl TIOCGICOUNT.
    
    Signed-off-by: René Bürgel <r.buergel@unicontrol.de>
    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/serial/mpc52xx_uart.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 28c00c3..d82650d 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -752,10 +752,15 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
 			if (status & MPC52xx_PSC_SR_RB) {
 				flag = TTY_BREAK;
 				uart_handle_break(port);
-			} else if (status & MPC52xx_PSC_SR_PE)
+				port->icount.brk++;
+			} else if (status & MPC52xx_PSC_SR_PE) {
 				flag = TTY_PARITY;
-			else if (status & MPC52xx_PSC_SR_FE)
+				port->icount.parity++;
+			}
+			else if (status & MPC52xx_PSC_SR_FE) {
 				flag = TTY_FRAME;
+				port->icount.frame++;
+			}
 
 			/* Clear error condition */
 			out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
@@ -769,6 +774,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
 			 * affect the current character
 			 */
 			tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+			port->icount.overrun++;
 		}
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
powerpc/mpc5200: Make PSC UART driver update serial errors ..., Linux Kernel Mailing ..., (Sun Dec 28, 6:05 pm)