fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / char / generic_serial.c
index 5e59c0b..e2a0b6f 100644 (file)
@@ -33,8 +33,6 @@
 
 #define DEBUG 
 
-static char *                  tmp_buf; 
-
 static int gs_debug;
 
 #ifdef DEBUG
@@ -205,7 +203,7 @@ int gs_write(struct tty_struct * tty,
        if (!tty) return -EIO;
 
        port = tty->driver_data;
-       if (!port || !port->xmit_buf || !tmp_buf)
+       if (!port || !port->xmit_buf)
                return -EIO;
 
        local_save_flags(flags);
@@ -713,18 +711,12 @@ void gs_close(struct tty_struct * tty, struct file * filp)
 }
 
 
-static unsigned int     gs_baudrates[] = {
-  0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
-  9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600
-};
-
-
 void gs_set_termios (struct tty_struct * tty, 
-                     struct termios * old_termios)
+                     struct ktermios * old_termios)
 {
        struct gs_port *port;
        int baudrate, tmp, rv;
-       struct termios *tiosp;
+       struct ktermios *tiosp;
 
        func_enter();
 
@@ -746,11 +738,9 @@ void gs_set_termios (struct tty_struct * tty,
                gs_dprintk (GS_DEBUG_TERMIOS, "termios structure (%p):\n", tiosp);
        }
 
-#if 0
        /* This is an optimization that is only allowed for dumb cards */
        /* Smart cards require knowledge of iflags and oflags too: that 
           might change hardware cooking mode.... */
-#endif
        if (old_termios) {
                if(   (tiosp->c_iflag == old_termios->c_iflag)
                   && (tiosp->c_oflag == old_termios->c_oflag)
@@ -774,16 +764,8 @@ void gs_set_termios (struct tty_struct * tty,
                if(!memcmp(tiosp->c_cc, old_termios->c_cc, NCC)) printk("c_cc changed\n");
        }
 
-       baudrate = tiosp->c_cflag & CBAUD;
-       if (baudrate & CBAUDEX) {
-               baudrate &= ~CBAUDEX;
-               if ((baudrate < 1) || (baudrate > 4))
-                       tiosp->c_cflag &= ~CBAUDEX;
-               else
-                       baudrate += 15;
-       }
+       baudrate = tty_get_baud_rate(tty);
 
-       baudrate = gs_baudrates[baudrate];
        if ((tiosp->c_cflag & CBAUD) == B38400) {
                if (     (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
                        baudrate = 57600;
@@ -846,24 +828,9 @@ void gs_set_termios (struct tty_struct * tty,
 int gs_init_port(struct gs_port *port)
 {
        unsigned long flags;
-       unsigned long page;
 
        func_enter ();
 
-        if (!tmp_buf) {
-               page = get_zeroed_page(GFP_KERNEL);
-               spin_lock_irqsave (&port->driver_lock, flags); /* Don't expect this to make a difference. */
-               if (tmp_buf)
-                       free_page(page);
-               else
-                       tmp_buf = (unsigned char *) page;
-               spin_unlock_irqrestore (&port->driver_lock, flags);
-               if (!tmp_buf) {
-                       func_exit ();
-                       return -ENOMEM;
-               }
-       }
-
        if (port->flags & ASYNC_INITIALIZED) {
                func_exit ();
                return 0;