aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRené Bürgel <r.buergel@unicontrol.de>2008-12-21 04:54:31 -0500
committerGrant Likely <grant.likely@secretlab.ca>2008-12-21 04:54:31 -0500
commitb65149880d0467287fa4c7b4f19953392323f4ac (patch)
tree3deeca7f6219eb27566a52f80cb54e7dd09fb767
parente51f47a5c695b76905aadc2be47c7dc774f3e5af (diff)
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>
-rw-r--r--drivers/serial/mpc52xx_uart.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 28c00c3d58f5..d82650d54391 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)
752 if (status & MPC52xx_PSC_SR_RB) { 752 if (status & MPC52xx_PSC_SR_RB) {
753 flag = TTY_BREAK; 753 flag = TTY_BREAK;
754 uart_handle_break(port); 754 uart_handle_break(port);
755 } else if (status & MPC52xx_PSC_SR_PE) 755 port->icount.brk++;
756 } else if (status & MPC52xx_PSC_SR_PE) {
756 flag = TTY_PARITY; 757 flag = TTY_PARITY;
757 else if (status & MPC52xx_PSC_SR_FE) 758 port->icount.parity++;
759 }
760 else if (status & MPC52xx_PSC_SR_FE) {
758 flag = TTY_FRAME; 761 flag = TTY_FRAME;
762 port->icount.frame++;
763 }
759 764
760 /* Clear error condition */ 765 /* Clear error condition */
761 out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT); 766 out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
@@ -769,6 +774,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
769 * affect the current character 774 * affect the current character
770 */ 775 */
771 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 776 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
777 port->icount.overrun++;
772 } 778 }
773 } 779 }
774 780