Skip to content

Commit f74861c

Browse files
peterhurleydavem330
authored andcommitted
net/irda: Raise dtr in non-blocking open
DTR/RTS need to be raised, regardless of the open() mode, but not if the port has already shutdown. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0b176ce commit f74861c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎net/irda/ircomm/ircomm_tty.c‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,15 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
289289
* If non-blocking mode is set, or the port is not enabled,
290290
* then make the check up front and then exit.
291291
*/
292-
if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){
293-
/* nonblock mode is set or port is not enabled */
292+
if (test_bit(TTY_IO_ERROR, &tty->flags)) {
293+
port->flags |= ASYNC_NORMAL_ACTIVE;
294+
return 0;
295+
}
296+
297+
if (filp->f_flags & O_NONBLOCK) {
298+
/* nonblock mode is set */
299+
if (tty->termios.c_cflag & CBAUD)
300+
tty_port_raise_dtr_rts(port);
294301
port->flags |= ASYNC_NORMAL_ACTIVE;
295302
IRDA_DEBUG(1, "%s(), O_NONBLOCK requested!\n", __func__ );
296303
return 0;

0 commit comments

Comments
 (0)