diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-12-08 05:38:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:57 -0500 |
commit | 606d099cdd1080bbb50ea50dc52d98252f8f10a1 (patch) | |
tree | 80d17450a5fb78effce3f4312f672c058658e004 /drivers/char/pty.c | |
parent | edc6afc5496875a640bef0913604be7550c1795d (diff) |
[PATCH] tty: switch to ktermios
This is the grungy swap all the occurrences in the right places patch that
goes with the updates. At this point we have the same functionality as
before (except that sgttyb() returns speeds not zero) and are ready to
begin turning new stuff on providing nobody reports lots of bugs
If you are a tty driver author converting an out of tree driver the only
impact should be termios->ktermios name changes for the speed/property
setting functions from your upper layers.
If you are implementing your own TCGETS function before then your driver
was broken already and its about to get a whole lot more painful for you so
please fix it 8)
Also fill in c_ispeed/ospeed on init for most devices, although the current
code will do this for you anyway but I'd like eventually to lose that extra
paranoia
[akpm@osdl.org: bluetooth fix]
[mp3@de.ibm.com: sclp fix]
[mp3@de.ibm.com: warning fix for tty3270]
[hugh@veritas.com: fix tty_ioctl powerpc build]
[jdike@addtoit.com: uml: fix ->set_termios declaration]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Acked-by: Peter Oberparleiter <oberpar@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r-- | drivers/char/pty.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 80d3eedd7f96..c07a1b5cd05d 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -218,7 +218,7 @@ out: | |||
218 | return retval; | 218 | return retval; |
219 | } | 219 | } |
220 | 220 | ||
221 | static void pty_set_termios(struct tty_struct *tty, struct termios *old_termios) | 221 | static void pty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) |
222 | { | 222 | { |
223 | tty->termios->c_cflag &= ~(CSIZE | PARENB); | 223 | tty->termios->c_cflag &= ~(CSIZE | PARENB); |
224 | tty->termios->c_cflag |= (CS8 | CREAD); | 224 | tty->termios->c_cflag |= (CS8 | CREAD); |
@@ -272,6 +272,8 @@ static void __init legacy_pty_init(void) | |||
272 | pty_driver->init_termios.c_oflag = 0; | 272 | pty_driver->init_termios.c_oflag = 0; |
273 | pty_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; | 273 | pty_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; |
274 | pty_driver->init_termios.c_lflag = 0; | 274 | pty_driver->init_termios.c_lflag = 0; |
275 | pty_driver->init_termios.c_ispeed = 38400; | ||
276 | pty_driver->init_termios.c_ospeed = 38400; | ||
275 | pty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW; | 277 | pty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW; |
276 | pty_driver->other = pty_slave_driver; | 278 | pty_driver->other = pty_slave_driver; |
277 | tty_set_operations(pty_driver, &pty_ops); | 279 | tty_set_operations(pty_driver, &pty_ops); |
@@ -286,6 +288,8 @@ static void __init legacy_pty_init(void) | |||
286 | pty_slave_driver->subtype = PTY_TYPE_SLAVE; | 288 | pty_slave_driver->subtype = PTY_TYPE_SLAVE; |
287 | pty_slave_driver->init_termios = tty_std_termios; | 289 | pty_slave_driver->init_termios = tty_std_termios; |
288 | pty_slave_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; | 290 | pty_slave_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; |
291 | pty_slave_driver->init_termios.c_ispeed = 38400; | ||
292 | pty_slave_driver->init_termios.c_ospeed = 38400; | ||
289 | pty_slave_driver->flags = TTY_DRIVER_RESET_TERMIOS | | 293 | pty_slave_driver->flags = TTY_DRIVER_RESET_TERMIOS | |
290 | TTY_DRIVER_REAL_RAW; | 294 | TTY_DRIVER_REAL_RAW; |
291 | pty_slave_driver->other = pty_driver; | 295 | pty_slave_driver->other = pty_driver; |
@@ -366,6 +370,8 @@ static void __init unix98_pty_init(void) | |||
366 | ptm_driver->init_termios.c_oflag = 0; | 370 | ptm_driver->init_termios.c_oflag = 0; |
367 | ptm_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; | 371 | ptm_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; |
368 | ptm_driver->init_termios.c_lflag = 0; | 372 | ptm_driver->init_termios.c_lflag = 0; |
373 | ptm_driver->init_termios.c_ispeed = 38400; | ||
374 | ptm_driver->init_termios.c_ospeed = 38400; | ||
369 | ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | | 375 | ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | |
370 | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM; | 376 | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM; |
371 | ptm_driver->other = pts_driver; | 377 | ptm_driver->other = pts_driver; |
@@ -381,6 +387,8 @@ static void __init unix98_pty_init(void) | |||
381 | pts_driver->subtype = PTY_TYPE_SLAVE; | 387 | pts_driver->subtype = PTY_TYPE_SLAVE; |
382 | pts_driver->init_termios = tty_std_termios; | 388 | pts_driver->init_termios = tty_std_termios; |
383 | pts_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; | 389 | pts_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; |
390 | pts_driver->init_termios.c_ispeed = 38400; | ||
391 | pts_driver->init_termios.c_ospeed = 38400; | ||
384 | pts_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | | 392 | pts_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | |
385 | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM; | 393 | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM; |
386 | pts_driver->other = ptm_driver; | 394 | pts_driver->other = ptm_driver; |