X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2F21285.c;h=759addd51854745dd7fe5118c84b58ba79324a38;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=511a40b0f8539f6dfeccdb31e0759478dc75d87e;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 511a40b0f..759addd51 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -13,12 +13,14 @@ #include #include #include +#include +#include #include #include -#include #include #include +#include #include #include @@ -90,22 +92,21 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r { struct uart_port *port = dev_id; struct tty_struct *tty = port->info->tty; - unsigned int status, ch, rxs, max_count = 256; + unsigned int status, ch, flag, rxs, max_count = 256; status = *CSR_UARTFLG; while (!(status & 0x10) && max_count--) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty->flip.work.func((void *)tty); - if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - printk(KERN_WARNING "TTY_DONT_FLIP set\n"); - goto out; - } + if (tty->low_latency) + tty_flip_buffer_push(tty); + /* + * If this failed then we will throw away the + * bytes but must do so to clear interrupts + */ } ch = *CSR_UARTDR; - - *tty->flip.char_buf_ptr = ch; - *tty->flip.flag_buf_ptr = TTY_NORMAL; + flag = TTY_NORMAL; port->icount.rx++; rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ; @@ -120,15 +121,13 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r rxs &= port->read_status_mask; if (rxs & RXSTAT_PARITY) - *tty->flip.flag_buf_ptr = TTY_PARITY; + flag = TTY_PARITY; else if (rxs & RXSTAT_FRAME) - *tty->flip.flag_buf_ptr = TTY_FRAME; + flag = TTY_FRAME; } if ((rxs & port->ignore_status_mask) == 0) { - tty->flip.flag_buf_ptr++; - tty->flip.char_buf_ptr++; - tty->flip.count++; + tty_insert_flip_char(tty, ch, flag); } if ((rxs & RXSTAT_OVERRUN) && tty->flip.count < TTY_FLIPBUF_SIZE) { @@ -137,9 +136,7 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r * immediately, and doesn't affect the current * character. */ - *tty->flip.char_buf_ptr++ = 0; - *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; - tty->flip.count++; + tty_insert_flip_char(tty, 0, TTY_OVERRUN); } status = *CSR_UARTFLG; }