aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mxser.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-12-08 05:38:45 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:57 -0500
commit606d099cdd1080bbb50ea50dc52d98252f8f10a1 (patch)
tree80d17450a5fb78effce3f4312f672c058658e004 /drivers/char/mxser.c
parentedc6afc5496875a640bef0913604be7550c1795d (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.c18
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] = {
364static struct tty_driver *mxvar_sdriver; 364static struct tty_driver *mxvar_sdriver;
365static struct mxser_struct mxvar_table[MXSER_PORTS]; 365static struct mxser_struct mxvar_table[MXSER_PORTS];
366static struct tty_struct *mxvar_tty[MXSER_PORTS + 1]; 366static struct tty_struct *mxvar_tty[MXSER_PORTS + 1];
367static struct termios *mxvar_termios[MXSER_PORTS + 1]; 367static struct ktermios *mxvar_termios[MXSER_PORTS + 1];
368static struct termios *mxvar_termios_locked[MXSER_PORTS + 1]; 368static struct ktermios *mxvar_termios_locked[MXSER_PORTS + 1];
369static struct mxser_log mxvar_log; 369static struct mxser_log mxvar_log;
370static int mxvar_diagflag; 370static int mxvar_diagflag;
371static unsigned char mxser_msr[MXSER_PORTS + 1]; 371static unsigned char mxser_msr[MXSER_PORTS + 1];
@@ -402,7 +402,7 @@ static int mxser_ioctl(struct tty_struct *, struct file *, uint, ulong);
402static int mxser_ioctl_special(unsigned int, void __user *); 402static int mxser_ioctl_special(unsigned int, void __user *);
403static void mxser_throttle(struct tty_struct *); 403static void mxser_throttle(struct tty_struct *);
404static void mxser_unthrottle(struct tty_struct *); 404static void mxser_unthrottle(struct tty_struct *);
405static void mxser_set_termios(struct tty_struct *, struct termios *); 405static void mxser_set_termios(struct tty_struct *, struct ktermios *);
406static void mxser_stop(struct tty_struct *); 406static void mxser_stop(struct tty_struct *);
407static void mxser_start(struct tty_struct *); 407static void mxser_start(struct tty_struct *);
408static void mxser_hangup(struct tty_struct *); 408static void mxser_hangup(struct tty_struct *);
@@ -414,7 +414,7 @@ static void mxser_check_modem_status(struct mxser_struct *, int);
414static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *); 414static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *);
415static int mxser_startup(struct mxser_struct *); 415static int mxser_startup(struct mxser_struct *);
416static void mxser_shutdown(struct mxser_struct *); 416static void mxser_shutdown(struct mxser_struct *);
417static int mxser_change_speed(struct mxser_struct *, struct termios *old_termios); 417static int mxser_change_speed(struct mxser_struct *, struct ktermios *old_termios);
418static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *); 418static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *);
419static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *); 419static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *);
420static int mxser_get_lsr_info(struct mxser_struct *, unsigned int __user *); 420static 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
1752static void mxser_set_termios(struct tty_struct *tty, struct termios *old_termios) 1754static 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 */
2544static int mxser_change_speed(struct mxser_struct *info, struct termios *old_termios) 2546static 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;