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/mxser.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/mxser.c')
-rw-r--r-- | drivers/char/mxser.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 2dc49be144e6..c063359baf78 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -328,8 +328,8 @@ struct mxser_struct { | |||
328 | int xmit_tail; | 328 | int xmit_tail; |
329 | int xmit_cnt; | 329 | int xmit_cnt; |
330 | struct work_struct tqueue; | 330 | struct work_struct tqueue; |
331 | struct termios normal_termios; | 331 | struct ktermios normal_termios; |
332 | struct termios callout_termios; | 332 | struct ktermios callout_termios; |
333 | wait_queue_head_t open_wait; | 333 | wait_queue_head_t open_wait; |
334 | wait_queue_head_t close_wait; | 334 | wait_queue_head_t close_wait; |
335 | wait_queue_head_t delta_msr_wait; | 335 | wait_queue_head_t delta_msr_wait; |
@@ -364,8 +364,8 @@ static int mxserBoardCAP[MXSER_BOARDS] = { | |||
364 | static struct tty_driver *mxvar_sdriver; | 364 | static struct tty_driver *mxvar_sdriver; |
365 | static struct mxser_struct mxvar_table[MXSER_PORTS]; | 365 | static struct mxser_struct mxvar_table[MXSER_PORTS]; |
366 | static struct tty_struct *mxvar_tty[MXSER_PORTS + 1]; | 366 | static struct tty_struct *mxvar_tty[MXSER_PORTS + 1]; |
367 | static struct termios *mxvar_termios[MXSER_PORTS + 1]; | 367 | static struct ktermios *mxvar_termios[MXSER_PORTS + 1]; |
368 | static struct termios *mxvar_termios_locked[MXSER_PORTS + 1]; | 368 | static struct ktermios *mxvar_termios_locked[MXSER_PORTS + 1]; |
369 | static struct mxser_log mxvar_log; | 369 | static struct mxser_log mxvar_log; |
370 | static int mxvar_diagflag; | 370 | static int mxvar_diagflag; |
371 | static unsigned char mxser_msr[MXSER_PORTS + 1]; | 371 | static unsigned char mxser_msr[MXSER_PORTS + 1]; |
@@ -402,7 +402,7 @@ static int mxser_ioctl(struct tty_struct *, struct file *, uint, ulong); | |||
402 | static int mxser_ioctl_special(unsigned int, void __user *); | 402 | static int mxser_ioctl_special(unsigned int, void __user *); |
403 | static void mxser_throttle(struct tty_struct *); | 403 | static void mxser_throttle(struct tty_struct *); |
404 | static void mxser_unthrottle(struct tty_struct *); | 404 | static void mxser_unthrottle(struct tty_struct *); |
405 | static void mxser_set_termios(struct tty_struct *, struct termios *); | 405 | static void mxser_set_termios(struct tty_struct *, struct ktermios *); |
406 | static void mxser_stop(struct tty_struct *); | 406 | static void mxser_stop(struct tty_struct *); |
407 | static void mxser_start(struct tty_struct *); | 407 | static void mxser_start(struct tty_struct *); |
408 | static void mxser_hangup(struct tty_struct *); | 408 | static void mxser_hangup(struct tty_struct *); |
@@ -414,7 +414,7 @@ static void mxser_check_modem_status(struct mxser_struct *, int); | |||
414 | static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *); | 414 | static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *); |
415 | static int mxser_startup(struct mxser_struct *); | 415 | static int mxser_startup(struct mxser_struct *); |
416 | static void mxser_shutdown(struct mxser_struct *); | 416 | static void mxser_shutdown(struct mxser_struct *); |
417 | static int mxser_change_speed(struct mxser_struct *, struct termios *old_termios); | 417 | static int mxser_change_speed(struct mxser_struct *, struct ktermios *old_termios); |
418 | static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *); | 418 | static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *); |
419 | static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *); | 419 | static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *); |
420 | static int mxser_get_lsr_info(struct mxser_struct *, unsigned int __user *); | 420 | static int mxser_get_lsr_info(struct mxser_struct *, unsigned int __user *); |
@@ -726,6 +726,8 @@ static int mxser_init(void) | |||
726 | mxvar_sdriver->subtype = SERIAL_TYPE_NORMAL; | 726 | mxvar_sdriver->subtype = SERIAL_TYPE_NORMAL; |
727 | mxvar_sdriver->init_termios = tty_std_termios; | 727 | mxvar_sdriver->init_termios = tty_std_termios; |
728 | mxvar_sdriver->init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL; | 728 | mxvar_sdriver->init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL; |
729 | mxvar_sdriver->init_termios.c_ispeed = 9600; | ||
730 | mxvar_sdriver->init_termios.c_ospeed = 9600; | ||
729 | mxvar_sdriver->flags = TTY_DRIVER_REAL_RAW; | 731 | mxvar_sdriver->flags = TTY_DRIVER_REAL_RAW; |
730 | tty_set_operations(mxvar_sdriver, &mxser_ops); | 732 | tty_set_operations(mxvar_sdriver, &mxser_ops); |
731 | mxvar_sdriver->ttys = mxvar_tty; | 733 | mxvar_sdriver->ttys = mxvar_tty; |
@@ -1749,7 +1751,7 @@ static void mxser_unthrottle(struct tty_struct *tty) | |||
1749 | /* MX_UNLOCK(&info->slock); */ | 1751 | /* MX_UNLOCK(&info->slock); */ |
1750 | } | 1752 | } |
1751 | 1753 | ||
1752 | static void mxser_set_termios(struct tty_struct *tty, struct termios *old_termios) | 1754 | static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termios) |
1753 | { | 1755 | { |
1754 | struct mxser_struct *info = tty->driver_data; | 1756 | struct mxser_struct *info = tty->driver_data; |
1755 | unsigned long flags; | 1757 | unsigned long flags; |
@@ -2541,7 +2543,7 @@ static void mxser_shutdown(struct mxser_struct *info) | |||
2541 | * This routine is called to set the UART divisor registers to match | 2543 | * This routine is called to set the UART divisor registers to match |
2542 | * the specified baud rate for a serial port. | 2544 | * the specified baud rate for a serial port. |
2543 | */ | 2545 | */ |
2544 | static int mxser_change_speed(struct mxser_struct *info, struct termios *old_termios) | 2546 | static int mxser_change_speed(struct mxser_struct *info, struct ktermios *old_termios) |
2545 | { | 2547 | { |
2546 | unsigned cflag, cval, fcr; | 2548 | unsigned cflag, cval, fcr; |
2547 | int ret = 0; | 2549 | int ret = 0; |