aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/mcfserial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/mcfserial.c')
-rw-r--r--drivers/serial/mcfserial.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index 47f7404cb045..f2a51e61eec7 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -313,7 +313,7 @@ static inline void receive_chars(struct mcf_serial *info)
313{ 313{
314 volatile unsigned char *uartp; 314 volatile unsigned char *uartp;
315 struct tty_struct *tty = info->tty; 315 struct tty_struct *tty = info->tty;
316 unsigned char status, ch; 316 unsigned char status, ch, flag;
317 317
318 if (!tty) 318 if (!tty)
319 return; 319 return;
@@ -321,10 +321,6 @@ static inline void receive_chars(struct mcf_serial *info)
321 uartp = info->addr; 321 uartp = info->addr;
322 322
323 while ((status = uartp[MCFUART_USR]) & MCFUART_USR_RXREADY) { 323 while ((status = uartp[MCFUART_USR]) & MCFUART_USR_RXREADY) {
324
325 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
326 break;
327
328 ch = uartp[MCFUART_URB]; 324 ch = uartp[MCFUART_URB];
329 info->stats.rx++; 325 info->stats.rx++;
330 326
@@ -335,29 +331,24 @@ static inline void receive_chars(struct mcf_serial *info)
335 } 331 }
336#endif 332#endif
337 333
338 tty->flip.count++; 334 flag = TTY_NORMAL;
339 if (status & MCFUART_USR_RXERR) { 335 if (status & MCFUART_USR_RXERR) {
340 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETERR; 336 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETERR;
341 if (status & MCFUART_USR_RXBREAK) { 337 if (status & MCFUART_USR_RXBREAK) {
342 info->stats.rxbreak++; 338 info->stats.rxbreak++;
343 *tty->flip.flag_buf_ptr++ = TTY_BREAK; 339 flag = TTY_BREAK;
344 } else if (status & MCFUART_USR_RXPARITY) { 340 } else if (status & MCFUART_USR_RXPARITY) {
345 info->stats.rxparity++; 341 info->stats.rxparity++;
346 *tty->flip.flag_buf_ptr++ = TTY_PARITY; 342 flag = TTY_PARITY;
347 } else if (status & MCFUART_USR_RXOVERRUN) { 343 } else if (status & MCFUART_USR_RXOVERRUN) {
348 info->stats.rxoverrun++; 344 info->stats.rxoverrun++;
349 *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; 345 flag = TTY_OVERRUN;
350 } else if (status & MCFUART_USR_RXFRAMING) { 346 } else if (status & MCFUART_USR_RXFRAMING) {
351 info->stats.rxframing++; 347 info->stats.rxframing++;
352 *tty->flip.flag_buf_ptr++ = TTY_FRAME; 348 flag = TTY_FRAME;
353 } else {
354 /* This should never happen... */
355 *tty->flip.flag_buf_ptr++ = 0;
356 } 349 }
357 } else {
358 *tty->flip.flag_buf_ptr++ = 0;
359 } 350 }
360 *tty->flip.char_buf_ptr++ = ch; 351 tty_insert_flip_char(tty, ch, flag);
361 } 352 }
362 353
363 schedule_work(&tty->flip.work); 354 schedule_work(&tty->flip.work);