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 --- devel/drivers/char/synclink_gt.c~synclink_gt-conversion-to-new-buffering 2005-11-22 22:31:20.000000000 -0800 +++ devel-akpm/drivers/char/synclink_gt.c 2005-11-22 22:31:20.000000000 -0800 @@ -1750,6 +1750,9 @@ static void rx_async(struct slgt_info *i unsigned char status; struct slgt_desc *bufs = info->rbufs; int i, count; + int chars = 0; + int stat; + unsigned char ch; start = end = info->rbuf_current; @@ -1761,16 +1764,15 @@ static void rx_async(struct slgt_info *i 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++; @@ -1779,17 +1781,14 @@ static void rx_async(struct slgt_info *i /* 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++; } } @@ -1812,7 +1811,7 @@ static void rx_async(struct slgt_info *i break; } - if (tty && tty->flip.count) + if (tty && chars) tty_flip_buffer_push(tty); } @@ -2030,7 +2029,7 @@ static void isr_serial(struct slgt_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); } _