]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/tty.h
TTY: move ldisc data from tty_struct: locks
[karo-tx-linux.git] / include / linux / tty.h
index 4f6c59a5fb7941996e8062dd41efe99ec3623555..08787ece3fdc152358493f9fa3085adc377224e4 100644 (file)
@@ -1,41 +1,6 @@
 #ifndef _LINUX_TTY_H
 #define _LINUX_TTY_H
 
-/*
- * 'tty.h' defines some structures used by tty_io.c and some defines.
- */
-
-#define NR_LDISCS              30
-
-/* line disciplines */
-#define N_TTY          0
-#define N_SLIP         1
-#define N_MOUSE                2
-#define N_PPP          3
-#define N_STRIP                4
-#define N_AX25         5
-#define N_X25          6       /* X.25 async */
-#define N_6PACK                7
-#define N_MASC         8       /* Reserved for Mobitex module <kaz@cafe.net> */
-#define N_R3964                9       /* Reserved for Simatic R3964 module */
-#define N_PROFIBUS_FDL 10      /* Reserved for Profibus */
-#define N_IRDA         11      /* Linux IrDa - http://irda.sourceforge.net/ */
-#define N_SMSBLOCK     12      /* SMS block mode - for talking to GSM data */
-                               /* cards about SMS messages */
-#define N_HDLC         13      /* synchronous HDLC */
-#define N_SYNC_PPP     14      /* synchronous PPP */
-#define N_HCI          15      /* Bluetooth HCI UART */
-#define N_GIGASET_M101 16      /* Siemens Gigaset M101 serial DECT adapter */
-#define N_SLCAN                17      /* Serial / USB serial CAN Adaptors */
-#define N_PPS          18      /* Pulse per Second */
-#define N_V253         19      /* Codec control over voice modem */
-#define N_CAIF         20      /* CAIF protocol for talking to modems */
-#define N_GSM0710      21      /* GSM 0710 Mux */
-#define N_TI_WL                22      /* for TI's WL BT, FM, GPS combo chips */
-#define N_TRACESINK    23      /* Trace data routing for MIPI P1149.7 */
-#define N_TRACEROUTER  24      /* Trace data routing for MIPI P1149.7 */
-
-#ifdef __KERNEL__
 #include <linux/fs.h>
 #include <linux/major.h>
 #include <linux/termios.h>
@@ -44,6 +9,7 @@
 #include <linux/tty_ldisc.h>
 #include <linux/mutex.h>
 #include <linux/tty_flags.h>
+#include <uapi/linux/tty.h>
 
 
 
@@ -269,6 +235,7 @@ struct tty_struct {
        struct mutex ldisc_mutex;
        struct tty_ldisc *ldisc;
 
+       struct mutex atomic_write_lock;
        struct mutex legacy_mutex;
        struct mutex termios_mutex;
        spinlock_t ctrl_lock;
@@ -299,37 +266,10 @@ struct tty_struct {
 
 #define N_TTY_BUF_SIZE 4096
 
-       /*
-        * The following is data for the N_TTY line discipline.  For
-        * historical reasons, this is included in the tty structure.
-        * Mostly locked by the BKL.
-        */
-       unsigned int column;
-       unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1;
        unsigned char closing:1;
-       unsigned char echo_overrun:1;
        unsigned short minimum_to_wake;
-       unsigned long overrun_time;
-       int num_overrun;
-       unsigned long process_char_map[256/(8*sizeof(unsigned long))];
-       char *read_buf;
-       int read_head;
-       int read_tail;
-       int read_cnt;
-       unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))];
-       unsigned char *echo_buf;
-       unsigned int echo_pos;
-       unsigned int echo_cnt;
-       int canon_data;
-       unsigned long canon_head;
-       unsigned int canon_column;
-       struct mutex atomic_read_lock;
-       struct mutex atomic_write_lock;
-       struct mutex output_lock;
-       struct mutex echo_lock;
        unsigned char *write_buf;
        int write_cnt;
-       spinlock_t read_lock;
        /* If the tty has a pending do_SAK, queue it here - akpm */
        struct work_struct SAK_work;
        struct tty_port *port;
@@ -569,7 +509,7 @@ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
 /* tty_audit.c */
 #ifdef CONFIG_AUDIT
 extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
-                              size_t size);
+                              size_t size, unsigned icanon);
 extern void tty_audit_exit(void);
 extern void tty_audit_fork(struct signal_struct *sig);
 extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
@@ -578,7 +518,7 @@ extern int tty_audit_push_task(struct task_struct *tsk,
                               kuid_t loginuid, u32 sessionid);
 #else
 static inline void tty_audit_add_data(struct tty_struct *tty,
-                                     unsigned char *data, size_t size)
+               unsigned char *data, size_t size, unsigned icanon)
 {
 }
 static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
@@ -694,5 +634,4 @@ do {                                                                        \
 } while (0)
 
 
-#endif /* __KERNEL__ */
 #endif