summaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorPeter Hurley2016-04-10 02:53:24 +0200
committerGreg Kroah-Hartman2016-04-30 18:26:55 +0200
commit80f02d5424301bf4df195d09b1a664f394435851 (patch)
tree8bfff4fbf3685f767fa776dbd7ae58a63420acd3 /include/linux/tty.h
parenttty: Replace ASYNC_CHECK_CD and update atomically (diff)
downloadkernel-qcow2-linux-80f02d5424301bf4df195d09b1a664f394435851.tar.gz
kernel-qcow2-linux-80f02d5424301bf4df195d09b1a664f394435851.tar.xz
kernel-qcow2-linux-80f02d5424301bf4df195d09b1a664f394435851.zip
tty: Replace ASYNC_SUSPENDED bit and update atomically
Replace ASYNC_SUSPENDED bit in the tty_port::flags field with TTY_PORT_SUSPENDED bit in the tty_port::iflags field. Introduce helpers tty_port_set_suspended() and tty_port_suspended() to abstract atomic bit ops. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 4254dfb12fb1..7ac5add66c00 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -597,6 +597,19 @@ static inline void tty_port_set_check_carrier(struct tty_port *port, bool val)
clear_bit(TTY_PORT_CHECK_CD, &port->iflags);
}
+static inline bool tty_port_suspended(struct tty_port *port)
+{
+ return test_bit(TTY_PORT_SUSPENDED, &port->iflags);
+}
+
+static inline void tty_port_set_suspended(struct tty_port *port, bool val)
+{
+ if (val)
+ set_bit(TTY_PORT_SUSPENDED, &port->iflags);
+ else
+ clear_bit(TTY_PORT_SUSPENDED, &port->iflags);
+}
+
extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
extern int tty_port_carrier_raised(struct tty_port *port);