Re: serial.c (half duplex support) (2nd posting)

Theodore Y. Ts'o (tytso@mit.edu)
Mon, 25 Oct 1999 17:57:46 -0400


Date: Sat, 23 Oct 1999 14:56:55 +0200 (MEST)
From: kees <kees@schoen.nl>

Make the result of ioctl( fd, TIOCGETSLR, &value) reflect the status
of the *hardware* bits as well the value of ( info->xmit_cnt > 0)
in get_lsr_info.

This is a little bit gross, but since the stated reason of TIOCGETLSR is
to support half-duplex modems, and since the user program shouldn't have
to know about the driver's implementation details about when it loads
the transmit FIFO, OK.

What I've added is the following logic:

if (info->x_char ||
((info->xmit_cnt > 0) && !info->tty->stopped &&n
!info->tty->hw_stopped))
result &= TIOCSER_TEMT;

Basically, these are the conditions under which transmit_chars() will
fill the transmit FIFO, so if they are true, then it's fair to clear
TIOCSER_TEMPT flag.

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/