aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2009-01-02 08:45:05 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 13:19:38 -0500
commit31f35939d1d9bcfb3099b32c67b896d2792603f9 (patch)
tree39b6ceaf0e7477e0357ff8235814f579adad3f28 /include/linux/tty.h
parentc9b3976e3fec266be25c5001a70aa0a890b6c476 (diff)
tty_port: Add a port level carrier detect operation
This is the first step to generalising the various pieces of waiting logic duplicated in all sorts of serial drivers. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index bbbeaef99626..bc7bae78e22f 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -180,8 +180,16 @@ struct signal_struct;
180 * until a hangup so don't use the wrong path. 180 * until a hangup so don't use the wrong path.
181 */ 181 */
182 182
183struct tty_port;
184
185struct tty_port_operations {
186 /* Return 1 if the carrier is raised */
187 int (*carrier_raised)(struct tty_port *port);
188};
189
183struct tty_port { 190struct tty_port {
184 struct tty_struct *tty; /* Back pointer */ 191 struct tty_struct *tty; /* Back pointer */
192 const struct tty_port_operations *ops; /* Port operations */
185 spinlock_t lock; /* Lock protecting tty field */ 193 spinlock_t lock; /* Lock protecting tty field */
186 int blocked_open; /* Waiting to open */ 194 int blocked_open; /* Waiting to open */
187 int count; /* Usage count */ 195 int count; /* Usage count */
@@ -427,6 +435,7 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port);
427extern void tty_port_free_xmit_buf(struct tty_port *port); 435extern void tty_port_free_xmit_buf(struct tty_port *port);
428extern struct tty_struct *tty_port_tty_get(struct tty_port *port); 436extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
429extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); 437extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
438extern int tty_port_carrier_raised(struct tty_port *port);
430 439
431extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); 440extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
432extern int tty_unregister_ldisc(int disc); 441extern int tty_unregister_ldisc(int disc);