Messages in this thread | | | Date | Thu, 14 Feb 2008 11:55:50 +0000 | From | Alan Cox <> | Subject | Re: Handshaking on USB serial devices |
| |
On Wed, 13 Feb 2008 21:02:11 -0800 Greg KH <greg@kroah.com> wrote:
> On Thu, Feb 14, 2008 at 01:15:37AM +1030, David Newall wrote: > > Consider a USB-attached serial port that is set to do RTS/CTS (or > > DSR/DTR) handshaking: What stops the kernel sending more data to it when > > the remote end lowers CTS (or DTR)? > > The tty layer should look at the proper flags and not send data on to > the driver in this kind of instance.
For outgoing data the tty ldisc will check the available room indicators the driver provides and stop when they fill. We don't want to be directly involved in flow control if possible as most decent hardware does RTS/CTS handshaking in hardware (except in the PC world).
If your hardware is dumb (ie you do RTS/CTS in software) then you need to track the CTS state and termios bits (in your set_termios method) and transmit according to flow control rules, letting the buffer fill up otherwise.
Alan
| |