summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJag Raman <jag.raman@oracle.com>2017-08-15 17:03:08 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-15 21:33:54 -0700
commite942e5775c87aee2b21179aa45e78b81e062b246 (patch)
tree92d3de3d9cc75454724fb6d479bca0cc84998de2 /drivers/tty
parentaeee7debf30b43b276f8aad2e889cd50dd3f0945 (diff)
downloadtalos-op-linux-e942e5775c87aee2b21179aa45e78b81e062b246.tar.gz
talos-op-linux-e942e5775c87aee2b21179aa45e78b81e062b246.zip
sparc64: vcc: Add break_ctl TTY operation
Add handler to support TTY break_ctl operation Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: Liam Merwick <liam.merwick@oracle.com> Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/vcc.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index 070c54188971..f913217159ee 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -960,6 +960,40 @@ static int vcc_chars_in_buffer(struct tty_struct *tty)
return num;
}
+static int vcc_break_ctl(struct tty_struct *tty, int state)
+{
+ struct vcc_port *port;
+ unsigned long flags;
+
+ if (unlikely(!tty)) {
+ pr_err("VCC: break_ctl: Invalid TTY handle\n");
+ return -ENXIO;
+ }
+
+ port = vcc_get_ne(tty->index);
+ if (unlikely(!port)) {
+ pr_err("VCC: break_ctl: Failed to find VCC port\n");
+ return -ENODEV;
+ }
+
+ /* Turn off break */
+ if (state == 0) {
+ vcc_put(port, false);
+ return 0;
+ }
+
+ spin_lock_irqsave(&port->lock, flags);
+
+ if (vcc_send_ctl(port, VCC_CTL_BREAK) < 0)
+ vcc_kick_tx(port);
+
+ spin_unlock_irqrestore(&port->lock, flags);
+
+ vcc_put(port, false);
+
+ return 0;
+}
+
static const struct tty_operations vcc_ops = {
.open = vcc_open,
.close = vcc_close,
@@ -967,6 +1001,7 @@ static const struct tty_operations vcc_ops = {
.write = vcc_write,
.write_room = vcc_write_room,
.chars_in_buffer = vcc_chars_in_buffer,
+ .break_ctl = vcc_break_ctl,
};
#define VCC_TTY_FLAGS (TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_REAL_RAW)
OpenPOWER on IntegriCloud