This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / serial / 21285.c
index 759addd..511a40b 100644 (file)
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/console.h>
-#include <linux/device.h>
-#include <linux/tty_flip.h>
 #include <linux/serial_core.h>
 #include <linux/serial.h>
+#include <linux/device.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/mach-types.h>
 #include <asm/hardware/dec21285.h>
 #include <asm/hardware.h>
 
@@ -92,21 +90,22 @@ 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, flag, rxs, max_count = 256;
+       unsigned int status, ch, rxs, max_count = 256;
 
        status = *CSR_UARTFLG;
        while (!(status & 0x10) && max_count--) {
                if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
-                       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
-                        */
+                       tty->flip.work.func((void *)tty);
+                       if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+                               printk(KERN_WARNING "TTY_DONT_FLIP set\n");
+                               goto out;
+                       }
                }
 
                ch = *CSR_UARTDR;
-               flag = TTY_NORMAL;
+
+               *tty->flip.char_buf_ptr = ch;
+               *tty->flip.flag_buf_ptr = TTY_NORMAL;
                port->icount.rx++;
 
                rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ;
@@ -121,13 +120,15 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r
                        rxs &= port->read_status_mask;
 
                        if (rxs & RXSTAT_PARITY)
-                               flag = TTY_PARITY;
+                               *tty->flip.flag_buf_ptr = TTY_PARITY;
                        else if (rxs & RXSTAT_FRAME)
-                               flag = TTY_FRAME;
+                               *tty->flip.flag_buf_ptr = TTY_FRAME;
                }
 
                if ((rxs & port->ignore_status_mask) == 0) {
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty->flip.flag_buf_ptr++;
+                       tty->flip.char_buf_ptr++;
+                       tty->flip.count++;
                }
                if ((rxs & RXSTAT_OVERRUN) &&
                    tty->flip.count < TTY_FLIPBUF_SIZE) {
@@ -136,7 +137,9 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r
                         * immediately, and doesn't affect the current
                         * character.
                         */
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       *tty->flip.char_buf_ptr++ = 0;
+                       *tty->flip.flag_buf_ptr++ = TTY_OVERRUN;
+                       tty->flip.count++;
                }
                status = *CSR_UARTFLG;
        }