diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2013-07-02 11:07:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:21:13 -0400 |
commit | 33e745a192c272130b02b86d5dea5b577a291ed7 (patch) | |
tree | 781e9404d1664513c308bb8a4ea891f6cb73ff81 | |
parent | e84f54fc58ada30f67b7353f6c16c3c4aa7c8da5 (diff) |
tty/hvc_console: Add DTR/RTS callback to handle HUPCL control
Introduce a new callback to explicitly handle the HUPCL termios control flag.
This prepares for a follow-up commit for the hvc_iucv device driver to
improve handling when to drop an established network connection.
The callback naming is based on the recently added tty_port interface to
facilitate a potential refactoring of the hvc_console to use tty_port
functions.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/hvc/hvc_console.c | 11 | ||||
-rw-r--r-- | drivers/tty/hvc/hvc_console.h | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index eb255e807c06..9eba119bcdd3 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c | |||
@@ -361,7 +361,12 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) | |||
361 | tty->driver_data = NULL; | 361 | tty->driver_data = NULL; |
362 | tty_port_put(&hp->port); | 362 | tty_port_put(&hp->port); |
363 | printk(KERN_ERR "hvc_open: request_irq failed with rc %d.\n", rc); | 363 | printk(KERN_ERR "hvc_open: request_irq failed with rc %d.\n", rc); |
364 | } | 364 | } else |
365 | /* We are ready... raise DTR/RTS */ | ||
366 | if (C_BAUD(tty)) | ||
367 | if (hp->ops->dtr_rts) | ||
368 | hp->ops->dtr_rts(hp, 1); | ||
369 | |||
365 | /* Force wakeup of the polling thread */ | 370 | /* Force wakeup of the polling thread */ |
366 | hvc_kick(); | 371 | hvc_kick(); |
367 | 372 | ||
@@ -393,6 +398,10 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) | |||
393 | /* We are done with the tty pointer now. */ | 398 | /* We are done with the tty pointer now. */ |
394 | tty_port_tty_set(&hp->port, NULL); | 399 | tty_port_tty_set(&hp->port, NULL); |
395 | 400 | ||
401 | if (C_HUPCL(tty)) | ||
402 | if (hp->ops->dtr_rts) | ||
403 | hp->ops->dtr_rts(hp, 0); | ||
404 | |||
396 | if (hp->ops->notifier_del) | 405 | if (hp->ops->notifier_del) |
397 | hp->ops->notifier_del(hp, hp->data); | 406 | hp->ops->notifier_del(hp, hp->data); |
398 | 407 | ||
diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h index 674d23cb919a..913101980827 100644 --- a/drivers/tty/hvc/hvc_console.h +++ b/drivers/tty/hvc/hvc_console.h | |||
@@ -75,6 +75,9 @@ struct hv_ops { | |||
75 | /* tiocmget/set implementation */ | 75 | /* tiocmget/set implementation */ |
76 | int (*tiocmget)(struct hvc_struct *hp); | 76 | int (*tiocmget)(struct hvc_struct *hp); |
77 | int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear); | 77 | int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear); |
78 | |||
79 | /* Callbacks to handle tty ports */ | ||
80 | void (*dtr_rts)(struct hvc_struct *hp, int raise); | ||
78 | }; | 81 | }; |
79 | 82 | ||
80 | /* Register a vterm and a slot index for use as a console (console_init) */ | 83 | /* Register a vterm and a slot index for use as a console (console_init) */ |