aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/au1x00_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/au1x00_uart.c')
-rw-r--r--drivers/serial/au1x00_uart.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/drivers/serial/au1x00_uart.c b/drivers/serial/au1x00_uart.c
index a274ebf256a1..ceb5d7f37bbd 100644
--- a/drivers/serial/au1x00_uart.c
+++ b/drivers/serial/au1x00_uart.c
@@ -241,18 +241,12 @@ static _INLINE_ void
241receive_chars(struct uart_8250_port *up, int *status, struct pt_regs *regs) 241receive_chars(struct uart_8250_port *up, int *status, struct pt_regs *regs)
242{ 242{
243 struct tty_struct *tty = up->port.info->tty; 243 struct tty_struct *tty = up->port.info->tty;
244 unsigned char ch; 244 unsigned char ch, flag;
245 int max_count = 256; 245 int max_count = 256;
246 246
247 do { 247 do {
248 if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
249 tty->flip.work.func((void *)tty);
250 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
251 return; // if TTY_DONT_FLIP is set
252 }
253 ch = serial_inp(up, UART_RX); 248 ch = serial_inp(up, UART_RX);
254 *tty->flip.char_buf_ptr = ch; 249 flag = TTY_NORMAL;
255 *tty->flip.flag_buf_ptr = TTY_NORMAL;
256 up->port.icount.rx++; 250 up->port.icount.rx++;
257 251
258 if (unlikely(*status & (UART_LSR_BI | UART_LSR_PE | 252 if (unlikely(*status & (UART_LSR_BI | UART_LSR_PE |
@@ -292,30 +286,23 @@ receive_chars(struct uart_8250_port *up, int *status, struct pt_regs *regs)
292#endif 286#endif
293 if (*status & UART_LSR_BI) { 287 if (*status & UART_LSR_BI) {
294 DEBUG_INTR("handling break...."); 288 DEBUG_INTR("handling break....");
295 *tty->flip.flag_buf_ptr = TTY_BREAK; 289 flag = TTY_BREAK;
296 } else if (*status & UART_LSR_PE) 290 } else if (*status & UART_LSR_PE)
297 *tty->flip.flag_buf_ptr = TTY_PARITY; 291 flag = TTY_PARITY;
298 else if (*status & UART_LSR_FE) 292 else if (*status & UART_LSR_FE)
299 *tty->flip.flag_buf_ptr = TTY_FRAME; 293 flag = TTY_FRAME;
300 } 294 }
301 if (uart_handle_sysrq_char(&up->port, ch, regs)) 295 if (uart_handle_sysrq_char(&up->port, ch, regs))
302 goto ignore_char; 296 goto ignore_char;
303 if ((*status & up->port.ignore_status_mask) == 0) { 297 if ((*status & up->port.ignore_status_mask) == 0)
304 tty->flip.flag_buf_ptr++; 298 tty_insert_flip_char(tty, ch, flag);
305 tty->flip.char_buf_ptr++; 299 if (*status & UART_LSR_OE)
306 tty->flip.count++;
307 }
308 if ((*status & UART_LSR_OE) &&
309 tty->flip.count < TTY_FLIPBUF_SIZE) {
310 /* 300 /*
311 * Overrun is special, since it's reported 301 * Overrun is special, since it's reported
312 * immediately, and doesn't affect the current 302 * immediately, and doesn't affect the current
313 * character. 303 * character.
314 */ 304 */
315 *tty->flip.flag_buf_ptr = TTY_OVERRUN; 305 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
316 tty->flip.flag_buf_ptr++;
317 tty->flip.char_buf_ptr++;
318 tty->flip.count++;
319 } 306 }
320 ignore_char: 307 ignore_char:
321 *status = serial_inp(up, UART_LSR); 308 *status = serial_inp(up, UART_LSR);