[PATCH] tty: preparatory structures for termios revamp
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 8 Dec 2006 10:38:43 +0000 (02:38 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Fri, 8 Dec 2006 16:28:56 +0000 (08:28 -0800)
In order to sort out our struct termios and add proper speed control we need
to separate the kernel and user termios structures.  Glibc is fine but the
other libraries rely on the kernel exported struct termios and we need to
extend this without breaking the ABI/API

To do so we add a struct ktermios which is the kernel view of a termios
structure and overlaps the struct termios with extra fields on the end for
now.  (That limitation will go away in later patches).  Some platforms (eg
alpha) planned ahead and thus use the same struct for both, others did not.

This just adds the structures but does not use them, it seems a sensible
splitting point for bisect if there are compile failures (not that I expect
them)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
21 files changed:
drivers/net/wireless/strip.c
include/asm-alpha/termbits.h
include/asm-arm/termbits.h
include/asm-arm26/termbits.h
include/asm-avr32/termbits.h
include/asm-cris/termbits.h
include/asm-frv/termbits.h
include/asm-h8300/termbits.h
include/asm-i386/termbits.h
include/asm-ia64/termbits.h
include/asm-m32r/termbits.h
include/asm-m68k/termbits.h
include/asm-mips/termbits.h
include/asm-parisc/termbits.h
include/asm-powerpc/termbits.h
include/asm-s390/termbits.h
include/asm-sh/termbits.h
include/asm-sparc/termbits.h
include/asm-sparc64/termbits.h
include/asm-v850/termbits.h
include/asm-x86_64/termbits.h

index 337c692..ce3a8ba 100644 (file)
@@ -798,7 +798,7 @@ static unsigned int get_baud(struct tty_struct *tty)
  */
 static void set_baud(struct tty_struct *tty, unsigned int baudcode)
 {
-       struct termios old_termios = *(tty->termios);
+       struct ktermios old_termios = *(tty->termios);
        tty->termios->c_cflag &= ~CBAUD;        /* Clear the old baud setting */
        tty->termios->c_cflag |= baudcode;      /* Set the new baud setting */
        tty->driver->set_termios(tty, &old_termios);
index 5541101..ad854a4 100644 (file)
@@ -25,6 +25,19 @@ struct termios {
        speed_t c_ospeed;               /* output speed */
 };
 
+/* Alpha has matching termios and ktermios */
+
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_cc[NCCS];                /* control characters */
+       cc_t c_line;                    /* line discipline (== c_cc[19]) */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VEOF 0
 #define VEOL 1
index bbc6e1d..a3f4fe1 100644 (file)
@@ -15,6 +15,18 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index bbc6e1d..a3f4fe1 100644 (file)
@@ -15,6 +15,18 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index 9dc6eac..c215faf 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index be0836d..8d8cec2 100644 (file)
@@ -19,6 +19,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index 74f20d6..2d6d389 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index fa69ae0..6a1f4d3 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index 72c10e3..12baf1d 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index b9e843f..4531a51 100644 (file)
@@ -26,6 +26,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index 5ace370..faf2bd0 100644 (file)
@@ -19,6 +19,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index e9eec3e..a194092 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index b62ec7c..0bbe07b 100644 (file)
@@ -30,6 +30,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR           0              /* Interrupt character [ISIG].  */
 #define VQUIT           1              /* Quit character [ISIG].  */
index 372b634..a46e299 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index 6d533b0..b572f21 100644 (file)
@@ -30,6 +30,19 @@ struct termios {
        speed_t c_ospeed;               /* output speed */
 };
 
+/* For PowerPC the termios and ktermios are the same */
+
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR           0
 #define VQUIT           1
index eb3f8bf..585c78a 100644 (file)
@@ -25,6 +25,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index 4f9822a..f1b7b46 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index 1794d71..5eb00a1 100644 (file)
@@ -31,6 +31,18 @@ struct termios {
 #endif
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       cc_t _x_cc[2];                  /* We need them to hold vmin/vtime */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR    0
 #define VQUIT    1
index b077152..705cd44 100644 (file)
@@ -33,6 +33,18 @@ struct termios {
 #endif
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       cc_t _x_cc[2];                  /* We need them to hold vmin/vtime */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR    0
 #define VQUIT    1
index 212d4e2..f3b4330 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1
index bd95094..f31918c 100644 (file)
@@ -17,6 +17,17 @@ struct termios {
        cc_t c_cc[NCCS];                /* control characters */
 };
 
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 0
 #define VQUIT 1