vserver 1.9.3
[linux-2.6.git] / drivers / char / generic_serial.c
index 1f278a4..45bc1be 100644 (file)
@@ -45,7 +45,7 @@ static int gs_debug;
 #define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __FUNCTION__)
 #define func_exit()  gs_dprintk (GS_DEBUG_FLOW, "gs: exit  %s\n", __FUNCTION__)
 
-#if NEW_WRITE_LOCKING
+#ifdef NEW_WRITE_LOCKING
 #define DECL      /* Nothing */
 #define LOCKIT    down (& port->port_write_sem);
 #define RELEASEIT up (&port->port_write_sem);
@@ -436,9 +436,7 @@ void gs_flush_buffer(struct tty_struct *tty)
        restore_flags(flags);
 
        wake_up_interruptible(&tty->write_wait);
-       if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-           tty->ldisc.write_wakeup)
-               (tty->ldisc.write_wakeup)(tty);
+       tty_wakeup(tty);
        func_exit ();
 }
 
@@ -526,7 +524,7 @@ void gs_shutdown_port (struct gs_port *port)
 
        if (port->xmit_buf) {
                free_page((unsigned long) port->xmit_buf);
-               port->xmit_buf = 0;
+               port->xmit_buf = NULL;
        }
 
        if (port->tty)
@@ -578,9 +576,7 @@ void gs_do_softint(void *private_)
        if (!tty) return;
 
        if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &port->event)) {
-               if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-                   tty->ldisc.write_wakeup)
-                       (tty->ldisc.write_wakeup)(tty);
+               tty_wakeup(tty);
                wake_up_interruptible(&tty->write_wait);
        }
        func_exit ();
@@ -694,7 +690,7 @@ void gs_close(struct tty_struct * tty, struct file * filp)
 {
        unsigned long flags;
        struct gs_port *port;
-
+       
        func_enter ();
 
        if (!tty) return;
@@ -760,14 +756,14 @@ void gs_close(struct tty_struct * tty, struct file * filp)
 
        if (tty->driver->flush_buffer)
                tty->driver->flush_buffer(tty);
-       if (tty->ldisc.flush_buffer)
-               tty->ldisc.flush_buffer(tty);
+               
+       tty_ldisc_flush(tty);
        tty->closing = 0;
 
        port->event = 0;
        port->rd->close (port);
        port->rd->shutdown_port (port);
-       port->tty = 0;
+       port->tty = NULL;
 
        if (port->blocked_open) {
                if (port->close_delay) {
@@ -967,7 +963,7 @@ int gs_init_port(struct gs_port *port)
 }
 
 
-int gs_setserial(struct gs_port *port, struct serial_struct *sp)
+int gs_setserial(struct gs_port *port, struct serial_struct __user *sp)
 {
        struct serial_struct sio;
 
@@ -1002,7 +998,7 @@ int gs_setserial(struct gs_port *port, struct serial_struct *sp)
  *      Generate the serial struct info.
  */
 
-int gs_getserial(struct gs_port *port, struct serial_struct *sp)
+int gs_getserial(struct gs_port *port, struct serial_struct __user *sp)
 {
        struct serial_struct    sio;