RE: Add hardware handshaking to pseudo-tty and USB serial gadget

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxxxxxxxxxxx] On Thu,
> > > 2013-03-21 at 20:38 +0000, Grant Edwards wrote:
> > > > On 2013-03-21, Craig McQueen
> > > > <craig.mcqueen@xxxxxxxxxxxxxxxxxxxxxx>
> > > 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?

Thanks,
Craig McQueen

��.n��������+%������w��{.n�����{��ǫ����{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux