This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / serial / dz.c
index 97824ee..293d172 100644 (file)
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/tty.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/console.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/serial_core.h>
 #include <linux/serial.h>
+#include <linux/serial_core.h>
 
 #include <asm/bootinfo.h>
 #include <asm/dec/interrupts.h>
@@ -187,7 +186,7 @@ static inline void dz_receive_chars(struct dz_port *dport)
        struct uart_icount *icount;
        int ignore = 0;
        unsigned short status, tmp;
-       unsigned char ch, flag;
+       unsigned char ch;
 
        /* this code is going to be a problem...
           the call to tty_flip_buffer is going to need
@@ -202,7 +201,6 @@ static inline void dz_receive_chars(struct dz_port *dport)
 
 
                ch = UCHAR(status);     /* grab the char */
-               flag = TTY_NORMAL;
 
 #if 0
                if (info->is_console) {
@@ -219,6 +217,8 @@ static inline void dz_receive_chars(struct dz_port *dport)
                if (tty->flip.count >= TTY_FLIPBUF_SIZE)
                        break;
 
+               *tty->flip.char_buf_ptr = ch;
+               *tty->flip.flag_buf_ptr = 0;
                icount->rx++;
 
                /* keep track of the statistics */
@@ -243,12 +243,12 @@ static inline void dz_receive_chars(struct dz_port *dport)
                        tmp = status & dport->port.read_status_mask;
 
                        if (tmp & DZ_PERR) {
-                               flag = TTY_PARITY;
+                               *tty->flip.flag_buf_ptr = TTY_PARITY;
 #ifdef DEBUG_DZ
                                debug_console("PERR\n", 5);
 #endif
                        } else if (tmp & DZ_FERR) {
-                               flag = TTY_FRAME;
+                               *tty->flip.flag_buf_ptr = TTY_FRAME;
 #ifdef DEBUG_DZ
                                debug_console("FERR\n", 5);
 #endif
@@ -257,12 +257,17 @@ static inline void dz_receive_chars(struct dz_port *dport)
 #ifdef DEBUG_DZ
                                debug_console("OERR\n", 5);
 #endif
-                               tty_insert_flip_char(tty, ch, flag);
-                               ch = 0;
-                               flag = TTY_OVERRUN;
+                               if (tty->flip.count < TTY_FLIPBUF_SIZE) {
+                                       tty->flip.count++;
+                                       tty->flip.flag_buf_ptr++;
+                                       tty->flip.char_buf_ptr++;
+                                       *tty->flip.flag_buf_ptr = TTY_OVERRUN;
+                               }
                        }
                }
-               tty_insert_flip_char(tty, ch, flag);
+               tty->flip.flag_buf_ptr++;
+               tty->flip.char_buf_ptr++;
+               tty->flip.count++;
              ignore_char:
        } while (status & DZ_DVAL);