diff options
author | hyc@symas.com <hyc@symas.com> | 2010-06-22 13:14:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:39 -0400 |
commit | 26df6d13406d1a53b0bda08bd712f1924affd7cd (patch) | |
tree | db17328acbd7cac9dc20bc854509527c1c89ca01 /arch/alpha | |
parent | a3c8ed693da9782f924223f65da9261da796e49b (diff) |
tty: Add EXTPROC support for LINEMODE
This patch is against the 2.6.34 source.
Paraphrased from the 1989 BSD patch by David Borman @ cray.com:
These are the changes needed for the kernel to support
LINEMODE in the server.
There is a new bit in the termios local flag word, EXTPROC.
When this bit is set, several aspects of the terminal driver
are disabled. Input line editing, character echo, and mapping
of signals are all disabled. This allows the telnetd to turn
off these functions when in linemode, but still keep track of
what state the user wants the terminal to be in.
New ioctl:
TIOCSIG Generate a signal to processes in the
current process group of the pty.
There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
When packet mode is turned on in the pty, and the EXTPROC bit
is set, then whenever the state of the pty is changed, the
next read on the master side of the pty will have the TIOCPKT_IOCTL
bit set. This allows the process on the server side of the pty
to know when the state of the terminal has changed; it can then
issue the appropriate ioctl to retrieve the new state.
Since the original BSD patches accompanied the source code for telnet
I've left that reference here, but obviously the feature is useful for
any remote terminal protocol, including ssh.
The corresponding feature has existed in the BSD tty driver since 1989.
For historical reference, a good copy of the relevant files can be found
here:
http://anonsvn.mit.edu/viewvc/krb5/trunk/src/appl/telnet/?pathrev=17741
Signed-off-by: Howard Chu <hyc@symas.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/include/asm/ioctls.h | 2 | ||||
-rw-r--r-- | arch/alpha/include/asm/termbits.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/ioctls.h b/arch/alpha/include/asm/ioctls.h index c7b0cc61ce5b..59617c3c2be6 100644 --- a/arch/alpha/include/asm/ioctls.h +++ b/arch/alpha/include/asm/ioctls.h | |||
@@ -80,6 +80,7 @@ | |||
80 | # define TIOCPKT_START 8 | 80 | # define TIOCPKT_START 8 |
81 | # define TIOCPKT_NOSTOP 16 | 81 | # define TIOCPKT_NOSTOP 16 |
82 | # define TIOCPKT_DOSTOP 32 | 82 | # define TIOCPKT_DOSTOP 32 |
83 | # define TIOCPKT_IOCTL 64 | ||
83 | 84 | ||
84 | 85 | ||
85 | #define TIOCNOTTY 0x5422 | 86 | #define TIOCNOTTY 0x5422 |
@@ -91,6 +92,7 @@ | |||
91 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 92 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
92 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 93 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
93 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 94 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
95 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ | ||
94 | 96 | ||
95 | #define TIOCSERCONFIG 0x5453 | 97 | #define TIOCSERCONFIG 0x5453 |
96 | #define TIOCSERGWILD 0x5454 | 98 | #define TIOCSERGWILD 0x5454 |
diff --git a/arch/alpha/include/asm/termbits.h b/arch/alpha/include/asm/termbits.h index ad854a4a3af6..879dd3589921 100644 --- a/arch/alpha/include/asm/termbits.h +++ b/arch/alpha/include/asm/termbits.h | |||
@@ -180,6 +180,7 @@ struct ktermios { | |||
180 | #define FLUSHO 0x00800000 | 180 | #define FLUSHO 0x00800000 |
181 | #define PENDIN 0x20000000 | 181 | #define PENDIN 0x20000000 |
182 | #define IEXTEN 0x00000400 | 182 | #define IEXTEN 0x00000400 |
183 | #define EXTPROC 0x10000000 | ||
183 | 184 | ||
184 | /* Values for the ACTION argument to `tcflow'. */ | 185 | /* Values for the ACTION argument to `tcflow'. */ |
185 | #define TCOOFF 0 | 186 | #define TCOOFF 0 |