lkml.org 
[lkml]   [2004]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectset termios from within line discipline
Date
I am porting a 9bit serial protocol that requires the 9th bit to be high on 
the last transmitted byte, and low on the others.

What I tried to do was implement a line discipline that changes parity before
each byte is transmitted, to get the proper 9th bit value.

But the problem is changing the parity from a line discipline.
This is what I do, when a parity change has to be made:

tty_wait_until_sent(dev->tty, 0);
if (signal_pending(current)) return -EINTR;

if (odd)
{
tty->termios->c_cflag |= PARODD;
}
else
{
tty->termios->c_cflag &= ~PARODD;
}

if (tty->driver.set_termios)
tty->driver.set_termios(tty, &oldterm);
if (tty->ldisc.set_termios)
tty->ldisc.set_termios(tty, &oldterm);

tty->driver.write(tty, 0, &byte, 1);

Two things,
1. when I use 'tcgetattr' from userspace, I don't see the changes made from
within the line discipline
2. though I see that the parity changes now and then, the transmitted bytes
don't always have the correct parity

What would be the preferred way to change termios flags from a line
discipline?

Please also reply to my email address, since I'm not subscribed to the list.

Best regards,

Pieter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.027 / U:1.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site