aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/um/drivers/line.c2
-rw-r--r--arch/um/include/line.h2
-rw-r--r--drivers/char/amiserial.c6
-rw-r--r--drivers/char/cyclades.c2
-rw-r--r--drivers/char/epca.c16
-rw-r--r--drivers/char/esp.c2
-rw-r--r--drivers/char/generic_serial.c4
-rw-r--r--drivers/char/hvcs.c6
-rw-r--r--drivers/char/hvsi.c2
-rw-r--r--drivers/char/ip2/ip2main.c10
-rw-r--r--drivers/char/isicom.c2
-rw-r--r--drivers/char/istallion.c14
-rw-r--r--drivers/char/moxa.c18
-rw-r--r--drivers/char/mxser.c18
-rw-r--r--drivers/char/mxser_new.c8
-rw-r--r--drivers/char/n_r3964.c4
-rw-r--r--drivers/char/n_tty.c2
-rw-r--r--drivers/char/pcmcia/synclink_cs.c2
-rw-r--r--drivers/char/pty.c10
-rw-r--r--drivers/char/riscom8.c4
-rw-r--r--drivers/char/rocket.c8
-rw-r--r--drivers/char/ser_a2232.c2
-rw-r--r--drivers/char/serial167.c2
-rw-r--r--drivers/char/specialix.c9
-rw-r--r--drivers/char/stallion.c20
-rw-r--r--drivers/char/sx.c2
-rw-r--r--drivers/char/synclink.c4
-rw-r--r--drivers/char/synclink_gt.c6
-rw-r--r--drivers/char/synclinkmp.c6
-rw-r--r--drivers/char/tty_ioctl.c4
-rw-r--r--drivers/char/vme_scc.c2
-rw-r--r--drivers/isdn/capi/capi.c2
-rw-r--r--drivers/isdn/gigaset/interface.c4
-rw-r--r--drivers/isdn/i4l/isdn_tty.c2
-rw-r--r--drivers/net/irda/irtty-sir.c4
-rw-r--r--drivers/s390/char/sclp_tty.c2
-rw-r--r--drivers/s390/char/tty3270.c2
-rw-r--r--drivers/serial/21285.c4
-rw-r--r--drivers/serial/68328serial.c2
-rw-r--r--drivers/serial/68360serial.c2
-rw-r--r--drivers/serial/8250.c4
-rw-r--r--drivers/serial/amba-pl010.c4
-rw-r--r--drivers/serial/amba-pl011.c4
-rw-r--r--drivers/serial/atmel_serial.c2
-rw-r--r--drivers/serial/clps711x.c4
-rw-r--r--drivers/serial/crisv10.c8
-rw-r--r--drivers/serial/crisv10.h4
-rw-r--r--drivers/serial/dz.c4
-rw-r--r--drivers/serial/icom.c4
-rw-r--r--drivers/serial/imx.c4
-rw-r--r--drivers/serial/ioc3_serial.c4
-rw-r--r--drivers/serial/ioc4_serial.c6
-rw-r--r--drivers/serial/ip22zilog.c4
-rw-r--r--drivers/serial/jsm/jsm_tty.c10
-rw-r--r--drivers/serial/m32r_sio.c2
-rw-r--r--drivers/serial/mcfserial.c2
-rw-r--r--drivers/serial/mpc52xx_uart.c4
-rw-r--r--drivers/serial/mpsc.c4
-rw-r--r--drivers/serial/mux.c4
-rw-r--r--drivers/serial/netx-serial.c4
-rw-r--r--drivers/serial/pmac_zilog.c10
-rw-r--r--drivers/serial/pmac_zilog.h2
-rw-r--r--drivers/serial/pxa.c4
-rw-r--r--drivers/serial/s3c2410.c4
-rw-r--r--drivers/serial/sa1100.c4
-rw-r--r--drivers/serial/serial_core.c21
-rw-r--r--drivers/serial/serial_lh7a40x.c4
-rw-r--r--drivers/serial/serial_txx9.c4
-rw-r--r--drivers/serial/sh-sci.c4
-rw-r--r--drivers/serial/sn_console.c4
-rw-r--r--drivers/serial/sunhv.c4
-rw-r--r--drivers/serial/sunsab.c4
-rw-r--r--drivers/serial/sunsu.c4
-rw-r--r--drivers/serial/sunzilog.c4
-rw-r--r--drivers/serial/uartlite.c4
-rw-r--r--drivers/serial/v850e_uart.c4
-rw-r--r--drivers/serial/vr41xx_siu.c4
-rw-r--r--drivers/tc/zs.c2
-rw-r--r--drivers/usb/class/cdc-acm.c4
-rw-r--r--drivers/usb/gadget/serial.c4
-rw-r--r--drivers/usb/serial/ark3116.c4
-rw-r--r--drivers/usb/serial/belkin_sa.c4
-rw-r--r--drivers/usb/serial/console.c2
-rw-r--r--drivers/usb/serial/cp2101.c4
-rw-r--r--drivers/usb/serial/cypress_m8.c10
-rw-r--r--drivers/usb/serial/digi_acceleport.c6
-rw-r--r--drivers/usb/serial/empeg.c4
-rw-r--r--drivers/usb/serial/ftdi_sio.c4
-rw-r--r--drivers/usb/serial/io_edgeport.c8
-rw-r--r--drivers/usb/serial/io_ti.c6
-rw-r--r--drivers/usb/serial/ir-usb.c4
-rw-r--r--drivers/usb/serial/keyspan.c2
-rw-r--r--drivers/usb/serial/keyspan.h2
-rw-r--r--drivers/usb/serial/keyspan_pda.c2
-rw-r--r--drivers/usb/serial/kl5kusb105.c6
-rw-r--r--drivers/usb/serial/kobil_sct.c10
-rw-r--r--drivers/usb/serial/mct_u232.c4
-rw-r--r--drivers/usb/serial/mos7720.c4
-rw-r--r--drivers/usb/serial/mos7840.c4
-rw-r--r--drivers/usb/serial/option.c4
-rw-r--r--drivers/usb/serial/pl2303.c4
-rw-r--r--drivers/usb/serial/sierra.c2
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c4
-rw-r--r--drivers/usb/serial/usb-serial.c2
-rw-r--r--drivers/usb/serial/visor.c4
-rw-r--r--drivers/usb/serial/whiteheat.c6
-rw-r--r--include/asm-generic/termios.h4
-rw-r--r--include/asm-powerpc/termbits.h2
-rw-r--r--include/linux/generic_serial.h2
-rw-r--r--include/linux/isdn.h8
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/usb/serial.h2
-rw-r--r--net/bluetooth/rfcomm/tty.c4
113 files changed, 301 insertions, 253 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index aa3090d05a8f..83301e1ef67c 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -246,7 +246,7 @@ out_up:
246 return ret; 246 return ret;
247} 247}
248 248
249void line_set_termios(struct tty_struct *tty, struct termios * old) 249void line_set_termios(struct tty_struct *tty, struct ktermios * old)
250{ 250{
251 /* nothing */ 251 /* nothing */
252} 252}
diff --git a/arch/um/include/line.h b/arch/um/include/line.h
index 214ee76c40df..5f232ae89fbb 100644
--- a/arch/um/include/line.h
+++ b/arch/um/include/line.h
@@ -76,7 +76,7 @@ extern int line_setup(struct line *lines, unsigned int sizeof_lines,
76extern int line_write(struct tty_struct *tty, const unsigned char *buf, 76extern int line_write(struct tty_struct *tty, const unsigned char *buf,
77 int len); 77 int len);
78extern void line_put_char(struct tty_struct *tty, unsigned char ch); 78extern void line_put_char(struct tty_struct *tty, unsigned char ch);
79extern void line_set_termios(struct tty_struct *tty, struct termios * old); 79extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
80extern int line_chars_in_buffer(struct tty_struct *tty); 80extern int line_chars_in_buffer(struct tty_struct *tty);
81extern void line_flush_buffer(struct tty_struct *tty); 81extern void line_flush_buffer(struct tty_struct *tty);
82extern void line_flush_chars(struct tty_struct *tty); 82extern void line_flush_chars(struct tty_struct *tty);
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 66086fa2d59a..feb4ac802a0d 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -104,7 +104,7 @@ static struct async_struct *IRQ_ports;
104 104
105static unsigned char current_ctl_bits; 105static unsigned char current_ctl_bits;
106 106
107static void change_speed(struct async_struct *info, struct termios *old); 107static void change_speed(struct async_struct *info, struct ktermios *old);
108static void rs_wait_until_sent(struct tty_struct *tty, int timeout); 108static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
109 109
110 110
@@ -694,7 +694,7 @@ static void shutdown(struct async_struct * info)
694 * the specified baud rate for a serial port. 694 * the specified baud rate for a serial port.
695 */ 695 */
696static void change_speed(struct async_struct *info, 696static void change_speed(struct async_struct *info,
697 struct termios *old_termios) 697 struct ktermios *old_termios)
698{ 698{
699 int quot = 0, baud_base, baud; 699 int quot = 0, baud_base, baud;
700 unsigned cflag, cval = 0; 700 unsigned cflag, cval = 0;
@@ -1365,7 +1365,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1365 return 0; 1365 return 0;
1366} 1366}
1367 1367
1368static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios) 1368static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1369{ 1369{
1370 struct async_struct *info = (struct async_struct *)tty->driver_data; 1370 struct async_struct *info = (struct async_struct *)tty->driver_data;
1371 unsigned long flags; 1371 unsigned long flags;
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index acb2de5e3a98..3bb4e534c14e 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -4101,7 +4101,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
4101 * where old == NULL, and try to do something rational. 4101 * where old == NULL, and try to do something rational.
4102 */ 4102 */
4103static void 4103static void
4104cy_set_termios(struct tty_struct *tty, struct termios * old_termios) 4104cy_set_termios(struct tty_struct *tty, struct ktermios * old_termios)
4105{ 4105{
4106 struct cyclades_port *info = (struct cyclades_port *)tty->driver_data; 4106 struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
4107 4107
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 7c71eb779802..a0f822c9d74d 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -199,7 +199,7 @@ static int pc_ioctl(struct tty_struct *, struct file *,
199 unsigned int, unsigned long); 199 unsigned int, unsigned long);
200static int info_ioctl(struct tty_struct *, struct file *, 200static int info_ioctl(struct tty_struct *, struct file *,
201 unsigned int, unsigned long); 201 unsigned int, unsigned long);
202static void pc_set_termios(struct tty_struct *, struct termios *); 202static void pc_set_termios(struct tty_struct *, struct ktermios *);
203static void do_softint(struct work_struct *work); 203static void do_softint(struct work_struct *work);
204static void pc_stop(struct tty_struct *); 204static void pc_stop(struct tty_struct *);
205static void pc_start(struct tty_struct *); 205static void pc_start(struct tty_struct *);
@@ -1236,6 +1236,8 @@ static int __init pc_init(void)
1236 pc_driver->init_termios.c_oflag = 0; 1236 pc_driver->init_termios.c_oflag = 0;
1237 pc_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; 1237 pc_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
1238 pc_driver->init_termios.c_lflag = 0; 1238 pc_driver->init_termios.c_lflag = 0;
1239 pc_driver->init_termios.c_ispeed = 9600;
1240 pc_driver->init_termios.c_ospeed = 9600;
1239 pc_driver->flags = TTY_DRIVER_REAL_RAW; 1241 pc_driver->flags = TTY_DRIVER_REAL_RAW;
1240 tty_set_operations(pc_driver, &pc_ops); 1242 tty_set_operations(pc_driver, &pc_ops);
1241 1243
@@ -1250,6 +1252,8 @@ static int __init pc_init(void)
1250 pc_info->init_termios.c_oflag = 0; 1252 pc_info->init_termios.c_oflag = 0;
1251 pc_info->init_termios.c_lflag = 0; 1253 pc_info->init_termios.c_lflag = 0;
1252 pc_info->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL; 1254 pc_info->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL;
1255 pc_info->init_termios.c_ispeed = 9600;
1256 pc_info->init_termios.c_ospeed = 9600;
1253 pc_info->flags = TTY_DRIVER_REAL_RAW; 1257 pc_info->flags = TTY_DRIVER_REAL_RAW;
1254 tty_set_operations(pc_info, &info_ops); 1258 tty_set_operations(pc_info, &info_ops);
1255 1259
@@ -1999,7 +2003,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch)
1999{ /* Begin epcaparam */ 2003{ /* Begin epcaparam */
2000 2004
2001 unsigned int cmdHead; 2005 unsigned int cmdHead;
2002 struct termios *ts; 2006 struct ktermios *ts;
2003 struct board_chan __iomem *bc; 2007 struct board_chan __iomem *bc;
2004 unsigned mval, hflow, cflag, iflag; 2008 unsigned mval, hflow, cflag, iflag;
2005 2009
@@ -2114,7 +2118,7 @@ static void receive_data(struct channel *ch)
2114{ /* Begin receive_data */ 2118{ /* Begin receive_data */
2115 2119
2116 unchar *rptr; 2120 unchar *rptr;
2117 struct termios *ts = NULL; 2121 struct ktermios *ts = NULL;
2118 struct tty_struct *tty; 2122 struct tty_struct *tty;
2119 struct board_chan __iomem *bc; 2123 struct board_chan __iomem *bc;
2120 int dataToRead, wrapgap, bytesAvailable; 2124 int dataToRead, wrapgap, bytesAvailable;
@@ -2362,12 +2366,14 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
2362 switch (cmd) 2366 switch (cmd)
2363 { /* Begin switch cmd */ 2367 { /* Begin switch cmd */
2364 2368
2369#if 0 /* Handled by calling layer properly */
2365 case TCGETS: 2370 case TCGETS:
2366 if (copy_to_user(argp, tty->termios, sizeof(struct termios))) 2371 if (copy_to_user(argp, tty->termios, sizeof(struct ktermios)))
2367 return -EFAULT; 2372 return -EFAULT;
2368 return 0; 2373 return 0;
2369 case TCGETA: 2374 case TCGETA:
2370 return get_termio(tty, argp); 2375 return get_termio(tty, argp);
2376#endif
2371 case TCSBRK: /* SVID version: non-zero arg --> no break */ 2377 case TCSBRK: /* SVID version: non-zero arg --> no break */
2372 retval = tty_check_change(tty); 2378 retval = tty_check_change(tty);
2373 if (retval) 2379 if (retval)
@@ -2536,7 +2542,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
2536 2542
2537/* --------------------- Begin pc_set_termios ----------------------- */ 2543/* --------------------- Begin pc_set_termios ----------------------- */
2538 2544
2539static void pc_set_termios(struct tty_struct *tty, struct termios *old_termios) 2545static void pc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
2540{ /* Begin pc_set_termios */ 2546{ /* Begin pc_set_termios */
2541 2547
2542 struct channel *ch; 2548 struct channel *ch;
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 93b551962513..d1bfbaa2aa02 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -1915,7 +1915,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1915 return 0; 1915 return 0;
1916} 1916}
1917 1917
1918static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios) 1918static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1919{ 1919{
1920 struct esp_struct *info = (struct esp_struct *)tty->driver_data; 1920 struct esp_struct *info = (struct esp_struct *)tty->driver_data;
1921 unsigned long flags; 1921 unsigned long flags;
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
index 87127e49c0db..e769811e7417 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/char/generic_serial.c
@@ -718,11 +718,11 @@ static unsigned int gs_baudrates[] = {
718 718
719 719
720void gs_set_termios (struct tty_struct * tty, 720void gs_set_termios (struct tty_struct * tty,
721 struct termios * old_termios) 721 struct ktermios * old_termios)
722{ 722{
723 struct gs_port *port; 723 struct gs_port *port;
724 int baudrate, tmp, rv; 724 int baudrate, tmp, rv;
725 struct termios *tiosp; 725 struct ktermios *tiosp;
726 726
727 func_enter(); 727 func_enter();
728 728
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c
index d090622f1dea..207f7343ba60 100644
--- a/drivers/char/hvcs.c
+++ b/drivers/char/hvcs.c
@@ -192,11 +192,13 @@ MODULE_VERSION(HVCS_DRIVER_VERSION);
192 * that will cause echoing or we'll go into recursive loop echoing chars back 192 * that will cause echoing or we'll go into recursive loop echoing chars back
193 * and forth with the console drivers. 193 * and forth with the console drivers.
194 */ 194 */
195static struct termios hvcs_tty_termios = { 195static struct ktermios hvcs_tty_termios = {
196 .c_iflag = IGNBRK | IGNPAR, 196 .c_iflag = IGNBRK | IGNPAR,
197 .c_oflag = OPOST, 197 .c_oflag = OPOST,
198 .c_cflag = B38400 | CS8 | CREAD | HUPCL, 198 .c_cflag = B38400 | CS8 | CREAD | HUPCL,
199 .c_cc = INIT_C_CC 199 .c_cc = INIT_C_CC,
200 .c_ispeed = 38400,
201 .c_ospeed = 38400
200}; 202};
201 203
202/* 204/*
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 82a41d5b4ed0..d7806834fc17 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -1161,6 +1161,8 @@ static int __init hvsi_init(void)
1161 hvsi_driver->type = TTY_DRIVER_TYPE_SYSTEM; 1161 hvsi_driver->type = TTY_DRIVER_TYPE_SYSTEM;
1162 hvsi_driver->init_termios = tty_std_termios; 1162 hvsi_driver->init_termios = tty_std_termios;
1163 hvsi_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL; 1163 hvsi_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL;
1164 hvsi_driver->init_termios.c_ispeed = 9600;
1165 hvsi_driver->init_termios.c_ospeed = 9600;
1164 hvsi_driver->flags = TTY_DRIVER_REAL_RAW; 1166 hvsi_driver->flags = TTY_DRIVER_REAL_RAW;
1165 tty_set_operations(hvsi_driver, &hvsi_ops); 1167 tty_set_operations(hvsi_driver, &hvsi_ops);
1166 1168
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 6810b7bbcbb7..7c70310a49b5 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -177,7 +177,7 @@ static int ip2_write_room(PTTY);
177static int ip2_chars_in_buf(PTTY); 177static int ip2_chars_in_buf(PTTY);
178static void ip2_flush_buffer(PTTY); 178static void ip2_flush_buffer(PTTY);
179static int ip2_ioctl(PTTY, struct file *, UINT, ULONG); 179static int ip2_ioctl(PTTY, struct file *, UINT, ULONG);
180static void ip2_set_termios(PTTY, struct termios *); 180static void ip2_set_termios(PTTY, struct ktermios *);
181static void ip2_set_line_discipline(PTTY); 181static void ip2_set_line_discipline(PTTY);
182static void ip2_throttle(PTTY); 182static void ip2_throttle(PTTY);
183static void ip2_unthrottle(PTTY); 183static void ip2_unthrottle(PTTY);
@@ -198,7 +198,7 @@ static void do_status(struct work_struct *);
198 198
199static void ip2_wait_until_sent(PTTY,int); 199static void ip2_wait_until_sent(PTTY,int);
200 200
201static void set_params (i2ChanStrPtr, struct termios *); 201static void set_params (i2ChanStrPtr, struct ktermios *);
202static int get_serial_info(i2ChanStrPtr, struct serial_struct __user *); 202static int get_serial_info(i2ChanStrPtr, struct serial_struct __user *);
203static int set_serial_info(i2ChanStrPtr, struct serial_struct __user *); 203static int set_serial_info(i2ChanStrPtr, struct serial_struct __user *);
204 204
@@ -2398,7 +2398,7 @@ set_serial_info( i2ChanStrPtr pCh, struct serial_struct __user *new_info )
2398/* */ 2398/* */
2399/******************************************************************************/ 2399/******************************************************************************/
2400static void 2400static void
2401ip2_set_termios( PTTY tty, struct termios *old_termios ) 2401ip2_set_termios( PTTY tty, struct ktermios *old_termios )
2402{ 2402{
2403 i2ChanStrPtr pCh = (i2ChanStrPtr)tty->driver_data; 2403 i2ChanStrPtr pCh = (i2ChanStrPtr)tty->driver_data;
2404 2404
@@ -2440,11 +2440,11 @@ ip2_set_line_discipline ( PTTY tty )
2440/* change. */ 2440/* change. */
2441/******************************************************************************/ 2441/******************************************************************************/
2442static void 2442static void
2443set_params( i2ChanStrPtr pCh, struct termios *o_tios ) 2443set_params( i2ChanStrPtr pCh, struct ktermios *o_tios )
2444{ 2444{
2445 tcflag_t cflag, iflag, lflag; 2445 tcflag_t cflag, iflag, lflag;
2446 char stop_char, start_char; 2446 char stop_char, start_char;
2447 struct termios dummy; 2447 struct ktermios dummy;
2448 2448
2449 lflag = pCh->pTTY->termios->c_lflag; 2449 lflag = pCh->pTTY->termios->c_lflag;
2450 cflag = pCh->pTTY->termios->c_cflag; 2450 cflag = pCh->pTTY->termios->c_cflag;
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 1637c1d9a4ba..29e28b756336 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -1399,7 +1399,7 @@ static int isicom_ioctl(struct tty_struct *tty, struct file *filp,
1399 1399
1400/* set_termios et all */ 1400/* set_termios et all */
1401static void isicom_set_termios(struct tty_struct *tty, 1401static void isicom_set_termios(struct tty_struct *tty,
1402 struct termios *old_termios) 1402 struct ktermios *old_termios)
1403{ 1403{
1404 struct isi_port *port = tty->driver_data; 1404 struct isi_port *port = tty->driver_data;
1405 1405
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index b6f0d036a760..0ef2523733ee 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -194,9 +194,11 @@ static struct tty_struct *stli_txcooktty;
194 * with this termios initially. Basically all it defines is a raw port 194 * with this termios initially. Basically all it defines is a raw port
195 * at 9600 baud, 8 data bits, no parity, 1 stop bit. 195 * at 9600 baud, 8 data bits, no parity, 1 stop bit.
196 */ 196 */
197static struct termios stli_deftermios = { 197static struct ktermios stli_deftermios = {
198 .c_cflag = (B9600 | CS8 | CREAD | HUPCL | CLOCAL), 198 .c_cflag = (B9600 | CS8 | CREAD | HUPCL | CLOCAL),
199 .c_cc = INIT_C_CC, 199 .c_cc = INIT_C_CC,
200 .c_ispeed = 9600,
201 .c_ospeed = 9600,
200}; 202};
201 203
202/* 204/*
@@ -639,7 +641,7 @@ static void stli_flushchars(struct tty_struct *tty);
639static int stli_writeroom(struct tty_struct *tty); 641static int stli_writeroom(struct tty_struct *tty);
640static int stli_charsinbuffer(struct tty_struct *tty); 642static int stli_charsinbuffer(struct tty_struct *tty);
641static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg); 643static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg);
642static void stli_settermios(struct tty_struct *tty, struct termios *old); 644static void stli_settermios(struct tty_struct *tty, struct ktermios *old);
643static void stli_throttle(struct tty_struct *tty); 645static void stli_throttle(struct tty_struct *tty);
644static void stli_unthrottle(struct tty_struct *tty); 646static void stli_unthrottle(struct tty_struct *tty);
645static void stli_stop(struct tty_struct *tty); 647static void stli_stop(struct tty_struct *tty);
@@ -669,7 +671,7 @@ static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, v
669static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback); 671static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback);
670static void __stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback); 672static void __stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback);
671static void stli_dodelaycmd(stliport_t *portp, cdkctrl_t __iomem *cp); 673static void stli_dodelaycmd(stliport_t *portp, cdkctrl_t __iomem *cp);
672static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp); 674static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct ktermios *tiosp);
673static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts); 675static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts);
674static long stli_mktiocm(unsigned long sigvalue); 676static long stli_mktiocm(unsigned long sigvalue);
675static void stli_read(stlibrd_t *brdp, stliport_t *portp); 677static void stli_read(stlibrd_t *brdp, stliport_t *portp);
@@ -1889,11 +1891,11 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
1889 * Looks like it is true for the current ttys implementation..!! 1891 * Looks like it is true for the current ttys implementation..!!
1890 */ 1892 */
1891 1893
1892static void stli_settermios(struct tty_struct *tty, struct termios *old) 1894static void stli_settermios(struct tty_struct *tty, struct ktermios *old)
1893{ 1895{
1894 stliport_t *portp; 1896 stliport_t *portp;
1895 stlibrd_t *brdp; 1897 stlibrd_t *brdp;
1896 struct termios *tiosp; 1898 struct ktermios *tiosp;
1897 asyport_t aport; 1899 asyport_t aport;
1898 1900
1899 if (tty == NULL) 1901 if (tty == NULL)
@@ -2730,7 +2732,7 @@ static void stli_poll(unsigned long arg)
2730 * the slave. 2732 * the slave.
2731 */ 2733 */
2732 2734
2733static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp) 2735static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct ktermios *tiosp)
2734{ 2736{
2735 memset(pp, 0, sizeof(asyport_t)); 2737 memset(pp, 0, sizeof(asyport_t));
2736 2738
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 8b316953173d..f391a24a1b44 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -234,7 +234,7 @@ static void moxa_put_char(struct tty_struct *, unsigned char);
234static int moxa_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long); 234static int moxa_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long);
235static void moxa_throttle(struct tty_struct *); 235static void moxa_throttle(struct tty_struct *);
236static void moxa_unthrottle(struct tty_struct *); 236static void moxa_unthrottle(struct tty_struct *);
237static void moxa_set_termios(struct tty_struct *, struct termios *); 237static void moxa_set_termios(struct tty_struct *, struct ktermios *);
238static void moxa_stop(struct tty_struct *); 238static void moxa_stop(struct tty_struct *);
239static void moxa_start(struct tty_struct *); 239static void moxa_start(struct tty_struct *);
240static void moxa_hangup(struct tty_struct *); 240static void moxa_hangup(struct tty_struct *);
@@ -261,7 +261,7 @@ static void MoxaPortEnable(int);
261static void MoxaPortDisable(int); 261static void MoxaPortDisable(int);
262static long MoxaPortGetMaxBaud(int); 262static long MoxaPortGetMaxBaud(int);
263static long MoxaPortSetBaud(int, long); 263static long MoxaPortSetBaud(int, long);
264static int MoxaPortSetTermio(int, struct termios *, speed_t); 264static int MoxaPortSetTermio(int, struct ktermios *, speed_t);
265static int MoxaPortGetLineOut(int, int *, int *); 265static int MoxaPortGetLineOut(int, int *, int *);
266static void MoxaPortLineCtrl(int, int, int); 266static void MoxaPortLineCtrl(int, int, int);
267static void MoxaPortFlowCtrl(int, int, int, int, int, int); 267static void MoxaPortFlowCtrl(int, int, int, int, int, int);
@@ -355,6 +355,8 @@ static int __init moxa_init(void)
355 moxaDriver->init_termios.c_oflag = 0; 355 moxaDriver->init_termios.c_oflag = 0;
356 moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; 356 moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
357 moxaDriver->init_termios.c_lflag = 0; 357 moxaDriver->init_termios.c_lflag = 0;
358 moxaDriver->init_termios.c_ispeed = 9600;
359 moxaDriver->init_termios.c_ospeed = 9600;
358 moxaDriver->flags = TTY_DRIVER_REAL_RAW; 360 moxaDriver->flags = TTY_DRIVER_REAL_RAW;
359 tty_set_operations(moxaDriver, &moxa_ops); 361 tty_set_operations(moxaDriver, &moxa_ops);
360 362
@@ -864,7 +866,7 @@ static void moxa_unthrottle(struct tty_struct *tty)
864} 866}
865 867
866static void moxa_set_termios(struct tty_struct *tty, 868static void moxa_set_termios(struct tty_struct *tty,
867 struct termios *old_termios) 869 struct ktermios *old_termios)
868{ 870{
869 struct moxa_str *ch = (struct moxa_str *) tty->driver_data; 871 struct moxa_str *ch = (struct moxa_str *) tty->driver_data;
870 872
@@ -978,7 +980,7 @@ static void moxa_poll(unsigned long ignored)
978 980
979static void set_tty_param(struct tty_struct *tty) 981static void set_tty_param(struct tty_struct *tty)
980{ 982{
981 register struct termios *ts; 983 register struct ktermios *ts;
982 struct moxa_str *ch; 984 struct moxa_str *ch;
983 int rts, cts, txflow, rxflow, xany; 985 int rts, cts, txflow, rxflow, xany;
984 986
@@ -1149,7 +1151,7 @@ static void shut_down(struct moxa_str *ch)
1149static void receive_data(struct moxa_str *ch) 1151static void receive_data(struct moxa_str *ch)
1150{ 1152{
1151 struct tty_struct *tp; 1153 struct tty_struct *tp;
1152 struct termios *ts; 1154 struct ktermios *ts;
1153 unsigned long flags; 1155 unsigned long flags;
1154 1156
1155 ts = NULL; 1157 ts = NULL;
@@ -1912,9 +1914,9 @@ int MoxaPortsOfCard(int cardno)
1912 * 1914 *
1913 * Function 12: Configure the port. 1915 * Function 12: Configure the port.
1914 * Syntax: 1916 * Syntax:
1915 * int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud); 1917 * int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud);
1916 * int port : port number (0 - 127) 1918 * int port : port number (0 - 127)
1917 * struct termios * termio : termio structure pointer 1919 * struct ktermios * termio : termio structure pointer
1918 * speed_t baud : baud rate 1920 * speed_t baud : baud rate
1919 * 1921 *
1920 * return: -1 : this port is invalid or termio == NULL 1922 * return: -1 : this port is invalid or termio == NULL
@@ -2195,7 +2197,7 @@ long MoxaPortSetBaud(int port, long baud)
2195 return (baud); 2197 return (baud);
2196} 2198}
2197 2199
2198int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud) 2200int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud)
2199{ 2201{
2200 void __iomem *ofsAddr; 2202 void __iomem *ofsAddr;
2201 tcflag_t cflag; 2203 tcflag_t cflag;
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;
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 369d2742d6be..efa8076c33e0 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -266,8 +266,8 @@ struct mxser_port {
266 int xmit_tail; 266 int xmit_tail;
267 int xmit_cnt; 267 int xmit_cnt;
268 268
269 struct termios normal_termios; 269 struct ktermios normal_termios;
270 struct termios callout_termios; 270 struct ktermios callout_termios;
271 271
272 struct mxser_mon mon_data; 272 struct mxser_mon mon_data;
273 273
@@ -512,7 +512,7 @@ static int mxser_set_baud(struct mxser_port *info, long newspd)
512 * the specified baud rate for a serial port. 512 * the specified baud rate for a serial port.
513 */ 513 */
514static int mxser_change_speed(struct mxser_port *info, 514static int mxser_change_speed(struct mxser_port *info,
515 struct termios *old_termios) 515 struct ktermios *old_termios)
516{ 516{
517 unsigned cflag, cval, fcr; 517 unsigned cflag, cval, fcr;
518 int ret = 0; 518 int ret = 0;
@@ -1966,7 +1966,7 @@ static void mxser_start(struct tty_struct *tty)
1966 spin_unlock_irqrestore(&info->slock, flags); 1966 spin_unlock_irqrestore(&info->slock, flags);
1967} 1967}
1968 1968
1969static void mxser_set_termios(struct tty_struct *tty, struct termios *old_termios) 1969static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1970{ 1970{
1971 struct mxser_port *info = tty->driver_data; 1971 struct mxser_port *info = tty->driver_data;
1972 unsigned long flags; 1972 unsigned long flags;
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 203dc2b661d5..103d338f21e2 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -142,7 +142,7 @@ static ssize_t r3964_write(struct tty_struct * tty, struct file * file,
142 const unsigned char * buf, size_t nr); 142 const unsigned char * buf, size_t nr);
143static int r3964_ioctl(struct tty_struct * tty, struct file * file, 143static int r3964_ioctl(struct tty_struct * tty, struct file * file,
144 unsigned int cmd, unsigned long arg); 144 unsigned int cmd, unsigned long arg);
145static void r3964_set_termios(struct tty_struct *tty, struct termios * old); 145static void r3964_set_termios(struct tty_struct *tty, struct ktermios * old);
146static unsigned int r3964_poll(struct tty_struct * tty, struct file * file, 146static unsigned int r3964_poll(struct tty_struct * tty, struct file * file,
147 struct poll_table_struct *wait); 147 struct poll_table_struct *wait);
148static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp, 148static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
@@ -1347,7 +1347,7 @@ static int r3964_ioctl(struct tty_struct * tty, struct file * file,
1347 } 1347 }
1348} 1348}
1349 1349
1350static void r3964_set_termios(struct tty_struct *tty, struct termios * old) 1350static void r3964_set_termios(struct tty_struct *tty, struct ktermios * old)
1351{ 1351{
1352 TRACE_L("set_termios"); 1352 TRACE_L("set_termios");
1353} 1353}
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 603b9ade5eb0..e96a00fe1389 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -994,7 +994,7 @@ int is_ignored(int sig)
994 * when the ldisc is closed. 994 * when the ldisc is closed.
995 */ 995 */
996 996
997static void n_tty_set_termios(struct tty_struct *tty, struct termios * old) 997static void n_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
998{ 998{
999 if (!tty) 999 if (!tty)
1000 return; 1000 return;
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 74d21c1c104f..5152cedd8878 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -2375,7 +2375,7 @@ static int ioctl_common(MGSLPC_INFO *info, unsigned int cmd, unsigned long arg)
2375 * tty pointer to tty structure 2375 * tty pointer to tty structure
2376 * termios pointer to buffer to hold returned old termios 2376 * termios pointer to buffer to hold returned old termios
2377 */ 2377 */
2378static void mgslpc_set_termios(struct tty_struct *tty, struct termios *old_termios) 2378static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
2379{ 2379{
2380 MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; 2380 MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
2381 unsigned long flags; 2381 unsigned long flags;
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
221static void pty_set_termios(struct tty_struct *tty, struct termios *old_termios) 221static 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;
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 0a77bfcd5b5e..e2a94bfb2a43 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -1539,7 +1539,7 @@ static void rc_hangup(struct tty_struct * tty)
1539 wake_up_interruptible(&port->open_wait); 1539 wake_up_interruptible(&port->open_wait);
1540} 1540}
1541 1541
1542static void rc_set_termios(struct tty_struct * tty, struct termios * old_termios) 1542static void rc_set_termios(struct tty_struct * tty, struct ktermios * old_termios)
1543{ 1543{
1544 struct riscom_port *port = (struct riscom_port *)tty->driver_data; 1544 struct riscom_port *port = (struct riscom_port *)tty->driver_data;
1545 unsigned long flags; 1545 unsigned long flags;
@@ -1614,6 +1614,8 @@ static inline int rc_init_drivers(void)
1614 riscom_driver->init_termios = tty_std_termios; 1614 riscom_driver->init_termios = tty_std_termios;
1615 riscom_driver->init_termios.c_cflag = 1615 riscom_driver->init_termios.c_cflag =
1616 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 1616 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
1617 riscom_driver->init_termios.c_ispeed = 9600;
1618 riscom_driver->init_termios.c_ospeed = 9600;
1617 riscom_driver->flags = TTY_DRIVER_REAL_RAW; 1619 riscom_driver->flags = TTY_DRIVER_REAL_RAW;
1618 tty_set_operations(riscom_driver, &riscom_ops); 1620 tty_set_operations(riscom_driver, &riscom_ops);
1619 if ((error = tty_register_driver(riscom_driver))) { 1621 if ((error = tty_register_driver(riscom_driver))) {
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 4fdf52e9f3b1..e94a62e30fc4 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -712,7 +712,7 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
712 * user mode into the driver (exception handler). *info CD manipulation is spinlock protected. 712 * user mode into the driver (exception handler). *info CD manipulation is spinlock protected.
713 */ 713 */
714static void configure_r_port(struct r_port *info, 714static void configure_r_port(struct r_port *info,
715 struct termios *old_termios) 715 struct ktermios *old_termios)
716{ 716{
717 unsigned cflag; 717 unsigned cflag;
718 unsigned long flags; 718 unsigned long flags;
@@ -1194,7 +1194,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1194} 1194}
1195 1195
1196static void rp_set_termios(struct tty_struct *tty, 1196static void rp_set_termios(struct tty_struct *tty,
1197 struct termios *old_termios) 1197 struct ktermios *old_termios)
1198{ 1198{
1199 struct r_port *info = (struct r_port *) tty->driver_data; 1199 struct r_port *info = (struct r_port *) tty->driver_data;
1200 CHANNEL_t *cp; 1200 CHANNEL_t *cp;
@@ -2214,7 +2214,7 @@ static int __init init_PCI(int boards_found)
2214 int count = 0; 2214 int count = 0;
2215 2215
2216 /* Work through the PCI device list, pulling out ours */ 2216 /* Work through the PCI device list, pulling out ours */
2217 while ((dev = pci_find_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) { 2217 while ((dev = pci_get_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) {
2218 if (register_PCI(count + boards_found, dev)) 2218 if (register_PCI(count + boards_found, dev))
2219 count++; 2219 count++;
2220 } 2220 }
@@ -2436,6 +2436,8 @@ static int __init rp_init(void)
2436 rocket_driver->init_termios = tty_std_termios; 2436 rocket_driver->init_termios = tty_std_termios;
2437 rocket_driver->init_termios.c_cflag = 2437 rocket_driver->init_termios.c_cflag =
2438 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 2438 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
2439 rocket_driver->init_termios.c_ispeed = 9600;
2440 rocket_driver->init_termios.c_ospeed = 9600;
2439#ifdef ROCKET_SOFT_FLOW 2441#ifdef ROCKET_SOFT_FLOW
2440 rocket_driver->flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; 2442 rocket_driver->flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
2441#endif 2443#endif
diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
index 4217d38caef9..75de5f66517a 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/char/ser_a2232.c
@@ -695,6 +695,8 @@ static int a2232_init_drivers(void)
695 a2232_driver->init_termios = tty_std_termios; 695 a2232_driver->init_termios = tty_std_termios;
696 a2232_driver->init_termios.c_cflag = 696 a2232_driver->init_termios.c_cflag =
697 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 697 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
698 a2232_driver->init_termios.c_ispeed = 9600;
699 a2232_driver->init_termios.c_ospeed = 9600;
698 a2232_driver->flags = TTY_DRIVER_REAL_RAW; 700 a2232_driver->flags = TTY_DRIVER_REAL_RAW;
699 tty_set_operations(a2232_driver, &a2232_ops); 701 tty_set_operations(a2232_driver, &a2232_ops);
700 if ((error = tty_register_driver(a2232_driver))) { 702 if ((error = tty_register_driver(a2232_driver))) {
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 9ba13af234be..af50d32ae2c7 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -1695,7 +1695,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
1695 1695
1696 1696
1697static void 1697static void
1698cy_set_termios(struct tty_struct *tty, struct termios * old_termios) 1698cy_set_termios(struct tty_struct *tty, struct ktermios * old_termios)
1699{ 1699{
1700 struct cyclades_port *info = (struct cyclades_port *)tty->driver_data; 1700 struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
1701 1701
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 99137ab66b62..20946f5127e0 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -2311,7 +2311,7 @@ static void sx_hangup(struct tty_struct * tty)
2311} 2311}
2312 2312
2313 2313
2314static void sx_set_termios(struct tty_struct * tty, struct termios * old_termios) 2314static void sx_set_termios(struct tty_struct * tty, struct ktermios * old_termios)
2315{ 2315{
2316 struct specialix_port *port = (struct specialix_port *)tty->driver_data; 2316 struct specialix_port *port = (struct specialix_port *)tty->driver_data;
2317 unsigned long flags; 2317 unsigned long flags;
@@ -2400,6 +2400,8 @@ static int sx_init_drivers(void)
2400 specialix_driver->init_termios = tty_std_termios; 2400 specialix_driver->init_termios = tty_std_termios;
2401 specialix_driver->init_termios.c_cflag = 2401 specialix_driver->init_termios.c_cflag =
2402 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 2402 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
2403 specialix_driver->init_termios.c_ispeed = 9600;
2404 specialix_driver->init_termios.c_ospeed = 9600;
2403 specialix_driver->flags = TTY_DRIVER_REAL_RAW; 2405 specialix_driver->flags = TTY_DRIVER_REAL_RAW;
2404 tty_set_operations(specialix_driver, &sx_ops); 2406 tty_set_operations(specialix_driver, &sx_ops);
2405 2407
@@ -2475,7 +2477,7 @@ static int __init specialix_init(void)
2475 i++; 2477 i++;
2476 continue; 2478 continue;
2477 } 2479 }
2478 pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX, 2480 pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
2479 PCI_DEVICE_ID_SPECIALIX_IO8, 2481 PCI_DEVICE_ID_SPECIALIX_IO8,
2480 pdev); 2482 pdev);
2481 if (!pdev) break; 2483 if (!pdev) break;
@@ -2491,6 +2493,9 @@ static int __init specialix_init(void)
2491 if (!sx_probe(&sx_board[i])) 2493 if (!sx_probe(&sx_board[i]))
2492 found ++; 2494 found ++;
2493 } 2495 }
2496 /* May exit pci_get sequence early with lots of boards */
2497 if (pdev != NULL)
2498 pci_dev_put(pdev);
2494 } 2499 }
2495#endif 2500#endif
2496 2501
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index a547c0c8fb2a..71bfdccfb42e 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -141,9 +141,11 @@ static struct tty_driver *stl_serial;
141 * with this termios initially. Basically all it defines is a raw port 141 * with this termios initially. Basically all it defines is a raw port
142 * at 9600, 8 data bits, 1 stop bit. 142 * at 9600, 8 data bits, 1 stop bit.
143 */ 143 */
144static struct termios stl_deftermios = { 144static struct ktermios stl_deftermios = {
145 .c_cflag = (B9600 | CS8 | CREAD | HUPCL | CLOCAL), 145 .c_cflag = (B9600 | CS8 | CREAD | HUPCL | CLOCAL),
146 .c_cc = INIT_C_CC, 146 .c_cc = INIT_C_CC,
147 .c_ispeed = 9600,
148 .c_ospeed = 9600,
147}; 149};
148 150
149/* 151/*
@@ -464,7 +466,7 @@ static int stl_cd1400getreg(struct stlport *portp, int regnr);
464static int stl_cd1400updatereg(struct stlport *portp, int regnr, int value); 466static int stl_cd1400updatereg(struct stlport *portp, int regnr, int value);
465static int stl_cd1400panelinit(struct stlbrd *brdp, struct stlpanel *panelp); 467static int stl_cd1400panelinit(struct stlbrd *brdp, struct stlpanel *panelp);
466static void stl_cd1400portinit(struct stlbrd *brdp, struct stlpanel *panelp, struct stlport *portp); 468static void stl_cd1400portinit(struct stlbrd *brdp, struct stlpanel *panelp, struct stlport *portp);
467static void stl_cd1400setport(struct stlport *portp, struct termios *tiosp); 469static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp);
468static int stl_cd1400getsignals(struct stlport *portp); 470static int stl_cd1400getsignals(struct stlport *portp);
469static void stl_cd1400setsignals(struct stlport *portp, int dtr, int rts); 471static void stl_cd1400setsignals(struct stlport *portp, int dtr, int rts);
470static void stl_cd1400ccrwait(struct stlport *portp); 472static void stl_cd1400ccrwait(struct stlport *portp);
@@ -493,7 +495,7 @@ static int stl_sc26198updatereg(struct stlport *portp, int regnr, int value);
493static int stl_sc26198getglobreg(struct stlport *portp, int regnr); 495static int stl_sc26198getglobreg(struct stlport *portp, int regnr);
494static int stl_sc26198panelinit(struct stlbrd *brdp, struct stlpanel *panelp); 496static int stl_sc26198panelinit(struct stlbrd *brdp, struct stlpanel *panelp);
495static void stl_sc26198portinit(struct stlbrd *brdp, struct stlpanel *panelp, struct stlport *portp); 497static void stl_sc26198portinit(struct stlbrd *brdp, struct stlpanel *panelp, struct stlport *portp);
496static void stl_sc26198setport(struct stlport *portp, struct termios *tiosp); 498static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp);
497static int stl_sc26198getsignals(struct stlport *portp); 499static int stl_sc26198getsignals(struct stlport *portp);
498static void stl_sc26198setsignals(struct stlport *portp, int dtr, int rts); 500static void stl_sc26198setsignals(struct stlport *portp, int dtr, int rts);
499static void stl_sc26198enablerxtx(struct stlport *portp, int rx, int tx); 501static void stl_sc26198enablerxtx(struct stlport *portp, int rx, int tx);
@@ -521,7 +523,7 @@ static void stl_sc26198otherisr(struct stlport *port, unsigned int iack);
521typedef struct uart { 523typedef struct uart {
522 int (*panelinit)(struct stlbrd *brdp, struct stlpanel *panelp); 524 int (*panelinit)(struct stlbrd *brdp, struct stlpanel *panelp);
523 void (*portinit)(struct stlbrd *brdp, struct stlpanel *panelp, struct stlport *portp); 525 void (*portinit)(struct stlbrd *brdp, struct stlpanel *panelp, struct stlport *portp);
524 void (*setport)(struct stlport *portp, struct termios *tiosp); 526 void (*setport)(struct stlport *portp, struct ktermios *tiosp);
525 int (*getsignals)(struct stlport *portp); 527 int (*getsignals)(struct stlport *portp);
526 void (*setsignals)(struct stlport *portp, int dtr, int rts); 528 void (*setsignals)(struct stlport *portp, int dtr, int rts);
527 void (*enablerxtx)(struct stlport *portp, int rx, int tx); 529 void (*enablerxtx)(struct stlport *portp, int rx, int tx);
@@ -1427,10 +1429,10 @@ static void stl_start(struct tty_struct *tty)
1427 1429
1428/*****************************************************************************/ 1430/*****************************************************************************/
1429 1431
1430static void stl_settermios(struct tty_struct *tty, struct termios *old) 1432static void stl_settermios(struct tty_struct *tty, struct ktermios *old)
1431{ 1433{
1432 struct stlport *portp; 1434 struct stlport *portp;
1433 struct termios *tiosp; 1435 struct ktermios *tiosp;
1434 1436
1435 pr_debug("stl_settermios(tty=%p,old=%p)\n", tty, old); 1437 pr_debug("stl_settermios(tty=%p,old=%p)\n", tty, old);
1436 1438
@@ -2468,7 +2470,7 @@ static int __init stl_findpcibrds(void)
2468 pr_debug("stl_findpcibrds()\n"); 2470 pr_debug("stl_findpcibrds()\n");
2469 2471
2470 for (i = 0; (i < stl_nrpcibrds); i++) 2472 for (i = 0; (i < stl_nrpcibrds); i++)
2471 while ((dev = pci_find_device(stl_pcibrds[i].vendid, 2473 while ((dev = pci_get_device(stl_pcibrds[i].vendid,
2472 stl_pcibrds[i].devid, dev))) { 2474 stl_pcibrds[i].devid, dev))) {
2473 2475
2474/* 2476/*
@@ -2947,7 +2949,7 @@ static void stl_cd1400ccrwait(struct stlport *portp)
2947 * settings. 2949 * settings.
2948 */ 2950 */
2949 2951
2950static void stl_cd1400setport(struct stlport *portp, struct termios *tiosp) 2952static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp)
2951{ 2953{
2952 struct stlbrd *brdp; 2954 struct stlbrd *brdp;
2953 unsigned long flags; 2955 unsigned long flags;
@@ -3924,7 +3926,7 @@ static void stl_sc26198portinit(struct stlbrd *brdp, struct stlpanel *panelp, st
3924 * settings. 3926 * settings.
3925 */ 3927 */
3926 3928
3927static void stl_sc26198setport(struct stlport *portp, struct termios *tiosp) 3929static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp)
3928{ 3930{
3929 struct stlbrd *brdp; 3931 struct stlbrd *brdp;
3930 unsigned long flags; 3932 unsigned long flags;
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index cc10af08cb05..e9bc147c32fe 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -2263,6 +2263,8 @@ static int sx_init_drivers(void)
2263 sx_driver->init_termios = tty_std_termios; 2263 sx_driver->init_termios = tty_std_termios;
2264 sx_driver->init_termios.c_cflag = 2264 sx_driver->init_termios.c_cflag =
2265 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 2265 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
2266 sx_driver->init_termios.c_ispeed = 9600;
2267 sx_driver->init_termios.c_ospeed = 9600;
2266 sx_driver->flags = TTY_DRIVER_REAL_RAW; 2268 sx_driver->flags = TTY_DRIVER_REAL_RAW;
2267 tty_set_operations(sx_driver, &sx_ops); 2269 tty_set_operations(sx_driver, &sx_ops);
2268 2270
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index 645187b9141e..acc6fab601cc 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -3060,7 +3060,7 @@ static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigne
3060 * 3060 *
3061 * Return Value: None 3061 * Return Value: None
3062 */ 3062 */
3063static void mgsl_set_termios(struct tty_struct *tty, struct termios *old_termios) 3063static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
3064{ 3064{
3065 struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data; 3065 struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
3066 unsigned long flags; 3066 unsigned long flags;
@@ -4405,6 +4405,8 @@ static int mgsl_init_tty(void)
4405 serial_driver->init_termios = tty_std_termios; 4405 serial_driver->init_termios = tty_std_termios;
4406 serial_driver->init_termios.c_cflag = 4406 serial_driver->init_termios.c_cflag =
4407 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 4407 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
4408 serial_driver->init_termios.c_ispeed = 9600;
4409 serial_driver->init_termios.c_ospeed = 9600;
4408 serial_driver->flags = TTY_DRIVER_REAL_RAW; 4410 serial_driver->flags = TTY_DRIVER_REAL_RAW;
4409 tty_set_operations(serial_driver, &mgsl_ops); 4411 tty_set_operations(serial_driver, &mgsl_ops);
4410 if ((rc = tty_register_driver(serial_driver)) < 0) { 4412 if ((rc = tty_register_driver(serial_driver)) < 0) {
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index e4730a7312b5..792c79c315e0 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -151,7 +151,7 @@ static struct tty_driver *serial_driver;
151static int open(struct tty_struct *tty, struct file * filp); 151static int open(struct tty_struct *tty, struct file * filp);
152static void close(struct tty_struct *tty, struct file * filp); 152static void close(struct tty_struct *tty, struct file * filp);
153static void hangup(struct tty_struct *tty); 153static void hangup(struct tty_struct *tty);
154static void set_termios(struct tty_struct *tty, struct termios *old_termios); 154static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
155 155
156static int write(struct tty_struct *tty, const unsigned char *buf, int count); 156static int write(struct tty_struct *tty, const unsigned char *buf, int count);
157static void put_char(struct tty_struct *tty, unsigned char ch); 157static void put_char(struct tty_struct *tty, unsigned char ch);
@@ -816,7 +816,7 @@ static void hangup(struct tty_struct *tty)
816 wake_up_interruptible(&info->open_wait); 816 wake_up_interruptible(&info->open_wait);
817} 817}
818 818
819static void set_termios(struct tty_struct *tty, struct termios *old_termios) 819static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)
820{ 820{
821 struct slgt_info *info = tty->driver_data; 821 struct slgt_info *info = tty->driver_data;
822 unsigned long flags; 822 unsigned long flags;
@@ -3546,6 +3546,8 @@ static int __init slgt_init(void)
3546 serial_driver->init_termios = tty_std_termios; 3546 serial_driver->init_termios = tty_std_termios;
3547 serial_driver->init_termios.c_cflag = 3547 serial_driver->init_termios.c_cflag =
3548 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 3548 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
3549 serial_driver->init_termios.c_ispeed = 9600;
3550 serial_driver->init_termios.c_ospeed = 9600;
3549 serial_driver->flags = TTY_DRIVER_REAL_RAW; 3551 serial_driver->flags = TTY_DRIVER_REAL_RAW;
3550 tty_set_operations(serial_driver, &ops); 3552 tty_set_operations(serial_driver, &ops);
3551 if ((rc = tty_register_driver(serial_driver)) < 0) { 3553 if ((rc = tty_register_driver(serial_driver)) < 0) {
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 20a96ef250be..53e8ccf94fe3 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -519,7 +519,7 @@ static struct tty_driver *serial_driver;
519static int open(struct tty_struct *tty, struct file * filp); 519static int open(struct tty_struct *tty, struct file * filp);
520static void close(struct tty_struct *tty, struct file * filp); 520static void close(struct tty_struct *tty, struct file * filp);
521static void hangup(struct tty_struct *tty); 521static void hangup(struct tty_struct *tty);
522static void set_termios(struct tty_struct *tty, struct termios *old_termios); 522static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
523 523
524static int write(struct tty_struct *tty, const unsigned char *buf, int count); 524static int write(struct tty_struct *tty, const unsigned char *buf, int count);
525static void put_char(struct tty_struct *tty, unsigned char ch); 525static void put_char(struct tty_struct *tty, unsigned char ch);
@@ -918,7 +918,7 @@ static void hangup(struct tty_struct *tty)
918 918
919/* Set new termios settings 919/* Set new termios settings
920 */ 920 */
921static void set_termios(struct tty_struct *tty, struct termios *old_termios) 921static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)
922{ 922{
923 SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; 923 SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
924 unsigned long flags; 924 unsigned long flags;
@@ -4034,6 +4034,8 @@ static int __init synclinkmp_init(void)
4034 serial_driver->init_termios = tty_std_termios; 4034 serial_driver->init_termios = tty_std_termios;
4035 serial_driver->init_termios.c_cflag = 4035 serial_driver->init_termios.c_cflag =
4036 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 4036 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
4037 serial_driver->init_termios.c_ispeed = 9600;
4038 serial_driver->init_termios.c_ospeed = 9600;
4037 serial_driver->flags = TTY_DRIVER_REAL_RAW; 4039 serial_driver->flags = TTY_DRIVER_REAL_RAW;
4038 tty_set_operations(serial_driver, &ops); 4040 tty_set_operations(serial_driver, &ops);
4039 if ((rc = tty_register_driver(serial_driver)) < 0) { 4041 if ((rc = tty_register_driver(serial_driver)) < 0) {
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 0ffba4e911ca..30486df9fd3f 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -495,8 +495,8 @@ static int get_sgttyb(struct tty_struct * tty, struct sgttyb __user * sgttyb)
495 struct sgttyb tmp; 495 struct sgttyb tmp;
496 496
497 mutex_lock(&tty->termios_mutex); 497 mutex_lock(&tty->termios_mutex);
498 tmp.sg_ispeed = tty->c_ispeed; 498 tmp.sg_ispeed = tty->termios->c_ispeed;
499 tmp.sg_ospeed = tty->c_ospeed; 499 tmp.sg_ospeed = tty->termios->c_ospeed;
500 tmp.sg_erase = tty->termios->c_cc[VERASE]; 500 tmp.sg_erase = tty->termios->c_cc[VERASE];
501 tmp.sg_kill = tty->termios->c_cc[VKILL]; 501 tmp.sg_kill = tty->termios->c_cc[VKILL];
502 tmp.sg_flags = get_sgflags(tty); 502 tmp.sg_flags = get_sgflags(tty);
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
index d0b94dd1af6d..e01317cb1a0e 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/char/vme_scc.c
@@ -153,6 +153,8 @@ static int scc_init_drivers(void)
153 scc_driver->init_termios = tty_std_termios; 153 scc_driver->init_termios = tty_std_termios;
154 scc_driver->init_termios.c_cflag = 154 scc_driver->init_termios.c_cflag =
155 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 155 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
156 scc_driver->init_termios.c_ispeed = 9600;
157 scc_driver->init_termios.c_ospeed = 9600;
156 scc_driver->flags = TTY_DRIVER_REAL_RAW; 158 scc_driver->flags = TTY_DRIVER_REAL_RAW;
157 tty_set_operations(scc_driver, &scc_ops); 159 tty_set_operations(scc_driver, &scc_ops);
158 160
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 787a630a8e56..0475a54df83a 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1203,7 +1203,7 @@ static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1203 return error; 1203 return error;
1204} 1204}
1205 1205
1206static void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old) 1206static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
1207{ 1207{
1208#ifdef _DEBUG_TTYFUNCS 1208#ifdef _DEBUG_TTYFUNCS
1209 printk(KERN_DEBUG "capinc_tty_set_termios\n"); 1209 printk(KERN_DEBUG "capinc_tty_set_termios\n");
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 7edea015867e..458b6462f937 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -127,7 +127,7 @@ static int if_write_room(struct tty_struct *tty);
127static int if_chars_in_buffer(struct tty_struct *tty); 127static int if_chars_in_buffer(struct tty_struct *tty);
128static void if_throttle(struct tty_struct *tty); 128static void if_throttle(struct tty_struct *tty);
129static void if_unthrottle(struct tty_struct *tty); 129static void if_unthrottle(struct tty_struct *tty);
130static void if_set_termios(struct tty_struct *tty, struct termios *old); 130static void if_set_termios(struct tty_struct *tty, struct ktermios *old);
131static int if_tiocmget(struct tty_struct *tty, struct file *file); 131static int if_tiocmget(struct tty_struct *tty, struct file *file);
132static int if_tiocmset(struct tty_struct *tty, struct file *file, 132static int if_tiocmset(struct tty_struct *tty, struct file *file,
133 unsigned int set, unsigned int clear); 133 unsigned int set, unsigned int clear);
@@ -490,7 +490,7 @@ static void if_unthrottle(struct tty_struct *tty)
490 mutex_unlock(&cs->mutex); 490 mutex_unlock(&cs->mutex);
491} 491}
492 492
493static void if_set_termios(struct tty_struct *tty, struct termios *old) 493static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
494{ 494{
495 struct cardstate *cs; 495 struct cardstate *cs;
496 unsigned int iflag; 496 unsigned int iflag;
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 2b91bb07fc7f..fc80afe555b9 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1464,7 +1464,7 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
1464} 1464}
1465 1465
1466static void 1466static void
1467isdn_tty_set_termios(struct tty_struct *tty, struct termios *old_termios) 1467isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1468{ 1468{
1469 modem_info *info = (modem_info *) tty->driver_data; 1469 modem_info *info = (modem_info *) tty->driver_data;
1470 1470
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index 6a98b7ae4975..ad1857364d51 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -117,7 +117,7 @@ static int irtty_change_speed(struct sir_dev *dev, unsigned speed)
117{ 117{
118 struct sirtty_cb *priv = dev->priv; 118 struct sirtty_cb *priv = dev->priv;
119 struct tty_struct *tty; 119 struct tty_struct *tty;
120 struct termios old_termios; 120 struct ktermios old_termios;
121 int cflag; 121 int cflag;
122 122
123 IRDA_ASSERT(priv != NULL, return -1;); 123 IRDA_ASSERT(priv != NULL, return -1;);
@@ -318,7 +318,7 @@ static void irtty_write_wakeup(struct tty_struct *tty)
318 318
319static inline void irtty_stop_receiver(struct tty_struct *tty, int stop) 319static inline void irtty_stop_receiver(struct tty_struct *tty, int stop)
320{ 320{
321 struct termios old_termios; 321 struct ktermios old_termios;
322 int cflag; 322 int cflag;
323 323
324 lock_kernel(); 324 lock_kernel();
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index 6f43e04dbefd..2d173e5c8a09 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -60,8 +60,6 @@ static unsigned short int sclp_tty_chars_count;
60 60
61struct tty_driver *sclp_tty_driver; 61struct tty_driver *sclp_tty_driver;
62 62
63extern struct termios tty_std_termios;
64
65static struct sclp_ioctls sclp_ioctls; 63static struct sclp_ioctls sclp_ioctls;
66static struct sclp_ioctls sclp_ioctls_init = 64static struct sclp_ioctls sclp_ioctls_init =
67{ 65{
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index 4717c3611601..09844621edc0 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -1659,7 +1659,7 @@ tty3270_flush_buffer(struct tty_struct *tty)
1659 * Check for visible/invisible input switches 1659 * Check for visible/invisible input switches
1660 */ 1660 */
1661static void 1661static void
1662tty3270_set_termios(struct tty_struct *tty, struct termios *old) 1662tty3270_set_termios(struct tty_struct *tty, struct ktermios *old)
1663{ 1663{
1664 struct tty3270 *tp; 1664 struct tty3270 *tp;
1665 int new; 1665 int new;
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c
index 6a1a568ca649..facb67855619 100644
--- a/drivers/serial/21285.c
+++ b/drivers/serial/21285.c
@@ -214,8 +214,8 @@ static void serial21285_shutdown(struct uart_port *port)
214} 214}
215 215
216static void 216static void
217serial21285_set_termios(struct uart_port *port, struct termios *termios, 217serial21285_set_termios(struct uart_port *port, struct ktermios *termios,
218 struct termios *old) 218 struct ktermios *old)
219{ 219{
220 unsigned long flags; 220 unsigned long flags;
221 unsigned int baud, quot, h_lcr; 221 unsigned int baud, quot, h_lcr;
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c
index 9b8b585513ec..cad426c9711e 100644
--- a/drivers/serial/68328serial.c
+++ b/drivers/serial/68328serial.c
@@ -1061,7 +1061,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1061 return 0; 1061 return 0;
1062} 1062}
1063 1063
1064static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios) 1064static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1065{ 1065{
1066 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; 1066 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
1067 1067
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index 634ecca36a77..68817a7d8c0d 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -1523,7 +1523,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
1523 1523
1524/* FIX UP modem control here someday...... 1524/* FIX UP modem control here someday......
1525*/ 1525*/
1526static void rs_360_set_termios(struct tty_struct *tty, struct termios *old_termios) 1526static void rs_360_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1527{ 1527{
1528 ser_info_t *info = (ser_info_t *)tty->driver_data; 1528 ser_info_t *info = (ser_info_t *)tty->driver_data;
1529 1529
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index e34bd03cfce7..51f3c739f7e1 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1763,8 +1763,8 @@ static unsigned int serial8250_get_divisor(struct uart_port *port, unsigned int
1763} 1763}
1764 1764
1765static void 1765static void
1766serial8250_set_termios(struct uart_port *port, struct termios *termios, 1766serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
1767 struct termios *old) 1767 struct ktermios *old)
1768{ 1768{
1769 struct uart_8250_port *up = (struct uart_8250_port *)port; 1769 struct uart_8250_port *up = (struct uart_8250_port *)port;
1770 unsigned char cval, fcr = 0; 1770 unsigned char cval, fcr = 0;
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 4d3626ef4643..61db6973755a 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -345,8 +345,8 @@ static void pl010_shutdown(struct uart_port *port)
345} 345}
346 346
347static void 347static void
348pl010_set_termios(struct uart_port *port, struct termios *termios, 348pl010_set_termios(struct uart_port *port, struct ktermios *termios,
349 struct termios *old) 349 struct ktermios *old)
350{ 350{
351 unsigned int lcr_h, old_cr; 351 unsigned int lcr_h, old_cr;
352 unsigned long flags; 352 unsigned long flags;
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index d503625730df..9a3b374b2a08 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -412,8 +412,8 @@ static void pl011_shutdown(struct uart_port *port)
412} 412}
413 413
414static void 414static void
415pl011_set_termios(struct uart_port *port, struct termios *termios, 415pl011_set_termios(struct uart_port *port, struct ktermios *termios,
416 struct termios *old) 416 struct ktermios *old)
417{ 417{
418 unsigned int lcr_h, old_cr; 418 unsigned int lcr_h, old_cr;
419 unsigned long flags; 419 unsigned long flags;
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 9217ee6c7865..ed7f7209ea59 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -478,7 +478,7 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state, unsigned
478/* 478/*
479 * Change the port parameters 479 * Change the port parameters
480 */ 480 */
481static void atmel_set_termios(struct uart_port *port, struct termios * termios, struct termios * old) 481static void atmel_set_termios(struct uart_port *port, struct ktermios * termios, struct ktermios * old)
482{ 482{
483 unsigned long flags; 483 unsigned long flags;
484 unsigned int mode, imr, quot, baud; 484 unsigned int mode, imr, quot, baud;
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
index 598012714882..23827189ec0e 100644
--- a/drivers/serial/clps711x.c
+++ b/drivers/serial/clps711x.c
@@ -286,8 +286,8 @@ static void clps711xuart_shutdown(struct uart_port *port)
286} 286}
287 287
288static void 288static void
289clps711xuart_set_termios(struct uart_port *port, struct termios *termios, 289clps711xuart_set_termios(struct uart_port *port, struct ktermios *termios,
290 struct termios *old) 290 struct ktermios *old)
291{ 291{
292 unsigned int ubrlcr, baud, quot; 292 unsigned int ubrlcr, baud, quot;
293 unsigned long flags; 293 unsigned long flags;
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 7a24e53546c7..42b050c46abe 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -804,8 +804,8 @@ static struct e100_serial rs_table[] = {
804 804
805#define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial)) 805#define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial))
806 806
807static struct termios *serial_termios[NR_PORTS]; 807static struct ktermios *serial_termios[NR_PORTS];
808static struct termios *serial_termios_locked[NR_PORTS]; 808static struct ktermios *serial_termios_locked[NR_PORTS];
809#ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER 809#ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
810static struct fast_timer fast_timers[NR_PORTS]; 810static struct fast_timer fast_timers[NR_PORTS];
811#endif 811#endif
@@ -4223,7 +4223,7 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
4223} 4223}
4224 4224
4225static void 4225static void
4226rs_set_termios(struct tty_struct *tty, struct termios *old_termios) 4226rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
4227{ 4227{
4228 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 4228 struct e100_serial *info = (struct e100_serial *)tty->driver_data;
4229 4229
@@ -4877,6 +4877,8 @@ rs_init(void)
4877 driver->init_termios = tty_std_termios; 4877 driver->init_termios = tty_std_termios;
4878 driver->init_termios.c_cflag = 4878 driver->init_termios.c_cflag =
4879 B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */ 4879 B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
4880 driver->init_termios.c_ispeed = 115200;
4881 driver->init_termios.c_ospeed = 115200;
4880 driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; 4882 driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
4881 driver->termios = serial_termios; 4883 driver->termios = serial_termios;
4882 driver->termios_locked = serial_termios_locked; 4884 driver->termios_locked = serial_termios_locked;
diff --git a/drivers/serial/crisv10.h b/drivers/serial/crisv10.h
index f30b93d6ef79..4a23340663aa 100644
--- a/drivers/serial/crisv10.h
+++ b/drivers/serial/crisv10.h
@@ -93,8 +93,8 @@ struct e100_serial {
93 93
94 struct work_struct work; 94 struct work_struct work;
95 struct async_icount icount; /* error-statistics etc.*/ 95 struct async_icount icount; /* error-statistics etc.*/
96 struct termios normal_termios; 96 struct ktermios normal_termios;
97 struct termios callout_termios; 97 struct ktermios callout_termios;
98#ifdef DECLARE_WAITQUEUE 98#ifdef DECLARE_WAITQUEUE
99 wait_queue_head_t open_wait; 99 wait_queue_head_t open_wait;
100 wait_queue_head_t close_wait; 100 wait_queue_head_t close_wait;
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index af1544f3356f..587d87b9eb3c 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -461,8 +461,8 @@ static void dz_break_ctl(struct uart_port *uport, int break_state)
461 spin_unlock_irqrestore(&uport->lock, flags); 461 spin_unlock_irqrestore(&uport->lock, flags);
462} 462}
463 463
464static void dz_set_termios(struct uart_port *uport, struct termios *termios, 464static void dz_set_termios(struct uart_port *uport, struct ktermios *termios,
465 struct termios *old_termios) 465 struct ktermios *old_termios)
466{ 466{
467 struct dz_port *dport = (struct dz_port *)uport; 467 struct dz_port *dport = (struct dz_port *)uport;
468 unsigned long flags; 468 unsigned long flags;
diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c
index 8aa0f641866b..7d623003e65e 100644
--- a/drivers/serial/icom.c
+++ b/drivers/serial/icom.c
@@ -1087,8 +1087,8 @@ static void icom_close(struct uart_port *port)
1087} 1087}
1088 1088
1089static void icom_set_termios(struct uart_port *port, 1089static void icom_set_termios(struct uart_port *port,
1090 struct termios *termios, 1090 struct ktermios *termios,
1091 struct termios *old_termios) 1091 struct ktermios *old_termios)
1092{ 1092{
1093 int baud; 1093 int baud;
1094 unsigned cflag, iflag; 1094 unsigned cflag, iflag;
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index ee5c782597dd..e216dcf29376 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -459,8 +459,8 @@ static void imx_shutdown(struct uart_port *port)
459} 459}
460 460
461static void 461static void
462imx_set_termios(struct uart_port *port, struct termios *termios, 462imx_set_termios(struct uart_port *port, struct ktermios *termios,
463 struct termios *old) 463 struct ktermios *old)
464{ 464{
465 struct imx_port *sport = (struct imx_port *)port; 465 struct imx_port *sport = (struct imx_port *)port;
466 unsigned long flags; 466 unsigned long flags;
diff --git a/drivers/serial/ioc3_serial.c b/drivers/serial/ioc3_serial.c
index 2308d26c8629..9cc0be932316 100644
--- a/drivers/serial/ioc3_serial.c
+++ b/drivers/serial/ioc3_serial.c
@@ -950,7 +950,7 @@ static void transmit_chars(struct uart_port *the_port)
950 */ 950 */
951static void 951static void
952ioc3_change_speed(struct uart_port *the_port, 952ioc3_change_speed(struct uart_port *the_port,
953 struct termios *new_termios, struct termios *old_termios) 953 struct ktermios *new_termios, struct ktermios *old_termios)
954{ 954{
955 struct ioc3_port *port = get_ioc3_port(the_port); 955 struct ioc3_port *port = get_ioc3_port(the_port);
956 unsigned int cflag; 956 unsigned int cflag;
@@ -1853,7 +1853,7 @@ static int ic3_startup(struct uart_port *the_port)
1853 */ 1853 */
1854static void 1854static void
1855ic3_set_termios(struct uart_port *the_port, 1855ic3_set_termios(struct uart_port *the_port,
1856 struct termios *termios, struct termios *old_termios) 1856 struct ktermios *termios, struct ktermios *old_termios)
1857{ 1857{
1858 unsigned long port_flags; 1858 unsigned long port_flags;
1859 1859
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index 711bd1511439..c862f67c985a 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -1681,7 +1681,7 @@ static void transmit_chars(struct uart_port *the_port)
1681 */ 1681 */
1682static void 1682static void
1683ioc4_change_speed(struct uart_port *the_port, 1683ioc4_change_speed(struct uart_port *the_port,
1684 struct termios *new_termios, struct termios *old_termios) 1684 struct ktermios *new_termios, struct ktermios *old_termios)
1685{ 1685{
1686 struct ioc4_port *port = get_ioc4_port(the_port, 0); 1686 struct ioc4_port *port = get_ioc4_port(the_port, 0);
1687 int baud, bits; 1687 int baud, bits;
@@ -1802,7 +1802,7 @@ static inline int ic4_startup_local(struct uart_port *the_port)
1802 ioc4_set_proto(port, the_port->mapbase); 1802 ioc4_set_proto(port, the_port->mapbase);
1803 1803
1804 /* set the speed of the serial port */ 1804 /* set the speed of the serial port */
1805 ioc4_change_speed(the_port, info->tty->termios, (struct termios *)0); 1805 ioc4_change_speed(the_port, info->tty->termios, (struct ktermios *)0);
1806 1806
1807 return 0; 1807 return 0;
1808} 1808}
@@ -2570,7 +2570,7 @@ static int ic4_startup(struct uart_port *the_port)
2570 */ 2570 */
2571static void 2571static void
2572ic4_set_termios(struct uart_port *the_port, 2572ic4_set_termios(struct uart_port *the_port,
2573 struct termios *termios, struct termios *old_termios) 2573 struct ktermios *termios, struct ktermios *old_termios)
2574{ 2574{
2575 unsigned long port_flags; 2575 unsigned long port_flags;
2576 2576
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index dca6c1bde8f9..0746c9446ae0 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -840,8 +840,8 @@ ip22zilog_convert_to_zs(struct uart_ip22zilog_port *up, unsigned int cflag,
840 840
841/* The port lock is not held. */ 841/* The port lock is not held. */
842static void 842static void
843ip22zilog_set_termios(struct uart_port *port, struct termios *termios, 843ip22zilog_set_termios(struct uart_port *port, struct ktermios *termios,
844 struct termios *old) 844 struct ktermios *old)
845{ 845{
846 struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port; 846 struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port;
847 unsigned long flags; 847 unsigned long flags;
diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c
index f8262e6ad8d3..7cf1c60027f8 100644
--- a/drivers/serial/jsm/jsm_tty.c
+++ b/drivers/serial/jsm/jsm_tty.c
@@ -142,7 +142,7 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch)
142{ 142{
143 unsigned long lock_flags; 143 unsigned long lock_flags;
144 struct jsm_channel *channel = (struct jsm_channel *)port; 144 struct jsm_channel *channel = (struct jsm_channel *)port;
145 struct termios *termios; 145 struct ktermios *termios;
146 146
147 spin_lock_irqsave(&port->lock, lock_flags); 147 spin_lock_irqsave(&port->lock, lock_flags);
148 termios = port->info->tty->termios; 148 termios = port->info->tty->termios;
@@ -180,7 +180,7 @@ static int jsm_tty_open(struct uart_port *port)
180 struct jsm_board *brd; 180 struct jsm_board *brd;
181 int rc = 0; 181 int rc = 0;
182 struct jsm_channel *channel = (struct jsm_channel *)port; 182 struct jsm_channel *channel = (struct jsm_channel *)port;
183 struct termios *termios; 183 struct ktermios *termios;
184 184
185 /* Get board pointer from our array of majors we have allocated */ 185 /* Get board pointer from our array of majors we have allocated */
186 brd = channel->ch_bd; 186 brd = channel->ch_bd;
@@ -269,7 +269,7 @@ static int jsm_tty_open(struct uart_port *port)
269static void jsm_tty_close(struct uart_port *port) 269static void jsm_tty_close(struct uart_port *port)
270{ 270{
271 struct jsm_board *bd; 271 struct jsm_board *bd;
272 struct termios *ts; 272 struct ktermios *ts;
273 struct jsm_channel *channel = (struct jsm_channel *)port; 273 struct jsm_channel *channel = (struct jsm_channel *)port;
274 274
275 jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n"); 275 jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n");
@@ -302,8 +302,8 @@ static void jsm_tty_close(struct uart_port *port)
302} 302}
303 303
304static void jsm_tty_set_termios(struct uart_port *port, 304static void jsm_tty_set_termios(struct uart_port *port,
305 struct termios *termios, 305 struct ktermios *termios,
306 struct termios *old_termios) 306 struct ktermios *old_termios)
307{ 307{
308 unsigned long lock_flags; 308 unsigned long lock_flags;
309 struct jsm_channel *channel = (struct jsm_channel *)port; 309 struct jsm_channel *channel = (struct jsm_channel *)port;
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
index 7656a35f5e2f..6e09c8b395e8 100644
--- a/drivers/serial/m32r_sio.c
+++ b/drivers/serial/m32r_sio.c
@@ -699,7 +699,7 @@ static unsigned int m32r_sio_get_divisor(struct uart_port *port,
699} 699}
700 700
701static void m32r_sio_set_termios(struct uart_port *port, 701static void m32r_sio_set_termios(struct uart_port *port,
702 struct termios *termios, struct termios *old) 702 struct ktermios *termios, struct ktermios *old)
703{ 703{
704 struct uart_sio_port *up = (struct uart_sio_port *)port; 704 struct uart_sio_port *up = (struct uart_sio_port *)port;
705 unsigned char cval = 0; 705 unsigned char cval = 0;
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index 3db206d29b33..08430961a895 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -1132,7 +1132,7 @@ static int mcfrs_ioctl(struct tty_struct *tty, struct file * file,
1132 return 0; 1132 return 0;
1133} 1133}
1134 1134
1135static void mcfrs_set_termios(struct tty_struct *tty, struct termios *old_termios) 1135static void mcfrs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1136{ 1136{
1137 struct mcf_serial *info = (struct mcf_serial *)tty->driver_data; 1137 struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
1138 1138
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 6dd579ed9777..9d11a75663e6 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -270,8 +270,8 @@ mpc52xx_uart_shutdown(struct uart_port *port)
270} 270}
271 271
272static void 272static void
273mpc52xx_uart_set_termios(struct uart_port *port, struct termios *new, 273mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
274 struct termios *old) 274 struct ktermios *old)
275{ 275{
276 struct mpc52xx_psc __iomem *psc = PSC(port); 276 struct mpc52xx_psc __iomem *psc = PSC(port);
277 unsigned long flags; 277 unsigned long flags;
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index 29823bd60fb0..3d2fcc57b1ce 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -1440,8 +1440,8 @@ mpsc_shutdown(struct uart_port *port)
1440} 1440}
1441 1441
1442static void 1442static void
1443mpsc_set_termios(struct uart_port *port, struct termios *termios, 1443mpsc_set_termios(struct uart_port *port, struct ktermios *termios,
1444 struct termios *old) 1444 struct ktermios *old)
1445{ 1445{
1446 struct mpsc_port_info *pi = (struct mpsc_port_info *)port; 1446 struct mpsc_port_info *pi = (struct mpsc_port_info *)port;
1447 u32 baud; 1447 u32 baud;
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c
index 8ad1b8c5ec5d..ccb8fa1800a5 100644
--- a/drivers/serial/mux.c
+++ b/drivers/serial/mux.c
@@ -273,8 +273,8 @@ static void mux_shutdown(struct uart_port *port)
273 * The Serial Mux does not support this function. 273 * The Serial Mux does not support this function.
274 */ 274 */
275static void 275static void
276mux_set_termios(struct uart_port *port, struct termios *termios, 276mux_set_termios(struct uart_port *port, struct ktermios *termios,
277 struct termios *old) 277 struct ktermios *old)
278{ 278{
279} 279}
280 280
diff --git a/drivers/serial/netx-serial.c b/drivers/serial/netx-serial.c
index 062bad457b1a..b56f7db45031 100644
--- a/drivers/serial/netx-serial.c
+++ b/drivers/serial/netx-serial.c
@@ -337,8 +337,8 @@ static void netx_shutdown(struct uart_port *port)
337} 337}
338 338
339static void 339static void
340netx_set_termios(struct uart_port *port, struct termios *termios, 340netx_set_termios(struct uart_port *port, struct ktermios *termios,
341 struct termios *old) 341 struct ktermios *old)
342{ 342{
343 unsigned int baud, quot; 343 unsigned int baud, quot;
344 unsigned char old_cr; 344 unsigned char old_cr;
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index bf9809ed9c0b..752ef07516b9 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -1262,8 +1262,8 @@ static void pmz_irda_setup(struct uart_pmac_port *uap, unsigned long *baud)
1262} 1262}
1263 1263
1264 1264
1265static void __pmz_set_termios(struct uart_port *port, struct termios *termios, 1265static void __pmz_set_termios(struct uart_port *port, struct ktermios *termios,
1266 struct termios *old) 1266 struct ktermios *old)
1267{ 1267{
1268 struct uart_pmac_port *uap = to_pmz(port); 1268 struct uart_pmac_port *uap = to_pmz(port);
1269 unsigned long baud; 1269 unsigned long baud;
@@ -1273,7 +1273,7 @@ static void __pmz_set_termios(struct uart_port *port, struct termios *termios,
1273 if (ZS_IS_ASLEEP(uap)) 1273 if (ZS_IS_ASLEEP(uap))
1274 return; 1274 return;
1275 1275
1276 memcpy(&uap->termios_cache, termios, sizeof(struct termios)); 1276 memcpy(&uap->termios_cache, termios, sizeof(struct ktermios));
1277 1277
1278 /* XXX Check which revs of machines actually allow 1 and 4Mb speeds 1278 /* XXX Check which revs of machines actually allow 1 and 4Mb speeds
1279 * on the IR dongle. Note that the IRTTY driver currently doesn't know 1279 * on the IR dongle. Note that the IRTTY driver currently doesn't know
@@ -1313,8 +1313,8 @@ static void __pmz_set_termios(struct uart_port *port, struct termios *termios,
1313} 1313}
1314 1314
1315/* The port lock is not held. */ 1315/* The port lock is not held. */
1316static void pmz_set_termios(struct uart_port *port, struct termios *termios, 1316static void pmz_set_termios(struct uart_port *port, struct ktermios *termios,
1317 struct termios *old) 1317 struct ktermios *old)
1318{ 1318{
1319 struct uart_pmac_port *uap = to_pmz(port); 1319 struct uart_pmac_port *uap = to_pmz(port);
1320 unsigned long flags; 1320 unsigned long flags;
diff --git a/drivers/serial/pmac_zilog.h b/drivers/serial/pmac_zilog.h
index c03f9bfacdd8..570b0d925e83 100644
--- a/drivers/serial/pmac_zilog.h
+++ b/drivers/serial/pmac_zilog.h
@@ -60,7 +60,7 @@ struct uart_pmac_port {
60 volatile struct dbdma_regs __iomem *tx_dma_regs; 60 volatile struct dbdma_regs __iomem *tx_dma_regs;
61 volatile struct dbdma_regs __iomem *rx_dma_regs; 61 volatile struct dbdma_regs __iomem *rx_dma_regs;
62 62
63 struct termios termios_cache; 63 struct ktermios termios_cache;
64}; 64};
65 65
66#define to_pmz(p) ((struct uart_pmac_port *)(p)) 66#define to_pmz(p) ((struct uart_pmac_port *)(p))
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 415fe9633a9b..d403aaa55092 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -433,8 +433,8 @@ static void serial_pxa_shutdown(struct uart_port *port)
433} 433}
434 434
435static void 435static void
436serial_pxa_set_termios(struct uart_port *port, struct termios *termios, 436serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
437 struct termios *old) 437 struct ktermios *old)
438{ 438{
439 struct uart_pxa_port *up = (struct uart_pxa_port *)port; 439 struct uart_pxa_port *up = (struct uart_pxa_port *)port;
440 unsigned char cval, fcr = 0; 440 unsigned char cval, fcr = 0;
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 8dfc2dd058ca..3ba9208ebd0c 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -738,8 +738,8 @@ static unsigned int s3c24xx_serial_getclk(struct uart_port *port,
738} 738}
739 739
740static void s3c24xx_serial_set_termios(struct uart_port *port, 740static void s3c24xx_serial_set_termios(struct uart_port *port,
741 struct termios *termios, 741 struct ktermios *termios,
742 struct termios *old) 742 struct ktermios *old)
743{ 743{
744 struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); 744 struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
745 struct s3c24xx_uart_port *ourport = to_ourport(port); 745 struct s3c24xx_uart_port *ourport = to_ourport(port);
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index d4065266b6fc..58a83c27e14b 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -408,8 +408,8 @@ static void sa1100_shutdown(struct uart_port *port)
408} 408}
409 409
410static void 410static void
411sa1100_set_termios(struct uart_port *port, struct termios *termios, 411sa1100_set_termios(struct uart_port *port, struct ktermios *termios,
412 struct termios *old) 412 struct ktermios *old)
413{ 413{
414 struct sa1100_port *sport = (struct sa1100_port *)port; 414 struct sa1100_port *sport = (struct sa1100_port *)port;
415 unsigned long flags; 415 unsigned long flags;
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index c67b05e9a451..f84982e508c7 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -65,7 +65,7 @@ static struct lock_class_key port_lock_key;
65#define uart_console(port) (0) 65#define uart_console(port) (0)
66#endif 66#endif
67 67
68static void uart_change_speed(struct uart_state *state, struct termios *old_termios); 68static void uart_change_speed(struct uart_state *state, struct ktermios *old_termios);
69static void uart_wait_until_sent(struct tty_struct *tty, int timeout); 69static void uart_wait_until_sent(struct tty_struct *tty, int timeout);
70static void uart_change_pm(struct uart_state *state, int pm_state); 70static void uart_change_pm(struct uart_state *state, int pm_state);
71 71
@@ -338,8 +338,8 @@ EXPORT_SYMBOL(uart_update_timeout);
338 * we're actually going to be using. 338 * we're actually going to be using.
339 */ 339 */
340unsigned int 340unsigned int
341uart_get_baud_rate(struct uart_port *port, struct termios *termios, 341uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
342 struct termios *old, unsigned int min, unsigned int max) 342 struct ktermios *old, unsigned int min, unsigned int max)
343{ 343{
344 unsigned int try, baud, altbaud = 38400; 344 unsigned int try, baud, altbaud = 38400;
345 upf_t flags = port->flags & UPF_SPD_MASK; 345 upf_t flags = port->flags & UPF_SPD_MASK;
@@ -421,11 +421,11 @@ uart_get_divisor(struct uart_port *port, unsigned int baud)
421EXPORT_SYMBOL(uart_get_divisor); 421EXPORT_SYMBOL(uart_get_divisor);
422 422
423static void 423static void
424uart_change_speed(struct uart_state *state, struct termios *old_termios) 424uart_change_speed(struct uart_state *state, struct ktermios *old_termios)
425{ 425{
426 struct tty_struct *tty = state->info->tty; 426 struct tty_struct *tty = state->info->tty;
427 struct uart_port *port = state->port; 427 struct uart_port *port = state->port;
428 struct termios *termios; 428 struct ktermios *termios;
429 429
430 /* 430 /*
431 * If we have no tty, termios, or the port does not exist, 431 * If we have no tty, termios, or the port does not exist,
@@ -1139,7 +1139,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
1139 return ret; 1139 return ret;
1140} 1140}
1141 1141
1142static void uart_set_termios(struct tty_struct *tty, struct termios *old_termios) 1142static void uart_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1143{ 1143{
1144 struct uart_state *state = tty->driver_data; 1144 struct uart_state *state = tty->driver_data;
1145 unsigned long flags; 1145 unsigned long flags;
@@ -1866,7 +1866,7 @@ int __init
1866uart_set_options(struct uart_port *port, struct console *co, 1866uart_set_options(struct uart_port *port, struct console *co,
1867 int baud, int parity, int bits, int flow) 1867 int baud, int parity, int bits, int flow)
1868{ 1868{
1869 struct termios termios; 1869 struct ktermios termios;
1870 int i; 1870 int i;
1871 1871
1872 /* 1872 /*
@@ -1876,7 +1876,7 @@ uart_set_options(struct uart_port *port, struct console *co,
1876 spin_lock_init(&port->lock); 1876 spin_lock_init(&port->lock);
1877 lockdep_set_class(&port->lock, &port_lock_key); 1877 lockdep_set_class(&port->lock, &port_lock_key);
1878 1878
1879 memset(&termios, 0, sizeof(struct termios)); 1879 memset(&termios, 0, sizeof(struct ktermios));
1880 1880
1881 termios.c_cflag = CREAD | HUPCL | CLOCAL; 1881 termios.c_cflag = CREAD | HUPCL | CLOCAL;
1882 1882
@@ -1991,12 +1991,12 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
1991 * Re-enable the console device after suspending. 1991 * Re-enable the console device after suspending.
1992 */ 1992 */
1993 if (uart_console(port)) { 1993 if (uart_console(port)) {
1994 struct termios termios; 1994 struct ktermios termios;
1995 1995
1996 /* 1996 /*
1997 * First try to use the console cflag setting. 1997 * First try to use the console cflag setting.
1998 */ 1998 */
1999 memset(&termios, 0, sizeof(struct termios)); 1999 memset(&termios, 0, sizeof(struct ktermios));
2000 termios.c_cflag = port->cons->cflag; 2000 termios.c_cflag = port->cons->cflag;
2001 2001
2002 /* 2002 /*
@@ -2189,6 +2189,7 @@ int uart_register_driver(struct uart_driver *drv)
2189 normal->subtype = SERIAL_TYPE_NORMAL; 2189 normal->subtype = SERIAL_TYPE_NORMAL;
2190 normal->init_termios = tty_std_termios; 2190 normal->init_termios = tty_std_termios;
2191 normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; 2191 normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
2192 normal->init_termios.c_ispeed = normal->init_termios.c_ospeed = 9600;
2192 normal->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; 2193 normal->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
2193 normal->driver_state = drv; 2194 normal->driver_state = drv;
2194 tty_set_operations(normal, &uart_ops); 2195 tty_set_operations(normal, &uart_ops);
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c
index 5e1ac356bbb0..eb18d429752d 100644
--- a/drivers/serial/serial_lh7a40x.c
+++ b/drivers/serial/serial_lh7a40x.c
@@ -348,8 +348,8 @@ static void lh7a40xuart_shutdown (struct uart_port* port)
348} 348}
349 349
350static void lh7a40xuart_set_termios (struct uart_port* port, 350static void lh7a40xuart_set_termios (struct uart_port* port,
351 struct termios* termios, 351 struct ktermios* termios,
352 struct termios* old) 352 struct ktermios* old)
353{ 353{
354 unsigned int con; 354 unsigned int con;
355 unsigned int inten; 355 unsigned int inten;
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c
index 2a48289ac722..7186a82c4759 100644
--- a/drivers/serial/serial_txx9.c
+++ b/drivers/serial/serial_txx9.c
@@ -556,8 +556,8 @@ static void serial_txx9_shutdown(struct uart_port *port)
556} 556}
557 557
558static void 558static void
559serial_txx9_set_termios(struct uart_port *port, struct termios *termios, 559serial_txx9_set_termios(struct uart_port *port, struct ktermios *termios,
560 struct termios *old) 560 struct ktermios *old)
561{ 561{
562 struct uart_txx9_port *up = (struct uart_txx9_port *)port; 562 struct uart_txx9_port *up = (struct uart_txx9_port *)port;
563 unsigned int cval, fcr = 0; 563 unsigned int cval, fcr = 0;
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 3b5f19ec2126..9031b57f12dd 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -943,8 +943,8 @@ static void sci_shutdown(struct uart_port *port)
943 s->disable(port); 943 s->disable(port);
944} 944}
945 945
946static void sci_set_termios(struct uart_port *port, struct termios *termios, 946static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
947 struct termios *old) 947 struct ktermios *old)
948{ 948{
949 struct sci_port *s = &sci_ports[port->line]; 949 struct sci_port *s = &sci_ports[port->line];
950 unsigned int status, baud, smr_val; 950 unsigned int status, baud, smr_val;
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c
index 956b2cf08e1e..253ceb895ca7 100644
--- a/drivers/serial/sn_console.c
+++ b/drivers/serial/sn_console.c
@@ -361,8 +361,8 @@ static int snp_startup(struct uart_port *port)
361 * 361 *
362 */ 362 */
363static void 363static void
364snp_set_termios(struct uart_port *port, struct termios *termios, 364snp_set_termios(struct uart_port *port, struct ktermios *termios,
365 struct termios *old) 365 struct ktermios *old)
366{ 366{
367} 367}
368 368
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index 03941d27d15d..40d48566215c 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -281,8 +281,8 @@ static void sunhv_shutdown(struct uart_port *port)
281} 281}
282 282
283/* port->lock is not held. */ 283/* port->lock is not held. */
284static void sunhv_set_termios(struct uart_port *port, struct termios *termios, 284static void sunhv_set_termios(struct uart_port *port, struct ktermios *termios,
285 struct termios *old) 285 struct ktermios *old)
286{ 286{
287 unsigned int baud = uart_get_baud_rate(port, termios, old, 0, 4000000); 287 unsigned int baud = uart_get_baud_rate(port, termios, old, 0, 4000000);
288 unsigned int quot = uart_get_divisor(port, baud); 288 unsigned int quot = uart_get_divisor(port, baud);
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 08a7cd6a3a0c..493d5bbb661b 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -786,8 +786,8 @@ static void sunsab_convert_to_sab(struct uart_sunsab_port *up, unsigned int cfla
786} 786}
787 787
788/* port->lock is not held. */ 788/* port->lock is not held. */
789static void sunsab_set_termios(struct uart_port *port, struct termios *termios, 789static void sunsab_set_termios(struct uart_port *port, struct ktermios *termios,
790 struct termios *old) 790 struct ktermios *old)
791{ 791{
792 struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; 792 struct uart_sunsab_port *up = (struct uart_sunsab_port *) port;
793 unsigned long flags; 793 unsigned long flags;
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index c577faea60e8..564592b2b2ba 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -893,8 +893,8 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag,
893} 893}
894 894
895static void 895static void
896sunsu_set_termios(struct uart_port *port, struct termios *termios, 896sunsu_set_termios(struct uart_port *port, struct ktermios *termios,
897 struct termios *old) 897 struct ktermios *old)
898{ 898{
899 unsigned int baud, quot; 899 unsigned int baud, quot;
900 900
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index b2cc703b2b9e..75de919a9471 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -922,8 +922,8 @@ sunzilog_convert_to_zs(struct uart_sunzilog_port *up, unsigned int cflag,
922 922
923/* The port lock is not held. */ 923/* The port lock is not held. */
924static void 924static void
925sunzilog_set_termios(struct uart_port *port, struct termios *termios, 925sunzilog_set_termios(struct uart_port *port, struct ktermios *termios,
926 struct termios *old) 926 struct ktermios *old)
927{ 927{
928 struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port; 928 struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
929 unsigned long flags; 929 unsigned long flags;
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 83690653b78b..92eba893559d 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -214,8 +214,8 @@ static void ulite_shutdown(struct uart_port *port)
214 free_irq(port->irq, port); 214 free_irq(port->irq, port);
215} 215}
216 216
217static void ulite_set_termios(struct uart_port *port, struct termios *termios, 217static void ulite_set_termios(struct uart_port *port, struct ktermios *termios,
218 struct termios *old) 218 struct ktermios *old)
219{ 219{
220 unsigned long flags; 220 unsigned long flags;
221 unsigned int baud; 221 unsigned int baud;
diff --git a/drivers/serial/v850e_uart.c b/drivers/serial/v850e_uart.c
index 28f3bbff87bf..dd98aca6ed08 100644
--- a/drivers/serial/v850e_uart.c
+++ b/drivers/serial/v850e_uart.c
@@ -404,8 +404,8 @@ static void v850e_uart_shutdown (struct uart_port *port)
404} 404}
405 405
406static void 406static void
407v850e_uart_set_termios (struct uart_port *port, struct termios *termios, 407v850e_uart_set_termios (struct uart_port *port, struct ktermios *termios,
408 struct termios *old) 408 struct ktermios *old)
409{ 409{
410 unsigned cflags = termios->c_cflag; 410 unsigned cflags = termios->c_cflag;
411 411
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index fd51f8182dec..cf0e663b42ed 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -562,8 +562,8 @@ static void siu_shutdown(struct uart_port *port)
562 free_irq(port->irq, port); 562 free_irq(port->irq, port);
563} 563}
564 564
565static void siu_set_termios(struct uart_port *port, struct termios *new, 565static void siu_set_termios(struct uart_port *port, struct ktermios *new,
566 struct termios *old) 566 struct ktermios *old)
567{ 567{
568 tcflag_t c_cflag, c_iflag; 568 tcflag_t c_cflag, c_iflag;
569 uint8_t lcr, fcr, ier; 569 uint8_t lcr, fcr, ier;
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 792becdfe6f8..fc3197273663 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -1238,7 +1238,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1238 return 0; 1238 return 0;
1239} 1239}
1240 1240
1241static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios) 1241static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1242{ 1242{
1243 struct dec_serial *info = (struct dec_serial *)tty->driver_data; 1243 struct dec_serial *info = (struct dec_serial *)tty->driver_data;
1244 int was_stopped; 1244 int was_stopped;
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 7f1fa956dcdb..98199628e394 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -677,10 +677,10 @@ static const __u8 acm_tty_size[] = {
677 5, 6, 7, 8 677 5, 6, 7, 8
678}; 678};
679 679
680static void acm_tty_set_termios(struct tty_struct *tty, struct termios *termios_old) 680static void acm_tty_set_termios(struct tty_struct *tty, struct ktermios *termios_old)
681{ 681{
682 struct acm *acm = tty->driver_data; 682 struct acm *acm = tty->driver_data;
683 struct termios *termios = tty->termios; 683 struct ktermios *termios = tty->termios;
684 struct usb_cdc_line_coding newline; 684 struct usb_cdc_line_coding newline;
685 int newctrl = acm->ctrlout; 685 int newctrl = acm->ctrlout;
686 686
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 208e55a667ac..5516c59ed5ec 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -200,7 +200,7 @@ static void gs_unthrottle(struct tty_struct * tty);
200static void gs_break(struct tty_struct *tty, int break_state); 200static void gs_break(struct tty_struct *tty, int break_state);
201static int gs_ioctl(struct tty_struct *tty, struct file *file, 201static int gs_ioctl(struct tty_struct *tty, struct file *file,
202 unsigned int cmd, unsigned long arg); 202 unsigned int cmd, unsigned long arg);
203static void gs_set_termios(struct tty_struct *tty, struct termios *old); 203static void gs_set_termios(struct tty_struct *tty, struct ktermios *old);
204 204
205static int gs_send(struct gs_dev *dev); 205static int gs_send(struct gs_dev *dev);
206static int gs_send_packet(struct gs_dev *dev, char *packet, 206static int gs_send_packet(struct gs_dev *dev, char *packet,
@@ -1077,7 +1077,7 @@ static int gs_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd,
1077/* 1077/*
1078 * gs_set_termios 1078 * gs_set_termios
1079 */ 1079 */
1080static void gs_set_termios(struct tty_struct *tty, struct termios *old) 1080static void gs_set_termios(struct tty_struct *tty, struct ktermios *old)
1081{ 1081{
1082} 1082}
1083 1083
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 863966c1c5ac..5261cd22ee6b 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -156,7 +156,7 @@ cleanup:
156} 156}
157 157
158static void ark3116_set_termios(struct usb_serial_port *port, 158static void ark3116_set_termios(struct usb_serial_port *port,
159 struct termios *old_termios) 159 struct ktermios *old_termios)
160{ 160{
161 struct usb_serial *serial = port->serial; 161 struct usb_serial *serial = port->serial;
162 struct ark3116_private *priv = usb_get_serial_port_data(port); 162 struct ark3116_private *priv = usb_get_serial_port_data(port);
@@ -326,7 +326,7 @@ static void ark3116_set_termios(struct usb_serial_port *port,
326 326
327static int ark3116_open(struct usb_serial_port *port, struct file *filp) 327static int ark3116_open(struct usb_serial_port *port, struct file *filp)
328{ 328{
329 struct termios tmp_termios; 329 struct ktermios tmp_termios;
330 struct usb_serial *serial = port->serial; 330 struct usb_serial *serial = port->serial;
331 char *buf; 331 char *buf;
332 int result = 0; 332 int result = 0;
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 8835bb58ca9b..38b4dae319ee 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -92,7 +92,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial);
92static int belkin_sa_open (struct usb_serial_port *port, struct file *filp); 92static int belkin_sa_open (struct usb_serial_port *port, struct file *filp);
93static void belkin_sa_close (struct usb_serial_port *port, struct file *filp); 93static void belkin_sa_close (struct usb_serial_port *port, struct file *filp);
94static void belkin_sa_read_int_callback (struct urb *urb); 94static void belkin_sa_read_int_callback (struct urb *urb);
95static void belkin_sa_set_termios (struct usb_serial_port *port, struct termios * old); 95static void belkin_sa_set_termios (struct usb_serial_port *port, struct ktermios * old);
96static int belkin_sa_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 96static int belkin_sa_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
97static void belkin_sa_break_ctl (struct usb_serial_port *port, int break_state ); 97static void belkin_sa_break_ctl (struct usb_serial_port *port, int break_state );
98static int belkin_sa_tiocmget (struct usb_serial_port *port, struct file *file); 98static int belkin_sa_tiocmget (struct usb_serial_port *port, struct file *file);
@@ -333,7 +333,7 @@ exit:
333 __FUNCTION__, retval); 333 __FUNCTION__, retval);
334} 334}
335 335
336static void belkin_sa_set_termios (struct usb_serial_port *port, struct termios *old_termios) 336static void belkin_sa_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
337{ 337{
338 struct usb_serial *serial = port->serial; 338 struct usb_serial *serial = port->serial;
339 struct belkin_sa_private *priv = usb_get_serial_port_data(port); 339 struct belkin_sa_private *priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 7167728d764c..9386e216d681 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -65,7 +65,7 @@ static int usb_console_setup(struct console *co, char *options)
65 struct usb_serial_port *port; 65 struct usb_serial_port *port;
66 int retval = 0; 66 int retval = 0;
67 struct tty_struct *tty; 67 struct tty_struct *tty;
68 struct termios *termios; 68 struct ktermios *termios;
69 69
70 dbg ("%s", __FUNCTION__); 70 dbg ("%s", __FUNCTION__);
71 71
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index f95d42c0d16a..2f9b7ac32663 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -41,7 +41,7 @@ static int cp2101_open(struct usb_serial_port*, struct file*);
41static void cp2101_cleanup(struct usb_serial_port*); 41static void cp2101_cleanup(struct usb_serial_port*);
42static void cp2101_close(struct usb_serial_port*, struct file*); 42static void cp2101_close(struct usb_serial_port*, struct file*);
43static void cp2101_get_termios(struct usb_serial_port*); 43static void cp2101_get_termios(struct usb_serial_port*);
44static void cp2101_set_termios(struct usb_serial_port*, struct termios*); 44static void cp2101_set_termios(struct usb_serial_port*, struct ktermios*);
45static int cp2101_tiocmget (struct usb_serial_port *, struct file *); 45static int cp2101_tiocmget (struct usb_serial_port *, struct file *);
46static int cp2101_tiocmset (struct usb_serial_port *, struct file *, 46static int cp2101_tiocmset (struct usb_serial_port *, struct file *,
47 unsigned int, unsigned int); 47 unsigned int, unsigned int);
@@ -506,7 +506,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
506} 506}
507 507
508static void cp2101_set_termios (struct usb_serial_port *port, 508static void cp2101_set_termios (struct usb_serial_port *port,
509 struct termios *old_termios) 509 struct ktermios *old_termios)
510{ 510{
511 unsigned int cflag, old_cflag=0; 511 unsigned int cflag, old_cflag=0;
512 int baud=0, bits; 512 int baud=0, bits;
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 093f303b3189..a1fdb85b8c0a 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -143,7 +143,7 @@ struct cypress_private {
143 wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */ 143 wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */
144 char prev_status, diff_status; /* used for TIOCMIWAIT */ 144 char prev_status, diff_status; /* used for TIOCMIWAIT */
145 /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */ 145 /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */
146 struct termios tmp_termios; /* stores the old termios settings */ 146 struct ktermios tmp_termios; /* stores the old termios settings */
147}; 147};
148 148
149/* write buffer structure */ 149/* write buffer structure */
@@ -165,7 +165,7 @@ static int cypress_write (struct usb_serial_port *port, const unsigned char *b
165static void cypress_send (struct usb_serial_port *port); 165static void cypress_send (struct usb_serial_port *port);
166static int cypress_write_room (struct usb_serial_port *port); 166static int cypress_write_room (struct usb_serial_port *port);
167static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 167static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
168static void cypress_set_termios (struct usb_serial_port *port, struct termios * old); 168static void cypress_set_termios (struct usb_serial_port *port, struct ktermios * old);
169static int cypress_tiocmget (struct usb_serial_port *port, struct file *file); 169static int cypress_tiocmget (struct usb_serial_port *port, struct file *file);
170static int cypress_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); 170static int cypress_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
171static int cypress_chars_in_buffer (struct usb_serial_port *port); 171static int cypress_chars_in_buffer (struct usb_serial_port *port);
@@ -949,13 +949,13 @@ static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsi
949 949
950 switch (cmd) { 950 switch (cmd) {
951 case TIOCGSERIAL: 951 case TIOCGSERIAL:
952 if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct termios))) { 952 if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct ktermios))) {
953 return -EFAULT; 953 return -EFAULT;
954 } 954 }
955 return (0); 955 return (0);
956 break; 956 break;
957 case TIOCSSERIAL: 957 case TIOCSSERIAL:
958 if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct termios))) { 958 if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct ktermios))) {
959 return -EFAULT; 959 return -EFAULT;
960 } 960 }
961 /* here we need to call cypress_set_termios to invoke the new settings */ 961 /* here we need to call cypress_set_termios to invoke the new settings */
@@ -1019,7 +1019,7 @@ static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsi
1019 1019
1020 1020
1021static void cypress_set_termios (struct usb_serial_port *port, 1021static void cypress_set_termios (struct usb_serial_port *port,
1022 struct termios *old_termios) 1022 struct ktermios *old_termios)
1023{ 1023{
1024 struct cypress_private *priv = usb_get_serial_port_data(port); 1024 struct cypress_private *priv = usb_get_serial_port_data(port);
1025 struct tty_struct *tty; 1025 struct tty_struct *tty;
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 83d0e21145b0..9d9ea874639c 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -449,7 +449,7 @@ static int digi_transmit_idle( struct usb_serial_port *port,
449static void digi_rx_throttle (struct usb_serial_port *port); 449static void digi_rx_throttle (struct usb_serial_port *port);
450static void digi_rx_unthrottle (struct usb_serial_port *port); 450static void digi_rx_unthrottle (struct usb_serial_port *port);
451static void digi_set_termios( struct usb_serial_port *port, 451static void digi_set_termios( struct usb_serial_port *port,
452 struct termios *old_termios ); 452 struct ktermios *old_termios );
453static void digi_break_ctl( struct usb_serial_port *port, int break_state ); 453static void digi_break_ctl( struct usb_serial_port *port, int break_state );
454static int digi_ioctl( struct usb_serial_port *port, struct file *file, 454static int digi_ioctl( struct usb_serial_port *port, struct file *file,
455 unsigned int cmd, unsigned long arg ); 455 unsigned int cmd, unsigned long arg );
@@ -976,7 +976,7 @@ dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num );
976 976
977 977
978static void digi_set_termios( struct usb_serial_port *port, 978static void digi_set_termios( struct usb_serial_port *port,
979 struct termios *old_termios ) 979 struct ktermios *old_termios )
980{ 980{
981 981
982 struct digi_port *priv = usb_get_serial_port_data(port); 982 struct digi_port *priv = usb_get_serial_port_data(port);
@@ -1463,7 +1463,7 @@ static int digi_open( struct usb_serial_port *port, struct file *filp )
1463 int ret; 1463 int ret;
1464 unsigned char buf[32]; 1464 unsigned char buf[32];
1465 struct digi_port *priv = usb_get_serial_port_data(port); 1465 struct digi_port *priv = usb_get_serial_port_data(port);
1466 struct termios not_termios; 1466 struct ktermios not_termios;
1467 unsigned long flags = 0; 1467 unsigned long flags = 0;
1468 1468
1469 1469
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index 4ce10a831953..92beeb19795f 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -92,7 +92,7 @@ static int empeg_ioctl (struct usb_serial_port *port,
92 struct file * file, 92 struct file * file,
93 unsigned int cmd, 93 unsigned int cmd,
94 unsigned long arg); 94 unsigned long arg);
95static void empeg_set_termios (struct usb_serial_port *port, struct termios *old_termios); 95static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *old_termios);
96static void empeg_write_bulk_callback (struct urb *urb); 96static void empeg_write_bulk_callback (struct urb *urb);
97static void empeg_read_bulk_callback (struct urb *urb); 97static void empeg_read_bulk_callback (struct urb *urb);
98 98
@@ -442,7 +442,7 @@ static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsign
442} 442}
443 443
444 444
445static void empeg_set_termios (struct usb_serial_port *port, struct termios *old_termios) 445static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
446{ 446{
447 447
448 dbg("%s - port %d", __FUNCTION__, port->number); 448 dbg("%s - port %d", __FUNCTION__, port->number);
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 72e4d48f51e9..41b0ad2d56ac 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -595,7 +595,7 @@ static int ftdi_chars_in_buffer (struct usb_serial_port *port);
595static void ftdi_write_bulk_callback (struct urb *urb); 595static void ftdi_write_bulk_callback (struct urb *urb);
596static void ftdi_read_bulk_callback (struct urb *urb); 596static void ftdi_read_bulk_callback (struct urb *urb);
597static void ftdi_process_read (struct work_struct *work); 597static void ftdi_process_read (struct work_struct *work);
598static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old); 598static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios * old);
599static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file); 599static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file);
600static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear); 600static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear);
601static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 601static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
@@ -1880,7 +1880,7 @@ static void ftdi_break_ctl( struct usb_serial_port *port, int break_state )
1880 * WARNING: set_termios calls this with old_termios in kernel space 1880 * WARNING: set_termios calls this with old_termios in kernel space
1881 */ 1881 */
1882 1882
1883static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_termios) 1883static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
1884{ /* ftdi_termios */ 1884{ /* ftdi_termios */
1885 struct usb_device *dev = port->serial->dev; 1885 struct usb_device *dev = port->serial->dev;
1886 unsigned int cflag = port->tty->termios->c_cflag; 1886 unsigned int cflag = port->tty->termios->c_cflag;
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index d06547a13f28..f623d58370a4 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -229,7 +229,7 @@ static int edge_write_room (struct usb_serial_port *port);
229static int edge_chars_in_buffer (struct usb_serial_port *port); 229static int edge_chars_in_buffer (struct usb_serial_port *port);
230static void edge_throttle (struct usb_serial_port *port); 230static void edge_throttle (struct usb_serial_port *port);
231static void edge_unthrottle (struct usb_serial_port *port); 231static void edge_unthrottle (struct usb_serial_port *port);
232static void edge_set_termios (struct usb_serial_port *port, struct termios *old_termios); 232static void edge_set_termios (struct usb_serial_port *port, struct ktermios *old_termios);
233static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg); 233static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg);
234static void edge_break (struct usb_serial_port *port, int break_state); 234static void edge_break (struct usb_serial_port *port, int break_state);
235static int edge_tiocmget (struct usb_serial_port *port, struct file *file); 235static int edge_tiocmget (struct usb_serial_port *port, struct file *file);
@@ -257,7 +257,7 @@ static void handle_new_lsr (struct edgeport_port *edge_port, __u8 lsrData, __u8
257static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u8 param); 257static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u8 param);
258static int calc_baud_rate_divisor (int baud_rate, int *divisor); 258static int calc_baud_rate_divisor (int baud_rate, int *divisor);
259static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRate); 259static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRate);
260static void change_port_settings (struct edgeport_port *edge_port, struct termios *old_termios); 260static void change_port_settings (struct edgeport_port *edge_port, struct ktermios *old_termios);
261static int send_cmd_write_uart_register (struct edgeport_port *edge_port, __u8 regNum, __u8 regValue); 261static int send_cmd_write_uart_register (struct edgeport_port *edge_port, __u8 regNum, __u8 regValue);
262static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer, int writeLength); 262static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer, int writeLength);
263static void send_more_port_data (struct edgeport_serial *edge_serial, struct edgeport_port *edge_port); 263static void send_more_port_data (struct edgeport_serial *edge_serial, struct edgeport_port *edge_port);
@@ -1431,7 +1431,7 @@ static void edge_unthrottle (struct usb_serial_port *port)
1431 * SerialSetTermios 1431 * SerialSetTermios
1432 * this function is called by the tty driver when it wants to change the termios structure 1432 * this function is called by the tty driver when it wants to change the termios structure
1433 *****************************************************************************/ 1433 *****************************************************************************/
1434static void edge_set_termios (struct usb_serial_port *port, struct termios *old_termios) 1434static void edge_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
1435{ 1435{
1436 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 1436 struct edgeport_port *edge_port = usb_get_serial_port_data(port);
1437 struct tty_struct *tty = port->tty; 1437 struct tty_struct *tty = port->tty;
@@ -2412,7 +2412,7 @@ static int send_cmd_write_uart_register (struct edgeport_port *edge_port, __u8 r
2412#ifndef CMSPAR 2412#ifndef CMSPAR
2413#define CMSPAR 0 2413#define CMSPAR 0
2414#endif 2414#endif
2415static void change_port_settings (struct edgeport_port *edge_port, struct termios *old_termios) 2415static void change_port_settings (struct edgeport_port *edge_port, struct ktermios *old_termios)
2416{ 2416{
2417 struct tty_struct *tty; 2417 struct tty_struct *tty;
2418 int baud; 2418 int baud;
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index ee0c921e1520..2da2684e0809 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -238,7 +238,7 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned c
238static void stop_read(struct edgeport_port *edge_port); 238static void stop_read(struct edgeport_port *edge_port);
239static int restart_read(struct edgeport_port *edge_port); 239static int restart_read(struct edgeport_port *edge_port);
240 240
241static void edge_set_termios (struct usb_serial_port *port, struct termios *old_termios); 241static void edge_set_termios (struct usb_serial_port *port, struct ktermios *old_termios);
242static void edge_send(struct usb_serial_port *port); 242static void edge_send(struct usb_serial_port *port);
243 243
244/* circular buffer */ 244/* circular buffer */
@@ -2361,7 +2361,7 @@ static int restart_read(struct edgeport_port *edge_port)
2361 return status; 2361 return status;
2362} 2362}
2363 2363
2364static void change_port_settings (struct edgeport_port *edge_port, struct termios *old_termios) 2364static void change_port_settings (struct edgeport_port *edge_port, struct ktermios *old_termios)
2365{ 2365{
2366 struct ump_uart_config *config; 2366 struct ump_uart_config *config;
2367 struct tty_struct *tty; 2367 struct tty_struct *tty;
@@ -2512,7 +2512,7 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
2512 return; 2512 return;
2513} 2513}
2514 2514
2515static void edge_set_termios (struct usb_serial_port *port, struct termios *old_termios) 2515static void edge_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
2516{ 2516{
2517 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 2517 struct edgeport_port *edge_port = usb_get_serial_port_data(port);
2518 struct tty_struct *tty = port->tty; 2518 struct tty_struct *tty = port->tty;
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 331bf81556fc..8fdf486e3465 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -107,7 +107,7 @@ static void ir_close (struct usb_serial_port *port, struct file *filep);
107static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int count); 107static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int count);
108static void ir_write_bulk_callback (struct urb *urb); 108static void ir_write_bulk_callback (struct urb *urb);
109static void ir_read_bulk_callback (struct urb *urb); 109static void ir_read_bulk_callback (struct urb *urb);
110static void ir_set_termios (struct usb_serial_port *port, struct termios *old_termios); 110static void ir_set_termios (struct usb_serial_port *port, struct ktermios *old_termios);
111 111
112static u8 ir_baud = 0; 112static u8 ir_baud = 0;
113static u8 ir_xbof = 0; 113static u8 ir_xbof = 0;
@@ -497,7 +497,7 @@ static void ir_read_bulk_callback (struct urb *urb)
497 return; 497 return;
498} 498}
499 499
500static void ir_set_termios (struct usb_serial_port *port, struct termios *old_termios) 500static void ir_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
501{ 501{
502 unsigned char *transfer_buffer; 502 unsigned char *transfer_buffer;
503 unsigned int cflag; 503 unsigned int cflag;
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 7639652cec42..9d2fdfd6865f 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -264,7 +264,7 @@ static void keyspan_break_ctl (struct usb_serial_port *port, int break_state)
264 264
265 265
266static void keyspan_set_termios (struct usb_serial_port *port, 266static void keyspan_set_termios (struct usb_serial_port *port,
267 struct termios *old_termios) 267 struct ktermios *old_termios)
268{ 268{
269 int baud_rate, device_port; 269 int baud_rate, device_port;
270 struct keyspan_port_private *p_priv; 270 struct keyspan_port_private *p_priv;
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
index 7472ed6bf626..6413d73c139c 100644
--- a/drivers/usb/serial/keyspan.h
+++ b/drivers/usb/serial/keyspan.h
@@ -59,7 +59,7 @@ static int keyspan_ioctl (struct usb_serial_port *port,
59 unsigned int cmd, 59 unsigned int cmd,
60 unsigned long arg); 60 unsigned long arg);
61static void keyspan_set_termios (struct usb_serial_port *port, 61static void keyspan_set_termios (struct usb_serial_port *port,
62 struct termios *old); 62 struct ktermios *old);
63static void keyspan_break_ctl (struct usb_serial_port *port, 63static void keyspan_break_ctl (struct usb_serial_port *port,
64 int break_state); 64 int break_state);
65static int keyspan_tiocmget (struct usb_serial_port *port, 65static int keyspan_tiocmget (struct usb_serial_port *port,
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index e09a0bfe6231..126b9703bbaf 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -365,7 +365,7 @@ static void keyspan_pda_break_ctl (struct usb_serial_port *port, int break_state
365 365
366 366
367static void keyspan_pda_set_termios (struct usb_serial_port *port, 367static void keyspan_pda_set_termios (struct usb_serial_port *port,
368 struct termios *old_termios) 368 struct ktermios *old_termios)
369{ 369{
370 struct usb_serial *serial = port->serial; 370 struct usb_serial *serial = port->serial;
371 unsigned int cflag = port->tty->termios->c_cflag; 371 unsigned int cflag = port->tty->termios->c_cflag;
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 17e205699c2b..73d755df4840 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -86,7 +86,7 @@ static int klsi_105_write_room (struct usb_serial_port *port);
86 86
87static void klsi_105_read_bulk_callback (struct urb *urb); 87static void klsi_105_read_bulk_callback (struct urb *urb);
88static void klsi_105_set_termios (struct usb_serial_port *port, 88static void klsi_105_set_termios (struct usb_serial_port *port,
89 struct termios * old); 89 struct ktermios *old);
90static int klsi_105_ioctl (struct usb_serial_port *port, 90static int klsi_105_ioctl (struct usb_serial_port *port,
91 struct file * file, 91 struct file * file,
92 unsigned int cmd, 92 unsigned int cmd,
@@ -164,7 +164,7 @@ struct klsi_105_port_settings {
164#define URB_TRANSFER_BUFFER_SIZE 64 164#define URB_TRANSFER_BUFFER_SIZE 64
165struct klsi_105_private { 165struct klsi_105_private {
166 struct klsi_105_port_settings cfg; 166 struct klsi_105_port_settings cfg;
167 struct termios termios; 167 struct ktermios termios;
168 unsigned long line_state; /* modem line settings */ 168 unsigned long line_state; /* modem line settings */
169 /* write pool */ 169 /* write pool */
170 struct urb * write_urb_pool[NUM_URBS]; 170 struct urb * write_urb_pool[NUM_URBS];
@@ -688,7 +688,7 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
688 688
689 689
690static void klsi_105_set_termios (struct usb_serial_port *port, 690static void klsi_105_set_termios (struct usb_serial_port *port,
691 struct termios *old_termios) 691 struct ktermios *old_termios)
692{ 692{
693 struct klsi_105_private *priv = usb_get_serial_port_data(port); 693 struct klsi_105_private *priv = usb_get_serial_port_data(port);
694 unsigned int iflag = port->tty->termios->c_iflag; 694 unsigned int iflag = port->tty->termios->c_iflag;
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 237289920f03..e284d6c0fd35 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -136,7 +136,7 @@ struct kobil_private {
136 int cur_pos; // index of the next char to send in buf 136 int cur_pos; // index of the next char to send in buf
137 __u16 device_type; 137 __u16 device_type;
138 int line_state; 138 int line_state;
139 struct termios internal_termios; 139 struct ktermios internal_termios;
140}; 140};
141 141
142 142
@@ -624,11 +624,11 @@ static int kobil_ioctl(struct usb_serial_port *port, struct file *file,
624 624
625 switch (cmd) { 625 switch (cmd) {
626 case TCGETS: // 0x5401 626 case TCGETS: // 0x5401
627 if (!access_ok(VERIFY_WRITE, user_arg, sizeof(struct termios))) { 627 if (!access_ok(VERIFY_WRITE, user_arg, sizeof(struct ktermios))) {
628 dbg("%s - port %d Error in access_ok", __FUNCTION__, port->number); 628 dbg("%s - port %d Error in access_ok", __FUNCTION__, port->number);
629 return -EFAULT; 629 return -EFAULT;
630 } 630 }
631 if (kernel_termios_to_user_termios((struct termios __user *)arg, 631 if (kernel_termios_to_user_termios((struct ktermios __user *)arg,
632 &priv->internal_termios)) 632 &priv->internal_termios))
633 return -EFAULT; 633 return -EFAULT;
634 return 0; 634 return 0;
@@ -638,12 +638,12 @@ static int kobil_ioctl(struct usb_serial_port *port, struct file *file,
638 dbg("%s - port %d Error: port->tty->termios is NULL", __FUNCTION__, port->number); 638 dbg("%s - port %d Error: port->tty->termios is NULL", __FUNCTION__, port->number);
639 return -ENOTTY; 639 return -ENOTTY;
640 } 640 }
641 if (!access_ok(VERIFY_READ, user_arg, sizeof(struct termios))) { 641 if (!access_ok(VERIFY_READ, user_arg, sizeof(struct ktermios))) {
642 dbg("%s - port %d Error in access_ok", __FUNCTION__, port->number); 642 dbg("%s - port %d Error in access_ok", __FUNCTION__, port->number);
643 return -EFAULT; 643 return -EFAULT;
644 } 644 }
645 if (user_termios_to_kernel_termios(&priv->internal_termios, 645 if (user_termios_to_kernel_termios(&priv->internal_termios,
646 (struct termios __user *)arg)) 646 (struct ktermios __user *)arg))
647 return -EFAULT; 647 return -EFAULT;
648 648
649 settings = kzalloc(50, GFP_KERNEL); 649 settings = kzalloc(50, GFP_KERNEL);
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index a906e500a02b..38b1d17e06ef 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -98,7 +98,7 @@ static void mct_u232_close (struct usb_serial_port *port,
98 struct file *filp); 98 struct file *filp);
99static void mct_u232_read_int_callback (struct urb *urb); 99static void mct_u232_read_int_callback (struct urb *urb);
100static void mct_u232_set_termios (struct usb_serial_port *port, 100static void mct_u232_set_termios (struct usb_serial_port *port,
101 struct termios * old); 101 struct ktermios * old);
102static int mct_u232_ioctl (struct usb_serial_port *port, 102static int mct_u232_ioctl (struct usb_serial_port *port,
103 struct file * file, 103 struct file * file,
104 unsigned int cmd, 104 unsigned int cmd,
@@ -556,7 +556,7 @@ exit:
556} /* mct_u232_read_int_callback */ 556} /* mct_u232_read_int_callback */
557 557
558static void mct_u232_set_termios (struct usb_serial_port *port, 558static void mct_u232_set_termios (struct usb_serial_port *port,
559 struct termios *old_termios) 559 struct ktermios *old_termios)
560{ 560{
561 struct usb_serial *serial = port->serial; 561 struct usb_serial *serial = port->serial;
562 struct mct_u232_private *priv = usb_get_serial_port_data(port); 562 struct mct_u232_private *priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 70f93b18292f..e55f4ed81d7b 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1014,7 +1014,7 @@ static int send_cmd_write_baud_rate(struct moschip_port *mos7720_port,
1014 * the specified new settings. 1014 * the specified new settings.
1015 */ 1015 */
1016static void change_port_settings(struct moschip_port *mos7720_port, 1016static void change_port_settings(struct moschip_port *mos7720_port,
1017 struct termios *old_termios) 1017 struct ktermios *old_termios)
1018{ 1018{
1019 struct usb_serial_port *port; 1019 struct usb_serial_port *port;
1020 struct usb_serial *serial; 1020 struct usb_serial *serial;
@@ -1203,7 +1203,7 @@ static void change_port_settings(struct moschip_port *mos7720_port,
1203 * termios structure. 1203 * termios structure.
1204 */ 1204 */
1205static void mos7720_set_termios(struct usb_serial_port *port, 1205static void mos7720_set_termios(struct usb_serial_port *port,
1206 struct termios *old_termios) 1206 struct ktermios *old_termios)
1207{ 1207{
1208 int status; 1208 int status;
1209 unsigned int cflag; 1209 unsigned int cflag;
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 5432c6340086..8cc728a49e41 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1931,7 +1931,7 @@ static int mos7840_send_cmd_write_baud_rate(struct moschip_port *mos7840_port,
1931 *****************************************************************************/ 1931 *****************************************************************************/
1932 1932
1933static void mos7840_change_port_settings(struct moschip_port *mos7840_port, 1933static void mos7840_change_port_settings(struct moschip_port *mos7840_port,
1934 struct termios *old_termios) 1934 struct ktermios *old_termios)
1935{ 1935{
1936 struct tty_struct *tty; 1936 struct tty_struct *tty;
1937 int baud; 1937 int baud;
@@ -2118,7 +2118,7 @@ static void mos7840_change_port_settings(struct moschip_port *mos7840_port,
2118 *****************************************************************************/ 2118 *****************************************************************************/
2119 2119
2120static void mos7840_set_termios(struct usb_serial_port *port, 2120static void mos7840_set_termios(struct usb_serial_port *port,
2121 struct termios *old_termios) 2121 struct ktermios *old_termios)
2122{ 2122{
2123 int status; 2123 int status;
2124 unsigned int cflag; 2124 unsigned int cflag;
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 130afbbd3fca..0ae4098718c3 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -59,7 +59,7 @@ static int option_chars_in_buffer(struct usb_serial_port *port);
59static int option_ioctl(struct usb_serial_port *port, struct file *file, 59static int option_ioctl(struct usb_serial_port *port, struct file *file,
60 unsigned int cmd, unsigned long arg); 60 unsigned int cmd, unsigned long arg);
61static void option_set_termios(struct usb_serial_port *port, 61static void option_set_termios(struct usb_serial_port *port,
62 struct termios *old); 62 struct ktermios *old);
63static void option_break_ctl(struct usb_serial_port *port, int break_state); 63static void option_break_ctl(struct usb_serial_port *port, int break_state);
64static int option_tiocmget(struct usb_serial_port *port, struct file *file); 64static int option_tiocmget(struct usb_serial_port *port, struct file *file);
65static int option_tiocmset(struct usb_serial_port *port, struct file *file, 65static int option_tiocmset(struct usb_serial_port *port, struct file *file,
@@ -230,7 +230,7 @@ static void option_break_ctl(struct usb_serial_port *port, int break_state)
230} 230}
231 231
232static void option_set_termios(struct usb_serial_port *port, 232static void option_set_termios(struct usb_serial_port *port,
233 struct termios *old_termios) 233 struct ktermios *old_termios)
234{ 234{
235 dbg("%s", __FUNCTION__); 235 dbg("%s", __FUNCTION__);
236 236
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index bc800c8787a8..d124d780e42e 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -455,7 +455,7 @@ static int pl2303_chars_in_buffer(struct usb_serial_port *port)
455} 455}
456 456
457static void pl2303_set_termios(struct usb_serial_port *port, 457static void pl2303_set_termios(struct usb_serial_port *port,
458 struct termios *old_termios) 458 struct ktermios *old_termios)
459{ 459{
460 struct usb_serial *serial = port->serial; 460 struct usb_serial *serial = port->serial;
461 struct pl2303_private *priv = usb_get_serial_port_data(port); 461 struct pl2303_private *priv = usb_get_serial_port_data(port);
@@ -687,7 +687,7 @@ static void pl2303_close(struct usb_serial_port *port, struct file *filp)
687 687
688static int pl2303_open(struct usb_serial_port *port, struct file *filp) 688static int pl2303_open(struct usb_serial_port *port, struct file *filp)
689{ 689{
690 struct termios tmp_termios; 690 struct ktermios tmp_termios;
691 struct usb_serial *serial = port->serial; 691 struct usb_serial *serial = port->serial;
692 struct pl2303_private *priv = usb_get_serial_port_data(port); 692 struct pl2303_private *priv = usb_get_serial_port_data(port);
693 unsigned char *buf; 693 unsigned char *buf;
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 4b5097fa48d7..6d8e91e00ecf 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -145,7 +145,7 @@ static void sierra_break_ctl(struct usb_serial_port *port, int break_state)
145} 145}
146 146
147static void sierra_set_termios(struct usb_serial_port *port, 147static void sierra_set_termios(struct usb_serial_port *port,
148 struct termios *old_termios) 148 struct ktermios *old_termios)
149{ 149{
150 dbg("%s", __FUNCTION__); 150 dbg("%s", __FUNCTION__);
151 151
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index ae98d8cbdbb8..f42eb9ea6405 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -161,7 +161,7 @@ static void ti_throttle(struct usb_serial_port *port);
161static void ti_unthrottle(struct usb_serial_port *port); 161static void ti_unthrottle(struct usb_serial_port *port);
162static int ti_ioctl(struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg); 162static int ti_ioctl(struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg);
163static void ti_set_termios(struct usb_serial_port *port, 163static void ti_set_termios(struct usb_serial_port *port,
164 struct termios *old_termios); 164 struct ktermios *old_termios);
165static int ti_tiocmget(struct usb_serial_port *port, struct file *file); 165static int ti_tiocmget(struct usb_serial_port *port, struct file *file);
166static int ti_tiocmset(struct usb_serial_port *port, struct file *file, 166static int ti_tiocmset(struct usb_serial_port *port, struct file *file,
167 unsigned int set, unsigned int clear); 167 unsigned int set, unsigned int clear);
@@ -881,7 +881,7 @@ static int ti_ioctl(struct usb_serial_port *port, struct file *file,
881 881
882 882
883static void ti_set_termios(struct usb_serial_port *port, 883static void ti_set_termios(struct usb_serial_port *port,
884 struct termios *old_termios) 884 struct ktermios *old_termios)
885{ 885{
886 struct ti_port *tport = usb_get_serial_port_data(port); 886 struct ti_port *tport = usb_get_serial_port_data(port);
887 struct tty_struct *tty = port->tty; 887 struct tty_struct *tty = port->tty;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 3d5072f14b8d..716f6806cc89 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -397,7 +397,7 @@ exit:
397 return retval; 397 return retval;
398} 398}
399 399
400static void serial_set_termios (struct tty_struct *tty, struct termios * old) 400static void serial_set_termios (struct tty_struct *tty, struct ktermios * old)
401{ 401{
402 struct usb_serial_port *port = tty->driver_data; 402 struct usb_serial_port *port = tty->driver_data;
403 403
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index eef5eaa5fa0b..b09f06096056 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -46,7 +46,7 @@ static int visor_probe (struct usb_serial *serial, const struct usb_device_id
46static int visor_calc_num_ports(struct usb_serial *serial); 46static int visor_calc_num_ports(struct usb_serial *serial);
47static void visor_shutdown (struct usb_serial *serial); 47static void visor_shutdown (struct usb_serial *serial);
48static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 48static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
49static void visor_set_termios (struct usb_serial_port *port, struct termios *old_termios); 49static void visor_set_termios (struct usb_serial_port *port, struct ktermios *old_termios);
50static void visor_write_bulk_callback (struct urb *urb); 50static void visor_write_bulk_callback (struct urb *urb);
51static void visor_read_bulk_callback (struct urb *urb); 51static void visor_read_bulk_callback (struct urb *urb);
52static void visor_read_int_callback (struct urb *urb); 52static void visor_read_int_callback (struct urb *urb);
@@ -916,7 +916,7 @@ static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsign
916 916
917 917
918/* This function is all nice and good, but we don't change anything based on it :) */ 918/* This function is all nice and good, but we don't change anything based on it :) */
919static void visor_set_termios (struct usb_serial_port *port, struct termios *old_termios) 919static void visor_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
920{ 920{
921 unsigned int cflag; 921 unsigned int cflag;
922 922
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 154c7d290597..dc45e58e2b8c 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -145,7 +145,7 @@ static void whiteheat_close (struct usb_serial_port *port, struct file *filp);
145static int whiteheat_write (struct usb_serial_port *port, const unsigned char *buf, int count); 145static int whiteheat_write (struct usb_serial_port *port, const unsigned char *buf, int count);
146static int whiteheat_write_room (struct usb_serial_port *port); 146static int whiteheat_write_room (struct usb_serial_port *port);
147static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 147static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
148static void whiteheat_set_termios (struct usb_serial_port *port, struct termios * old); 148static void whiteheat_set_termios (struct usb_serial_port *port, struct ktermios * old);
149static int whiteheat_tiocmget (struct usb_serial_port *port, struct file *file); 149static int whiteheat_tiocmget (struct usb_serial_port *port, struct file *file);
150static int whiteheat_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); 150static int whiteheat_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
151static void whiteheat_break_ctl (struct usb_serial_port *port, int break_state); 151static void whiteheat_break_ctl (struct usb_serial_port *port, int break_state);
@@ -597,7 +597,7 @@ static void whiteheat_shutdown (struct usb_serial *serial)
597static int whiteheat_open (struct usb_serial_port *port, struct file *filp) 597static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
598{ 598{
599 int retval = 0; 599 int retval = 0;
600 struct termios old_term; 600 struct ktermios old_term;
601 601
602 dbg("%s - port %d", __FUNCTION__, port->number); 602 dbg("%s - port %d", __FUNCTION__, port->number);
603 603
@@ -870,7 +870,7 @@ static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, un
870} 870}
871 871
872 872
873static void whiteheat_set_termios (struct usb_serial_port *port, struct termios *old_termios) 873static void whiteheat_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
874{ 874{
875 dbg("%s -port %d", __FUNCTION__, port->number); 875 dbg("%s -port %d", __FUNCTION__, port->number);
876 876
diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h
index 1e58ca39592c..3769e6bd63b1 100644
--- a/include/asm-generic/termios.h
+++ b/include/asm-generic/termios.h
@@ -11,7 +11,7 @@
11/* 11/*
12 * Translate a "termio" structure into a "termios". Ugh. 12 * Translate a "termio" structure into a "termios". Ugh.
13 */ 13 */
14static inline int user_termio_to_kernel_termios(struct termios *termios, 14static inline int user_termio_to_kernel_termios(struct ktermios *termios,
15 struct termio __user *termio) 15 struct termio __user *termio)
16{ 16{
17 unsigned short tmp; 17 unsigned short tmp;
@@ -48,7 +48,7 @@ static inline int user_termio_to_kernel_termios(struct termios *termios,
48 * Translate a "termios" structure into a "termio". Ugh. 48 * Translate a "termios" structure into a "termio". Ugh.
49 */ 49 */
50static inline int kernel_termios_to_user_termio(struct termio __user *termio, 50static inline int kernel_termios_to_user_termio(struct termio __user *termio,
51 struct termios *termios) 51 struct ktermios *termios)
52{ 52{
53 if (put_user(termios->c_iflag, &termio->c_iflag) < 0 || 53 if (put_user(termios->c_iflag, &termio->c_iflag) < 0 ||
54 put_user(termios->c_oflag, &termio->c_oflag) < 0 || 54 put_user(termios->c_oflag, &termio->c_oflag) < 0 ||
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h
index b572f21b32c4..5e79198f7d18 100644
--- a/include/asm-powerpc/termbits.h
+++ b/include/asm-powerpc/termbits.h
@@ -37,8 +37,8 @@ struct ktermios {
37 tcflag_t c_oflag; /* output mode flags */ 37 tcflag_t c_oflag; /* output mode flags */
38 tcflag_t c_cflag; /* control mode flags */ 38 tcflag_t c_cflag; /* control mode flags */
39 tcflag_t c_lflag; /* local mode flags */ 39 tcflag_t c_lflag; /* local mode flags */
40 cc_t c_line; /* line discipline */
41 cc_t c_cc[NCCS]; /* control characters */ 40 cc_t c_cc[NCCS]; /* control characters */
41 cc_t c_line; /* line discipline (== c_cc[19]) */
42 speed_t c_ispeed; /* input speed */ 42 speed_t c_ispeed; /* input speed */
43 speed_t c_ospeed; /* output speed */ 43 speed_t c_ospeed; /* output speed */
44}; 44};
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index e25384561955..5412da28fa47 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -91,7 +91,7 @@ void gs_hangup(struct tty_struct *tty);
91int gs_block_til_ready(void *port, struct file *filp); 91int gs_block_til_ready(void *port, struct file *filp);
92void gs_close(struct tty_struct *tty, struct file *filp); 92void gs_close(struct tty_struct *tty, struct file *filp);
93void gs_set_termios (struct tty_struct * tty, 93void gs_set_termios (struct tty_struct * tty,
94 struct termios * old_termios); 94 struct ktermios * old_termios);
95int gs_init_port(struct gs_port *port); 95int gs_init_port(struct gs_port *port);
96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); 96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp);
97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); 97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp);
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 62991148d5a5..3c7875b7ab5b 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -511,8 +511,8 @@ typedef struct modem_info {
511#endif 511#endif
512 struct tty_struct *tty; /* Pointer to corresponding tty */ 512 struct tty_struct *tty; /* Pointer to corresponding tty */
513 atemu emu; /* AT-emulator data */ 513 atemu emu; /* AT-emulator data */
514 struct termios normal_termios; /* For saving termios structs */ 514 struct ktermios normal_termios; /* For saving termios structs */
515 struct termios callout_termios; 515 struct ktermios callout_termios;
516 wait_queue_head_t open_wait, close_wait; 516 wait_queue_head_t open_wait, close_wait;
517 struct semaphore write_sem; 517 struct semaphore write_sem;
518 spinlock_t readlock; 518 spinlock_t readlock;
@@ -525,8 +525,8 @@ typedef struct _isdn_modem {
525 int refcount; /* Number of opens */ 525 int refcount; /* Number of opens */
526 struct tty_driver *tty_modem; /* tty-device */ 526 struct tty_driver *tty_modem; /* tty-device */
527 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */ 527 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
528 struct termios *modem_termios[ISDN_MAX_CHANNELS]; 528 struct ktermios *modem_termios[ISDN_MAX_CHANNELS];
529 struct termios *modem_termios_locked[ISDN_MAX_CHANNELS]; 529 struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS];
530 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */ 530 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
531} isdn_modem_t; 531} isdn_modem_t;
532 532
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 827672136646..cf23813cbec2 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -166,8 +166,8 @@ struct uart_ops {
166 void (*break_ctl)(struct uart_port *, int ctl); 166 void (*break_ctl)(struct uart_port *, int ctl);
167 int (*startup)(struct uart_port *); 167 int (*startup)(struct uart_port *);
168 void (*shutdown)(struct uart_port *); 168 void (*shutdown)(struct uart_port *);
169 void (*set_termios)(struct uart_port *, struct termios *new, 169 void (*set_termios)(struct uart_port *, struct ktermios *new,
170 struct termios *old); 170 struct ktermios *old);
171 void (*pm)(struct uart_port *, unsigned int state, 171 void (*pm)(struct uart_port *, unsigned int state,
172 unsigned int oldstate); 172 unsigned int oldstate);
173 int (*set_wake)(struct uart_port *, unsigned int state); 173 int (*set_wake)(struct uart_port *, unsigned int state);
@@ -361,8 +361,8 @@ void uart_write_wakeup(struct uart_port *port);
361 */ 361 */
362void uart_update_timeout(struct uart_port *port, unsigned int cflag, 362void uart_update_timeout(struct uart_port *port, unsigned int cflag,
363 unsigned int baud); 363 unsigned int baud);
364unsigned int uart_get_baud_rate(struct uart_port *port, struct termios *termios, 364unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
365 struct termios *old, unsigned int min, 365 struct ktermios *old, unsigned int min,
366 unsigned int max); 366 unsigned int max);
367unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); 367unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud);
368 368
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 91b3ea2bbb14..10f99e5f1a97 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -218,7 +218,7 @@ struct usb_serial_driver {
218 int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); 218 int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count);
219 int (*write_room) (struct usb_serial_port *port); 219 int (*write_room) (struct usb_serial_port *port);
220 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 220 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
221 void (*set_termios) (struct usb_serial_port *port, struct termios * old); 221 void (*set_termios) (struct usb_serial_port *port, struct ktermios * old);
222 void (*break_ctl) (struct usb_serial_port *port, int break_state); 222 void (*break_ctl) (struct usb_serial_port *port, int break_state);
223 int (*chars_in_buffer) (struct usb_serial_port *port); 223 int (*chars_in_buffer) (struct usb_serial_port *port);
224 void (*throttle) (struct usb_serial_port *port); 224 void (*throttle) (struct usb_serial_port *port);
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 1fb5d42f37ae..e0e0d09023b2 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -752,9 +752,9 @@ static int rfcomm_tty_ioctl(struct tty_struct *tty, struct file *filp, unsigned
752 return -ENOIOCTLCMD; 752 return -ENOIOCTLCMD;
753} 753}
754 754
755static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old) 755static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
756{ 756{
757 struct termios *new = (struct termios *) tty->termios; 757 struct ktermios *new = tty->termios;
758 int old_baud_rate = tty_termios_baud_rate(old); 758 int old_baud_rate = tty_termios_baud_rate(old);
759 int new_baud_rate = tty_termios_baud_rate(new); 759 int new_baud_rate = tty_termios_baud_rate(new);
760 760