From: Alan Cox Update the synclink_gt driver to the new buffering and also fix an apparent bug in the break handling. Cc: Paul Fulghum Signed-off-by: Andrew Morton --- drivers/char/synclink_gt.c | 35 +++++++++++++++++------------------ 1 files changed, 17 insertions(+), 18 deletions(-) diff -puN drivers/char/synclink_gt.c~synclink_gt-conversion-to-new-buffering drivers/char/synclink_gt.c --- 25/drivers/char/synclink_gt.c~synclink_gt-conversion-to-new-buffering Mon Nov 7 16:54:42 2005 +++ 25-akpm/drivers/char/synclink_gt.c Mon Nov 7 16:54:42 2005 @@ -1767,6 +1767,9 @@ static void rx_async(SLGT_INFO *info) unsigned char status; SLGT_DESC *bufs = info->rbufs; int i, count; + int chars = 0; + int stat; + unsigned char ch; start = end = info->rbuf_current; @@ -1778,16 +1781,15 @@ static void rx_async(SLGT_INFO *info) DBGDATA(info, p, count, "rx"); for(i=0 ; i < count; i+=2, p+=2) { - if (tty) { - if (tty->flip.count >= TTY_FLIPBUF_SIZE) - tty_flip_buffer_push(tty); - if (tty->flip.count >= TTY_FLIPBUF_SIZE) - break; - *tty->flip.char_buf_ptr = *p; - *tty->flip.flag_buf_ptr = 0; + if (tty && chars) { + tty_flip_buffer_push(tty); + chars = 0; } + ch = *p; icount->rx++; + stat = 0; + if ((status = *(p+1) & (BIT9 + BIT8))) { if (status & BIT9) icount->parity++; @@ -1796,17 +1798,14 @@ static void rx_async(SLGT_INFO *info) /* discard char if tty control flags say so */ if (status & info->ignore_status_mask) continue; - if (tty) { - if (status & BIT9) - *tty->flip.flag_buf_ptr = TTY_PARITY; - else if (status & BIT8) - *tty->flip.flag_buf_ptr = TTY_FRAME; - } + if (status & BIT9) + stat = TTY_PARITY; + else if (status & BIT8) + stat = TTY_FRAME; } if (tty) { - tty->flip.flag_buf_ptr++; - tty->flip.char_buf_ptr++; - tty->flip.count++; + tty_insert_flip_char(tty, ch, stat); + chars++; } } @@ -1829,7 +1828,7 @@ static void rx_async(SLGT_INFO *info) break; } - if (tty && tty->flip.count) + if (tty && chars) tty_flip_buffer_push(tty); } @@ -2047,7 +2046,7 @@ static void isr_serial(SLGT_INFO *info) if (info->tty) { if (!(status & info->ignore_status_mask)) { if (info->read_status_mask & MASK_BREAK) { - *info->tty->flip.flag_buf_ptr = TTY_BREAK; + tty_insert_flip_char(info->tty, 0, TTY_BREAK); if (info->flags & ASYNC_SAK) do_SAK(info->tty); } _