aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mxser.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/mxser.c')
-rw-r--r--drivers/char/mxser.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index eafbbcf355e7..ff5ff6188809 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -547,6 +547,17 @@ static int mxser_carrier_raised(struct tty_port *port)
547 return (inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD)?1:0; 547 return (inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD)?1:0;
548} 548}
549 549
550static void mxser_raise_dtr_rts(struct tty_port *port)
551{
552 struct mxser_port *mp = container_of(port, struct mxser_port, port);
553 unsigned long flags;
554
555 spin_lock_irqsave(&mp->slock, flags);
556 outb(inb(mp->ioaddr + UART_MCR) |
557 UART_MCR_DTR | UART_MCR_RTS, mp->ioaddr + UART_MCR);
558 spin_unlock_irqrestore(&mp->slock, flags);
559}
560
550static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp, 561static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp,
551 struct mxser_port *mp) 562 struct mxser_port *mp)
552{ 563{
@@ -586,10 +597,7 @@ static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp,
586 spin_unlock_irqrestore(&mp->slock, flags); 597 spin_unlock_irqrestore(&mp->slock, flags);
587 port->blocked_open++; 598 port->blocked_open++;
588 while (1) { 599 while (1) {
589 spin_lock_irqsave(&mp->slock, flags); 600 tty_port_raise_dtr_rts(port);
590 outb(inb(mp->ioaddr + UART_MCR) |
591 UART_MCR_DTR | UART_MCR_RTS, mp->ioaddr + UART_MCR);
592 spin_unlock_irqrestore(&mp->slock, flags);
593 set_current_state(TASK_INTERRUPTIBLE); 601 set_current_state(TASK_INTERRUPTIBLE);
594 if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) { 602 if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) {
595 if (port->flags & ASYNC_HUP_NOTIFY) 603 if (port->flags & ASYNC_HUP_NOTIFY)
@@ -2458,6 +2466,7 @@ static const struct tty_operations mxser_ops = {
2458 2466
2459struct tty_port_operations mxser_port_ops = { 2467struct tty_port_operations mxser_port_ops = {
2460 .carrier_raised = mxser_carrier_raised, 2468 .carrier_raised = mxser_carrier_raised,
2469 .raise_dtr_rts = mxser_raise_dtr_rts,
2461}; 2470};
2462 2471
2463/* 2472/*