summaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-10-18 22:26:46 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 16:53:40 -0700
commit967fab6916681e5ab131fdef1226327b02454f19 (patch)
tree11865e2652ea1901d130b6b639e503bf59bfb773 /include/linux/tty.h
parent5cff39c69b57df6d7bf4e87f2963571aa4ea6336 (diff)
downloadlinux-967fab6916681e5ab131fdef1226327b02454f19.tar.gz
linux-967fab6916681e5ab131fdef1226327b02454f19.tar.xz
TTY: add port -> tty link
For that purpose we have to temporarily introduce a second tty back pointer into tty_port. It is because serial layer, and maybe others, still do not use tty_port_tty_set/get. So that we cannot set the tty_port->tty to NULL at will now. Yes, the fix would be to convert whole serial layer and all its users to tty_port_tty_set/get. However we are in the process of removing the need of tty in most of the call sites, so this would lead to a duplicated work. Instead we have now tty_port->itty (internal tty) which will be used only in flush_to_ldisc. For that one it is ensured that itty is valid wherever the work is run. IOW, the work is synchronously cancelled before we set itty to NULL and also before hangup is processed. After we need only tty_port and not tty_struct in most code, this shall be changed to tty_port_tty_set/get and itty removed completely. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index b4b3c568d242..9be74d649a51 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -189,6 +189,7 @@ struct tty_port_operations {
struct tty_port {
struct tty_struct *tty; /* Back pointer */
+ struct tty_struct *itty; /* internal back ptr */
const struct tty_port_operations *ops; /* Port operations */
spinlock_t lock; /* Lock protecting tty field */
int blocked_open; /* Waiting to open */