termios flow control

WuHao derossi at mail.ustc.edu.cn
Thu May 24 09:30:05 UTC 2007


Hi:
I am reading code of rtems 4.7.0.
Here are 2 questions about termios flow control.
Suppose input controlled with XON/XOFF protocol:

1.When the RawInbuf reaches highwater,a character indicate XOFF will be
writen to device immediately if the RawOutBuf if idle or the output is
not working,and a bit in flow control(FL_ISNTXOF) will be set indicate
that the XOFF signal is already sent. However,the write action will
cause a dequeue callback where the tty->t_dqlen will be added by 1.As a
result, the "Tail" of the data buffer will not be correct.

2.Opposite to question XOFF,when the RawInbuf reaches lowwater,a
character indicate XON will be writen to device immediately if the
RawOutBuf if idle or the output is not working.Different to "highwater
reaching",none of flow control bits is set to indicate that the XON
signal is already
sent.As a result,the following dequeue callback will detect that a XON
signal is required to send but not send yet.Then a XON signal is sent
again,reduce tty->t_dqlen by 1. This case will keep RowOutBuf's tail
correct,but the XON signal is sent twice.

Thanks a lot.



More information about the users mailing list