diff options
author | Jag Raman <jag.raman@oracle.com> | 2017-08-15 17:03:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-15 21:33:52 -0700 |
commit | 103b9b0bc9e068d5e9432ee1da526d8feabc0216 (patch) | |
tree | 7b6689612db05b3896df766d5a048fcd0a75dcad /drivers/tty | |
parent | f8c553354e71fbb982ff63f2f574c1658aea50a9 (diff) | |
download | linux-103b9b0bc9e068d5e9432ee1da526d8feabc0216.tar.gz linux-103b9b0bc9e068d5e9432ee1da526d8feabc0216.tar.bz2 linux-103b9b0bc9e068d5e9432ee1da526d8feabc0216.zip |
sparc64: vcc: Enable LDC event processing engine
Enable event processing engine to handle LDC events
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.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index 27566d5f7df0..91f663d207b6 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -437,8 +437,42 @@ done: vcc_put(port, false); } +/** + * vcc_event() - LDC event processing engine + * @arg: VCC private data + * @event: LDC event + * + * Handles LDC events for VCC + */ static void vcc_event(void *arg, int event) { + struct vio_driver_state *vio; + struct vcc_port *port; + unsigned long flags; + int rv; + + port = arg; + vio = &port->vio; + + spin_lock_irqsave(&port->lock, flags); + + switch (event) { + case LDC_EVENT_RESET: + case LDC_EVENT_UP: + vio_link_state_change(vio, event); + break; + + case LDC_EVENT_DATA_READY: + rv = vcc_ldc_read(port); + if (rv == -ECONNRESET) + vio_conn_reset(vio); + break; + + default: + pr_err("VCC: unexpected LDC event(%d)\n", event); + } + + spin_unlock_irqrestore(&port->lock, flags); } static struct ldc_channel_config vcc_ldc_cfg = { |