diff options
-rw-r--r-- | include/linux/tty.h | 16 | ||||
-rw-r--r-- | include/uapi/linux/tty_flags.h | 9 |
2 files changed, 23 insertions, 2 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 89f9c91b40f5..4e0dbda05180 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -228,7 +228,8 @@ struct tty_port { | |||
228 | int count; /* Usage count */ | 228 | int count; /* Usage count */ |
229 | wait_queue_head_t open_wait; /* Open waiters */ | 229 | wait_queue_head_t open_wait; /* Open waiters */ |
230 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 230 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
231 | unsigned long flags; /* TTY flags ASY_*/ | 231 | unsigned long flags; /* User TTY flags ASYNC_ */ |
232 | unsigned long iflags; /* Internal flags TTY_PORT_ */ | ||
232 | unsigned char console:1, /* port is a console */ | 233 | unsigned char console:1, /* port is a console */ |
233 | low_latency:1; /* optional: tune for latency */ | 234 | low_latency:1; /* optional: tune for latency */ |
234 | struct mutex mutex; /* Locking */ | 235 | struct mutex mutex; /* Locking */ |
@@ -242,6 +243,19 @@ struct tty_port { | |||
242 | struct kref kref; /* Ref counter */ | 243 | struct kref kref; /* Ref counter */ |
243 | }; | 244 | }; |
244 | 245 | ||
246 | /* tty_port::iflags bits -- use atomic bit ops */ | ||
247 | #define TTY_PORT_INITIALIZED 0 /* device is initialized */ | ||
248 | #define TTY_PORT_SUSPENDED 1 /* device is suspended */ | ||
249 | #define TTY_PORT_ACTIVE 2 /* device is open */ | ||
250 | |||
251 | /* | ||
252 | * uart drivers: use the uart_port::status field and the UPSTAT_* defines | ||
253 | * for s/w-based flow control steering and carrier detection status | ||
254 | */ | ||
255 | #define TTY_PORT_CTS_FLOW 3 /* h/w flow control enabled */ | ||
256 | #define TTY_PORT_CHECK_CD 4 /* carrier detect enabled */ | ||
257 | |||
258 | |||
245 | /* | 259 | /* |
246 | * Where all of the state associated with a tty is kept while the tty | 260 | * Where all of the state associated with a tty is kept while the tty |
247 | * is open. Since the termios state should be kept even if the tty | 261 | * is open. Since the termios state should be kept even if the tty |
diff --git a/include/uapi/linux/tty_flags.h b/include/uapi/linux/tty_flags.h index 072e41e45ee2..8e1a4365259f 100644 --- a/include/uapi/linux/tty_flags.h +++ b/include/uapi/linux/tty_flags.h | |||
@@ -32,7 +32,12 @@ | |||
32 | #define ASYNCB_MAGIC_MULTIPLIER 16 /* Use special CLK or divisor */ | 32 | #define ASYNCB_MAGIC_MULTIPLIER 16 /* Use special CLK or divisor */ |
33 | #define ASYNCB_LAST_USER 16 | 33 | #define ASYNCB_LAST_USER 16 |
34 | 34 | ||
35 | /* Internal flags used only by kernel */ | 35 | /* |
36 | * Internal flags used only by kernel (read-only) | ||
37 | * | ||
38 | * WARNING: These flags are no longer used and have been superceded by the | ||
39 | * TTY_PORT_ flags in the iflags field (and not userspace-visible) | ||
40 | */ | ||
36 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ | 41 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ |
37 | #define ASYNCB_SUSPENDED 30 /* Serial port is suspended */ | 42 | #define ASYNCB_SUSPENDED 30 /* Serial port is suspended */ |
38 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ | 43 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ |
@@ -44,6 +49,7 @@ | |||
44 | #define ASYNCB_CONS_FLOW 23 /* flow control for console */ | 49 | #define ASYNCB_CONS_FLOW 23 /* flow control for console */ |
45 | #define ASYNCB_FIRST_KERNEL 22 | 50 | #define ASYNCB_FIRST_KERNEL 22 |
46 | 51 | ||
52 | /* Masks */ | ||
47 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) | 53 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) |
48 | #define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED) | 54 | #define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED) |
49 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) | 55 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) |
@@ -72,6 +78,7 @@ | |||
72 | #define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI) | 78 | #define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI) |
73 | #define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI) | 79 | #define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI) |
74 | 80 | ||
81 | /* These flags are no longer used (and were always masked from userspace) */ | ||
75 | #define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED) | 82 | #define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED) |
76 | #define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE) | 83 | #define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE) |
77 | #define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF) | 84 | #define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF) |