drm/radeon: 9800 SE has only one quadpipe
[safe/jmp/linux-2.6] / drivers / char / n_tty.c
index e6eeeb2..bdae832 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/audit.h>
 #include <linux/file.h>
 #include <linux/uaccess.h>
+#include <linux/module.h>
 
 #include <asm/system.h>
 
@@ -576,33 +577,23 @@ static void process_echoes(struct tty_struct *tty)
                                break;
 
                        default:
-                               if (iscntrl(op)) {
-                                       if (L_ECHOCTL(tty)) {
-                                               /*
-                                                * Ensure there is enough space
-                                                * for the whole ctrl pair.
-                                                */
-                                               if (space < 2) {
-                                                       no_space_left = 1;
-                                                       break;
-                                               }
-                                               tty_put_char(tty, '^');
-                                               tty_put_char(tty, op ^ 0100);
-                                               tty->column += 2;
-                                               space -= 2;
-                                       } else {
-                                               if (!space) {
-                                                       no_space_left = 1;
-                                                       break;
-                                               }
-                                               tty_put_char(tty, op);
-                                               space--;
-                                       }
-                               }
                                /*
-                                * If above falls through, this was an
-                                * undefined op.
+                                * If the op is not a special byte code,
+                                * it is a ctrl char tagged to be echoed
+                                * as "^X" (where X is the letter
+                                * representing the control char).
+                                * Note that we must ensure there is
+                                * enough space for the whole ctrl pair.
+                                *
                                 */
+                               if (space < 2) {
+                                       no_space_left = 1;
+                                       break;
+                               }
+                               tty_put_char(tty, '^');
+                               tty_put_char(tty, op ^ 0100);
+                               tty->column += 2;
+                               space -= 2;
                                cp += 2;
                                nr -= 2;
                        }
@@ -809,8 +800,8 @@ static void echo_char_raw(unsigned char c, struct tty_struct *tty)
  *     Echo user input back onto the screen. This must be called only when
  *     L_ECHO(tty) is true. Called from the driver receive_buf path.
  *
- *     This variant tags control characters to be possibly echoed as
- *     as "^X" (where X is the letter representing the control char).
+ *     This variant tags control characters to be echoed as "^X"
+ *     (where X is the letter representing the control char).
  *
  *     Locking: echo_lock to protect the echo buffer
  */
@@ -823,7 +814,7 @@ static void echo_char(unsigned char c, struct tty_struct *tty)
                add_echo_byte(ECHO_OP_START, tty);
                add_echo_byte(ECHO_OP_START, tty);
        } else {
-               if (iscntrl(c) && c != '\t')
+               if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t')
                        add_echo_byte(ECHO_OP_START, tty);
                add_echo_byte(c, tty);
        }
@@ -2101,3 +2092,19 @@ struct tty_ldisc_ops tty_ldisc_N_TTY = {
        .receive_buf     = n_tty_receive_buf,
        .write_wakeup    = n_tty_write_wakeup
 };
+
+/**
+ *     n_tty_inherit_ops       -       inherit N_TTY methods
+ *     @ops: struct tty_ldisc_ops where to save N_TTY methods
+ *
+ *     Used by a generic struct tty_ldisc_ops to easily inherit N_TTY
+ *     methods.
+ */
+
+void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
+{
+       *ops = tty_ldisc_N_TTY;
+       ops->owner = NULL;
+       ops->refcount = ops->flags = 0;
+}
+EXPORT_SYMBOL_GPL(n_tty_inherit_ops);