From patchwork Thu Oct 30 06:14:07 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmVuw6kgQsO8cmdlbA==?= X-Patchwork-Id: 6444 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 76D10DDFF7 for ; Thu, 30 Oct 2008 17:24:31 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.161]) by ozlabs.org (Postfix) with ESMTP id 79025DDDE7 for ; Thu, 30 Oct 2008 17:24:15 +1100 (EST) X-RZG-CLASS-ID: mo00 X-RZG-AUTH: :O2kGeEG7b/pS1Fi3Qny8h5cV9+njuawu84na/cL5YoHgc/7iwRiKVLzvXfs3/QW1 Received: from obelix.unicontrol.de (pd907c61f.dip0.t-ipconnect.de [217.7.198.31]) by post.webmailer.de (fruni mo58) (RZmta 17.14) with ESMTP id p002a7k9U0Tt3U for ; Thu, 30 Oct 2008 07:24:13 +0100 (MET) (envelope-from: ) Received: from localhost (localhost [127.0.0.1]) by obelix.unicontrol.de (Postfix on SuSE Linux 8.1 (i386)) with ESMTP id 3C08617DFC for ; Thu, 30 Oct 2008 07:22:50 +0100 (CET) Received: from [192.168.1.55] (arkturus.unicontrol.de [192.168.1.55]) by obelix.unicontrol.de (Postfix on SuSE Linux 8.1 (i386)) with ESMTP id 5618B17DFB for ; Thu, 30 Oct 2008 07:22:46 +0100 (CET) Message-ID: <490950AF.1000303@unicontrol.de> Date: Thu, 30 Oct 2008 07:14:07 +0100 From: =?ISO-8859-15?Q?Ren=E9_B=FCrgel?= User-Agent: Thunderbird 2.0.0.17 (X11/20080930) MIME-Version: 1.0 To: linuxppc-dev@ozlabs.org Subject: [PATCH] mpc52xx_uart: report serial errors to users X-Virus-Scanned: by AMaViS 0.3.12pre8 X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Hi! 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 Kind regards, René Bürgel --- drivers/serial/mpc52xx_uart.c 2008-08-07 15:55:43.000000000 +0200 +++ drivers/serial/mpc52xx_uart_orig.c 2008-09-11 13:19:12.000000000 +0200 @@ -752,10 +752,17 @@ if (status & MPC52xx_PSC_SR_RB) { flag = TTY_BREAK; uart_handle_break(port); + port->icount.brk++; } else if (status & MPC52xx_PSC_SR_PE) + { flag = TTY_PARITY; + 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 +776,7 @@ * affect the current character */ tty_insert_flip_char(tty, 0, TTY_OVERRUN); + port->icount.overrun++; } }