fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / serial / jsm / jsm_tty.c
index 4d48b62..7cf1c60 100644 (file)
@@ -142,12 +142,14 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch)
 {
        unsigned long lock_flags;
        struct jsm_channel *channel = (struct jsm_channel *)port;
+       struct ktermios *termios;
 
        spin_lock_irqsave(&port->lock, lock_flags);
-       if (ch == port->info->tty->termios->c_cc[VSTART])
+       termios = port->info->tty->termios;
+       if (ch == termios->c_cc[VSTART])
                channel->ch_bd->bd_ops->send_start_character(channel);
 
-       if (ch == port->info->tty->termios->c_cc[VSTOP])
+       if (ch == termios->c_cc[VSTOP])
                channel->ch_bd->bd_ops->send_stop_character(channel);
        spin_unlock_irqrestore(&port->lock, lock_flags);
 }
@@ -178,6 +180,7 @@ static int jsm_tty_open(struct uart_port *port)
        struct jsm_board *brd;
        int rc = 0;
        struct jsm_channel *channel = (struct jsm_channel *)port;
+       struct ktermios *termios;
 
        /* Get board pointer from our array of majors we have allocated */
        brd = channel->ch_bd;
@@ -239,12 +242,13 @@ static int jsm_tty_open(struct uart_port *port)
        channel->ch_cached_lsr = 0;
        channel->ch_stops_sent = 0;
 
-       channel->ch_c_cflag     = port->info->tty->termios->c_cflag;
-       channel->ch_c_iflag     = port->info->tty->termios->c_iflag;
-       channel->ch_c_oflag     = port->info->tty->termios->c_oflag;
-       channel->ch_c_lflag     = port->info->tty->termios->c_lflag;
-       channel->ch_startc = port->info->tty->termios->c_cc[VSTART];
-       channel->ch_stopc = port->info->tty->termios->c_cc[VSTOP];
+       termios = port->info->tty->termios;
+       channel->ch_c_cflag     = termios->c_cflag;
+       channel->ch_c_iflag     = termios->c_iflag;
+       channel->ch_c_oflag     = termios->c_oflag;
+       channel->ch_c_lflag     = termios->c_lflag;
+       channel->ch_startc      = termios->c_cc[VSTART];
+       channel->ch_stopc       = termios->c_cc[VSTOP];
 
        /* Tell UART to init itself */
        brd->bd_ops->uart_init(channel);
@@ -265,7 +269,7 @@ static int jsm_tty_open(struct uart_port *port)
 static void jsm_tty_close(struct uart_port *port)
 {
        struct jsm_board *bd;
-       struct termios *ts;
+       struct ktermios *ts;
        struct jsm_channel *channel = (struct jsm_channel *)port;
 
        jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n");
@@ -298,8 +302,8 @@ static void jsm_tty_close(struct uart_port *port)
 }
 
 static void jsm_tty_set_termios(struct uart_port *port,
-                                struct termios *termios,
-                                struct termios *old_termios)
+                                struct ktermios *termios,
+                                struct ktermios *old_termios)
 {
        unsigned long lock_flags;
        struct jsm_channel *channel = (struct jsm_channel *)port;
@@ -584,13 +588,6 @@ void jsm_input(struct jsm_channel *ch)
        len = min(len, (N_TTY_BUF_SIZE - 1) - tp->read_cnt);
        ld = tty_ldisc_ref(tp);
 
-       /*
-        * If the DONT_FLIP flag is on, don't flush our buffer, and act
-        * like the ld doesn't have any space to put the data right now.
-        */
-       if (test_bit(TTY_DONT_FLIP, &tp->flags))
-               len = 0;
-
        /*
         * If we were unable to get a reference to the ld,
         * don't flush our buffer, and act like the ld doesn't
@@ -784,6 +781,7 @@ static void jsm_carrier(struct jsm_channel *ch)
 
 void jsm_check_queue_flow_control(struct jsm_channel *ch)
 {
+       struct board_ops *bd_ops = ch->ch_bd->bd_ops;
        int qleft = 0;
 
        /* Store how much space we have left in the queue */
@@ -809,7 +807,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
                /* HWFLOW */
                if (ch->ch_c_cflag & CRTSCTS) {
                        if(!(ch->ch_flags & CH_RECEIVER_OFF)) {
-                               ch->ch_bd->bd_ops->disable_receiver(ch);
+                               bd_ops->disable_receiver(ch);
                                ch->ch_flags |= (CH_RECEIVER_OFF);
                                jsm_printk(READ, INFO, &ch->ch_bd->pci_dev,
                                        "Internal queue hit hilevel mark (%d)! Turning off interrupts.\n",
@@ -819,7 +817,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
                /* SWFLOW */
                else if (ch->ch_c_iflag & IXOFF) {
                        if (ch->ch_stops_sent <= MAX_STOPS_SENT) {
-                               ch->ch_bd->bd_ops->send_stop_character(ch);
+                               bd_ops->send_stop_character(ch);
                                ch->ch_stops_sent++;
                                jsm_printk(READ, INFO, &ch->ch_bd->pci_dev,
                                        "Sending stop char! Times sent: %x\n", ch->ch_stops_sent);
@@ -846,7 +844,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
                /* HWFLOW */
                if (ch->ch_c_cflag & CRTSCTS) {
                        if (ch->ch_flags & CH_RECEIVER_OFF) {
-                               ch->ch_bd->bd_ops->enable_receiver(ch);
+                               bd_ops->enable_receiver(ch);
                                ch->ch_flags &= ~(CH_RECEIVER_OFF);
                                jsm_printk(READ, INFO, &ch->ch_bd->pci_dev,
                                        "Internal queue hit lowlevel mark (%d)! Turning on interrupts.\n",
@@ -856,7 +854,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
                /* SWFLOW */
                else if (ch->ch_c_iflag & IXOFF && ch->ch_stops_sent) {
                        ch->ch_stops_sent = 0;
-                       ch->ch_bd->bd_ops->send_start_character(ch);
+                       bd_ops->send_start_character(ch);
                        jsm_printk(READ, INFO, &ch->ch_bd->pci_dev, "Sending start char!\n");
                }
        }