lkml.org 
[lkml]   [2011]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] char nvtty: Network Virtual Terminal support
> By using these devices and a proper compatible server (not included
> here but you can use sredird) you can get access to a remote tty
> device as the tty device itself was conneted with your local host.
> All data and settings are sent and received through the network.

And this is still something that should be done in userspace if necessary
by fixing up the tty layer to support pty/tty pair modem lines and
termios change reporting, or some kind of *generic* vt that can also
expose all the config other net protocols might need.

> + default:
> + tty->termios->c_cflag = B0;

This btw is wrong - if you don't recognize the baud rate you want to
force a new one. Also you shouldn't be writing all of c_cflag here just
the baud bits, also you shouldn't in fact ever be hand mangling the baud
bits but using the helpers.


> + }
> +}
> +#undef TEST_SET_BAUDRATE
> +
> +#define TEST_SET_DATASIZE(b) case b: tty->termios->c_cflag |= CS ## b ; break
> +static void nvtty_set_datasize(struct nvtty_serial *info, unsigned int datasize)
> +{
> + struct tty_struct *tty = info->tty;
> +
> + nvtty_dbg(info, "datasize=%d", datasize);
> +
> + tty->termios->c_cflag &= ~CSIZE;
> + switch (datasize) {
> + TEST_SET_DATASIZE(5);
> + TEST_SET_DATASIZE(6);
> + TEST_SET_DATASIZE(7);
> + TEST_SET_DATASIZE(8);
> + default:
> + tty->termios->c_cflag = CS5;

Should be |=

> +static void nvtty_set_parity(struct nvtty_serial *info, unsigned int parity)
> +{
> + struct tty_struct *tty = info->tty;
> +
> + nvtty_dbg(info, "parity=%d", parity);
> +
> + tty->termios->c_cflag &= ~(PARENB | PARODD);

Needs to consider the CMSPAR bit.

Otherwise its a very nice implementation of something I don't think we
should have implemented in the kernel.


\
 
 \ /
  Last update: 2011-01-10 14:19    [from the cache]
©2003-2011 Jasper Spaans