fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / s390 / char / sclp_vt220.c
index 06bd858..723bf41 100644 (file)
@@ -7,7 +7,6 @@
  *    Author(s): Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
@@ -16,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/tty.h>
 #include <linux/tty_driver.h>
+#include <linux/tty_flip.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
@@ -482,16 +482,7 @@ sclp_vt220_receiver_fn(struct evbuf_header *evbuf)
                /* Send input to line discipline */
                buffer++;
                count--;
-               /* Prevent buffer overrun by discarding input. Note that
-                * because buffer_push works asynchronously, we cannot wait
-                * for the buffer to be emptied. */
-               if (count + sclp_vt220_tty->flip.count > TTY_FLIPBUF_SIZE)
-                       count = TTY_FLIPBUF_SIZE - sclp_vt220_tty->flip.count;
-               memcpy(sclp_vt220_tty->flip.char_buf_ptr, buffer, count);
-               memset(sclp_vt220_tty->flip.flag_buf_ptr, TTY_NORMAL, count);
-               sclp_vt220_tty->flip.char_buf_ptr += count;
-               sclp_vt220_tty->flip.flag_buf_ptr += count;
-               sclp_vt220_tty->flip.count += count;
+               tty_insert_flip_string(sclp_vt220_tty, buffer, count);
                tty_flip_buffer_push(sclp_vt220_tty);
                break;
        }
@@ -664,7 +655,7 @@ __sclp_vt220_init(int early)
        return 0;
 }
 
-static struct tty_operations sclp_vt220_ops = {
+static const struct tty_operations sclp_vt220_ops = {
        .open = sclp_vt220_open,
        .close = sclp_vt220_close,
        .write = sclp_vt220_write,