All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Craig McQueen <craig.mcqueen@beamcommunications.com>
Cc: Grant Edwards <grant.b.edwards@gmail.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	Jiri Slaby <jslaby@suse.cz>
Subject: Re: Add hardware handshaking to pseudo-tty and USB serial gadget
Date: Thu, 21 Mar 2013 22:14:58 -0400	[thread overview]
Message-ID: <1363918498.3395.26.camel@thor.lan> (raw)
In-Reply-To: <DB8F1B3EEF94C3439BFFE674EB05E3CC23F2F908@SINPRD0211MB405.apcprd02.prod.outlook.com>

On Fri, 2013-03-22 at 01:44 +0000, Craig McQueen wrote:
> > From: Peter Hurley
> > [ +Jiri Slaby who doesn't read linux-serial ;) ]
> > 
> > On Thu, 2013-03-21 at 23:32 +0000, Craig McQueen wrote:
> > >
> > > > From: Peter Hurley [mailto:peter@hurleysoftware.com] On Thu,
> > > > 2013-03-21 at 20:38 +0000, Grant Edwards wrote:
> > > > > On 2013-03-21, Craig McQueen
> > > > > <craig.mcqueen@beamcommunications.com>
> > > > wrote:
> > > > > > 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?
> > > > >
> > > > > No reason other than you and I are the only two people who care
> > > > > about it. :)
> > > >
> > > > Assuming you're leaning toward an in-kernel solution, why not just
> > > > implement a new tty driver that behaves like a local serial port?
> > >
> > > The pseudo-tty already provides most of the functionality I want, so
> > I
> > > don't want to reinvent the wheel. I want to use it to simulate a
> > modem
> > > device. Various other programs could benefit from an enhanced
> > > pseudo-tty, so they also don't have to implement their own kernel
> > > drivers--e.g.:
> > 
> > I should have been more specific: I didn't mean necessarily start from
> > scratch. As a starting point you could just dup pty.c, rip out the BSD
> > legacy support, and rename the driver/tty device base names.
> > 
> > Whatever that was would behave just like ptm/pts.
> 
> I'm a little fuzzy about this...If I do this, how would userland
> programs create pty master/slave device pairs? Could it work with the
> API of the UNIX 98 style pseudo-tty in 'man 7 pty'? That is:
>
> posix_openpt()
> grantpt()
> unlockpt()
> ptsname()
>
> I see posix_openpt(flags) is essentially equivalent to
> open("/dev/ptmx", flags), so maybe if I made my own driver,
> posix_openpt(flags) would be replaced by open("/dev/my-driver-ptmx",
> flags), and the other function calls could stay the same. Is that
> right?

I was in the middle of dropping in some simple user-space code that
would do the trick when I remembered that what I suggested wouldn't be
that simple because of the devpts filesystem.

Sorry for the false start.

Regards,
Peter Hurley





  reply	other threads:[~2013-03-22  2:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-03-22 10:11       ` Peter Korsgaard
2013-03-22 14:22     ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363918498.3395.26.camel@thor.lan \
    --to=peter@hurleysoftware.com \
    --cc=craig.mcqueen@beamcommunications.com \
    --cc=grant.b.edwards@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.