public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* Add hardware handshaking to pseudo-tty and USB serial gadget
@ 2013-03-21 11:21 Craig McQueen
  2013-03-21 20:38 ` Grant Edwards
  0 siblings, 1 reply; 9+ messages in thread
From: Craig McQueen @ 2013-03-21 11:21 UTC (permalink / raw)
  To: linux-serial@vger.kernel.org

I'm interested in having support for hardware handshaking lines for both pseudo-tty (Unix 98 style) and USB serial gadget drivers. Unless I've missed something, it looks as though they don't support the hardware handshaking lines.

Has anyone worked on this already, for either pseudo-tty or USB serial gadget?

It sounds as though people have done pseudo-ttys with HW handshaking support--eg tty0tty project. However I'd rather implement this function in the kernel pseudo-terminal driver itself. Is there any reason not to do that?


I was wondering how to handle the HW lines on the master side of the pseudo-tty, and on the USB gadget device. It's the opposite way to a regular serial port (DCE rather than DTE), so you _write_ DSR, CTS, DCD and RING, and _read_ DTR and RTS. There could be two ways to do this:

1) Reverse normal operations, so do TIOCMSET of TIOCM_DSR, TIOCM_CD etc.

2) Act like a normal port, and "cross-over" signals. So do
TIOCMSET of TIOCM_DTR, which changes DSR on the slave;
TIOCMGET of TIOCM_DSR to read the state of DTR set by the slave. Etc.
What about setting the slave's DCD and RING? Maybe do TIOCMSET of TIOCM_OUT1 and TIOCM_OUT2 on the master.

Same question for the USB serial gadget.

So which of those choices would be better? I think I prefer (2) because the user code stays more the same whether it's talking to a master device or slave device.

Regards,
Craig McQueen



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-22 14:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 11:21 Add hardware handshaking to pseudo-tty and USB serial gadget Craig McQueen
2013-03-21 20:38 ` Grant Edwards
2013-03-21 22:22   ` Peter Hurley
2013-03-21 23:32     ` Craig McQueen
2013-03-22  0:03       ` Peter Hurley
2013-03-22  1:44         ` Craig McQueen
2013-03-22  2:14           ` Peter Hurley
2013-03-22 10:11       ` Peter Korsgaard
2013-03-22 14:22     ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox