当传入数据到达具有线路规则的TTY时,将调用线路规则回调receive_buf2()来处理数据。此函数用于返回实际使用的字节数。如果它不全部消耗它们,那么何时再次调用回调?例如,只有在收到其他传入数据时才会再次调用它吗?
答案 0 :(得分:0)
我知道这个答案有点晚了,但现在是:
根据https://www.kernel.org/doc/Documentation/serial/tty.txt
中的内核文档Driver Side Interfaces :
receive_buf() - (optional)Called by the low - level driver to hand
a buffer of received bytes to the ldisc for
processing.The number of bytes is guaranteed not
to exceed the current value of tty->receive_room.
**All bytes must be processed.**
必须处理来自receive_buf()
的所有字节。