summaryrefslogtreecommitdiff
path: root/drivers/tty/hvc/hvc_console.c
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2013-07-02 19:07:14 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 02:21:13 +0400
commit33e745a192c272130b02b86d5dea5b577a291ed7 (patch)
tree781e9404d1664513c308bb8a4ea891f6cb73ff81 /drivers/tty/hvc/hvc_console.c
parente84f54fc58ada30f67b7353f6c16c3c4aa7c8da5 (diff)
downloadlinux-33e745a192c272130b02b86d5dea5b577a291ed7.tar.xz
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>
Diffstat (limited to 'drivers/tty/hvc/hvc_console.c')
-rw-r--r--drivers/tty/hvc/hvc_console.c11
1 files changed, 10 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)
tty->driver_data = NULL;
tty_port_put(&hp->port);
printk(KERN_ERR "hvc_open: request_irq failed with rc %d.\n", rc);
- }
+ } else
+ /* We are ready... raise DTR/RTS */
+ if (C_BAUD(tty))
+ if (hp->ops->dtr_rts)
+ hp->ops->dtr_rts(hp, 1);
+
/* Force wakeup of the polling thread */
hvc_kick();
@@ -393,6 +398,10 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)
/* We are done with the tty pointer now. */
tty_port_tty_set(&hp->port, NULL);
+ if (C_HUPCL(tty))
+ if (hp->ops->dtr_rts)
+ hp->ops->dtr_rts(hp, 0);
+
if (hp->ops->notifier_del)
hp->ops->notifier_del(hp, hp->data);