aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/hci_ath.c26
-rw-r--r--drivers/char/Kconfig540
-rw-r--r--drivers/char/Makefile24
-rw-r--r--drivers/char/pcmcia/synclink_cs.c10
-rw-r--r--drivers/char/ttyprintk.c2
-rw-r--r--drivers/isdn/capi/capi.c10
-rw-r--r--drivers/isdn/gigaset/interface.c12
-rw-r--r--drivers/isdn/gigaset/ser-gigaset.c2
-rw-r--r--drivers/isdn/i4l/isdn_tty.c7
-rw-r--r--drivers/mmc/card/sdio_uart.c4
-rw-r--r--drivers/net/irda/irtty-sir.c2
-rw-r--r--drivers/net/usb/hso.c10
-rw-r--r--drivers/net/wan/pc300_tty.c9
-rw-r--r--drivers/staging/Kconfig4
-rw-r--r--drivers/staging/Makefile2
-rw-r--r--drivers/staging/generic_serial/Kconfig45
-rw-r--r--drivers/staging/generic_serial/Makefile6
-rw-r--r--drivers/staging/generic_serial/TODO6
-rw-r--r--drivers/staging/generic_serial/generic_serial.c (renamed from drivers/char/generic_serial.c)0
-rw-r--r--drivers/staging/generic_serial/rio/Makefile (renamed from drivers/char/rio/Makefile)0
-rw-r--r--drivers/staging/generic_serial/rio/board.h (renamed from drivers/char/rio/board.h)0
-rw-r--r--drivers/staging/generic_serial/rio/cirrus.h (renamed from drivers/char/rio/cirrus.h)0
-rw-r--r--drivers/staging/generic_serial/rio/cmdblk.h (renamed from drivers/char/rio/cmdblk.h)0
-rw-r--r--drivers/staging/generic_serial/rio/cmdpkt.h (renamed from drivers/char/rio/cmdpkt.h)0
-rw-r--r--drivers/staging/generic_serial/rio/daemon.h (renamed from drivers/char/rio/daemon.h)0
-rw-r--r--drivers/staging/generic_serial/rio/errors.h (renamed from drivers/char/rio/errors.h)0
-rw-r--r--drivers/staging/generic_serial/rio/func.h (renamed from drivers/char/rio/func.h)0
-rw-r--r--drivers/staging/generic_serial/rio/host.h (renamed from drivers/char/rio/host.h)0
-rw-r--r--drivers/staging/generic_serial/rio/link.h (renamed from drivers/char/rio/link.h)0
-rw-r--r--drivers/staging/generic_serial/rio/linux_compat.h (renamed from drivers/char/rio/linux_compat.h)0
-rw-r--r--drivers/staging/generic_serial/rio/map.h (renamed from drivers/char/rio/map.h)0
-rw-r--r--drivers/staging/generic_serial/rio/param.h (renamed from drivers/char/rio/param.h)0
-rw-r--r--drivers/staging/generic_serial/rio/parmmap.h (renamed from drivers/char/rio/parmmap.h)0
-rw-r--r--drivers/staging/generic_serial/rio/pci.h (renamed from drivers/char/rio/pci.h)0
-rw-r--r--drivers/staging/generic_serial/rio/phb.h (renamed from drivers/char/rio/phb.h)0
-rw-r--r--drivers/staging/generic_serial/rio/pkt.h (renamed from drivers/char/rio/pkt.h)0
-rw-r--r--drivers/staging/generic_serial/rio/port.h (renamed from drivers/char/rio/port.h)0
-rw-r--r--drivers/staging/generic_serial/rio/protsts.h (renamed from drivers/char/rio/protsts.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rio.h (renamed from drivers/char/rio/rio.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rio_linux.c (renamed from drivers/char/rio/rio_linux.c)0
-rw-r--r--drivers/staging/generic_serial/rio/rio_linux.h (renamed from drivers/char/rio/rio_linux.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rioboard.h (renamed from drivers/char/rio/rioboard.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rioboot.c (renamed from drivers/char/rio/rioboot.c)0
-rw-r--r--drivers/staging/generic_serial/rio/riocmd.c (renamed from drivers/char/rio/riocmd.c)0
-rw-r--r--drivers/staging/generic_serial/rio/rioctrl.c (renamed from drivers/char/rio/rioctrl.c)0
-rw-r--r--drivers/staging/generic_serial/rio/riodrvr.h (renamed from drivers/char/rio/riodrvr.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rioinfo.h (renamed from drivers/char/rio/rioinfo.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rioinit.c (renamed from drivers/char/rio/rioinit.c)0
-rw-r--r--drivers/staging/generic_serial/rio/riointr.c (renamed from drivers/char/rio/riointr.c)0
-rw-r--r--drivers/staging/generic_serial/rio/rioioctl.h (renamed from drivers/char/rio/rioioctl.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rioparam.c (renamed from drivers/char/rio/rioparam.c)0
-rw-r--r--drivers/staging/generic_serial/rio/rioroute.c (renamed from drivers/char/rio/rioroute.c)0
-rw-r--r--drivers/staging/generic_serial/rio/riospace.h (renamed from drivers/char/rio/riospace.h)0
-rw-r--r--drivers/staging/generic_serial/rio/riotable.c (renamed from drivers/char/rio/riotable.c)0
-rw-r--r--drivers/staging/generic_serial/rio/riotty.c (renamed from drivers/char/rio/riotty.c)0
-rw-r--r--drivers/staging/generic_serial/rio/route.h (renamed from drivers/char/rio/route.h)0
-rw-r--r--drivers/staging/generic_serial/rio/rup.h (renamed from drivers/char/rio/rup.h)0
-rw-r--r--drivers/staging/generic_serial/rio/unixrup.h (renamed from drivers/char/rio/unixrup.h)0
-rw-r--r--drivers/staging/generic_serial/ser_a2232.c (renamed from drivers/char/ser_a2232.c)6
-rw-r--r--drivers/staging/generic_serial/ser_a2232.h (renamed from drivers/char/ser_a2232.h)0
-rw-r--r--drivers/staging/generic_serial/ser_a2232fw.ax (renamed from drivers/char/ser_a2232fw.ax)0
-rw-r--r--drivers/staging/generic_serial/ser_a2232fw.h (renamed from drivers/char/ser_a2232fw.h)0
-rw-r--r--drivers/staging/generic_serial/sx.c (renamed from drivers/char/sx.c)8
-rw-r--r--drivers/staging/generic_serial/sx.h (renamed from drivers/char/sx.h)0
-rw-r--r--drivers/staging/generic_serial/sxboards.h (renamed from drivers/char/sxboards.h)0
-rw-r--r--drivers/staging/generic_serial/sxwindow.h (renamed from drivers/char/sxwindow.h)0
-rw-r--r--drivers/staging/generic_serial/vme_scc.c (renamed from drivers/char/vme_scc.c)4
-rw-r--r--drivers/staging/quatech_usb2/quatech_usb2.c6
-rw-r--r--drivers/staging/serqt_usb2/serqt_usb2.c13
-rw-r--r--drivers/staging/tty/Kconfig87
-rw-r--r--drivers/staging/tty/Makefile7
-rw-r--r--drivers/staging/tty/TODO6
-rw-r--r--drivers/staging/tty/epca.c (renamed from drivers/char/epca.c)16
-rw-r--r--drivers/staging/tty/epca.h (renamed from drivers/char/epca.h)0
-rw-r--r--drivers/staging/tty/epcaconfig.h (renamed from drivers/char/epcaconfig.h)0
-rw-r--r--drivers/staging/tty/ip2/Makefile (renamed from drivers/char/ip2/Makefile)0
-rw-r--r--drivers/staging/tty/ip2/i2cmd.c (renamed from drivers/char/ip2/i2cmd.c)0
-rw-r--r--drivers/staging/tty/ip2/i2cmd.h (renamed from drivers/char/ip2/i2cmd.h)0
-rw-r--r--drivers/staging/tty/ip2/i2ellis.c (renamed from drivers/char/ip2/i2ellis.c)0
-rw-r--r--drivers/staging/tty/ip2/i2ellis.h (renamed from drivers/char/ip2/i2ellis.h)0
-rw-r--r--drivers/staging/tty/ip2/i2hw.h (renamed from drivers/char/ip2/i2hw.h)0
-rw-r--r--drivers/staging/tty/ip2/i2lib.c (renamed from drivers/char/ip2/i2lib.c)0
-rw-r--r--drivers/staging/tty/ip2/i2lib.h (renamed from drivers/char/ip2/i2lib.h)0
-rw-r--r--drivers/staging/tty/ip2/i2pack.h (renamed from drivers/char/ip2/i2pack.h)0
-rw-r--r--drivers/staging/tty/ip2/ip2.h (renamed from drivers/char/ip2/ip2.h)0
-rw-r--r--drivers/staging/tty/ip2/ip2ioctl.h (renamed from drivers/char/ip2/ip2ioctl.h)0
-rw-r--r--drivers/staging/tty/ip2/ip2main.c (renamed from drivers/char/ip2/ip2main.c)12
-rw-r--r--drivers/staging/tty/ip2/ip2trace.h (renamed from drivers/char/ip2/ip2trace.h)0
-rw-r--r--drivers/staging/tty/ip2/ip2types.h (renamed from drivers/char/ip2/ip2types.h)0
-rw-r--r--drivers/staging/tty/istallion.c (renamed from drivers/char/istallion.c)8
-rw-r--r--drivers/staging/tty/riscom8.c (renamed from drivers/char/riscom8.c)8
-rw-r--r--drivers/staging/tty/riscom8.h (renamed from drivers/char/riscom8.h)0
-rw-r--r--drivers/staging/tty/riscom8_reg.h (renamed from drivers/char/riscom8_reg.h)0
-rw-r--r--drivers/staging/tty/serial167.c (renamed from drivers/char/serial167.c)7
-rw-r--r--drivers/staging/tty/specialix.c (renamed from drivers/char/specialix.c)6
-rw-r--r--drivers/staging/tty/specialix_io8.h (renamed from drivers/char/specialix_io8.h)0
-rw-r--r--drivers/staging/tty/stallion.c (renamed from drivers/char/stallion.c)9
-rw-r--r--drivers/tty/Kconfig321
-rw-r--r--drivers/tty/Makefile15
-rw-r--r--drivers/tty/amiserial.c (renamed from drivers/char/amiserial.c)8
-rw-r--r--drivers/tty/bfin_jtag_comm.c (renamed from drivers/char/bfin_jtag_comm.c)0
-rw-r--r--drivers/tty/cyclades.c (renamed from drivers/char/cyclades.c)6
-rw-r--r--drivers/tty/hvc/Kconfig105
-rw-r--r--drivers/tty/hvc/Makefile1
-rw-r--r--drivers/tty/hvc/hvc_bfin_jtag.c105
-rw-r--r--drivers/tty/hvc/hvc_dcc.c43
-rw-r--r--drivers/tty/hvc/hvsi.c6
-rw-r--r--drivers/tty/ipwireless/Makefile (renamed from drivers/char/pcmcia/ipwireless/Makefile)0
-rw-r--r--drivers/tty/ipwireless/hardware.c (renamed from drivers/char/pcmcia/ipwireless/hardware.c)0
-rw-r--r--drivers/tty/ipwireless/hardware.h (renamed from drivers/char/pcmcia/ipwireless/hardware.h)0
-rw-r--r--drivers/tty/ipwireless/main.c (renamed from drivers/char/pcmcia/ipwireless/main.c)0
-rw-r--r--drivers/tty/ipwireless/main.h (renamed from drivers/char/pcmcia/ipwireless/main.h)0
-rw-r--r--drivers/tty/ipwireless/network.c (renamed from drivers/char/pcmcia/ipwireless/network.c)0
-rw-r--r--drivers/tty/ipwireless/network.h (renamed from drivers/char/pcmcia/ipwireless/network.h)0
-rw-r--r--drivers/tty/ipwireless/setup_protocol.h (renamed from drivers/char/pcmcia/ipwireless/setup_protocol.h)0
-rw-r--r--drivers/tty/ipwireless/tty.c (renamed from drivers/char/pcmcia/ipwireless/tty.c)8
-rw-r--r--drivers/tty/ipwireless/tty.h (renamed from drivers/char/pcmcia/ipwireless/tty.h)0
-rw-r--r--drivers/tty/isicom.c (renamed from drivers/char/isicom.c)8
-rw-r--r--drivers/tty/moxa.c (renamed from drivers/char/moxa.c)10
-rw-r--r--drivers/tty/moxa.h (renamed from drivers/char/moxa.h)0
-rw-r--r--drivers/tty/mxser.c (renamed from drivers/char/mxser.c)6
-rw-r--r--drivers/tty/mxser.h (renamed from drivers/char/mxser.h)0
-rw-r--r--drivers/tty/n_gsm.c6
-rw-r--r--drivers/tty/nozomi.c (renamed from drivers/char/nozomi.c)8
-rw-r--r--drivers/tty/pty.c4
-rw-r--r--drivers/tty/rocket.c (renamed from drivers/char/rocket.c)8
-rw-r--r--drivers/tty/rocket.h (renamed from drivers/char/rocket.h)0
-rw-r--r--drivers/tty/rocket_int.h (renamed from drivers/char/rocket_int.h)0
-rw-r--r--drivers/tty/serial/68328serial.c25
-rw-r--r--drivers/tty/serial/68328serial.h1
-rw-r--r--drivers/tty/serial/68360serial.c6
-rw-r--r--drivers/tty/serial/8250.c33
-rw-r--r--drivers/tty/serial/Kconfig19
-rw-r--r--drivers/tty/serial/Makefile1
-rw-r--r--drivers/tty/serial/altera_jtaguart.c85
-rw-r--r--drivers/tty/serial/altera_uart.c22
-rw-r--r--drivers/tty/serial/atmel_serial.c16
-rw-r--r--drivers/tty/serial/bfin_sport_uart.c2
-rw-r--r--drivers/tty/serial/crisv10.c7
-rw-r--r--drivers/tty/serial/ifx6x60.c68
-rw-r--r--drivers/tty/serial/ifx6x60.h6
-rw-r--r--drivers/tty/serial/mfd.c73
-rw-r--r--drivers/tty/serial/mrst_max3110.c2
-rw-r--r--drivers/tty/serial/msm_smd_tty.c236
-rw-r--r--drivers/tty/serial/omap-serial.c11
-rw-r--r--drivers/tty/serial/pch_uart.c320
-rw-r--r--drivers/tty/serial/serial_core.c22
-rw-r--r--drivers/tty/synclink.c (renamed from drivers/char/synclink.c)13
-rw-r--r--drivers/tty/synclink_gt.c (renamed from drivers/char/synclink_gt.c)19
-rw-r--r--drivers/tty/synclinkmp.c (renamed from drivers/char/synclinkmp.c)17
-rw-r--r--drivers/tty/tty_io.c22
-rw-r--r--drivers/tty/tty_ioctl.c14
-rw-r--r--drivers/tty/tty_ldisc.c17
-rw-r--r--drivers/tty/vt/keyboard.c5
-rw-r--r--drivers/tty/vt/vc_screen.c110
-rw-r--r--drivers/tty/vt/vt.c27
-rw-r--r--drivers/tty/vt/vt_ioctl.c12
-rw-r--r--drivers/usb/class/cdc-acm.c6
-rw-r--r--drivers/usb/serial/ark3116.c6
-rw-r--r--drivers/usb/serial/belkin_sa.c8
-rw-r--r--drivers/usb/serial/ch341.c7
-rw-r--r--drivers/usb/serial/cp210x.c19
-rw-r--r--drivers/usb/serial/cypress_m8.c12
-rw-r--r--drivers/usb/serial/digi_acceleport.c14
-rw-r--r--drivers/usb/serial/ftdi_sio.c12
-rw-r--r--drivers/usb/serial/io_edgeport.c12
-rw-r--r--drivers/usb/serial/io_ti.c6
-rw-r--r--drivers/usb/serial/iuu_phoenix.c4
-rw-r--r--drivers/usb/serial/keyspan.c4
-rw-r--r--drivers/usb/serial/keyspan.h5
-rw-r--r--drivers/usb/serial/keyspan_pda.c4
-rw-r--r--drivers/usb/serial/kl5kusb105.c8
-rw-r--r--drivers/usb/serial/kobil_sct.c12
-rw-r--r--drivers/usb/serial/mct_u232.c8
-rw-r--r--drivers/usb/serial/mos7720.c8
-rw-r--r--drivers/usb/serial/mos7840.c6
-rw-r--r--drivers/usb/serial/opticon.c4
-rw-r--r--drivers/usb/serial/oti6858.c12
-rw-r--r--drivers/usb/serial/pl2303.c6
-rw-r--r--drivers/usb/serial/sierra.c4
-rw-r--r--drivers/usb/serial/spcp8x5.c6
-rw-r--r--drivers/usb/serial/ssu100.c6
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c14
-rw-r--r--drivers/usb/serial/usb-serial.c12
-rw-r--r--drivers/usb/serial/usb-wwan.h6
-rw-r--r--drivers/usb/serial/usb_wwan.c6
-rw-r--r--drivers/usb/serial/whiteheat.c12
187 files changed, 1782 insertions, 1270 deletions
diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 6a160c17ea94..bd34406faaae 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -51,32 +51,32 @@ struct ath_struct {
51 51
52static int ath_wakeup_ar3k(struct tty_struct *tty) 52static int ath_wakeup_ar3k(struct tty_struct *tty)
53{ 53{
54 struct termios settings; 54 struct ktermios ktermios;
55 int status = tty->driver->ops->tiocmget(tty, NULL); 55 int status = tty->driver->ops->tiocmget(tty);
56 56
57 if (status & TIOCM_CTS) 57 if (status & TIOCM_CTS)
58 return status; 58 return status;
59 59
60 /* Disable Automatic RTSCTS */ 60 /* Disable Automatic RTSCTS */
61 n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); 61 memcpy(&ktermios, tty->termios, sizeof(ktermios));
62 settings.c_cflag &= ~CRTSCTS; 62 ktermios.c_cflag &= ~CRTSCTS;
63 n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); 63 tty_set_termios(tty, &ktermios);
64 64
65 /* Clear RTS first */ 65 /* Clear RTS first */
66 status = tty->driver->ops->tiocmget(tty, NULL); 66 status = tty->driver->ops->tiocmget(tty);
67 tty->driver->ops->tiocmset(tty, NULL, 0x00, TIOCM_RTS); 67 tty->driver->ops->tiocmset(tty, 0x00, TIOCM_RTS);
68 mdelay(20); 68 mdelay(20);
69 69
70 /* Set RTS, wake up board */ 70 /* Set RTS, wake up board */
71 status = tty->driver->ops->tiocmget(tty, NULL); 71 status = tty->driver->ops->tiocmget(tty);
72 tty->driver->ops->tiocmset(tty, NULL, TIOCM_RTS, 0x00); 72 tty->driver->ops->tiocmset(tty, TIOCM_RTS, 0x00);
73 mdelay(20); 73 mdelay(20);
74 74
75 status = tty->driver->ops->tiocmget(tty, NULL); 75 status = tty->driver->ops->tiocmget(tty);
76 76
77 n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); 77 /* Disable Automatic RTSCTS */
78 settings.c_cflag |= CRTSCTS; 78 ktermios.c_cflag |= CRTSCTS;
79 n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); 79 status = tty_set_termios(tty, &ktermios);
80 80
81 return status; 81 return status;
82} 82}
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index b7980a83ce2d..04f8b2d083c6 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -4,89 +4,7 @@
4 4
5menu "Character devices" 5menu "Character devices"
6 6
7config VT 7source "drivers/tty/Kconfig"
8 bool "Virtual terminal" if EXPERT
9 depends on !S390
10 select INPUT
11 default y
12 ---help---
13 If you say Y here, you will get support for terminal devices with
14 display and keyboard devices. These are called "virtual" because you
15 can run several virtual terminals (also called virtual consoles) on
16 one physical terminal. This is rather useful, for example one
17 virtual terminal can collect system messages and warnings, another
18 one can be used for a text-mode user session, and a third could run
19 an X session, all in parallel. Switching between virtual terminals
20 is done with certain key combinations, usually Alt-<function key>.
21
22 The setterm command ("man setterm") can be used to change the
23 properties (such as colors or beeping) of a virtual terminal. The
24 man page console_codes(4) ("man console_codes") contains the special
25 character sequences that can be used to change those properties
26 directly. The fonts used on virtual terminals can be changed with
27 the setfont ("man setfont") command and the key bindings are defined
28 with the loadkeys ("man loadkeys") command.
29
30 You need at least one virtual terminal device in order to make use
31 of your keyboard and monitor. Therefore, only people configuring an
32 embedded system would want to say N here in order to save some
33 memory; the only way to log into such a system is then via a serial
34 or network connection.
35
36 If unsure, say Y, or else you won't be able to do much with your new
37 shiny Linux system :-)
38
39config CONSOLE_TRANSLATIONS
40 depends on VT
41 default y
42 bool "Enable character translations in console" if EXPERT
43 ---help---
44 This enables support for font mapping and Unicode translation
45 on virtual consoles.
46
47config VT_CONSOLE
48 bool "Support for console on virtual terminal" if EXPERT
49 depends on VT
50 default y
51 ---help---
52 The system console is the device which receives all kernel messages
53 and warnings and which allows logins in single user mode. If you
54 answer Y here, a virtual terminal (the device used to interact with
55 a physical terminal) can be used as system console. This is the most
56 common mode of operations, so you should say Y here unless you want
57 the kernel messages be output only to a serial port (in which case
58 you should say Y to "Console on serial port", below).
59
60 If you do say Y here, by default the currently visible virtual
61 terminal (/dev/tty0) will be used as system console. You can change
62 that with a kernel command line option such as "console=tty3" which
63 would use the third virtual terminal as system console. (Try "man
64 bootparam" or see the documentation of your boot loader (lilo or
65 loadlin) about how to pass options to the kernel at boot time.)
66
67 If unsure, say Y.
68
69config HW_CONSOLE
70 bool
71 depends on VT && !S390 && !UML
72 default y
73
74config VT_HW_CONSOLE_BINDING
75 bool "Support for binding and unbinding console drivers"
76 depends on HW_CONSOLE
77 default n
78 ---help---
79 The virtual terminal is the device that interacts with the physical
80 terminal through console drivers. On these systems, at least one
81 console driver is loaded. In other configurations, additional console
82 drivers may be enabled, such as the framebuffer console. If more than
83 1 console driver is enabled, setting this to 'y' will allow you to
84 select the console driver that will serve as the backend for the
85 virtual terminals.
86
87 See <file:Documentation/console/console.txt> for more
88 information. For framebuffer console users, please refer to
89 <file:Documentation/fb/fbcon.txt>.
90 8
91config DEVKMEM 9config DEVKMEM
92 bool "/dev/kmem virtual device support" 10 bool "/dev/kmem virtual device support"
@@ -97,253 +15,6 @@ config DEVKMEM
97 kind of kernel debugging operations. 15 kind of kernel debugging operations.
98 When in doubt, say "N". 16 When in doubt, say "N".
99 17
100config BFIN_JTAG_COMM
101 tristate "Blackfin JTAG Communication"
102 depends on BLACKFIN
103 help
104 Add support for emulating a TTY device over the Blackfin JTAG.
105
106 To compile this driver as a module, choose M here: the
107 module will be called bfin_jtag_comm.
108
109config BFIN_JTAG_COMM_CONSOLE
110 bool "Console on Blackfin JTAG"
111 depends on BFIN_JTAG_COMM=y
112
113config SERIAL_NONSTANDARD
114 bool "Non-standard serial port support"
115 depends on HAS_IOMEM
116 ---help---
117 Say Y here if you have any non-standard serial boards -- boards
118 which aren't supported using the standard "dumb" serial driver.
119 This includes intelligent serial boards such as Cyclades,
120 Digiboards, etc. These are usually used for systems that need many
121 serial ports because they serve many terminals or dial-in
122 connections.
123
124 Note that the answer to this question won't directly affect the
125 kernel: saying N will just cause the configurator to skip all
126 the questions about non-standard serial boards.
127
128 Most people can say N here.
129
130config COMPUTONE
131 tristate "Computone IntelliPort Plus serial support"
132 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
133 ---help---
134 This driver supports the entire family of Intelliport II/Plus
135 controllers with the exception of the MicroChannel controllers and
136 products previous to the Intelliport II. These are multiport cards,
137 which give you many serial ports. You would need something like this
138 to connect more than two modems to your Linux box, for instance in
139 order to become a dial-in server. If you have a card like that, say
140 Y here and read <file:Documentation/serial/computone.txt>.
141
142 To compile this driver as module, choose M here: the
143 module will be called ip2.
144
145config ROCKETPORT
146 tristate "Comtrol RocketPort support"
147 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
148 help
149 This driver supports Comtrol RocketPort and RocketModem PCI boards.
150 These boards provide 2, 4, 8, 16, or 32 high-speed serial ports or
151 modems. For information about the RocketPort/RocketModem boards
152 and this driver read <file:Documentation/serial/rocket.txt>.
153
154 To compile this driver as a module, choose M here: the
155 module will be called rocket.
156
157 If you want to compile this driver into the kernel, say Y here. If
158 you don't have a Comtrol RocketPort/RocketModem card installed, say N.
159
160config CYCLADES
161 tristate "Cyclades async mux support"
162 depends on SERIAL_NONSTANDARD && (PCI || ISA)
163 select FW_LOADER
164 ---help---
165 This driver supports Cyclades Z and Y multiserial boards.
166 You would need something like this to connect more than two modems to
167 your Linux box, for instance in order to become a dial-in server.
168
169 For information about the Cyclades-Z card, read
170 <file:Documentation/serial/README.cycladesZ>.
171
172 To compile this driver as a module, choose M here: the
173 module will be called cyclades.
174
175 If you haven't heard about it, it's safe to say N.
176
177config CYZ_INTR
178 bool "Cyclades-Z interrupt mode operation (EXPERIMENTAL)"
179 depends on EXPERIMENTAL && CYCLADES
180 help
181 The Cyclades-Z family of multiport cards allows 2 (two) driver op
182 modes: polling and interrupt. In polling mode, the driver will check
183 the status of the Cyclades-Z ports every certain amount of time
184 (which is called polling cycle and is configurable). In interrupt
185 mode, it will use an interrupt line (IRQ) in order to check the
186 status of the Cyclades-Z ports. The default op mode is polling. If
187 unsure, say N.
188
189config DIGIEPCA
190 tristate "Digiboard Intelligent Async Support"
191 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
192 ---help---
193 This is a driver for Digi International's Xx, Xeve, and Xem series
194 of cards which provide multiple serial ports. You would need
195 something like this to connect more than two modems to your Linux
196 box, for instance in order to become a dial-in server. This driver
197 supports the original PC (ISA) boards as well as PCI, and EISA. If
198 you have a card like this, say Y here and read the file
199 <file:Documentation/serial/digiepca.txt>.
200
201 To compile this driver as a module, choose M here: the
202 module will be called epca.
203
204config MOXA_INTELLIO
205 tristate "Moxa Intellio support"
206 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
207 select FW_LOADER
208 help
209 Say Y here if you have a Moxa Intellio multiport serial card.
210
211 To compile this driver as a module, choose M here: the
212 module will be called moxa.
213
214config MOXA_SMARTIO
215 tristate "Moxa SmartIO support v. 2.0"
216 depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA)
217 help
218 Say Y here if you have a Moxa SmartIO multiport serial card and/or
219 want to help develop a new version of this driver.
220
221 This is upgraded (1.9.1) driver from original Moxa drivers with
222 changes finally resulting in PCI probing.
223
224 This driver can also be built as a module. The module will be called
225 mxser. If you want to do that, say M here.
226
227config ISI
228 tristate "Multi-Tech multiport card support (EXPERIMENTAL)"
229 depends on SERIAL_NONSTANDARD && PCI
230 select FW_LOADER
231 help
232 This is a driver for the Multi-Tech cards which provide several
233 serial ports. The driver is experimental and can currently only be
234 built as a module. The module will be called isicom.
235 If you want to do that, choose M here.
236
237config SYNCLINK
238 tristate "Microgate SyncLink card support"
239 depends on SERIAL_NONSTANDARD && PCI && ISA_DMA_API
240 help
241 Provides support for the SyncLink ISA and PCI multiprotocol serial
242 adapters. These adapters support asynchronous and HDLC bit
243 synchronous communication up to 10Mbps (PCI adapter).
244
245 This driver can only be built as a module ( = code which can be
246 inserted in and removed from the running kernel whenever you want).
247 The module will be called synclink. If you want to do that, say M
248 here.
249
250config SYNCLINKMP
251 tristate "SyncLink Multiport support"
252 depends on SERIAL_NONSTANDARD && PCI
253 help
254 Enable support for the SyncLink Multiport (2 or 4 ports)
255 serial adapter, running asynchronous and HDLC communications up
256 to 2.048Mbps. Each ports is independently selectable for
257 RS-232, V.35, RS-449, RS-530, and X.21
258
259 This driver may be built as a module ( = code which can be
260 inserted in and removed from the running kernel whenever you want).
261 The module will be called synclinkmp. If you want to do that, say M
262 here.
263
264config SYNCLINK_GT
265 tristate "SyncLink GT/AC support"
266 depends on SERIAL_NONSTANDARD && PCI
267 help
268 Support for SyncLink GT and SyncLink AC families of
269 synchronous and asynchronous serial adapters
270 manufactured by Microgate Systems, Ltd. (www.microgate.com)
271
272config N_HDLC
273 tristate "HDLC line discipline support"
274 depends on SERIAL_NONSTANDARD
275 help
276 Allows synchronous HDLC communications with tty device drivers that
277 support synchronous HDLC such as the Microgate SyncLink adapter.
278
279 This driver can be built as a module ( = code which can be
280 inserted in and removed from the running kernel whenever you want).
281 The module will be called n_hdlc. If you want to do that, say M
282 here.
283
284config N_GSM
285 tristate "GSM MUX line discipline support (EXPERIMENTAL)"
286 depends on EXPERIMENTAL
287 depends on NET
288 help
289 This line discipline provides support for the GSM MUX protocol and
290 presents the mux as a set of 61 individual tty devices.
291
292config RISCOM8
293 tristate "SDL RISCom/8 card support"
294 depends on SERIAL_NONSTANDARD
295 help
296 This is a driver for the SDL Communications RISCom/8 multiport card,
297 which gives you many serial ports. You would need something like
298 this to connect more than two modems to your Linux box, for instance
299 in order to become a dial-in server. If you have a card like that,
300 say Y here and read the file <file:Documentation/serial/riscom8.txt>.
301
302 Also it's possible to say M here and compile this driver as kernel
303 loadable module; the module will be called riscom8.
304
305config SPECIALIX
306 tristate "Specialix IO8+ card support"
307 depends on SERIAL_NONSTANDARD
308 help
309 This is a driver for the Specialix IO8+ multiport card (both the
310 ISA and the PCI version) which gives you many serial ports. You
311 would need something like this to connect more than two modems to
312 your Linux box, for instance in order to become a dial-in server.
313
314 If you have a card like that, say Y here and read the file
315 <file:Documentation/serial/specialix.txt>. Also it's possible to say
316 M here and compile this driver as kernel loadable module which will be
317 called specialix.
318
319config SX
320 tristate "Specialix SX (and SI) card support"
321 depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) && BROKEN
322 help
323 This is a driver for the SX and SI multiport serial cards.
324 Please read the file <file:Documentation/serial/sx.txt> for details.
325
326 This driver can only be built as a module ( = code which can be
327 inserted in and removed from the running kernel whenever you want).
328 The module will be called sx. If you want to do that, say M here.
329
330config RIO
331 tristate "Specialix RIO system support"
332 depends on SERIAL_NONSTANDARD && BROKEN
333 help
334 This is a driver for the Specialix RIO, a smart serial card which
335 drives an outboard box that can support up to 128 ports. Product
336 information is at <http://www.perle.com/support/documentation.html#multiport>.
337 There are both ISA and PCI versions.
338
339config RIO_OLDPCI
340 bool "Support really old RIO/PCI cards"
341 depends on RIO
342 help
343 Older RIO PCI cards need some initialization-time configuration to
344 determine the IRQ and some control addresses. If you have a RIO and
345 this doesn't seem to work, try setting this to Y.
346
347config STALDRV 18config STALDRV
348 bool "Stallion multiport serial support" 19 bool "Stallion multiport serial support"
349 depends on SERIAL_NONSTANDARD 20 depends on SERIAL_NONSTANDARD
@@ -356,54 +27,6 @@ config STALDRV
356 in this case. If you have never heard about all this, it's safe to 27 in this case. If you have never heard about all this, it's safe to
357 say N. 28 say N.
358 29
359config STALLION
360 tristate "Stallion EasyIO or EC8/32 support"
361 depends on STALDRV && (ISA || EISA || PCI)
362 help
363 If you have an EasyIO or EasyConnection 8/32 multiport Stallion
364 card, then this is for you; say Y. Make sure to read
365 <file:Documentation/serial/stallion.txt>.
366
367 To compile this driver as a module, choose M here: the
368 module will be called stallion.
369
370config ISTALLION
371 tristate "Stallion EC8/64, ONboard, Brumby support"
372 depends on STALDRV && (ISA || EISA || PCI)
373 help
374 If you have an EasyConnection 8/64, ONboard, Brumby or Stallion
375 serial multiport card, say Y here. Make sure to read
376 <file:Documentation/serial/stallion.txt>.
377
378 To compile this driver as a module, choose M here: the
379 module will be called istallion.
380
381config NOZOMI
382 tristate "HSDPA Broadband Wireless Data Card - Globe Trotter"
383 depends on PCI && EXPERIMENTAL
384 help
385 If you have a HSDPA driver Broadband Wireless Data Card -
386 Globe Trotter PCMCIA card, say Y here.
387
388 To compile this driver as a module, choose M here, the module
389 will be called nozomi.
390
391config A2232
392 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
393 depends on EXPERIMENTAL && ZORRO && BROKEN
394 ---help---
395 This option supports the 2232 7-port serial card shipped with the
396 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
397 a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
398 each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
399 ports were connected with 8 pin DIN connectors on the card bracket,
400 for which 8 pin to DB25 adapters were supplied. The card also had
401 jumpers internally to toggle various pinning configurations.
402
403 This driver can be built as a module; but then "generic_serial"
404 will also be built as a module. This has to be loaded before
405 "ser_a2232". If you want to do this, answer M here.
406
407config SGI_SNSC 30config SGI_SNSC
408 bool "SGI Altix system controller communication support" 31 bool "SGI Altix system controller communication support"
409 depends on (IA64_SGI_SN2 || IA64_GENERIC) 32 depends on (IA64_SGI_SN2 || IA64_GENERIC)
@@ -428,71 +51,6 @@ config SGI_MBCS
428 51
429source "drivers/tty/serial/Kconfig" 52source "drivers/tty/serial/Kconfig"
430 53
431config UNIX98_PTYS
432 bool "Unix98 PTY support" if EXPERT
433 default y
434 ---help---
435 A pseudo terminal (PTY) is a software device consisting of two
436 halves: a master and a slave. The slave device behaves identical to
437 a physical terminal; the master device is used by a process to
438 read data from and write data to the slave, thereby emulating a
439 terminal. Typical programs for the master side are telnet servers
440 and xterms.
441
442 Linux has traditionally used the BSD-like names /dev/ptyxx for
443 masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
444 has a number of problems. The GNU C library glibc 2.1 and later,
445 however, supports the Unix98 naming standard: in order to acquire a
446 pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
447 terminal is then made available to the process and the pseudo
448 terminal slave can be accessed as /dev/pts/<number>. What was
449 traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
450
451 All modern Linux systems use the Unix98 ptys. Say Y unless
452 you're on an embedded system and want to conserve memory.
453
454config DEVPTS_MULTIPLE_INSTANCES
455 bool "Support multiple instances of devpts"
456 depends on UNIX98_PTYS
457 default n
458 ---help---
459 Enable support for multiple instances of devpts filesystem.
460 If you want to have isolated PTY namespaces (eg: in containers),
461 say Y here. Otherwise, say N. If enabled, each mount of devpts
462 filesystem with the '-o newinstance' option will create an
463 independent PTY namespace.
464
465config LEGACY_PTYS
466 bool "Legacy (BSD) PTY support"
467 default y
468 ---help---
469 A pseudo terminal (PTY) is a software device consisting of two
470 halves: a master and a slave. The slave device behaves identical to
471 a physical terminal; the master device is used by a process to
472 read data from and write data to the slave, thereby emulating a
473 terminal. Typical programs for the master side are telnet servers
474 and xterms.
475
476 Linux has traditionally used the BSD-like names /dev/ptyxx
477 for masters and /dev/ttyxx for slaves of pseudo
478 terminals. This scheme has a number of problems, including
479 security. This option enables these legacy devices; on most
480 systems, it is safe to say N.
481
482
483config LEGACY_PTY_COUNT
484 int "Maximum number of legacy PTY in use"
485 depends on LEGACY_PTYS
486 range 0 256
487 default "256"
488 ---help---
489 The maximum number of legacy PTYs that can be used at any one time.
490 The default is 256, and should be more than enough. Embedded
491 systems may want to reduce this to save memory.
492
493 When not in use, each legacy PTY occupies 12 bytes on 32-bit
494 architectures and 24 bytes on 64-bit architectures.
495
496config TTY_PRINTK 54config TTY_PRINTK
497 bool "TTY driver to output user messages via printk" 55 bool "TTY driver to output user messages via printk"
498 depends on EXPERT 56 depends on EXPERT
@@ -612,84 +170,7 @@ config PPDEV
612 170
613 If unsure, say N. 171 If unsure, say N.
614 172
615config HVC_DRIVER 173source "drivers/tty/hvc/Kconfig"
616 bool
617 help
618 Generic "hypervisor virtual console" infrastructure for various
619 hypervisors (pSeries, iSeries, Xen, lguest).
620 It will automatically be selected if one of the back-end console drivers
621 is selected.
622
623config HVC_IRQ
624 bool
625
626config HVC_CONSOLE
627 bool "pSeries Hypervisor Virtual Console support"
628 depends on PPC_PSERIES
629 select HVC_DRIVER
630 select HVC_IRQ
631 help
632 pSeries machines when partitioned support a hypervisor virtual
633 console. This driver allows each pSeries partition to have a console
634 which is accessed via the HMC.
635
636config HVC_ISERIES
637 bool "iSeries Hypervisor Virtual Console support"
638 depends on PPC_ISERIES
639 default y
640 select HVC_DRIVER
641 select HVC_IRQ
642 select VIOPATH
643 help
644 iSeries machines support a hypervisor virtual console.
645
646config HVC_RTAS
647 bool "IBM RTAS Console support"
648 depends on PPC_RTAS
649 select HVC_DRIVER
650 help
651 IBM Console device driver which makes use of RTAS
652
653config HVC_BEAT
654 bool "Toshiba's Beat Hypervisor Console support"
655 depends on PPC_CELLEB
656 select HVC_DRIVER
657 help
658 Toshiba's Cell Reference Set Beat Console device driver
659
660config HVC_IUCV
661 bool "z/VM IUCV Hypervisor console support (VM only)"
662 depends on S390
663 select HVC_DRIVER
664 select IUCV
665 default y
666 help
667 This driver provides a Hypervisor console (HVC) back-end to access
668 a Linux (console) terminal via a z/VM IUCV communication path.
669
670config HVC_XEN
671 bool "Xen Hypervisor Console support"
672 depends on XEN
673 select HVC_DRIVER
674 select HVC_IRQ
675 default y
676 help
677 Xen virtual console device driver
678
679config HVC_UDBG
680 bool "udbg based fake hypervisor console"
681 depends on PPC && EXPERIMENTAL
682 select HVC_DRIVER
683 default n
684
685config HVC_DCC
686 bool "ARM JTAG DCC console"
687 depends on ARM
688 select HVC_DRIVER
689 help
690 This console uses the JTAG DCC on ARM to create a console under the HVC
691 driver. This console is used through a JTAG only on ARM. If you don't have
692 a JTAG then you probably don't want this option.
693 174
694config VIRTIO_CONSOLE 175config VIRTIO_CONSOLE
695 tristate "Virtio console" 176 tristate "Virtio console"
@@ -707,23 +188,6 @@ config VIRTIO_CONSOLE
707 the port which can be used by udev scripts to create a 188 the port which can be used by udev scripts to create a
708 symlink to the device. 189 symlink to the device.
709 190
710config HVCS
711 tristate "IBM Hypervisor Virtual Console Server support"
712 depends on PPC_PSERIES && HVC_CONSOLE
713 help
714 Partitionable IBM Power5 ppc64 machines allow hosting of
715 firmware virtual consoles from one Linux partition by
716 another Linux partition. This driver allows console data
717 from Linux partitions to be accessed through TTY device
718 interfaces in the device tree of a Linux partition running
719 this driver.
720
721 To compile this driver as a module, choose M here: the
722 module will be called hvcs. Additionally, this module
723 will depend on arch specific APIs exported from hvcserver.ko
724 which will also be compiled when this driver is built as a
725 module.
726
727config IBM_BSR 191config IBM_BSR
728 tristate "IBM POWER Barrier Synchronization Register support" 192 tristate "IBM POWER Barrier Synchronization Register support"
729 depends on PPC_PSERIES 193 depends on PPC_PSERIES
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 8238f89f73c9..057f65452e7b 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -5,31 +5,7 @@
5obj-y += mem.o random.o 5obj-y += mem.o random.o
6obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o 6obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o
7obj-y += misc.o 7obj-y += misc.o
8obj-$(CONFIG_BFIN_JTAG_COMM) += bfin_jtag_comm.o
9obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o
10obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o
11obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o
12obj-$(CONFIG_ROCKETPORT) += rocket.o
13obj-$(CONFIG_SERIAL167) += serial167.o
14obj-$(CONFIG_CYCLADES) += cyclades.o
15obj-$(CONFIG_STALLION) += stallion.o
16obj-$(CONFIG_ISTALLION) += istallion.o
17obj-$(CONFIG_NOZOMI) += nozomi.o
18obj-$(CONFIG_DIGIEPCA) += epca.o
19obj-$(CONFIG_SPECIALIX) += specialix.o
20obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
21obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o
22obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o 8obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
23obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
24obj-$(CONFIG_COMPUTONE) += ip2/
25obj-$(CONFIG_RISCOM8) += riscom8.o
26obj-$(CONFIG_ISI) += isicom.o
27obj-$(CONFIG_SYNCLINK) += synclink.o
28obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o
29obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o
30obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
31obj-$(CONFIG_SX) += sx.o generic_serial.o
32obj-$(CONFIG_RIO) += rio/ generic_serial.o
33obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o 9obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o
34obj-$(CONFIG_RAW_DRIVER) += raw.o 10obj-$(CONFIG_RAW_DRIVER) += raw.o
35obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o 11obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index eaa41992fbe2..02127cad0980 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -418,9 +418,9 @@ static void bh_status(MGSLPC_INFO *info);
418/* 418/*
419 * ioctl handlers 419 * ioctl handlers
420 */ 420 */
421static int tiocmget(struct tty_struct *tty, struct file *file); 421static int tiocmget(struct tty_struct *tty);
422static int tiocmset(struct tty_struct *tty, struct file *file, 422static int tiocmset(struct tty_struct *tty,
423 unsigned int set, unsigned int clear); 423 unsigned int set, unsigned int clear);
424static int get_stats(MGSLPC_INFO *info, struct mgsl_icount __user *user_icount); 424static int get_stats(MGSLPC_INFO *info, struct mgsl_icount __user *user_icount);
425static int get_params(MGSLPC_INFO *info, MGSL_PARAMS __user *user_params); 425static int get_params(MGSLPC_INFO *info, MGSL_PARAMS __user *user_params);
426static int set_params(MGSLPC_INFO *info, MGSL_PARAMS __user *new_params, struct tty_struct *tty); 426static int set_params(MGSLPC_INFO *info, MGSL_PARAMS __user *new_params, struct tty_struct *tty);
@@ -2114,7 +2114,7 @@ static int modem_input_wait(MGSLPC_INFO *info,int arg)
2114 2114
2115/* return the state of the serial control and status signals 2115/* return the state of the serial control and status signals
2116 */ 2116 */
2117static int tiocmget(struct tty_struct *tty, struct file *file) 2117static int tiocmget(struct tty_struct *tty)
2118{ 2118{
2119 MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; 2119 MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
2120 unsigned int result; 2120 unsigned int result;
@@ -2139,7 +2139,7 @@ static int tiocmget(struct tty_struct *tty, struct file *file)
2139 2139
2140/* set modem control signals (DTR/RTS) 2140/* set modem control signals (DTR/RTS)
2141 */ 2141 */
2142static int tiocmset(struct tty_struct *tty, struct file *file, 2142static int tiocmset(struct tty_struct *tty,
2143 unsigned int set, unsigned int clear) 2143 unsigned int set, unsigned int clear)
2144{ 2144{
2145 MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; 2145 MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
index c40c1612c8a7..a1f68af4ccf4 100644
--- a/drivers/char/ttyprintk.c
+++ b/drivers/char/ttyprintk.c
@@ -144,7 +144,7 @@ static int tpk_write_room(struct tty_struct *tty)
144/* 144/*
145 * TTY operations ioctl function. 145 * TTY operations ioctl function.
146 */ 146 */
147static int tpk_ioctl(struct tty_struct *tty, struct file *file, 147static int tpk_ioctl(struct tty_struct *tty,
148 unsigned int cmd, unsigned long arg) 148 unsigned int cmd, unsigned long arg)
149{ 149{
150 struct ttyprintk_port *tpkp = tty->driver_data; 150 struct ttyprintk_port *tpkp = tty->driver_data;
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index f80a7c48a35f..0d7088367038 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1219,16 +1219,10 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1219 return mp->outbytes; 1219 return mp->outbytes;
1220} 1220}
1221 1221
1222static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file, 1222static int capinc_tty_ioctl(struct tty_struct *tty,
1223 unsigned int cmd, unsigned long arg) 1223 unsigned int cmd, unsigned long arg)
1224{ 1224{
1225 int error = 0; 1225 return -ENOIOCTLCMD;
1226 switch (cmd) {
1227 default:
1228 error = n_tty_ioctl_helper(tty, file, cmd, arg);
1229 break;
1230 }
1231 return error;
1232} 1226}
1233 1227
1234static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old) 1228static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index bb710d16a526..59de638225fe 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -115,15 +115,15 @@ static int if_config(struct cardstate *cs, int *arg)
115 115
116static int if_open(struct tty_struct *tty, struct file *filp); 116static int if_open(struct tty_struct *tty, struct file *filp);
117static void if_close(struct tty_struct *tty, struct file *filp); 117static void if_close(struct tty_struct *tty, struct file *filp);
118static int if_ioctl(struct tty_struct *tty, struct file *file, 118static int if_ioctl(struct tty_struct *tty,
119 unsigned int cmd, unsigned long arg); 119 unsigned int cmd, unsigned long arg);
120static int if_write_room(struct tty_struct *tty); 120static int if_write_room(struct tty_struct *tty);
121static int if_chars_in_buffer(struct tty_struct *tty); 121static int if_chars_in_buffer(struct tty_struct *tty);
122static void if_throttle(struct tty_struct *tty); 122static void if_throttle(struct tty_struct *tty);
123static void if_unthrottle(struct tty_struct *tty); 123static void if_unthrottle(struct tty_struct *tty);
124static void if_set_termios(struct tty_struct *tty, struct ktermios *old); 124static void if_set_termios(struct tty_struct *tty, struct ktermios *old);
125static int if_tiocmget(struct tty_struct *tty, struct file *file); 125static int if_tiocmget(struct tty_struct *tty);
126static int if_tiocmset(struct tty_struct *tty, struct file *file, 126static int if_tiocmset(struct tty_struct *tty,
127 unsigned int set, unsigned int clear); 127 unsigned int set, unsigned int clear);
128static int if_write(struct tty_struct *tty, 128static int if_write(struct tty_struct *tty,
129 const unsigned char *buf, int count); 129 const unsigned char *buf, int count);
@@ -205,7 +205,7 @@ static void if_close(struct tty_struct *tty, struct file *filp)
205 module_put(cs->driver->owner); 205 module_put(cs->driver->owner);
206} 206}
207 207
208static int if_ioctl(struct tty_struct *tty, struct file *file, 208static int if_ioctl(struct tty_struct *tty,
209 unsigned int cmd, unsigned long arg) 209 unsigned int cmd, unsigned long arg)
210{ 210{
211 struct cardstate *cs; 211 struct cardstate *cs;
@@ -280,7 +280,7 @@ static int if_ioctl(struct tty_struct *tty, struct file *file,
280 return retval; 280 return retval;
281} 281}
282 282
283static int if_tiocmget(struct tty_struct *tty, struct file *file) 283static int if_tiocmget(struct tty_struct *tty)
284{ 284{
285 struct cardstate *cs; 285 struct cardstate *cs;
286 int retval; 286 int retval;
@@ -303,7 +303,7 @@ static int if_tiocmget(struct tty_struct *tty, struct file *file)
303 return retval; 303 return retval;
304} 304}
305 305
306static int if_tiocmset(struct tty_struct *tty, struct file *file, 306static int if_tiocmset(struct tty_struct *tty,
307 unsigned int set, unsigned int clear) 307 unsigned int set, unsigned int clear)
308{ 308{
309 struct cardstate *cs; 309 struct cardstate *cs;
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index 0ef09d0eb96b..86a5c4f7775e 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -440,7 +440,7 @@ static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
440 if (!set && !clear) 440 if (!set && !clear)
441 return 0; 441 return 0;
442 gig_dbg(DEBUG_IF, "tiocmset set %x clear %x", set, clear); 442 gig_dbg(DEBUG_IF, "tiocmset set %x clear %x", set, clear);
443 return tty->ops->tiocmset(tty, NULL, set, clear); 443 return tty->ops->tiocmset(tty, set, clear);
444} 444}
445 445
446static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag) 446static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index c463162843ba..3d88f15aa218 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1345,7 +1345,7 @@ isdn_tty_get_lsr_info(modem_info * info, uint __user * value)
1345 1345
1346 1346
1347static int 1347static int
1348isdn_tty_tiocmget(struct tty_struct *tty, struct file *file) 1348isdn_tty_tiocmget(struct tty_struct *tty)
1349{ 1349{
1350 modem_info *info = (modem_info *) tty->driver_data; 1350 modem_info *info = (modem_info *) tty->driver_data;
1351 u_char control, status; 1351 u_char control, status;
@@ -1372,7 +1372,7 @@ isdn_tty_tiocmget(struct tty_struct *tty, struct file *file)
1372} 1372}
1373 1373
1374static int 1374static int
1375isdn_tty_tiocmset(struct tty_struct *tty, struct file *file, 1375isdn_tty_tiocmset(struct tty_struct *tty,
1376 unsigned int set, unsigned int clear) 1376 unsigned int set, unsigned int clear)
1377{ 1377{
1378 modem_info *info = (modem_info *) tty->driver_data; 1378 modem_info *info = (modem_info *) tty->driver_data;
@@ -1413,8 +1413,7 @@ isdn_tty_tiocmset(struct tty_struct *tty, struct file *file,
1413} 1413}
1414 1414
1415static int 1415static int
1416isdn_tty_ioctl(struct tty_struct *tty, struct file *file, 1416isdn_tty_ioctl(struct tty_struct *tty, uint cmd, ulong arg)
1417 uint cmd, ulong arg)
1418{ 1417{
1419 modem_info *info = (modem_info *) tty->driver_data; 1418 modem_info *info = (modem_info *) tty->driver_data;
1420 int retval; 1419 int retval;
diff --git a/drivers/mmc/card/sdio_uart.c b/drivers/mmc/card/sdio_uart.c
index a0716967b7c8..c8c9edb3d7cb 100644
--- a/drivers/mmc/card/sdio_uart.c
+++ b/drivers/mmc/card/sdio_uart.c
@@ -956,7 +956,7 @@ static int sdio_uart_break_ctl(struct tty_struct *tty, int break_state)
956 return 0; 956 return 0;
957} 957}
958 958
959static int sdio_uart_tiocmget(struct tty_struct *tty, struct file *file) 959static int sdio_uart_tiocmget(struct tty_struct *tty)
960{ 960{
961 struct sdio_uart_port *port = tty->driver_data; 961 struct sdio_uart_port *port = tty->driver_data;
962 int result; 962 int result;
@@ -970,7 +970,7 @@ static int sdio_uart_tiocmget(struct tty_struct *tty, struct file *file)
970 return result; 970 return result;
971} 971}
972 972
973static int sdio_uart_tiocmset(struct tty_struct *tty, struct file *file, 973static int sdio_uart_tiocmset(struct tty_struct *tty,
974 unsigned int set, unsigned int clear) 974 unsigned int set, unsigned int clear)
975{ 975{
976 struct sdio_uart_port *port = tty->driver_data; 976 struct sdio_uart_port *port = tty->driver_data;
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index ee1dde52e8fc..3352b2443e58 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -167,7 +167,7 @@ static int irtty_set_dtr_rts(struct sir_dev *dev, int dtr, int rts)
167 * let's be careful... Jean II 167 * let's be careful... Jean II
168 */ 168 */
169 IRDA_ASSERT(priv->tty->ops->tiocmset != NULL, return -1;); 169 IRDA_ASSERT(priv->tty->ops->tiocmset != NULL, return -1;);
170 priv->tty->ops->tiocmset(priv->tty, NULL, set, clear); 170 priv->tty->ops->tiocmset(priv->tty, set, clear);
171 171
172 return 0; 172 return 0;
173} 173}
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 6d83812603b6..387ca43f26f4 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -324,7 +324,7 @@ struct hso_device {
324/* Prototypes */ 324/* Prototypes */
325/*****************************************************************************/ 325/*****************************************************************************/
326/* Serial driver functions */ 326/* Serial driver functions */
327static int hso_serial_tiocmset(struct tty_struct *tty, struct file *file, 327static int hso_serial_tiocmset(struct tty_struct *tty,
328 unsigned int set, unsigned int clear); 328 unsigned int set, unsigned int clear);
329static void ctrl_callback(struct urb *urb); 329static void ctrl_callback(struct urb *urb);
330static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial); 330static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial);
@@ -1335,7 +1335,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
1335 1335
1336 /* done */ 1336 /* done */
1337 if (result) 1337 if (result)
1338 hso_serial_tiocmset(tty, NULL, TIOCM_RTS | TIOCM_DTR, 0); 1338 hso_serial_tiocmset(tty, TIOCM_RTS | TIOCM_DTR, 0);
1339err_out: 1339err_out:
1340 mutex_unlock(&serial->parent->mutex); 1340 mutex_unlock(&serial->parent->mutex);
1341 return result; 1341 return result;
@@ -1656,7 +1656,7 @@ static int hso_get_count(struct tty_struct *tty,
1656} 1656}
1657 1657
1658 1658
1659static int hso_serial_tiocmget(struct tty_struct *tty, struct file *file) 1659static int hso_serial_tiocmget(struct tty_struct *tty)
1660{ 1660{
1661 int retval; 1661 int retval;
1662 struct hso_serial *serial = get_serial_by_tty(tty); 1662 struct hso_serial *serial = get_serial_by_tty(tty);
@@ -1687,7 +1687,7 @@ static int hso_serial_tiocmget(struct tty_struct *tty, struct file *file)
1687 return retval; 1687 return retval;
1688} 1688}
1689 1689
1690static int hso_serial_tiocmset(struct tty_struct *tty, struct file *file, 1690static int hso_serial_tiocmset(struct tty_struct *tty,
1691 unsigned int set, unsigned int clear) 1691 unsigned int set, unsigned int clear)
1692{ 1692{
1693 int val = 0; 1693 int val = 0;
@@ -1730,7 +1730,7 @@ static int hso_serial_tiocmset(struct tty_struct *tty, struct file *file,
1730 USB_CTRL_SET_TIMEOUT); 1730 USB_CTRL_SET_TIMEOUT);
1731} 1731}
1732 1732
1733static int hso_serial_ioctl(struct tty_struct *tty, struct file *file, 1733static int hso_serial_ioctl(struct tty_struct *tty,
1734 unsigned int cmd, unsigned long arg) 1734 unsigned int cmd, unsigned long arg)
1735{ 1735{
1736 struct hso_serial *serial = get_serial_by_tty(tty); 1736 struct hso_serial *serial = get_serial_by_tty(tty);
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index 515d9b8af01e..1c65d1c33873 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -131,9 +131,8 @@ static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx);
131static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char); 131static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char);
132static void cpc_tty_signal_on(pc300dev_t *pc300dev, unsigned char); 132static void cpc_tty_signal_on(pc300dev_t *pc300dev, unsigned char);
133 133
134static int pc300_tiocmset(struct tty_struct *, struct file *, 134static int pc300_tiocmset(struct tty_struct *, unsigned int, unsigned int);
135 unsigned int, unsigned int); 135static int pc300_tiocmget(struct tty_struct *);
136static int pc300_tiocmget(struct tty_struct *, struct file *);
137 136
138/* functions called by PC300 driver */ 137/* functions called by PC300 driver */
139void cpc_tty_init(pc300dev_t *dev); 138void cpc_tty_init(pc300dev_t *dev);
@@ -543,7 +542,7 @@ static int cpc_tty_chars_in_buffer(struct tty_struct *tty)
543 return 0; 542 return 0;
544} 543}
545 544
546static int pc300_tiocmset(struct tty_struct *tty, struct file *file, 545static int pc300_tiocmset(struct tty_struct *tty,
547 unsigned int set, unsigned int clear) 546 unsigned int set, unsigned int clear)
548{ 547{
549 st_cpc_tty_area *cpc_tty; 548 st_cpc_tty_area *cpc_tty;
@@ -570,7 +569,7 @@ static int pc300_tiocmset(struct tty_struct *tty, struct file *file,
570 return 0; 569 return 0;
571} 570}
572 571
573static int pc300_tiocmget(struct tty_struct *tty, struct file *file) 572static int pc300_tiocmget(struct tty_struct *tty)
574{ 573{
575 unsigned int result; 574 unsigned int result;
576 unsigned char status; 575 unsigned char status;
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 5c8fcfc42c3e..58e4a8e15a0e 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -41,6 +41,10 @@ config STAGING_EXCLUDE_BUILD
41 41
42if !STAGING_EXCLUDE_BUILD 42if !STAGING_EXCLUDE_BUILD
43 43
44source "drivers/staging/tty/Kconfig"
45
46source "drivers/staging/generic_serial/Kconfig"
47
44source "drivers/staging/et131x/Kconfig" 48source "drivers/staging/et131x/Kconfig"
45 49
46source "drivers/staging/slicoss/Kconfig" 50source "drivers/staging/slicoss/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index d53886317826..ff7372d25c91 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -3,6 +3,8 @@
3# fix for build system bug... 3# fix for build system bug...
4obj-$(CONFIG_STAGING) += staging.o 4obj-$(CONFIG_STAGING) += staging.o
5 5
6obj-y += tty/
7obj-y += generic_serial/
6obj-$(CONFIG_ET131X) += et131x/ 8obj-$(CONFIG_ET131X) += et131x/
7obj-$(CONFIG_SLICOSS) += slicoss/ 9obj-$(CONFIG_SLICOSS) += slicoss/
8obj-$(CONFIG_VIDEO_GO7007) += go7007/ 10obj-$(CONFIG_VIDEO_GO7007) += go7007/
diff --git a/drivers/staging/generic_serial/Kconfig b/drivers/staging/generic_serial/Kconfig
new file mode 100644
index 000000000000..795daea37750
--- /dev/null
+++ b/drivers/staging/generic_serial/Kconfig
@@ -0,0 +1,45 @@
1config A2232
2 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
3 depends on EXPERIMENTAL && ZORRO && BROKEN
4 ---help---
5 This option supports the 2232 7-port serial card shipped with the
6 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
7 a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
8 each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
9 ports were connected with 8 pin DIN connectors on the card bracket,
10 for which 8 pin to DB25 adapters were supplied. The card also had
11 jumpers internally to toggle various pinning configurations.
12
13 This driver can be built as a module; but then "generic_serial"
14 will also be built as a module. This has to be loaded before
15 "ser_a2232". If you want to do this, answer M here.
16
17config SX
18 tristate "Specialix SX (and SI) card support"
19 depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) && BROKEN
20 help
21 This is a driver for the SX and SI multiport serial cards.
22 Please read the file <file:Documentation/serial/sx.txt> for details.
23
24 This driver can only be built as a module ( = code which can be
25 inserted in and removed from the running kernel whenever you want).
26 The module will be called sx. If you want to do that, say M here.
27
28config RIO
29 tristate "Specialix RIO system support"
30 depends on SERIAL_NONSTANDARD && BROKEN
31 help
32 This is a driver for the Specialix RIO, a smart serial card which
33 drives an outboard box that can support up to 128 ports. Product
34 information is at <http://www.perle.com/support/documentation.html#multiport>.
35 There are both ISA and PCI versions.
36
37config RIO_OLDPCI
38 bool "Support really old RIO/PCI cards"
39 depends on RIO
40 help
41 Older RIO PCI cards need some initialization-time configuration to
42 determine the IRQ and some control addresses. If you have a RIO and
43 this doesn't seem to work, try setting this to Y.
44
45
diff --git a/drivers/staging/generic_serial/Makefile b/drivers/staging/generic_serial/Makefile
new file mode 100644
index 000000000000..ffc90c8b013c
--- /dev/null
+++ b/drivers/staging/generic_serial/Makefile
@@ -0,0 +1,6 @@
1obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o
2obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o
3obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o
4obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o
5obj-$(CONFIG_SX) += sx.o generic_serial.o
6obj-$(CONFIG_RIO) += rio/ generic_serial.o
diff --git a/drivers/staging/generic_serial/TODO b/drivers/staging/generic_serial/TODO
new file mode 100644
index 000000000000..88756453ac6c
--- /dev/null
+++ b/drivers/staging/generic_serial/TODO
@@ -0,0 +1,6 @@
1These are a few tty/serial drivers that either do not build,
2or work if they do build, or if they seem to work, are for obsolete
3hardware, or are full of unfixable races and no one uses them anymore.
4
5If no one steps up to adopt any of these drivers, they will be removed
6in the 2.6.41 release.
diff --git a/drivers/char/generic_serial.c b/drivers/staging/generic_serial/generic_serial.c
index 5954ee1dc953..5954ee1dc953 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/staging/generic_serial/generic_serial.c
diff --git a/drivers/char/rio/Makefile b/drivers/staging/generic_serial/rio/Makefile
index 1661875883fb..1661875883fb 100644
--- a/drivers/char/rio/Makefile
+++ b/drivers/staging/generic_serial/rio/Makefile
diff --git a/drivers/char/rio/board.h b/drivers/staging/generic_serial/rio/board.h
index bdea633a9076..bdea633a9076 100644
--- a/drivers/char/rio/board.h
+++ b/drivers/staging/generic_serial/rio/board.h
diff --git a/drivers/char/rio/cirrus.h b/drivers/staging/generic_serial/rio/cirrus.h
index 5ab51679caa2..5ab51679caa2 100644
--- a/drivers/char/rio/cirrus.h
+++ b/drivers/staging/generic_serial/rio/cirrus.h
diff --git a/drivers/char/rio/cmdblk.h b/drivers/staging/generic_serial/rio/cmdblk.h
index 9ed4f861675a..9ed4f861675a 100644
--- a/drivers/char/rio/cmdblk.h
+++ b/drivers/staging/generic_serial/rio/cmdblk.h
diff --git a/drivers/char/rio/cmdpkt.h b/drivers/staging/generic_serial/rio/cmdpkt.h
index c1e7a2798070..c1e7a2798070 100644
--- a/drivers/char/rio/cmdpkt.h
+++ b/drivers/staging/generic_serial/rio/cmdpkt.h
diff --git a/drivers/char/rio/daemon.h b/drivers/staging/generic_serial/rio/daemon.h
index 4af90323fd00..4af90323fd00 100644
--- a/drivers/char/rio/daemon.h
+++ b/drivers/staging/generic_serial/rio/daemon.h
diff --git a/drivers/char/rio/errors.h b/drivers/staging/generic_serial/rio/errors.h
index bdb05234090a..bdb05234090a 100644
--- a/drivers/char/rio/errors.h
+++ b/drivers/staging/generic_serial/rio/errors.h
diff --git a/drivers/char/rio/func.h b/drivers/staging/generic_serial/rio/func.h
index 078d44f85e45..078d44f85e45 100644
--- a/drivers/char/rio/func.h
+++ b/drivers/staging/generic_serial/rio/func.h
diff --git a/drivers/char/rio/host.h b/drivers/staging/generic_serial/rio/host.h
index 78f24540c224..78f24540c224 100644
--- a/drivers/char/rio/host.h
+++ b/drivers/staging/generic_serial/rio/host.h
diff --git a/drivers/char/rio/link.h b/drivers/staging/generic_serial/rio/link.h
index f3bf11a04d41..f3bf11a04d41 100644
--- a/drivers/char/rio/link.h
+++ b/drivers/staging/generic_serial/rio/link.h
diff --git a/drivers/char/rio/linux_compat.h b/drivers/staging/generic_serial/rio/linux_compat.h
index 34c0d2899ef1..34c0d2899ef1 100644
--- a/drivers/char/rio/linux_compat.h
+++ b/drivers/staging/generic_serial/rio/linux_compat.h
diff --git a/drivers/char/rio/map.h b/drivers/staging/generic_serial/rio/map.h
index 8366978578c1..8366978578c1 100644
--- a/drivers/char/rio/map.h
+++ b/drivers/staging/generic_serial/rio/map.h
diff --git a/drivers/char/rio/param.h b/drivers/staging/generic_serial/rio/param.h
index 7e9b6283e8aa..7e9b6283e8aa 100644
--- a/drivers/char/rio/param.h
+++ b/drivers/staging/generic_serial/rio/param.h
diff --git a/drivers/char/rio/parmmap.h b/drivers/staging/generic_serial/rio/parmmap.h
index acc8fa439df5..acc8fa439df5 100644
--- a/drivers/char/rio/parmmap.h
+++ b/drivers/staging/generic_serial/rio/parmmap.h
diff --git a/drivers/char/rio/pci.h b/drivers/staging/generic_serial/rio/pci.h
index 6032f9135956..6032f9135956 100644
--- a/drivers/char/rio/pci.h
+++ b/drivers/staging/generic_serial/rio/pci.h
diff --git a/drivers/char/rio/phb.h b/drivers/staging/generic_serial/rio/phb.h
index a4c48ae4e365..a4c48ae4e365 100644
--- a/drivers/char/rio/phb.h
+++ b/drivers/staging/generic_serial/rio/phb.h
diff --git a/drivers/char/rio/pkt.h b/drivers/staging/generic_serial/rio/pkt.h
index a9458164f02f..a9458164f02f 100644
--- a/drivers/char/rio/pkt.h
+++ b/drivers/staging/generic_serial/rio/pkt.h
diff --git a/drivers/char/rio/port.h b/drivers/staging/generic_serial/rio/port.h
index 49cf6d15ee54..49cf6d15ee54 100644
--- a/drivers/char/rio/port.h
+++ b/drivers/staging/generic_serial/rio/port.h
diff --git a/drivers/char/rio/protsts.h b/drivers/staging/generic_serial/rio/protsts.h
index 8ab79401d3ee..8ab79401d3ee 100644
--- a/drivers/char/rio/protsts.h
+++ b/drivers/staging/generic_serial/rio/protsts.h
diff --git a/drivers/char/rio/rio.h b/drivers/staging/generic_serial/rio/rio.h
index 1bf36223a4e8..1bf36223a4e8 100644
--- a/drivers/char/rio/rio.h
+++ b/drivers/staging/generic_serial/rio/rio.h
diff --git a/drivers/char/rio/rio_linux.c b/drivers/staging/generic_serial/rio/rio_linux.c
index 5e33293d24e3..5e33293d24e3 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/staging/generic_serial/rio/rio_linux.c
diff --git a/drivers/char/rio/rio_linux.h b/drivers/staging/generic_serial/rio/rio_linux.h
index 7f26cd7c815e..7f26cd7c815e 100644
--- a/drivers/char/rio/rio_linux.h
+++ b/drivers/staging/generic_serial/rio/rio_linux.h
diff --git a/drivers/char/rio/rioboard.h b/drivers/staging/generic_serial/rio/rioboard.h
index 252230043c82..252230043c82 100644
--- a/drivers/char/rio/rioboard.h
+++ b/drivers/staging/generic_serial/rio/rioboard.h
diff --git a/drivers/char/rio/rioboot.c b/drivers/staging/generic_serial/rio/rioboot.c
index d956dd316005..d956dd316005 100644
--- a/drivers/char/rio/rioboot.c
+++ b/drivers/staging/generic_serial/rio/rioboot.c
diff --git a/drivers/char/rio/riocmd.c b/drivers/staging/generic_serial/rio/riocmd.c
index f121357e5af0..f121357e5af0 100644
--- a/drivers/char/rio/riocmd.c
+++ b/drivers/staging/generic_serial/rio/riocmd.c
diff --git a/drivers/char/rio/rioctrl.c b/drivers/staging/generic_serial/rio/rioctrl.c
index 780506326a73..780506326a73 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/staging/generic_serial/rio/rioctrl.c
diff --git a/drivers/char/rio/riodrvr.h b/drivers/staging/generic_serial/rio/riodrvr.h
index 0907e711b355..0907e711b355 100644
--- a/drivers/char/rio/riodrvr.h
+++ b/drivers/staging/generic_serial/rio/riodrvr.h
diff --git a/drivers/char/rio/rioinfo.h b/drivers/staging/generic_serial/rio/rioinfo.h
index 42ff1e79d96f..42ff1e79d96f 100644
--- a/drivers/char/rio/rioinfo.h
+++ b/drivers/staging/generic_serial/rio/rioinfo.h
diff --git a/drivers/char/rio/rioinit.c b/drivers/staging/generic_serial/rio/rioinit.c
index 24a282bb89d4..24a282bb89d4 100644
--- a/drivers/char/rio/rioinit.c
+++ b/drivers/staging/generic_serial/rio/rioinit.c
diff --git a/drivers/char/rio/riointr.c b/drivers/staging/generic_serial/rio/riointr.c
index 2e71aecae206..2e71aecae206 100644
--- a/drivers/char/rio/riointr.c
+++ b/drivers/staging/generic_serial/rio/riointr.c
diff --git a/drivers/char/rio/rioioctl.h b/drivers/staging/generic_serial/rio/rioioctl.h
index e8af5b30519e..e8af5b30519e 100644
--- a/drivers/char/rio/rioioctl.h
+++ b/drivers/staging/generic_serial/rio/rioioctl.h
diff --git a/drivers/char/rio/rioparam.c b/drivers/staging/generic_serial/rio/rioparam.c
index 6415f3f32a72..6415f3f32a72 100644
--- a/drivers/char/rio/rioparam.c
+++ b/drivers/staging/generic_serial/rio/rioparam.c
diff --git a/drivers/char/rio/rioroute.c b/drivers/staging/generic_serial/rio/rioroute.c
index f9b936ac3394..f9b936ac3394 100644
--- a/drivers/char/rio/rioroute.c
+++ b/drivers/staging/generic_serial/rio/rioroute.c
diff --git a/drivers/char/rio/riospace.h b/drivers/staging/generic_serial/rio/riospace.h
index ffb31d4332b9..ffb31d4332b9 100644
--- a/drivers/char/rio/riospace.h
+++ b/drivers/staging/generic_serial/rio/riospace.h
diff --git a/drivers/char/rio/riotable.c b/drivers/staging/generic_serial/rio/riotable.c
index 3d15802dc0f3..3d15802dc0f3 100644
--- a/drivers/char/rio/riotable.c
+++ b/drivers/staging/generic_serial/rio/riotable.c
diff --git a/drivers/char/rio/riotty.c b/drivers/staging/generic_serial/rio/riotty.c
index 8a90393faf3c..8a90393faf3c 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/staging/generic_serial/rio/riotty.c
diff --git a/drivers/char/rio/route.h b/drivers/staging/generic_serial/rio/route.h
index 46e963771c30..46e963771c30 100644
--- a/drivers/char/rio/route.h
+++ b/drivers/staging/generic_serial/rio/route.h
diff --git a/drivers/char/rio/rup.h b/drivers/staging/generic_serial/rio/rup.h
index 4ae90cb207a9..4ae90cb207a9 100644
--- a/drivers/char/rio/rup.h
+++ b/drivers/staging/generic_serial/rio/rup.h
diff --git a/drivers/char/rio/unixrup.h b/drivers/staging/generic_serial/rio/unixrup.h
index 7abf0cba0f2c..7abf0cba0f2c 100644
--- a/drivers/char/rio/unixrup.h
+++ b/drivers/staging/generic_serial/rio/unixrup.h
diff --git a/drivers/char/ser_a2232.c b/drivers/staging/generic_serial/ser_a2232.c
index 9610861d1f5f..3f47c2ead8e5 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/staging/generic_serial/ser_a2232.c
@@ -133,8 +133,8 @@ static void a2232_hungup(void *ptr);
133/* END GENERIC_SERIAL PROTOTYPES */ 133/* END GENERIC_SERIAL PROTOTYPES */
134 134
135/* Functions that the TTY driver struct expects */ 135/* Functions that the TTY driver struct expects */
136static int a2232_ioctl(struct tty_struct *tty, struct file *file, 136static int a2232_ioctl(struct tty_struct *tty,
137 unsigned int cmd, unsigned long arg); 137 unsigned int cmd, unsigned long arg);
138static void a2232_throttle(struct tty_struct *tty); 138static void a2232_throttle(struct tty_struct *tty);
139static void a2232_unthrottle(struct tty_struct *tty); 139static void a2232_unthrottle(struct tty_struct *tty);
140static int a2232_open(struct tty_struct * tty, struct file * filp); 140static int a2232_open(struct tty_struct * tty, struct file * filp);
@@ -447,7 +447,7 @@ static void a2232_hungup(void *ptr)
447/*** END OF REAL_DRIVER FUNCTIONS ***/ 447/*** END OF REAL_DRIVER FUNCTIONS ***/
448 448
449/*** BEGIN FUNCTIONS EXPECTED BY TTY DRIVER STRUCTS ***/ 449/*** BEGIN FUNCTIONS EXPECTED BY TTY DRIVER STRUCTS ***/
450static int a2232_ioctl( struct tty_struct *tty, struct file *file, 450static int a2232_ioctl( struct tty_struct *tty,
451 unsigned int cmd, unsigned long arg) 451 unsigned int cmd, unsigned long arg)
452{ 452{
453 return -ENOIOCTLCMD; 453 return -ENOIOCTLCMD;
diff --git a/drivers/char/ser_a2232.h b/drivers/staging/generic_serial/ser_a2232.h
index bc09eb9e118b..bc09eb9e118b 100644
--- a/drivers/char/ser_a2232.h
+++ b/drivers/staging/generic_serial/ser_a2232.h
diff --git a/drivers/char/ser_a2232fw.ax b/drivers/staging/generic_serial/ser_a2232fw.ax
index 736438032768..736438032768 100644
--- a/drivers/char/ser_a2232fw.ax
+++ b/drivers/staging/generic_serial/ser_a2232fw.ax
diff --git a/drivers/char/ser_a2232fw.h b/drivers/staging/generic_serial/ser_a2232fw.h
index e09a30acfe5c..e09a30acfe5c 100644
--- a/drivers/char/ser_a2232fw.h
+++ b/drivers/staging/generic_serial/ser_a2232fw.h
diff --git a/drivers/char/sx.c b/drivers/staging/generic_serial/sx.c
index a786326cea2f..1291462bcddb 100644
--- a/drivers/char/sx.c
+++ b/drivers/staging/generic_serial/sx.c
@@ -1873,14 +1873,14 @@ static int sx_break(struct tty_struct *tty, int flag)
1873 return 0; 1873 return 0;
1874} 1874}
1875 1875
1876static int sx_tiocmget(struct tty_struct *tty, struct file *file) 1876static int sx_tiocmget(struct tty_struct *tty)
1877{ 1877{
1878 struct sx_port *port = tty->driver_data; 1878 struct sx_port *port = tty->driver_data;
1879 return sx_getsignals(port); 1879 return sx_getsignals(port);
1880} 1880}
1881 1881
1882static int sx_tiocmset(struct tty_struct *tty, struct file *file, 1882static int sx_tiocmset(struct tty_struct *tty,
1883 unsigned int set, unsigned int clear) 1883 unsigned int set, unsigned int clear)
1884{ 1884{
1885 struct sx_port *port = tty->driver_data; 1885 struct sx_port *port = tty->driver_data;
1886 int rts = -1, dtr = -1; 1886 int rts = -1, dtr = -1;
@@ -1899,7 +1899,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file,
1899 return 0; 1899 return 0;
1900} 1900}
1901 1901
1902static int sx_ioctl(struct tty_struct *tty, struct file *filp, 1902static int sx_ioctl(struct tty_struct *tty,
1903 unsigned int cmd, unsigned long arg) 1903 unsigned int cmd, unsigned long arg)
1904{ 1904{
1905 int rc; 1905 int rc;
diff --git a/drivers/char/sx.h b/drivers/staging/generic_serial/sx.h
index 87c2defdead7..87c2defdead7 100644
--- a/drivers/char/sx.h
+++ b/drivers/staging/generic_serial/sx.h
diff --git a/drivers/char/sxboards.h b/drivers/staging/generic_serial/sxboards.h
index 427927dc7dbf..427927dc7dbf 100644
--- a/drivers/char/sxboards.h
+++ b/drivers/staging/generic_serial/sxboards.h
diff --git a/drivers/char/sxwindow.h b/drivers/staging/generic_serial/sxwindow.h
index cf01b662aefc..cf01b662aefc 100644
--- a/drivers/char/sxwindow.h
+++ b/drivers/staging/generic_serial/sxwindow.h
diff --git a/drivers/char/vme_scc.c b/drivers/staging/generic_serial/vme_scc.c
index 12de1202d22c..96838640f575 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/staging/generic_serial/vme_scc.c
@@ -75,7 +75,7 @@ static void scc_hungup(void *ptr);
75static void scc_close(void *ptr); 75static void scc_close(void *ptr);
76static int scc_chars_in_buffer(void * ptr); 76static int scc_chars_in_buffer(void * ptr);
77static int scc_open(struct tty_struct * tty, struct file * filp); 77static int scc_open(struct tty_struct * tty, struct file * filp);
78static int scc_ioctl(struct tty_struct * tty, struct file * filp, 78static int scc_ioctl(struct tty_struct * tty,
79 unsigned int cmd, unsigned long arg); 79 unsigned int cmd, unsigned long arg);
80static void scc_throttle(struct tty_struct *tty); 80static void scc_throttle(struct tty_struct *tty);
81static void scc_unthrottle(struct tty_struct *tty); 81static void scc_unthrottle(struct tty_struct *tty);
@@ -1046,7 +1046,7 @@ static void scc_unthrottle (struct tty_struct * tty)
1046} 1046}
1047 1047
1048 1048
1049static int scc_ioctl(struct tty_struct *tty, struct file *file, 1049static int scc_ioctl(struct tty_struct *tty,
1050 unsigned int cmd, unsigned long arg) 1050 unsigned int cmd, unsigned long arg)
1051{ 1051{
1052 return -ENOIOCTLCMD; 1052 return -ENOIOCTLCMD;
diff --git a/drivers/staging/quatech_usb2/quatech_usb2.c b/drivers/staging/quatech_usb2/quatech_usb2.c
index ed58f482c963..36b18e302718 100644
--- a/drivers/staging/quatech_usb2/quatech_usb2.c
+++ b/drivers/staging/quatech_usb2/quatech_usb2.c
@@ -852,7 +852,7 @@ static int qt2_chars_in_buffer(struct tty_struct *tty)
852 * TIOCMGET and TIOCMSET are filtered off to their own methods before they get 852 * TIOCMGET and TIOCMSET are filtered off to their own methods before they get
853 * here, so we don't have to handle them. 853 * here, so we don't have to handle them.
854 */ 854 */
855static int qt2_ioctl(struct tty_struct *tty, struct file *file, 855static int qt2_ioctl(struct tty_struct *tty,
856 unsigned int cmd, unsigned long arg) 856 unsigned int cmd, unsigned long arg)
857{ 857{
858 struct usb_serial_port *port = tty->driver_data; 858 struct usb_serial_port *port = tty->driver_data;
@@ -1078,7 +1078,7 @@ static void qt2_set_termios(struct tty_struct *tty,
1078 } 1078 }
1079} 1079}
1080 1080
1081static int qt2_tiocmget(struct tty_struct *tty, struct file *file) 1081static int qt2_tiocmget(struct tty_struct *tty)
1082{ 1082{
1083 struct usb_serial_port *port = tty->driver_data; 1083 struct usb_serial_port *port = tty->driver_data;
1084 struct usb_serial *serial = port->serial; 1084 struct usb_serial *serial = port->serial;
@@ -1121,7 +1121,7 @@ static int qt2_tiocmget(struct tty_struct *tty, struct file *file)
1121 } 1121 }
1122} 1122}
1123 1123
1124static int qt2_tiocmset(struct tty_struct *tty, struct file *file, 1124static int qt2_tiocmset(struct tty_struct *tty,
1125 unsigned int set, unsigned int clear) 1125 unsigned int set, unsigned int clear)
1126{ 1126{
1127 struct usb_serial_port *port = tty->driver_data; 1127 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index 27841ef6a568..e0aae86a8809 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -1191,7 +1191,7 @@ static int qt_write_room(struct tty_struct *tty)
1191 1191
1192} 1192}
1193 1193
1194static int qt_ioctl(struct tty_struct *tty, struct file *file, 1194static int qt_ioctl(struct tty_struct *tty,
1195 unsigned int cmd, unsigned long arg) 1195 unsigned int cmd, unsigned long arg)
1196{ 1196{
1197 struct usb_serial_port *port = tty->driver_data; 1197 struct usb_serial_port *port = tty->driver_data;
@@ -1383,7 +1383,7 @@ static void qt_break(struct tty_struct *tty, int break_state)
1383 1383
1384static inline int qt_real_tiocmget(struct tty_struct *tty, 1384static inline int qt_real_tiocmget(struct tty_struct *tty,
1385 struct usb_serial_port *port, 1385 struct usb_serial_port *port,
1386 struct file *file, struct usb_serial *serial) 1386 struct usb_serial *serial)
1387{ 1387{
1388 1388
1389 u8 mcr; 1389 u8 mcr;
@@ -1425,7 +1425,6 @@ static inline int qt_real_tiocmget(struct tty_struct *tty,
1425 1425
1426static inline int qt_real_tiocmset(struct tty_struct *tty, 1426static inline int qt_real_tiocmset(struct tty_struct *tty,
1427 struct usb_serial_port *port, 1427 struct usb_serial_port *port,
1428 struct file *file,
1429 struct usb_serial *serial, 1428 struct usb_serial *serial,
1430 unsigned int value) 1429 unsigned int value)
1431{ 1430{
@@ -1462,7 +1461,7 @@ static inline int qt_real_tiocmset(struct tty_struct *tty,
1462 return 0; 1461 return 0;
1463} 1462}
1464 1463
1465static int qt_tiocmget(struct tty_struct *tty, struct file *file) 1464static int qt_tiocmget(struct tty_struct *tty)
1466{ 1465{
1467 struct usb_serial_port *port = tty->driver_data; 1466 struct usb_serial_port *port = tty->driver_data;
1468 struct usb_serial *serial = get_usb_serial(port, __func__); 1467 struct usb_serial *serial = get_usb_serial(port, __func__);
@@ -1480,13 +1479,13 @@ static int qt_tiocmget(struct tty_struct *tty, struct file *file)
1480 dbg("%s - port %d\n", __func__, port->number); 1479 dbg("%s - port %d\n", __func__, port->number);
1481 dbg("%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding); 1480 dbg("%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding);
1482 1481
1483 retval = qt_real_tiocmget(tty, port, file, serial); 1482 retval = qt_real_tiocmget(tty, port, serial);
1484 1483
1485 spin_unlock_irqrestore(&qt_port->lock, flags); 1484 spin_unlock_irqrestore(&qt_port->lock, flags);
1486 return retval; 1485 return retval;
1487} 1486}
1488 1487
1489static int qt_tiocmset(struct tty_struct *tty, struct file *file, 1488static int qt_tiocmset(struct tty_struct *tty,
1490 unsigned int set, unsigned int clear) 1489 unsigned int set, unsigned int clear)
1491{ 1490{
1492 1491
@@ -1506,7 +1505,7 @@ static int qt_tiocmset(struct tty_struct *tty, struct file *file,
1506 dbg("%s - port %d\n", __func__, port->number); 1505 dbg("%s - port %d\n", __func__, port->number);
1507 dbg("%s - qt_port->RxHolding = %d\n", __func__, qt_port->RxHolding); 1506 dbg("%s - qt_port->RxHolding = %d\n", __func__, qt_port->RxHolding);
1508 1507
1509 retval = qt_real_tiocmset(tty, port, file, serial, set); 1508 retval = qt_real_tiocmset(tty, port, serial, set);
1510 1509
1511 spin_unlock_irqrestore(&qt_port->lock, flags); 1510 spin_unlock_irqrestore(&qt_port->lock, flags);
1512 return retval; 1511 return retval;
diff --git a/drivers/staging/tty/Kconfig b/drivers/staging/tty/Kconfig
new file mode 100644
index 000000000000..77103a07abbd
--- /dev/null
+++ b/drivers/staging/tty/Kconfig
@@ -0,0 +1,87 @@
1config STALLION
2 tristate "Stallion EasyIO or EC8/32 support"
3 depends on STALDRV && (ISA || EISA || PCI)
4 help
5 If you have an EasyIO or EasyConnection 8/32 multiport Stallion
6 card, then this is for you; say Y. Make sure to read
7 <file:Documentation/serial/stallion.txt>.
8
9 To compile this driver as a module, choose M here: the
10 module will be called stallion.
11
12config ISTALLION
13 tristate "Stallion EC8/64, ONboard, Brumby support"
14 depends on STALDRV && (ISA || EISA || PCI)
15 help
16 If you have an EasyConnection 8/64, ONboard, Brumby or Stallion
17 serial multiport card, say Y here. Make sure to read
18 <file:Documentation/serial/stallion.txt>.
19
20 To compile this driver as a module, choose M here: the
21 module will be called istallion.
22
23config DIGIEPCA
24 tristate "Digiboard Intelligent Async Support"
25 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
26 ---help---
27 This is a driver for Digi International's Xx, Xeve, and Xem series
28 of cards which provide multiple serial ports. You would need
29 something like this to connect more than two modems to your Linux
30 box, for instance in order to become a dial-in server. This driver
31 supports the original PC (ISA) boards as well as PCI, and EISA. If
32 you have a card like this, say Y here and read the file
33 <file:Documentation/serial/digiepca.txt>.
34
35 To compile this driver as a module, choose M here: the
36 module will be called epca.
37
38config RISCOM8
39 tristate "SDL RISCom/8 card support"
40 depends on SERIAL_NONSTANDARD
41 help
42 This is a driver for the SDL Communications RISCom/8 multiport card,
43 which gives you many serial ports. You would need something like
44 this to connect more than two modems to your Linux box, for instance
45 in order to become a dial-in server. If you have a card like that,
46 say Y here and read the file <file:Documentation/serial/riscom8.txt>.
47
48 Also it's possible to say M here and compile this driver as kernel
49 loadable module; the module will be called riscom8.
50
51config SPECIALIX
52 tristate "Specialix IO8+ card support"
53 depends on SERIAL_NONSTANDARD
54 help
55 This is a driver for the Specialix IO8+ multiport card (both the
56 ISA and the PCI version) which gives you many serial ports. You
57 would need something like this to connect more than two modems to
58 your Linux box, for instance in order to become a dial-in server.
59
60 If you have a card like that, say Y here and read the file
61 <file:Documentation/serial/specialix.txt>. Also it's possible to say
62 M here and compile this driver as kernel loadable module which will be
63 called specialix.
64
65config COMPUTONE
66 tristate "Computone IntelliPort Plus serial support"
67 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
68 ---help---
69 This driver supports the entire family of Intelliport II/Plus
70 controllers with the exception of the MicroChannel controllers and
71 products previous to the Intelliport II. These are multiport cards,
72 which give you many serial ports. You would need something like this
73 to connect more than two modems to your Linux box, for instance in
74 order to become a dial-in server. If you have a card like that, say
75 Y here and read <file:Documentation/serial/computone.txt>.
76
77 To compile this driver as module, choose M here: the
78 module will be called ip2.
79
80config SERIAL167
81 bool "CD2401 support for MVME166/7 serial ports"
82 depends on MVME16x
83 help
84 This is the driver for the serial ports on the Motorola MVME166,
85 167, and 172 boards. Everyone using one of these boards should say
86 Y here.
87
diff --git a/drivers/staging/tty/Makefile b/drivers/staging/tty/Makefile
new file mode 100644
index 000000000000..ac57c105611b
--- /dev/null
+++ b/drivers/staging/tty/Makefile
@@ -0,0 +1,7 @@
1obj-$(CONFIG_STALLION) += stallion.o
2obj-$(CONFIG_ISTALLION) += istallion.o
3obj-$(CONFIG_DIGIEPCA) += epca.o
4obj-$(CONFIG_SERIAL167) += serial167.o
5obj-$(CONFIG_SPECIALIX) += specialix.o
6obj-$(CONFIG_RISCOM8) += riscom8.o
7obj-$(CONFIG_COMPUTONE) += ip2/
diff --git a/drivers/staging/tty/TODO b/drivers/staging/tty/TODO
new file mode 100644
index 000000000000..88756453ac6c
--- /dev/null
+++ b/drivers/staging/tty/TODO
@@ -0,0 +1,6 @@
1These are a few tty/serial drivers that either do not build,
2or work if they do build, or if they seem to work, are for obsolete
3hardware, or are full of unfixable races and no one uses them anymore.
4
5If no one steps up to adopt any of these drivers, they will be removed
6in the 2.6.41 release.
diff --git a/drivers/char/epca.c b/drivers/staging/tty/epca.c
index d9df46aa0fba..7ad3638967ae 100644
--- a/drivers/char/epca.c
+++ b/drivers/staging/tty/epca.c
@@ -175,9 +175,9 @@ static unsigned termios2digi_i(struct channel *ch, unsigned);
175static unsigned termios2digi_c(struct channel *ch, unsigned); 175static unsigned termios2digi_c(struct channel *ch, unsigned);
176static void epcaparam(struct tty_struct *, struct channel *); 176static void epcaparam(struct tty_struct *, struct channel *);
177static void receive_data(struct channel *, struct tty_struct *tty); 177static void receive_data(struct channel *, struct tty_struct *tty);
178static int pc_ioctl(struct tty_struct *, struct file *, 178static int pc_ioctl(struct tty_struct *,
179 unsigned int, unsigned long); 179 unsigned int, unsigned long);
180static int info_ioctl(struct tty_struct *, struct file *, 180static int info_ioctl(struct tty_struct *,
181 unsigned int, unsigned long); 181 unsigned int, unsigned long);
182static void pc_set_termios(struct tty_struct *, struct ktermios *); 182static void pc_set_termios(struct tty_struct *, struct ktermios *);
183static void do_softint(struct work_struct *work); 183static void do_softint(struct work_struct *work);
@@ -1919,7 +1919,7 @@ static void receive_data(struct channel *ch, struct tty_struct *tty)
1919 tty_schedule_flip(tty); 1919 tty_schedule_flip(tty);
1920} 1920}
1921 1921
1922static int info_ioctl(struct tty_struct *tty, struct file *file, 1922static int info_ioctl(struct tty_struct *tty,
1923 unsigned int cmd, unsigned long arg) 1923 unsigned int cmd, unsigned long arg)
1924{ 1924{
1925 switch (cmd) { 1925 switch (cmd) {
@@ -1982,7 +1982,7 @@ static int info_ioctl(struct tty_struct *tty, struct file *file,
1982 return 0; 1982 return 0;
1983} 1983}
1984 1984
1985static int pc_tiocmget(struct tty_struct *tty, struct file *file) 1985static int pc_tiocmget(struct tty_struct *tty)
1986{ 1986{
1987 struct channel *ch = tty->driver_data; 1987 struct channel *ch = tty->driver_data;
1988 struct board_chan __iomem *bc; 1988 struct board_chan __iomem *bc;
@@ -2015,7 +2015,7 @@ static int pc_tiocmget(struct tty_struct *tty, struct file *file)
2015 return mflag; 2015 return mflag;
2016} 2016}
2017 2017
2018static int pc_tiocmset(struct tty_struct *tty, struct file *file, 2018static int pc_tiocmset(struct tty_struct *tty,
2019 unsigned int set, unsigned int clear) 2019 unsigned int set, unsigned int clear)
2020{ 2020{
2021 struct channel *ch = tty->driver_data; 2021 struct channel *ch = tty->driver_data;
@@ -2057,7 +2057,7 @@ static int pc_tiocmset(struct tty_struct *tty, struct file *file,
2057 return 0; 2057 return 0;
2058} 2058}
2059 2059
2060static int pc_ioctl(struct tty_struct *tty, struct file *file, 2060static int pc_ioctl(struct tty_struct *tty,
2061 unsigned int cmd, unsigned long arg) 2061 unsigned int cmd, unsigned long arg)
2062{ 2062{
2063 digiflow_t dflow; 2063 digiflow_t dflow;
@@ -2074,14 +2074,14 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file,
2074 return -EINVAL; 2074 return -EINVAL;
2075 switch (cmd) { 2075 switch (cmd) {
2076 case TIOCMODG: 2076 case TIOCMODG:
2077 mflag = pc_tiocmget(tty, file); 2077 mflag = pc_tiocmget(tty);
2078 if (put_user(mflag, (unsigned long __user *)argp)) 2078 if (put_user(mflag, (unsigned long __user *)argp))
2079 return -EFAULT; 2079 return -EFAULT;
2080 break; 2080 break;
2081 case TIOCMODS: 2081 case TIOCMODS:
2082 if (get_user(mstat, (unsigned __user *)argp)) 2082 if (get_user(mstat, (unsigned __user *)argp))
2083 return -EFAULT; 2083 return -EFAULT;
2084 return pc_tiocmset(tty, file, mstat, ~mstat); 2084 return pc_tiocmset(tty, mstat, ~mstat);
2085 case TIOCSDTR: 2085 case TIOCSDTR:
2086 spin_lock_irqsave(&epca_lock, flags); 2086 spin_lock_irqsave(&epca_lock, flags);
2087 ch->omodem |= ch->m_dtr; 2087 ch->omodem |= ch->m_dtr;
diff --git a/drivers/char/epca.h b/drivers/staging/tty/epca.h
index d414bf2dbf7c..d414bf2dbf7c 100644
--- a/drivers/char/epca.h
+++ b/drivers/staging/tty/epca.h
diff --git a/drivers/char/epcaconfig.h b/drivers/staging/tty/epcaconfig.h
index 55dec067078e..55dec067078e 100644
--- a/drivers/char/epcaconfig.h
+++ b/drivers/staging/tty/epcaconfig.h
diff --git a/drivers/char/ip2/Makefile b/drivers/staging/tty/ip2/Makefile
index 7b78e0dfc5b0..7b78e0dfc5b0 100644
--- a/drivers/char/ip2/Makefile
+++ b/drivers/staging/tty/ip2/Makefile
diff --git a/drivers/char/ip2/i2cmd.c b/drivers/staging/tty/ip2/i2cmd.c
index e7af647800b6..e7af647800b6 100644
--- a/drivers/char/ip2/i2cmd.c
+++ b/drivers/staging/tty/ip2/i2cmd.c
diff --git a/drivers/char/ip2/i2cmd.h b/drivers/staging/tty/ip2/i2cmd.h
index 29277ec6b8ed..29277ec6b8ed 100644
--- a/drivers/char/ip2/i2cmd.h
+++ b/drivers/staging/tty/ip2/i2cmd.h
diff --git a/drivers/char/ip2/i2ellis.c b/drivers/staging/tty/ip2/i2ellis.c
index 29db44de399f..29db44de399f 100644
--- a/drivers/char/ip2/i2ellis.c
+++ b/drivers/staging/tty/ip2/i2ellis.c
diff --git a/drivers/char/ip2/i2ellis.h b/drivers/staging/tty/ip2/i2ellis.h
index fb6df2456018..fb6df2456018 100644
--- a/drivers/char/ip2/i2ellis.h
+++ b/drivers/staging/tty/ip2/i2ellis.h
diff --git a/drivers/char/ip2/i2hw.h b/drivers/staging/tty/ip2/i2hw.h
index c0ba6c05f0cd..c0ba6c05f0cd 100644
--- a/drivers/char/ip2/i2hw.h
+++ b/drivers/staging/tty/ip2/i2hw.h
diff --git a/drivers/char/ip2/i2lib.c b/drivers/staging/tty/ip2/i2lib.c
index 0d10b89218ed..0d10b89218ed 100644
--- a/drivers/char/ip2/i2lib.c
+++ b/drivers/staging/tty/ip2/i2lib.c
diff --git a/drivers/char/ip2/i2lib.h b/drivers/staging/tty/ip2/i2lib.h
index e559e9bac06d..e559e9bac06d 100644
--- a/drivers/char/ip2/i2lib.h
+++ b/drivers/staging/tty/ip2/i2lib.h
diff --git a/drivers/char/ip2/i2pack.h b/drivers/staging/tty/ip2/i2pack.h
index 00342a677c90..00342a677c90 100644
--- a/drivers/char/ip2/i2pack.h
+++ b/drivers/staging/tty/ip2/i2pack.h
diff --git a/drivers/char/ip2/ip2.h b/drivers/staging/tty/ip2/ip2.h
index 936ccc533949..936ccc533949 100644
--- a/drivers/char/ip2/ip2.h
+++ b/drivers/staging/tty/ip2/ip2.h
diff --git a/drivers/char/ip2/ip2ioctl.h b/drivers/staging/tty/ip2/ip2ioctl.h
index aa0a9da85e05..aa0a9da85e05 100644
--- a/drivers/char/ip2/ip2ioctl.h
+++ b/drivers/staging/tty/ip2/ip2ioctl.h
diff --git a/drivers/char/ip2/ip2main.c b/drivers/staging/tty/ip2/ip2main.c
index c3a025356b8b..ea7a8fb08283 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/staging/tty/ip2/ip2main.c
@@ -173,7 +173,7 @@ static void ip2_flush_chars(PTTY);
173static int ip2_write_room(PTTY); 173static int ip2_write_room(PTTY);
174static int ip2_chars_in_buf(PTTY); 174static int ip2_chars_in_buf(PTTY);
175static void ip2_flush_buffer(PTTY); 175static void ip2_flush_buffer(PTTY);
176static int ip2_ioctl(PTTY, struct file *, UINT, ULONG); 176static int ip2_ioctl(PTTY, UINT, ULONG);
177static void ip2_set_termios(PTTY, struct ktermios *); 177static void ip2_set_termios(PTTY, struct ktermios *);
178static void ip2_set_line_discipline(PTTY); 178static void ip2_set_line_discipline(PTTY);
179static void ip2_throttle(PTTY); 179static void ip2_throttle(PTTY);
@@ -181,8 +181,8 @@ static void ip2_unthrottle(PTTY);
181static void ip2_stop(PTTY); 181static void ip2_stop(PTTY);
182static void ip2_start(PTTY); 182static void ip2_start(PTTY);
183static void ip2_hangup(PTTY); 183static void ip2_hangup(PTTY);
184static int ip2_tiocmget(struct tty_struct *tty, struct file *file); 184static int ip2_tiocmget(struct tty_struct *tty);
185static int ip2_tiocmset(struct tty_struct *tty, struct file *file, 185static int ip2_tiocmset(struct tty_struct *tty,
186 unsigned int set, unsigned int clear); 186 unsigned int set, unsigned int clear);
187static int ip2_get_icount(struct tty_struct *tty, 187static int ip2_get_icount(struct tty_struct *tty,
188 struct serial_icounter_struct *icount); 188 struct serial_icounter_struct *icount);
@@ -2038,7 +2038,7 @@ ip2_stop ( PTTY tty )
2038/* Device Ioctl Section */ 2038/* Device Ioctl Section */
2039/******************************************************************************/ 2039/******************************************************************************/
2040 2040
2041static int ip2_tiocmget(struct tty_struct *tty, struct file *file) 2041static int ip2_tiocmget(struct tty_struct *tty)
2042{ 2042{
2043 i2ChanStrPtr pCh = DevTable[tty->index]; 2043 i2ChanStrPtr pCh = DevTable[tty->index];
2044#ifdef ENABLE_DSSNOW 2044#ifdef ENABLE_DSSNOW
@@ -2085,7 +2085,7 @@ static int ip2_tiocmget(struct tty_struct *tty, struct file *file)
2085 | ((pCh->dataSetIn & I2_CTS) ? TIOCM_CTS : 0); 2085 | ((pCh->dataSetIn & I2_CTS) ? TIOCM_CTS : 0);
2086} 2086}
2087 2087
2088static int ip2_tiocmset(struct tty_struct *tty, struct file *file, 2088static int ip2_tiocmset(struct tty_struct *tty,
2089 unsigned int set, unsigned int clear) 2089 unsigned int set, unsigned int clear)
2090{ 2090{
2091 i2ChanStrPtr pCh = DevTable[tty->index]; 2091 i2ChanStrPtr pCh = DevTable[tty->index];
@@ -2127,7 +2127,7 @@ static int ip2_tiocmset(struct tty_struct *tty, struct file *file,
2127/* */ 2127/* */
2128/******************************************************************************/ 2128/******************************************************************************/
2129static int 2129static int
2130ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) 2130ip2_ioctl ( PTTY tty, UINT cmd, ULONG arg )
2131{ 2131{
2132 wait_queue_t wait; 2132 wait_queue_t wait;
2133 i2ChanStrPtr pCh = DevTable[tty->index]; 2133 i2ChanStrPtr pCh = DevTable[tty->index];
diff --git a/drivers/char/ip2/ip2trace.h b/drivers/staging/tty/ip2/ip2trace.h
index da20435dc8a6..da20435dc8a6 100644
--- a/drivers/char/ip2/ip2trace.h
+++ b/drivers/staging/tty/ip2/ip2trace.h
diff --git a/drivers/char/ip2/ip2types.h b/drivers/staging/tty/ip2/ip2types.h
index 9d67b260b2f6..9d67b260b2f6 100644
--- a/drivers/char/ip2/ip2types.h
+++ b/drivers/staging/tty/ip2/ip2types.h
diff --git a/drivers/char/istallion.c b/drivers/staging/tty/istallion.c
index 7c6de4c92458..0b266272cccd 100644
--- a/drivers/char/istallion.c
+++ b/drivers/staging/tty/istallion.c
@@ -603,7 +603,7 @@ static int stli_putchar(struct tty_struct *tty, unsigned char ch);
603static void stli_flushchars(struct tty_struct *tty); 603static void stli_flushchars(struct tty_struct *tty);
604static int stli_writeroom(struct tty_struct *tty); 604static int stli_writeroom(struct tty_struct *tty);
605static int stli_charsinbuffer(struct tty_struct *tty); 605static int stli_charsinbuffer(struct tty_struct *tty);
606static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg); 606static int stli_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
607static void stli_settermios(struct tty_struct *tty, struct ktermios *old); 607static void stli_settermios(struct tty_struct *tty, struct ktermios *old);
608static void stli_throttle(struct tty_struct *tty); 608static void stli_throttle(struct tty_struct *tty);
609static void stli_unthrottle(struct tty_struct *tty); 609static void stli_unthrottle(struct tty_struct *tty);
@@ -1501,7 +1501,7 @@ static int stli_setserial(struct tty_struct *tty, struct serial_struct __user *s
1501 1501
1502/*****************************************************************************/ 1502/*****************************************************************************/
1503 1503
1504static int stli_tiocmget(struct tty_struct *tty, struct file *file) 1504static int stli_tiocmget(struct tty_struct *tty)
1505{ 1505{
1506 struct stliport *portp = tty->driver_data; 1506 struct stliport *portp = tty->driver_data;
1507 struct stlibrd *brdp; 1507 struct stlibrd *brdp;
@@ -1524,7 +1524,7 @@ static int stli_tiocmget(struct tty_struct *tty, struct file *file)
1524 return stli_mktiocm(portp->asig.sigvalue); 1524 return stli_mktiocm(portp->asig.sigvalue);
1525} 1525}
1526 1526
1527static int stli_tiocmset(struct tty_struct *tty, struct file *file, 1527static int stli_tiocmset(struct tty_struct *tty,
1528 unsigned int set, unsigned int clear) 1528 unsigned int set, unsigned int clear)
1529{ 1529{
1530 struct stliport *portp = tty->driver_data; 1530 struct stliport *portp = tty->driver_data;
@@ -1556,7 +1556,7 @@ static int stli_tiocmset(struct tty_struct *tty, struct file *file,
1556 sizeof(asysigs_t), 0); 1556 sizeof(asysigs_t), 0);
1557} 1557}
1558 1558
1559static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) 1559static int stli_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
1560{ 1560{
1561 struct stliport *portp; 1561 struct stliport *portp;
1562 struct stlibrd *brdp; 1562 struct stlibrd *brdp;
diff --git a/drivers/char/riscom8.c b/drivers/staging/tty/riscom8.c
index af4de1fe8445..602643a40b4b 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/staging/tty/riscom8.c
@@ -1086,7 +1086,7 @@ static int rc_chars_in_buffer(struct tty_struct *tty)
1086 return port->xmit_cnt; 1086 return port->xmit_cnt;
1087} 1087}
1088 1088
1089static int rc_tiocmget(struct tty_struct *tty, struct file *file) 1089static int rc_tiocmget(struct tty_struct *tty)
1090{ 1090{
1091 struct riscom_port *port = tty->driver_data; 1091 struct riscom_port *port = tty->driver_data;
1092 struct riscom_board *bp; 1092 struct riscom_board *bp;
@@ -1115,8 +1115,8 @@ static int rc_tiocmget(struct tty_struct *tty, struct file *file)
1115 return result; 1115 return result;
1116} 1116}
1117 1117
1118static int rc_tiocmset(struct tty_struct *tty, struct file *file, 1118static int rc_tiocmset(struct tty_struct *tty,
1119 unsigned int set, unsigned int clear) 1119 unsigned int set, unsigned int clear)
1120{ 1120{
1121 struct riscom_port *port = tty->driver_data; 1121 struct riscom_port *port = tty->driver_data;
1122 unsigned long flags; 1122 unsigned long flags;
@@ -1236,7 +1236,7 @@ static int rc_get_serial_info(struct riscom_port *port,
1236 return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0; 1236 return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0;
1237} 1237}
1238 1238
1239static int rc_ioctl(struct tty_struct *tty, struct file *filp, 1239static int rc_ioctl(struct tty_struct *tty,
1240 unsigned int cmd, unsigned long arg) 1240 unsigned int cmd, unsigned long arg)
1241{ 1241{
1242 struct riscom_port *port = tty->driver_data; 1242 struct riscom_port *port = tty->driver_data;
diff --git a/drivers/char/riscom8.h b/drivers/staging/tty/riscom8.h
index c9876b3f9714..c9876b3f9714 100644
--- a/drivers/char/riscom8.h
+++ b/drivers/staging/tty/riscom8.h
diff --git a/drivers/char/riscom8_reg.h b/drivers/staging/tty/riscom8_reg.h
index a32475ed0d18..a32475ed0d18 100644
--- a/drivers/char/riscom8_reg.h
+++ b/drivers/staging/tty/riscom8_reg.h
diff --git a/drivers/char/serial167.c b/drivers/staging/tty/serial167.c
index 748c3b0ecd89..674af6933978 100644
--- a/drivers/char/serial167.c
+++ b/drivers/staging/tty/serial167.c
@@ -1308,7 +1308,7 @@ check_and_exit:
1308 return startup(info); 1308 return startup(info);
1309} /* set_serial_info */ 1309} /* set_serial_info */
1310 1310
1311static int cy_tiocmget(struct tty_struct *tty, struct file *file) 1311static int cy_tiocmget(struct tty_struct *tty)
1312{ 1312{
1313 struct cyclades_port *info = tty->driver_data; 1313 struct cyclades_port *info = tty->driver_data;
1314 int channel; 1314 int channel;
@@ -1331,8 +1331,7 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
1331} /* cy_tiocmget */ 1331} /* cy_tiocmget */
1332 1332
1333static int 1333static int
1334cy_tiocmset(struct tty_struct *tty, struct file *file, 1334cy_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear)
1335 unsigned int set, unsigned int clear)
1336{ 1335{
1337 struct cyclades_port *info = tty->driver_data; 1336 struct cyclades_port *info = tty->driver_data;
1338 int channel; 1337 int channel;
@@ -1493,7 +1492,7 @@ get_default_timeout(struct cyclades_port *info, unsigned long __user * value)
1493} 1492}
1494 1493
1495static int 1494static int
1496cy_ioctl(struct tty_struct *tty, struct file *file, 1495cy_ioctl(struct tty_struct *tty,
1497 unsigned int cmd, unsigned long arg) 1496 unsigned int cmd, unsigned long arg)
1498{ 1497{
1499 struct cyclades_port *info = tty->driver_data; 1498 struct cyclades_port *info = tty->driver_data;
diff --git a/drivers/char/specialix.c b/drivers/staging/tty/specialix.c
index c2bca3f25ef3..47e5753f732a 100644
--- a/drivers/char/specialix.c
+++ b/drivers/staging/tty/specialix.c
@@ -1737,7 +1737,7 @@ static int sx_chars_in_buffer(struct tty_struct *tty)
1737 return port->xmit_cnt; 1737 return port->xmit_cnt;
1738} 1738}
1739 1739
1740static int sx_tiocmget(struct tty_struct *tty, struct file *file) 1740static int sx_tiocmget(struct tty_struct *tty)
1741{ 1741{
1742 struct specialix_port *port = tty->driver_data; 1742 struct specialix_port *port = tty->driver_data;
1743 struct specialix_board *bp; 1743 struct specialix_board *bp;
@@ -1778,7 +1778,7 @@ static int sx_tiocmget(struct tty_struct *tty, struct file *file)
1778} 1778}
1779 1779
1780 1780
1781static int sx_tiocmset(struct tty_struct *tty, struct file *file, 1781static int sx_tiocmset(struct tty_struct *tty,
1782 unsigned int set, unsigned int clear) 1782 unsigned int set, unsigned int clear)
1783{ 1783{
1784 struct specialix_port *port = tty->driver_data; 1784 struct specialix_port *port = tty->driver_data;
@@ -1928,7 +1928,7 @@ static int sx_get_serial_info(struct specialix_port *port,
1928} 1928}
1929 1929
1930 1930
1931static int sx_ioctl(struct tty_struct *tty, struct file *filp, 1931static int sx_ioctl(struct tty_struct *tty,
1932 unsigned int cmd, unsigned long arg) 1932 unsigned int cmd, unsigned long arg)
1933{ 1933{
1934 struct specialix_port *port = tty->driver_data; 1934 struct specialix_port *port = tty->driver_data;
diff --git a/drivers/char/specialix_io8.h b/drivers/staging/tty/specialix_io8.h
index c63005274d9b..c63005274d9b 100644
--- a/drivers/char/specialix_io8.h
+++ b/drivers/staging/tty/specialix_io8.h
diff --git a/drivers/char/stallion.c b/drivers/staging/tty/stallion.c
index 461a5a045517..4fff5cd3b163 100644
--- a/drivers/char/stallion.c
+++ b/drivers/staging/tty/stallion.c
@@ -1094,7 +1094,7 @@ static int stl_setserial(struct tty_struct *tty, struct serial_struct __user *sp
1094 1094
1095/*****************************************************************************/ 1095/*****************************************************************************/
1096 1096
1097static int stl_tiocmget(struct tty_struct *tty, struct file *file) 1097static int stl_tiocmget(struct tty_struct *tty)
1098{ 1098{
1099 struct stlport *portp; 1099 struct stlport *portp;
1100 1100
@@ -1107,7 +1107,7 @@ static int stl_tiocmget(struct tty_struct *tty, struct file *file)
1107 return stl_getsignals(portp); 1107 return stl_getsignals(portp);
1108} 1108}
1109 1109
1110static int stl_tiocmset(struct tty_struct *tty, struct file *file, 1110static int stl_tiocmset(struct tty_struct *tty,
1111 unsigned int set, unsigned int clear) 1111 unsigned int set, unsigned int clear)
1112{ 1112{
1113 struct stlport *portp; 1113 struct stlport *portp;
@@ -1132,14 +1132,13 @@ static int stl_tiocmset(struct tty_struct *tty, struct file *file,
1132 return 0; 1132 return 0;
1133} 1133}
1134 1134
1135static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) 1135static int stl_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
1136{ 1136{
1137 struct stlport *portp; 1137 struct stlport *portp;
1138 int rc; 1138 int rc;
1139 void __user *argp = (void __user *)arg; 1139 void __user *argp = (void __user *)arg;
1140 1140
1141 pr_debug("stl_ioctl(tty=%p,file=%p,cmd=%x,arg=%lx)\n", tty, file, cmd, 1141 pr_debug("stl_ioctl(tty=%p,cmd=%x,arg=%lx)\n", tty, cmd, arg);
1142 arg);
1143 1142
1144 portp = tty->driver_data; 1143 portp = tty->driver_data;
1145 if (portp == NULL) 1144 if (portp == NULL)
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
new file mode 100644
index 000000000000..3fd7199301b6
--- /dev/null
+++ b/drivers/tty/Kconfig
@@ -0,0 +1,321 @@
1config VT
2 bool "Virtual terminal" if EXPERT
3 depends on !S390
4 select INPUT
5 default y
6 ---help---
7 If you say Y here, you will get support for terminal devices with
8 display and keyboard devices. These are called "virtual" because you
9 can run several virtual terminals (also called virtual consoles) on
10 one physical terminal. This is rather useful, for example one
11 virtual terminal can collect system messages and warnings, another
12 one can be used for a text-mode user session, and a third could run
13 an X session, all in parallel. Switching between virtual terminals
14 is done with certain key combinations, usually Alt-<function key>.
15
16 The setterm command ("man setterm") can be used to change the
17 properties (such as colors or beeping) of a virtual terminal. The
18 man page console_codes(4) ("man console_codes") contains the special
19 character sequences that can be used to change those properties
20 directly. The fonts used on virtual terminals can be changed with
21 the setfont ("man setfont") command and the key bindings are defined
22 with the loadkeys ("man loadkeys") command.
23
24 You need at least one virtual terminal device in order to make use
25 of your keyboard and monitor. Therefore, only people configuring an
26 embedded system would want to say N here in order to save some
27 memory; the only way to log into such a system is then via a serial
28 or network connection.
29
30 If unsure, say Y, or else you won't be able to do much with your new
31 shiny Linux system :-)
32
33config CONSOLE_TRANSLATIONS
34 depends on VT
35 default y
36 bool "Enable character translations in console" if EXPERT
37 ---help---
38 This enables support for font mapping and Unicode translation
39 on virtual consoles.
40
41config VT_CONSOLE
42 bool "Support for console on virtual terminal" if EXPERT
43 depends on VT
44 default y
45 ---help---
46 The system console is the device which receives all kernel messages
47 and warnings and which allows logins in single user mode. If you
48 answer Y here, a virtual terminal (the device used to interact with
49 a physical terminal) can be used as system console. This is the most
50 common mode of operations, so you should say Y here unless you want
51 the kernel messages be output only to a serial port (in which case
52 you should say Y to "Console on serial port", below).
53
54 If you do say Y here, by default the currently visible virtual
55 terminal (/dev/tty0) will be used as system console. You can change
56 that with a kernel command line option such as "console=tty3" which
57 would use the third virtual terminal as system console. (Try "man
58 bootparam" or see the documentation of your boot loader (lilo or
59 loadlin) about how to pass options to the kernel at boot time.)
60
61 If unsure, say Y.
62
63config HW_CONSOLE
64 bool
65 depends on VT && !S390 && !UML
66 default y
67
68config VT_HW_CONSOLE_BINDING
69 bool "Support for binding and unbinding console drivers"
70 depends on HW_CONSOLE
71 default n
72 ---help---
73 The virtual terminal is the device that interacts with the physical
74 terminal through console drivers. On these systems, at least one
75 console driver is loaded. In other configurations, additional console
76 drivers may be enabled, such as the framebuffer console. If more than
77 1 console driver is enabled, setting this to 'y' will allow you to
78 select the console driver that will serve as the backend for the
79 virtual terminals.
80
81 See <file:Documentation/console/console.txt> for more
82 information. For framebuffer console users, please refer to
83 <file:Documentation/fb/fbcon.txt>.
84
85config UNIX98_PTYS
86 bool "Unix98 PTY support" if EXPERT
87 default y
88 ---help---
89 A pseudo terminal (PTY) is a software device consisting of two
90 halves: a master and a slave. The slave device behaves identical to
91 a physical terminal; the master device is used by a process to
92 read data from and write data to the slave, thereby emulating a
93 terminal. Typical programs for the master side are telnet servers
94 and xterms.
95
96 Linux has traditionally used the BSD-like names /dev/ptyxx for
97 masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
98 has a number of problems. The GNU C library glibc 2.1 and later,
99 however, supports the Unix98 naming standard: in order to acquire a
100 pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
101 terminal is then made available to the process and the pseudo
102 terminal slave can be accessed as /dev/pts/<number>. What was
103 traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
104
105 All modern Linux systems use the Unix98 ptys. Say Y unless
106 you're on an embedded system and want to conserve memory.
107
108config DEVPTS_MULTIPLE_INSTANCES
109 bool "Support multiple instances of devpts"
110 depends on UNIX98_PTYS
111 default n
112 ---help---
113 Enable support for multiple instances of devpts filesystem.
114 If you want to have isolated PTY namespaces (eg: in containers),
115 say Y here. Otherwise, say N. If enabled, each mount of devpts
116 filesystem with the '-o newinstance' option will create an
117 independent PTY namespace.
118
119config LEGACY_PTYS
120 bool "Legacy (BSD) PTY support"
121 default y
122 ---help---
123 A pseudo terminal (PTY) is a software device consisting of two
124 halves: a master and a slave. The slave device behaves identical to
125 a physical terminal; the master device is used by a process to
126 read data from and write data to the slave, thereby emulating a
127 terminal. Typical programs for the master side are telnet servers
128 and xterms.
129
130 Linux has traditionally used the BSD-like names /dev/ptyxx
131 for masters and /dev/ttyxx for slaves of pseudo
132 terminals. This scheme has a number of problems, including
133 security. This option enables these legacy devices; on most
134 systems, it is safe to say N.
135
136
137config LEGACY_PTY_COUNT
138 int "Maximum number of legacy PTY in use"
139 depends on LEGACY_PTYS
140 range 0 256
141 default "256"
142 ---help---
143 The maximum number of legacy PTYs that can be used at any one time.
144 The default is 256, and should be more than enough. Embedded
145 systems may want to reduce this to save memory.
146
147 When not in use, each legacy PTY occupies 12 bytes on 32-bit
148 architectures and 24 bytes on 64-bit architectures.
149
150config BFIN_JTAG_COMM
151 tristate "Blackfin JTAG Communication"
152 depends on BLACKFIN
153 help
154 Add support for emulating a TTY device over the Blackfin JTAG.
155
156 To compile this driver as a module, choose M here: the
157 module will be called bfin_jtag_comm.
158
159config BFIN_JTAG_COMM_CONSOLE
160 bool "Console on Blackfin JTAG"
161 depends on BFIN_JTAG_COMM=y
162
163config SERIAL_NONSTANDARD
164 bool "Non-standard serial port support"
165 depends on HAS_IOMEM
166 ---help---
167 Say Y here if you have any non-standard serial boards -- boards
168 which aren't supported using the standard "dumb" serial driver.
169 This includes intelligent serial boards such as Cyclades,
170 Digiboards, etc. These are usually used for systems that need many
171 serial ports because they serve many terminals or dial-in
172 connections.
173
174 Note that the answer to this question won't directly affect the
175 kernel: saying N will just cause the configurator to skip all
176 the questions about non-standard serial boards.
177
178 Most people can say N here.
179
180config ROCKETPORT
181 tristate "Comtrol RocketPort support"
182 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
183 help
184 This driver supports Comtrol RocketPort and RocketModem PCI boards.
185 These boards provide 2, 4, 8, 16, or 32 high-speed serial ports or
186 modems. For information about the RocketPort/RocketModem boards
187 and this driver read <file:Documentation/serial/rocket.txt>.
188
189 To compile this driver as a module, choose M here: the
190 module will be called rocket.
191
192 If you want to compile this driver into the kernel, say Y here. If
193 you don't have a Comtrol RocketPort/RocketModem card installed, say N.
194
195config CYCLADES
196 tristate "Cyclades async mux support"
197 depends on SERIAL_NONSTANDARD && (PCI || ISA)
198 select FW_LOADER
199 ---help---
200 This driver supports Cyclades Z and Y multiserial boards.
201 You would need something like this to connect more than two modems to
202 your Linux box, for instance in order to become a dial-in server.
203
204 For information about the Cyclades-Z card, read
205 <file:Documentation/serial/README.cycladesZ>.
206
207 To compile this driver as a module, choose M here: the
208 module will be called cyclades.
209
210 If you haven't heard about it, it's safe to say N.
211
212config CYZ_INTR
213 bool "Cyclades-Z interrupt mode operation (EXPERIMENTAL)"
214 depends on EXPERIMENTAL && CYCLADES
215 help
216 The Cyclades-Z family of multiport cards allows 2 (two) driver op
217 modes: polling and interrupt. In polling mode, the driver will check
218 the status of the Cyclades-Z ports every certain amount of time
219 (which is called polling cycle and is configurable). In interrupt
220 mode, it will use an interrupt line (IRQ) in order to check the
221 status of the Cyclades-Z ports. The default op mode is polling. If
222 unsure, say N.
223
224config MOXA_INTELLIO
225 tristate "Moxa Intellio support"
226 depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
227 select FW_LOADER
228 help
229 Say Y here if you have a Moxa Intellio multiport serial card.
230
231 To compile this driver as a module, choose M here: the
232 module will be called moxa.
233
234config MOXA_SMARTIO
235 tristate "Moxa SmartIO support v. 2.0"
236 depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA)
237 help
238 Say Y here if you have a Moxa SmartIO multiport serial card and/or
239 want to help develop a new version of this driver.
240
241 This is upgraded (1.9.1) driver from original Moxa drivers with
242 changes finally resulting in PCI probing.
243
244 This driver can also be built as a module. The module will be called
245 mxser. If you want to do that, say M here.
246
247config SYNCLINK
248 tristate "Microgate SyncLink card support"
249 depends on SERIAL_NONSTANDARD && PCI && ISA_DMA_API
250 help
251 Provides support for the SyncLink ISA and PCI multiprotocol serial
252 adapters. These adapters support asynchronous and HDLC bit
253 synchronous communication up to 10Mbps (PCI adapter).
254
255 This driver can only be built as a module ( = code which can be
256 inserted in and removed from the running kernel whenever you want).
257 The module will be called synclink. If you want to do that, say M
258 here.
259
260config SYNCLINKMP
261 tristate "SyncLink Multiport support"
262 depends on SERIAL_NONSTANDARD && PCI
263 help
264 Enable support for the SyncLink Multiport (2 or 4 ports)
265 serial adapter, running asynchronous and HDLC communications up
266 to 2.048Mbps. Each ports is independently selectable for
267 RS-232, V.35, RS-449, RS-530, and X.21
268
269 This driver may be built as a module ( = code which can be
270 inserted in and removed from the running kernel whenever you want).
271 The module will be called synclinkmp. If you want to do that, say M
272 here.
273
274config SYNCLINK_GT
275 tristate "SyncLink GT/AC support"
276 depends on SERIAL_NONSTANDARD && PCI
277 help
278 Support for SyncLink GT and SyncLink AC families of
279 synchronous and asynchronous serial adapters
280 manufactured by Microgate Systems, Ltd. (www.microgate.com)
281
282config NOZOMI
283 tristate "HSDPA Broadband Wireless Data Card - Globe Trotter"
284 depends on PCI && EXPERIMENTAL
285 help
286 If you have a HSDPA driver Broadband Wireless Data Card -
287 Globe Trotter PCMCIA card, say Y here.
288
289 To compile this driver as a module, choose M here, the module
290 will be called nozomi.
291
292config ISI
293 tristate "Multi-Tech multiport card support (EXPERIMENTAL)"
294 depends on SERIAL_NONSTANDARD && PCI
295 select FW_LOADER
296 help
297 This is a driver for the Multi-Tech cards which provide several
298 serial ports. The driver is experimental and can currently only be
299 built as a module. The module will be called isicom.
300 If you want to do that, choose M here.
301
302config N_HDLC
303 tristate "HDLC line discipline support"
304 depends on SERIAL_NONSTANDARD
305 help
306 Allows synchronous HDLC communications with tty device drivers that
307 support synchronous HDLC such as the Microgate SyncLink adapter.
308
309 This driver can be built as a module ( = code which can be
310 inserted in and removed from the running kernel whenever you want).
311 The module will be called n_hdlc. If you want to do that, say M
312 here.
313
314config N_GSM
315 tristate "GSM MUX line discipline support (EXPERIMENTAL)"
316 depends on EXPERIMENTAL
317 depends on NET
318 help
319 This line discipline provides support for the GSM MUX protocol and
320 presents the mux as a set of 61 individual tty devices.
321
diff --git a/drivers/tty/Makefile b/drivers/tty/Makefile
index 396277216e4f..690522fcb338 100644
--- a/drivers/tty/Makefile
+++ b/drivers/tty/Makefile
@@ -11,3 +11,18 @@ obj-$(CONFIG_R3964) += n_r3964.o
11obj-y += vt/ 11obj-y += vt/
12obj-$(CONFIG_HVC_DRIVER) += hvc/ 12obj-$(CONFIG_HVC_DRIVER) += hvc/
13obj-y += serial/ 13obj-y += serial/
14
15# tty drivers
16obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
17obj-$(CONFIG_BFIN_JTAG_COMM) += bfin_jtag_comm.o
18obj-$(CONFIG_CYCLADES) += cyclades.o
19obj-$(CONFIG_ISI) += isicom.o
20obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
21obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
22obj-$(CONFIG_NOZOMI) += nozomi.o
23obj-$(CONFIG_ROCKETPORT) += rocket.o
24obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o
25obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o
26obj-$(CONFIG_SYNCLINK) += synclink.o
27
28obj-y += ipwireless/
diff --git a/drivers/char/amiserial.c b/drivers/tty/amiserial.c
index 6ee3348bc3e4..f214e5022472 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -1194,7 +1194,7 @@ static int get_lsr_info(struct async_struct * info, unsigned int __user *value)
1194} 1194}
1195 1195
1196 1196
1197static int rs_tiocmget(struct tty_struct *tty, struct file *file) 1197static int rs_tiocmget(struct tty_struct *tty)
1198{ 1198{
1199 struct async_struct * info = tty->driver_data; 1199 struct async_struct * info = tty->driver_data;
1200 unsigned char control, status; 1200 unsigned char control, status;
@@ -1216,8 +1216,8 @@ static int rs_tiocmget(struct tty_struct *tty, struct file *file)
1216 | (!(status & SER_CTS) ? TIOCM_CTS : 0); 1216 | (!(status & SER_CTS) ? TIOCM_CTS : 0);
1217} 1217}
1218 1218
1219static int rs_tiocmset(struct tty_struct *tty, struct file *file, 1219static int rs_tiocmset(struct tty_struct *tty, unsigned int set,
1220 unsigned int set, unsigned int clear) 1220 unsigned int clear)
1221{ 1221{
1222 struct async_struct * info = tty->driver_data; 1222 struct async_struct * info = tty->driver_data;
1223 unsigned long flags; 1223 unsigned long flags;
@@ -1293,7 +1293,7 @@ static int rs_get_icount(struct tty_struct *tty,
1293 return 0; 1293 return 0;
1294} 1294}
1295 1295
1296static int rs_ioctl(struct tty_struct *tty, struct file * file, 1296static int rs_ioctl(struct tty_struct *tty,
1297 unsigned int cmd, unsigned long arg) 1297 unsigned int cmd, unsigned long arg)
1298{ 1298{
1299 struct async_struct * info = tty->driver_data; 1299 struct async_struct * info = tty->driver_data;
diff --git a/drivers/char/bfin_jtag_comm.c b/drivers/tty/bfin_jtag_comm.c
index 16402445f2b2..16402445f2b2 100644
--- a/drivers/char/bfin_jtag_comm.c
+++ b/drivers/tty/bfin_jtag_comm.c
diff --git a/drivers/char/cyclades.c b/drivers/tty/cyclades.c
index 4f152c28f40e..c99728f0cd9f 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -2429,7 +2429,7 @@ static int get_lsr_info(struct cyclades_port *info, unsigned int __user *value)
2429 return put_user(result, (unsigned long __user *)value); 2429 return put_user(result, (unsigned long __user *)value);
2430} 2430}
2431 2431
2432static int cy_tiocmget(struct tty_struct *tty, struct file *file) 2432static int cy_tiocmget(struct tty_struct *tty)
2433{ 2433{
2434 struct cyclades_port *info = tty->driver_data; 2434 struct cyclades_port *info = tty->driver_data;
2435 struct cyclades_card *card; 2435 struct cyclades_card *card;
@@ -2483,7 +2483,7 @@ end:
2483} /* cy_tiomget */ 2483} /* cy_tiomget */
2484 2484
2485static int 2485static int
2486cy_tiocmset(struct tty_struct *tty, struct file *file, 2486cy_tiocmset(struct tty_struct *tty,
2487 unsigned int set, unsigned int clear) 2487 unsigned int set, unsigned int clear)
2488{ 2488{
2489 struct cyclades_port *info = tty->driver_data; 2489 struct cyclades_port *info = tty->driver_data;
@@ -2680,7 +2680,7 @@ static int cy_cflags_changed(struct cyclades_port *info, unsigned long arg,
2680 * not recognized by the driver, it should return ENOIOCTLCMD. 2680 * not recognized by the driver, it should return ENOIOCTLCMD.
2681 */ 2681 */
2682static int 2682static int
2683cy_ioctl(struct tty_struct *tty, struct file *file, 2683cy_ioctl(struct tty_struct *tty,
2684 unsigned int cmd, unsigned long arg) 2684 unsigned int cmd, unsigned long arg)
2685{ 2685{
2686 struct cyclades_port *info = tty->driver_data; 2686 struct cyclades_port *info = tty->driver_data;
diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig
new file mode 100644
index 000000000000..6f2c9809f1fb
--- /dev/null
+++ b/drivers/tty/hvc/Kconfig
@@ -0,0 +1,105 @@
1config HVC_DRIVER
2 bool
3 help
4 Generic "hypervisor virtual console" infrastructure for various
5 hypervisors (pSeries, iSeries, Xen, lguest).
6 It will automatically be selected if one of the back-end console drivers
7 is selected.
8
9config HVC_IRQ
10 bool
11
12config HVC_CONSOLE
13 bool "pSeries Hypervisor Virtual Console support"
14 depends on PPC_PSERIES
15 select HVC_DRIVER
16 select HVC_IRQ
17 help
18 pSeries machines when partitioned support a hypervisor virtual
19 console. This driver allows each pSeries partition to have a console
20 which is accessed via the HMC.
21
22config HVC_ISERIES
23 bool "iSeries Hypervisor Virtual Console support"
24 depends on PPC_ISERIES
25 default y
26 select HVC_DRIVER
27 select HVC_IRQ
28 select VIOPATH
29 help
30 iSeries machines support a hypervisor virtual console.
31
32config HVC_RTAS
33 bool "IBM RTAS Console support"
34 depends on PPC_RTAS
35 select HVC_DRIVER
36 help
37 IBM Console device driver which makes use of RTAS
38
39config HVC_BEAT
40 bool "Toshiba's Beat Hypervisor Console support"
41 depends on PPC_CELLEB
42 select HVC_DRIVER
43 help
44 Toshiba's Cell Reference Set Beat Console device driver
45
46config HVC_IUCV
47 bool "z/VM IUCV Hypervisor console support (VM only)"
48 depends on S390
49 select HVC_DRIVER
50 select IUCV
51 default y
52 help
53 This driver provides a Hypervisor console (HVC) back-end to access
54 a Linux (console) terminal via a z/VM IUCV communication path.
55
56config HVC_XEN
57 bool "Xen Hypervisor Console support"
58 depends on XEN
59 select HVC_DRIVER
60 select HVC_IRQ
61 default y
62 help
63 Xen virtual console device driver
64
65config HVC_UDBG
66 bool "udbg based fake hypervisor console"
67 depends on PPC && EXPERIMENTAL
68 select HVC_DRIVER
69 default n
70
71config HVC_DCC
72 bool "ARM JTAG DCC console"
73 depends on ARM
74 select HVC_DRIVER
75 help
76 This console uses the JTAG DCC on ARM to create a console under the HVC
77 driver. This console is used through a JTAG only on ARM. If you don't have
78 a JTAG then you probably don't want this option.
79
80config HVC_BFIN_JTAG
81 bool "Blackfin JTAG console"
82 depends on BLACKFIN
83 select HVC_DRIVER
84 help
85 This console uses the Blackfin JTAG to create a console under the
86 the HVC driver. If you don't have JTAG, then you probably don't
87 want this option.
88
89config HVCS
90 tristate "IBM Hypervisor Virtual Console Server support"
91 depends on PPC_PSERIES && HVC_CONSOLE
92 help
93 Partitionable IBM Power5 ppc64 machines allow hosting of
94 firmware virtual consoles from one Linux partition by
95 another Linux partition. This driver allows console data
96 from Linux partitions to be accessed through TTY device
97 interfaces in the device tree of a Linux partition running
98 this driver.
99
100 To compile this driver as a module, choose M here: the
101 module will be called hvcs. Additionally, this module
102 will depend on arch specific APIs exported from hvcserver.ko
103 which will also be compiled when this driver is built as a
104 module.
105
diff --git a/drivers/tty/hvc/Makefile b/drivers/tty/hvc/Makefile
index d79e7e9bf9d2..40a25d93fe52 100644
--- a/drivers/tty/hvc/Makefile
+++ b/drivers/tty/hvc/Makefile
@@ -9,4 +9,5 @@ obj-$(CONFIG_HVC_IRQ) += hvc_irq.o
9obj-$(CONFIG_HVC_XEN) += hvc_xen.o 9obj-$(CONFIG_HVC_XEN) += hvc_xen.o
10obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o 10obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o
11obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o 11obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o
12obj-$(CONFIG_HVC_BFIN_JTAG) += hvc_bfin_jtag.o
12obj-$(CONFIG_HVCS) += hvcs.o 13obj-$(CONFIG_HVCS) += hvcs.o
diff --git a/drivers/tty/hvc/hvc_bfin_jtag.c b/drivers/tty/hvc/hvc_bfin_jtag.c
new file mode 100644
index 000000000000..31d6cc6a77af
--- /dev/null
+++ b/drivers/tty/hvc/hvc_bfin_jtag.c
@@ -0,0 +1,105 @@
1/*
2 * Console via Blackfin JTAG Communication
3 *
4 * Copyright 2008-2011 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 */
10
11#include <linux/console.h>
12#include <linux/delay.h>
13#include <linux/err.h>
14#include <linux/init.h>
15#include <linux/moduleparam.h>
16#include <linux/types.h>
17
18#include "hvc_console.h"
19
20/* See the Debug/Emulation chapter in the HRM */
21#define EMUDOF 0x00000001 /* EMUDAT_OUT full & valid */
22#define EMUDIF 0x00000002 /* EMUDAT_IN full & valid */
23#define EMUDOOVF 0x00000004 /* EMUDAT_OUT overflow */
24#define EMUDIOVF 0x00000008 /* EMUDAT_IN overflow */
25
26/* Helper functions to glue the register API to simple C operations */
27static inline uint32_t bfin_write_emudat(uint32_t emudat)
28{
29 __asm__ __volatile__("emudat = %0;" : : "d"(emudat));
30 return emudat;
31}
32
33static inline uint32_t bfin_read_emudat(void)
34{
35 uint32_t emudat;
36 __asm__ __volatile__("%0 = emudat;" : "=d"(emudat));
37 return emudat;
38}
39
40/* Send data to the host */
41static int hvc_bfin_put_chars(uint32_t vt, const char *buf, int count)
42{
43 static uint32_t outbound_len;
44 uint32_t emudat;
45 int ret;
46
47 if (bfin_read_DBGSTAT() & EMUDOF)
48 return 0;
49
50 if (!outbound_len) {
51 outbound_len = count;
52 bfin_write_emudat(outbound_len);
53 return 0;
54 }
55
56 ret = min(outbound_len, (uint32_t)4);
57 memcpy(&emudat, buf, ret);
58 bfin_write_emudat(emudat);
59 outbound_len -= ret;
60
61 return ret;
62}
63
64/* Receive data from the host */
65static int hvc_bfin_get_chars(uint32_t vt, char *buf, int count)
66{
67 static uint32_t inbound_len;
68 uint32_t emudat;
69 int ret;
70
71 if (!(bfin_read_DBGSTAT() & EMUDIF))
72 return 0;
73 emudat = bfin_read_emudat();
74
75 if (!inbound_len) {
76 inbound_len = emudat;
77 return 0;
78 }
79
80 ret = min(inbound_len, (uint32_t)4);
81 memcpy(buf, &emudat, ret);
82 inbound_len -= ret;
83
84 return ret;
85}
86
87/* Glue the HVC layers to the Blackfin layers */
88static const struct hv_ops hvc_bfin_get_put_ops = {
89 .get_chars = hvc_bfin_get_chars,
90 .put_chars = hvc_bfin_put_chars,
91};
92
93static int __init hvc_bfin_console_init(void)
94{
95 hvc_instantiate(0, 0, &hvc_bfin_get_put_ops);
96 return 0;
97}
98console_initcall(hvc_bfin_console_init);
99
100static int __init hvc_bfin_init(void)
101{
102 hvc_alloc(0, 0, &hvc_bfin_get_put_ops, 128);
103 return 0;
104}
105device_initcall(hvc_bfin_init);
diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c
index 6470f63deb4b..435f6facbc23 100644
--- a/drivers/tty/hvc/hvc_dcc.c
+++ b/drivers/tty/hvc/hvc_dcc.c
@@ -33,54 +33,29 @@
33static inline u32 __dcc_getstatus(void) 33static inline u32 __dcc_getstatus(void)
34{ 34{
35 u32 __ret; 35 u32 __ret;
36 36 asm volatile("mrc p14, 0, %0, c0, c1, 0 @ read comms ctrl reg"
37 asm("mrc p14, 0, %0, c0, c1, 0 @ read comms ctrl reg"
38 : "=r" (__ret) : : "cc"); 37 : "=r" (__ret) : : "cc");
39 38
40 return __ret; 39 return __ret;
41} 40}
42 41
43 42
44#if defined(CONFIG_CPU_V7)
45static inline char __dcc_getchar(void) 43static inline char __dcc_getchar(void)
46{ 44{
47 char __c; 45 char __c;
48 46
49 asm("get_wait: mrc p14, 0, pc, c0, c1, 0 \n\ 47 asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
50 bne get_wait \n\
51 mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
52 : "=r" (__c) : : "cc");
53
54 return __c;
55}
56#else
57static inline char __dcc_getchar(void)
58{
59 char __c;
60
61 asm("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
62 : "=r" (__c)); 48 : "=r" (__c));
63 49
64 return __c; 50 return __c;
65} 51}
66#endif
67 52
68#if defined(CONFIG_CPU_V7)
69static inline void __dcc_putchar(char c)
70{
71 asm("put_wait: mrc p14, 0, pc, c0, c1, 0 \n\
72 bcs put_wait \n\
73 mcr p14, 0, %0, c0, c5, 0 "
74 : : "r" (c) : "cc");
75}
76#else
77static inline void __dcc_putchar(char c) 53static inline void __dcc_putchar(char c)
78{ 54{
79 asm("mcr p14, 0, %0, c0, c5, 0 @ write a char" 55 asm volatile("mcr p14, 0, %0, c0, c5, 0 @ write a char"
80 : /* no output register */ 56 : /* no output register */
81 : "r" (c)); 57 : "r" (c));
82} 58}
83#endif
84 59
85static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count) 60static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
86{ 61{
@@ -90,7 +65,7 @@ static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
90 while (__dcc_getstatus() & DCC_STATUS_TX) 65 while (__dcc_getstatus() & DCC_STATUS_TX)
91 cpu_relax(); 66 cpu_relax();
92 67
93 __dcc_putchar((char)(buf[i] & 0xFF)); 68 __dcc_putchar(buf[i]);
94 } 69 }
95 70
96 return count; 71 return count;
@@ -100,15 +75,11 @@ static int hvc_dcc_get_chars(uint32_t vt, char *buf, int count)
100{ 75{
101 int i; 76 int i;
102 77
103 for (i = 0; i < count; ++i) { 78 for (i = 0; i < count; ++i)
104 int c = -1;
105
106 if (__dcc_getstatus() & DCC_STATUS_RX) 79 if (__dcc_getstatus() & DCC_STATUS_RX)
107 c = __dcc_getchar(); 80 buf[i] = __dcc_getchar();
108 if (c < 0) 81 else
109 break; 82 break;
110 buf[i] = c;
111 }
112 83
113 return i; 84 return i;
114} 85}
diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
index 67a75a502c01..8a8d6373f164 100644
--- a/drivers/tty/hvc/hvsi.c
+++ b/drivers/tty/hvc/hvsi.c
@@ -1095,7 +1095,7 @@ static void hvsi_unthrottle(struct tty_struct *tty)
1095 h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE); 1095 h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE);
1096} 1096}
1097 1097
1098static int hvsi_tiocmget(struct tty_struct *tty, struct file *file) 1098static int hvsi_tiocmget(struct tty_struct *tty)
1099{ 1099{
1100 struct hvsi_struct *hp = tty->driver_data; 1100 struct hvsi_struct *hp = tty->driver_data;
1101 1101
@@ -1103,8 +1103,8 @@ static int hvsi_tiocmget(struct tty_struct *tty, struct file *file)
1103 return hp->mctrl; 1103 return hp->mctrl;
1104} 1104}
1105 1105
1106static int hvsi_tiocmset(struct tty_struct *tty, struct file *file, 1106static int hvsi_tiocmset(struct tty_struct *tty,
1107 unsigned int set, unsigned int clear) 1107 unsigned int set, unsigned int clear)
1108{ 1108{
1109 struct hvsi_struct *hp = tty->driver_data; 1109 struct hvsi_struct *hp = tty->driver_data;
1110 unsigned long flags; 1110 unsigned long flags;
diff --git a/drivers/char/pcmcia/ipwireless/Makefile b/drivers/tty/ipwireless/Makefile
index db80873d7f20..db80873d7f20 100644
--- a/drivers/char/pcmcia/ipwireless/Makefile
+++ b/drivers/tty/ipwireless/Makefile
diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index 0aeb5a38d296..0aeb5a38d296 100644
--- a/drivers/char/pcmcia/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
diff --git a/drivers/char/pcmcia/ipwireless/hardware.h b/drivers/tty/ipwireless/hardware.h
index 90a8590e43b0..90a8590e43b0 100644
--- a/drivers/char/pcmcia/ipwireless/hardware.h
+++ b/drivers/tty/ipwireless/hardware.h
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/tty/ipwireless/main.c
index 94b8eb4d691d..94b8eb4d691d 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/tty/ipwireless/main.c
diff --git a/drivers/char/pcmcia/ipwireless/main.h b/drivers/tty/ipwireless/main.h
index f2cbb116bccb..f2cbb116bccb 100644
--- a/drivers/char/pcmcia/ipwireless/main.h
+++ b/drivers/tty/ipwireless/main.h
diff --git a/drivers/char/pcmcia/ipwireless/network.c b/drivers/tty/ipwireless/network.c
index f7daeea598e4..f7daeea598e4 100644
--- a/drivers/char/pcmcia/ipwireless/network.c
+++ b/drivers/tty/ipwireless/network.c
diff --git a/drivers/char/pcmcia/ipwireless/network.h b/drivers/tty/ipwireless/network.h
index 561f765b3334..561f765b3334 100644
--- a/drivers/char/pcmcia/ipwireless/network.h
+++ b/drivers/tty/ipwireless/network.h
diff --git a/drivers/char/pcmcia/ipwireless/setup_protocol.h b/drivers/tty/ipwireless/setup_protocol.h
index 9d6bcc77c73c..9d6bcc77c73c 100644
--- a/drivers/char/pcmcia/ipwireless/setup_protocol.h
+++ b/drivers/tty/ipwireless/setup_protocol.h
diff --git a/drivers/char/pcmcia/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
index f5eb28b6cb0f..ef92869502a7 100644
--- a/drivers/char/pcmcia/ipwireless/tty.c
+++ b/drivers/tty/ipwireless/tty.c
@@ -395,7 +395,7 @@ static int set_control_lines(struct ipw_tty *tty, unsigned int set,
395 return 0; 395 return 0;
396} 396}
397 397
398static int ipw_tiocmget(struct tty_struct *linux_tty, struct file *file) 398static int ipw_tiocmget(struct tty_struct *linux_tty)
399{ 399{
400 struct ipw_tty *tty = linux_tty->driver_data; 400 struct ipw_tty *tty = linux_tty->driver_data;
401 /* FIXME: Exactly how is the tty object locked here .. */ 401 /* FIXME: Exactly how is the tty object locked here .. */
@@ -410,7 +410,7 @@ static int ipw_tiocmget(struct tty_struct *linux_tty, struct file *file)
410} 410}
411 411
412static int 412static int
413ipw_tiocmset(struct tty_struct *linux_tty, struct file *file, 413ipw_tiocmset(struct tty_struct *linux_tty,
414 unsigned int set, unsigned int clear) 414 unsigned int set, unsigned int clear)
415{ 415{
416 struct ipw_tty *tty = linux_tty->driver_data; 416 struct ipw_tty *tty = linux_tty->driver_data;
@@ -425,7 +425,7 @@ ipw_tiocmset(struct tty_struct *linux_tty, struct file *file,
425 return set_control_lines(tty, set, clear); 425 return set_control_lines(tty, set, clear);
426} 426}
427 427
428static int ipw_ioctl(struct tty_struct *linux_tty, struct file *file, 428static int ipw_ioctl(struct tty_struct *linux_tty,
429 unsigned int cmd, unsigned long arg) 429 unsigned int cmd, unsigned long arg)
430{ 430{
431 struct ipw_tty *tty = linux_tty->driver_data; 431 struct ipw_tty *tty = linux_tty->driver_data;
@@ -484,7 +484,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty, struct file *file,
484 return tty_perform_flush(linux_tty, arg); 484 return tty_perform_flush(linux_tty, arg);
485 } 485 }
486 } 486 }
487 return tty_mode_ioctl(linux_tty, file, cmd , arg); 487 return -ENOIOCTLCMD;
488} 488}
489 489
490static int add_tty(int j, 490static int add_tty(int j,
diff --git a/drivers/char/pcmcia/ipwireless/tty.h b/drivers/tty/ipwireless/tty.h
index 747b2d637860..747b2d637860 100644
--- a/drivers/char/pcmcia/ipwireless/tty.h
+++ b/drivers/tty/ipwireless/tty.h
diff --git a/drivers/char/isicom.c b/drivers/tty/isicom.c
index c27e9d21fea9..db1cf9c328d8 100644
--- a/drivers/char/isicom.c
+++ b/drivers/tty/isicom.c
@@ -1065,7 +1065,7 @@ static int isicom_send_break(struct tty_struct *tty, int length)
1065 return 0; 1065 return 0;
1066} 1066}
1067 1067
1068static int isicom_tiocmget(struct tty_struct *tty, struct file *file) 1068static int isicom_tiocmget(struct tty_struct *tty)
1069{ 1069{
1070 struct isi_port *port = tty->driver_data; 1070 struct isi_port *port = tty->driver_data;
1071 /* just send the port status */ 1071 /* just send the port status */
@@ -1082,8 +1082,8 @@ static int isicom_tiocmget(struct tty_struct *tty, struct file *file)
1082 ((status & ISI_RI ) ? TIOCM_RI : 0); 1082 ((status & ISI_RI ) ? TIOCM_RI : 0);
1083} 1083}
1084 1084
1085static int isicom_tiocmset(struct tty_struct *tty, struct file *file, 1085static int isicom_tiocmset(struct tty_struct *tty,
1086 unsigned int set, unsigned int clear) 1086 unsigned int set, unsigned int clear)
1087{ 1087{
1088 struct isi_port *port = tty->driver_data; 1088 struct isi_port *port = tty->driver_data;
1089 unsigned long flags; 1089 unsigned long flags;
@@ -1167,7 +1167,7 @@ static int isicom_get_serial_info(struct isi_port *port,
1167 return 0; 1167 return 0;
1168} 1168}
1169 1169
1170static int isicom_ioctl(struct tty_struct *tty, struct file *filp, 1170static int isicom_ioctl(struct tty_struct *tty,
1171 unsigned int cmd, unsigned long arg) 1171 unsigned int cmd, unsigned long arg)
1172{ 1172{
1173 struct isi_port *port = tty->driver_data; 1173 struct isi_port *port = tty->driver_data;
diff --git a/drivers/char/moxa.c b/drivers/tty/moxa.c
index 107b0bd58d19..35b0c38590e6 100644
--- a/drivers/char/moxa.c
+++ b/drivers/tty/moxa.c
@@ -199,8 +199,8 @@ static void moxa_set_termios(struct tty_struct *, struct ktermios *);
199static void moxa_stop(struct tty_struct *); 199static void moxa_stop(struct tty_struct *);
200static void moxa_start(struct tty_struct *); 200static void moxa_start(struct tty_struct *);
201static void moxa_hangup(struct tty_struct *); 201static void moxa_hangup(struct tty_struct *);
202static int moxa_tiocmget(struct tty_struct *tty, struct file *file); 202static int moxa_tiocmget(struct tty_struct *tty);
203static int moxa_tiocmset(struct tty_struct *tty, struct file *file, 203static int moxa_tiocmset(struct tty_struct *tty,
204 unsigned int set, unsigned int clear); 204 unsigned int set, unsigned int clear);
205static void moxa_poll(unsigned long); 205static void moxa_poll(unsigned long);
206static void moxa_set_tty_param(struct tty_struct *, struct ktermios *); 206static void moxa_set_tty_param(struct tty_struct *, struct ktermios *);
@@ -287,7 +287,7 @@ static void moxa_low_water_check(void __iomem *ofsAddr)
287 * TTY operations 287 * TTY operations
288 */ 288 */
289 289
290static int moxa_ioctl(struct tty_struct *tty, struct file *file, 290static int moxa_ioctl(struct tty_struct *tty,
291 unsigned int cmd, unsigned long arg) 291 unsigned int cmd, unsigned long arg)
292{ 292{
293 struct moxa_port *ch = tty->driver_data; 293 struct moxa_port *ch = tty->driver_data;
@@ -1257,7 +1257,7 @@ static int moxa_chars_in_buffer(struct tty_struct *tty)
1257 return chars; 1257 return chars;
1258} 1258}
1259 1259
1260static int moxa_tiocmget(struct tty_struct *tty, struct file *file) 1260static int moxa_tiocmget(struct tty_struct *tty)
1261{ 1261{
1262 struct moxa_port *ch = tty->driver_data; 1262 struct moxa_port *ch = tty->driver_data;
1263 int flag = 0, dtr, rts; 1263 int flag = 0, dtr, rts;
@@ -1277,7 +1277,7 @@ static int moxa_tiocmget(struct tty_struct *tty, struct file *file)
1277 return flag; 1277 return flag;
1278} 1278}
1279 1279
1280static int moxa_tiocmset(struct tty_struct *tty, struct file *file, 1280static int moxa_tiocmset(struct tty_struct *tty,
1281 unsigned int set, unsigned int clear) 1281 unsigned int set, unsigned int clear)
1282{ 1282{
1283 struct moxa_port *ch; 1283 struct moxa_port *ch;
diff --git a/drivers/char/moxa.h b/drivers/tty/moxa.h
index 87d16ce57be7..87d16ce57be7 100644
--- a/drivers/char/moxa.h
+++ b/drivers/tty/moxa.h
diff --git a/drivers/char/mxser.c b/drivers/tty/mxser.c
index dd9d75351cd6..d188f378684d 100644
--- a/drivers/char/mxser.c
+++ b/drivers/tty/mxser.c
@@ -1320,7 +1320,7 @@ static int mxser_get_lsr_info(struct mxser_port *info,
1320 return put_user(result, value); 1320 return put_user(result, value);
1321} 1321}
1322 1322
1323static int mxser_tiocmget(struct tty_struct *tty, struct file *file) 1323static int mxser_tiocmget(struct tty_struct *tty)
1324{ 1324{
1325 struct mxser_port *info = tty->driver_data; 1325 struct mxser_port *info = tty->driver_data;
1326 unsigned char control, status; 1326 unsigned char control, status;
@@ -1347,7 +1347,7 @@ static int mxser_tiocmget(struct tty_struct *tty, struct file *file)
1347 ((status & UART_MSR_CTS) ? TIOCM_CTS : 0); 1347 ((status & UART_MSR_CTS) ? TIOCM_CTS : 0);
1348} 1348}
1349 1349
1350static int mxser_tiocmset(struct tty_struct *tty, struct file *file, 1350static int mxser_tiocmset(struct tty_struct *tty,
1351 unsigned int set, unsigned int clear) 1351 unsigned int set, unsigned int clear)
1352{ 1352{
1353 struct mxser_port *info = tty->driver_data; 1353 struct mxser_port *info = tty->driver_data;
@@ -1655,7 +1655,7 @@ static int mxser_cflags_changed(struct mxser_port *info, unsigned long arg,
1655 return ret; 1655 return ret;
1656} 1656}
1657 1657
1658static int mxser_ioctl(struct tty_struct *tty, struct file *file, 1658static int mxser_ioctl(struct tty_struct *tty,
1659 unsigned int cmd, unsigned long arg) 1659 unsigned int cmd, unsigned long arg)
1660{ 1660{
1661 struct mxser_port *info = tty->driver_data; 1661 struct mxser_port *info = tty->driver_data;
diff --git a/drivers/char/mxser.h b/drivers/tty/mxser.h
index 41878a69203d..41878a69203d 100644
--- a/drivers/char/mxser.h
+++ b/drivers/tty/mxser.h
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index aa2e5d3eb01a..0d90be48463d 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2649,13 +2649,13 @@ static void gsmtty_wait_until_sent(struct tty_struct *tty, int timeout)
2649 to do here */ 2649 to do here */
2650} 2650}
2651 2651
2652static int gsmtty_tiocmget(struct tty_struct *tty, struct file *filp) 2652static int gsmtty_tiocmget(struct tty_struct *tty)
2653{ 2653{
2654 struct gsm_dlci *dlci = tty->driver_data; 2654 struct gsm_dlci *dlci = tty->driver_data;
2655 return dlci->modem_rx; 2655 return dlci->modem_rx;
2656} 2656}
2657 2657
2658static int gsmtty_tiocmset(struct tty_struct *tty, struct file *filp, 2658static int gsmtty_tiocmset(struct tty_struct *tty,
2659 unsigned int set, unsigned int clear) 2659 unsigned int set, unsigned int clear)
2660{ 2660{
2661 struct gsm_dlci *dlci = tty->driver_data; 2661 struct gsm_dlci *dlci = tty->driver_data;
@@ -2672,7 +2672,7 @@ static int gsmtty_tiocmset(struct tty_struct *tty, struct file *filp,
2672} 2672}
2673 2673
2674 2674
2675static int gsmtty_ioctl(struct tty_struct *tty, struct file *filp, 2675static int gsmtty_ioctl(struct tty_struct *tty,
2676 unsigned int cmd, unsigned long arg) 2676 unsigned int cmd, unsigned long arg)
2677{ 2677{
2678 return -ENOIOCTLCMD; 2678 return -ENOIOCTLCMD;
diff --git a/drivers/char/nozomi.c b/drivers/tty/nozomi.c
index 294d03e8c61a..513ba12064ea 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -1750,7 +1750,7 @@ static int ntty_write_room(struct tty_struct *tty)
1750} 1750}
1751 1751
1752/* Gets io control parameters */ 1752/* Gets io control parameters */
1753static int ntty_tiocmget(struct tty_struct *tty, struct file *file) 1753static int ntty_tiocmget(struct tty_struct *tty)
1754{ 1754{
1755 const struct port *port = tty->driver_data; 1755 const struct port *port = tty->driver_data;
1756 const struct ctrl_dl *ctrl_dl = &port->ctrl_dl; 1756 const struct ctrl_dl *ctrl_dl = &port->ctrl_dl;
@@ -1767,8 +1767,8 @@ static int ntty_tiocmget(struct tty_struct *tty, struct file *file)
1767} 1767}
1768 1768
1769/* Sets io controls parameters */ 1769/* Sets io controls parameters */
1770static int ntty_tiocmset(struct tty_struct *tty, struct file *file, 1770static int ntty_tiocmset(struct tty_struct *tty,
1771 unsigned int set, unsigned int clear) 1771 unsigned int set, unsigned int clear)
1772{ 1772{
1773 struct nozomi *dc = get_dc_by_tty(tty); 1773 struct nozomi *dc = get_dc_by_tty(tty);
1774 unsigned long flags; 1774 unsigned long flags;
@@ -1824,7 +1824,7 @@ static int ntty_tiocgicount(struct tty_struct *tty,
1824 return 0; 1824 return 0;
1825} 1825}
1826 1826
1827static int ntty_ioctl(struct tty_struct *tty, struct file *file, 1827static int ntty_ioctl(struct tty_struct *tty,
1828 unsigned int cmd, unsigned long arg) 1828 unsigned int cmd, unsigned long arg)
1829{ 1829{
1830 struct port *port = tty->driver_data; 1830 struct port *port = tty->driver_data;
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 923a48585501..c88029af84dd 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -334,7 +334,7 @@ free_mem_out:
334 return -ENOMEM; 334 return -ENOMEM;
335} 335}
336 336
337static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file, 337static int pty_bsd_ioctl(struct tty_struct *tty,
338 unsigned int cmd, unsigned long arg) 338 unsigned int cmd, unsigned long arg)
339{ 339{
340 switch (cmd) { 340 switch (cmd) {
@@ -489,7 +489,7 @@ static struct ctl_table pty_root_table[] = {
489}; 489};
490 490
491 491
492static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, 492static int pty_unix98_ioctl(struct tty_struct *tty,
493 unsigned int cmd, unsigned long arg) 493 unsigned int cmd, unsigned long arg)
494{ 494{
495 switch (cmd) { 495 switch (cmd) {
diff --git a/drivers/char/rocket.c b/drivers/tty/rocket.c
index 3e4e73a0d7c1..3780da8ad12d 100644
--- a/drivers/char/rocket.c
+++ b/drivers/tty/rocket.c
@@ -1169,7 +1169,7 @@ static int sGetChanRI(CHANNEL_T * ChP)
1169 * Returns the state of the serial modem control lines. These next 2 functions 1169 * Returns the state of the serial modem control lines. These next 2 functions
1170 * are the way kernel versions > 2.5 handle modem control lines rather than IOCTLs. 1170 * are the way kernel versions > 2.5 handle modem control lines rather than IOCTLs.
1171 */ 1171 */
1172static int rp_tiocmget(struct tty_struct *tty, struct file *file) 1172static int rp_tiocmget(struct tty_struct *tty)
1173{ 1173{
1174 struct r_port *info = tty->driver_data; 1174 struct r_port *info = tty->driver_data;
1175 unsigned int control, result, ChanStatus; 1175 unsigned int control, result, ChanStatus;
@@ -1189,8 +1189,8 @@ static int rp_tiocmget(struct tty_struct *tty, struct file *file)
1189/* 1189/*
1190 * Sets the modem control lines 1190 * Sets the modem control lines
1191 */ 1191 */
1192static int rp_tiocmset(struct tty_struct *tty, struct file *file, 1192static int rp_tiocmset(struct tty_struct *tty,
1193 unsigned int set, unsigned int clear) 1193 unsigned int set, unsigned int clear)
1194{ 1194{
1195 struct r_port *info = tty->driver_data; 1195 struct r_port *info = tty->driver_data;
1196 1196
@@ -1326,7 +1326,7 @@ static int get_version(struct r_port *info, struct rocket_version __user *retver
1326} 1326}
1327 1327
1328/* IOCTL call handler into the driver */ 1328/* IOCTL call handler into the driver */
1329static int rp_ioctl(struct tty_struct *tty, struct file *file, 1329static int rp_ioctl(struct tty_struct *tty,
1330 unsigned int cmd, unsigned long arg) 1330 unsigned int cmd, unsigned long arg)
1331{ 1331{
1332 struct r_port *info = tty->driver_data; 1332 struct r_port *info = tty->driver_data;
diff --git a/drivers/char/rocket.h b/drivers/tty/rocket.h
index ec863f35f1a9..ec863f35f1a9 100644
--- a/drivers/char/rocket.h
+++ b/drivers/tty/rocket.h
diff --git a/drivers/char/rocket_int.h b/drivers/tty/rocket_int.h
index 67e0f1e778a2..67e0f1e778a2 100644
--- a/drivers/char/rocket_int.h
+++ b/drivers/tty/rocket_int.h
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index de0160e3f8c4..d5bfd41707e7 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -393,28 +393,6 @@ static void do_softint(struct work_struct *work)
393#endif 393#endif
394} 394}
395 395
396/*
397 * This routine is called from the scheduler tqueue when the interrupt
398 * routine has signalled that a hangup has occurred. The path of
399 * hangup processing is:
400 *
401 * serial interrupt routine -> (scheduler tqueue) ->
402 * do_serial_hangup() -> tty->hangup() -> rs_hangup()
403 *
404 */
405static void do_serial_hangup(struct work_struct *work)
406{
407 struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup);
408 struct tty_struct *tty;
409
410 tty = info->tty;
411 if (!tty)
412 return;
413
414 tty_hangup(tty);
415}
416
417
418static int startup(struct m68k_serial * info) 396static int startup(struct m68k_serial * info)
419{ 397{
420 m68328_uart *uart = &uart_addr[info->line]; 398 m68328_uart *uart = &uart_addr[info->line];
@@ -967,7 +945,7 @@ static void send_break(struct m68k_serial * info, unsigned int duration)
967 local_irq_restore(flags); 945 local_irq_restore(flags);
968} 946}
969 947
970static int rs_ioctl(struct tty_struct *tty, struct file * file, 948static int rs_ioctl(struct tty_struct *tty,
971 unsigned int cmd, unsigned long arg) 949 unsigned int cmd, unsigned long arg)
972{ 950{
973 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data; 951 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
@@ -1347,7 +1325,6 @@ rs68328_init(void)
1347 info->count = 0; 1325 info->count = 0;
1348 info->blocked_open = 0; 1326 info->blocked_open = 0;
1349 INIT_WORK(&info->tqueue, do_softint); 1327 INIT_WORK(&info->tqueue, do_softint);
1350 INIT_WORK(&info->tqueue_hangup, do_serial_hangup);
1351 init_waitqueue_head(&info->open_wait); 1328 init_waitqueue_head(&info->open_wait);
1352 init_waitqueue_head(&info->close_wait); 1329 init_waitqueue_head(&info->close_wait);
1353 info->line = i; 1330 info->line = i;
diff --git a/drivers/tty/serial/68328serial.h b/drivers/tty/serial/68328serial.h
index 664ceb0a158c..8c9c3c0745db 100644
--- a/drivers/tty/serial/68328serial.h
+++ b/drivers/tty/serial/68328serial.h
@@ -159,7 +159,6 @@ struct m68k_serial {
159 int xmit_tail; 159 int xmit_tail;
160 int xmit_cnt; 160 int xmit_cnt;
161 struct work_struct tqueue; 161 struct work_struct tqueue;
162 struct work_struct tqueue_hangup;
163 wait_queue_head_t open_wait; 162 wait_queue_head_t open_wait;
164 wait_queue_head_t close_wait; 163 wait_queue_head_t close_wait;
165}; 164};
diff --git a/drivers/tty/serial/68360serial.c b/drivers/tty/serial/68360serial.c
index bc21eeae8fde..0a3e8787ed50 100644
--- a/drivers/tty/serial/68360serial.c
+++ b/drivers/tty/serial/68360serial.c
@@ -1240,7 +1240,7 @@ static int get_lsr_info(struct async_struct * info, unsigned int *value)
1240} 1240}
1241#endif 1241#endif
1242 1242
1243static int rs_360_tiocmget(struct tty_struct *tty, struct file *file) 1243static int rs_360_tiocmget(struct tty_struct *tty)
1244{ 1244{
1245 ser_info_t *info = (ser_info_t *)tty->driver_data; 1245 ser_info_t *info = (ser_info_t *)tty->driver_data;
1246 unsigned int result = 0; 1246 unsigned int result = 0;
@@ -1271,7 +1271,7 @@ static int rs_360_tiocmget(struct tty_struct *tty, struct file *file)
1271 return result; 1271 return result;
1272} 1272}
1273 1273
1274static int rs_360_tiocmset(struct tty_struct *tty, struct file *file, 1274static int rs_360_tiocmset(struct tty_struct *tty,
1275 unsigned int set, unsigned int clear) 1275 unsigned int set, unsigned int clear)
1276{ 1276{
1277#ifdef modem_control 1277#ifdef modem_control
@@ -1405,7 +1405,7 @@ static int rs_360_get_icount(struct tty_struct *tty,
1405 return 0; 1405 return 0;
1406} 1406}
1407 1407
1408static int rs_360_ioctl(struct tty_struct *tty, struct file * file, 1408static int rs_360_ioctl(struct tty_struct *tty,
1409 unsigned int cmd, unsigned long arg) 1409 unsigned int cmd, unsigned long arg)
1410{ 1410{
1411 int error; 1411 int error;
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 3975df6f7fdb..b3b881bc4712 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -954,6 +954,23 @@ static int broken_efr(struct uart_8250_port *up)
954 return 0; 954 return 0;
955} 955}
956 956
957static inline int ns16550a_goto_highspeed(struct uart_8250_port *up)
958{
959 unsigned char status;
960
961 status = serial_in(up, 0x04); /* EXCR2 */
962#define PRESL(x) ((x) & 0x30)
963 if (PRESL(status) == 0x10) {
964 /* already in high speed mode */
965 return 0;
966 } else {
967 status &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
968 status |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
969 serial_outp(up, 0x04, status);
970 }
971 return 1;
972}
973
957/* 974/*
958 * We know that the chip has FIFOs. Does it have an EFR? The 975 * We know that the chip has FIFOs. Does it have an EFR? The
959 * EFR is located in the same register position as the IIR and 976 * EFR is located in the same register position as the IIR and
@@ -1025,12 +1042,8 @@ static void autoconfig_16550a(struct uart_8250_port *up)
1025 quot = serial_dl_read(up); 1042 quot = serial_dl_read(up);
1026 quot <<= 3; 1043 quot <<= 3;
1027 1044
1028 status1 = serial_in(up, 0x04); /* EXCR2 */ 1045 if (ns16550a_goto_highspeed(up))
1029 status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ 1046 serial_dl_write(up, quot);
1030 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
1031 serial_outp(up, 0x04, status1);
1032
1033 serial_dl_write(up, quot);
1034 1047
1035 serial_outp(up, UART_LCR, 0); 1048 serial_outp(up, UART_LCR, 0);
1036 1049
@@ -3025,17 +3038,13 @@ void serial8250_resume_port(int line)
3025 struct uart_8250_port *up = &serial8250_ports[line]; 3038 struct uart_8250_port *up = &serial8250_ports[line];
3026 3039
3027 if (up->capabilities & UART_NATSEMI) { 3040 if (up->capabilities & UART_NATSEMI) {
3028 unsigned char tmp;
3029
3030 /* Ensure it's still in high speed mode */ 3041 /* Ensure it's still in high speed mode */
3031 serial_outp(up, UART_LCR, 0xE0); 3042 serial_outp(up, UART_LCR, 0xE0);
3032 3043
3033 tmp = serial_in(up, 0x04); /* EXCR2 */ 3044 ns16550a_goto_highspeed(up);
3034 tmp &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
3035 tmp |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
3036 serial_outp(up, 0x04, tmp);
3037 3045
3038 serial_outp(up, UART_LCR, 0); 3046 serial_outp(up, UART_LCR, 0);
3047 up->port.uartclk = 921600*16;
3039 } 3048 }
3040 uart_resume_port(&serial8250_reg, &up->port); 3049 uart_resume_port(&serial8250_reg, &up->port);
3041} 3050}
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2b8334601c8b..90d939a4ee5d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1588,12 +1588,25 @@ config SERIAL_IFX6X60
1588 Support for the IFX6x60 modem devices on Intel MID platforms. 1588 Support for the IFX6x60 modem devices on Intel MID platforms.
1589 1589
1590config SERIAL_PCH_UART 1590config SERIAL_PCH_UART
1591 tristate "Intel EG20T PCH UART" 1591 tristate "Intel EG20T PCH UART/OKI SEMICONDUCTOR ML7213 IOH"
1592 depends on PCI && DMADEVICES 1592 depends on PCI
1593 select SERIAL_CORE 1593 select SERIAL_CORE
1594 select PCH_DMA
1595 help 1594 help
1596 This driver is for PCH(Platform controller Hub) UART of Intel EG20T 1595 This driver is for PCH(Platform controller Hub) UART of Intel EG20T
1597 which is an IOH(Input/Output Hub) for x86 embedded processor. 1596 which is an IOH(Input/Output Hub) for x86 embedded processor.
1598 Enabling PCH_DMA, this PCH UART works as DMA mode. 1597 Enabling PCH_DMA, this PCH UART works as DMA mode.
1598
1599 This driver also can be used for OKI SEMICONDUCTOR ML7213 IOH(Input/
1600 Output Hub) which is for IVI(In-Vehicle Infotainment) use.
1601 ML7213 is companion chip for Intel Atom E6xx series.
1602 ML7213 is completely compatible for Intel EG20T PCH.
1603
1604config SERIAL_MSM_SMD
1605 bool "Enable tty device interface for some SMD ports"
1606 default n
1607 depends on MSM_SMD
1608 help
1609 Enables userspace clients to read and write to some streaming SMD
1610 ports via tty device interface for MSM chipset.
1611
1599endmenu 1612endmenu
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 8ea92e9c73b0..0c6aefb55acf 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -92,3 +92,4 @@ obj-$(CONFIG_SERIAL_MRST_MAX3110) += mrst_max3110.o
92obj-$(CONFIG_SERIAL_MFD_HSU) += mfd.o 92obj-$(CONFIG_SERIAL_MFD_HSU) += mfd.o
93obj-$(CONFIG_SERIAL_IFX6X60) += ifx6x60.o 93obj-$(CONFIG_SERIAL_IFX6X60) += ifx6x60.o
94obj-$(CONFIG_SERIAL_PCH_UART) += pch_uart.o 94obj-$(CONFIG_SERIAL_PCH_UART) += pch_uart.o
95obj-$(CONFIG_SERIAL_MSM_SMD) += msm_smd_tty.o
diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index f9b49b5ff5e1..8f014bb916b7 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -305,28 +305,6 @@ static struct altera_jtaguart altera_jtaguart_ports[ALTERA_JTAGUART_MAXPORTS];
305 305
306#if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE) 306#if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE)
307 307
308int __init early_altera_jtaguart_setup(struct altera_jtaguart_platform_uart
309 *platp)
310{
311 struct uart_port *port;
312 int i;
313
314 for (i = 0; i < ALTERA_JTAGUART_MAXPORTS && platp[i].mapbase; i++) {
315 port = &altera_jtaguart_ports[i].port;
316
317 port->line = i;
318 port->type = PORT_ALTERA_JTAGUART;
319 port->mapbase = platp[i].mapbase;
320 port->membase = ioremap(port->mapbase, ALTERA_JTAGUART_SIZE);
321 port->iotype = SERIAL_IO_MEM;
322 port->irq = platp[i].irq;
323 port->flags = ASYNC_BOOT_AUTOCONF;
324 port->ops = &altera_jtaguart_ops;
325 }
326
327 return 0;
328}
329
330#if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS) 308#if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS)
331static void altera_jtaguart_console_putc(struct console *co, const char c) 309static void altera_jtaguart_console_putc(struct console *co, const char c)
332{ 310{
@@ -384,7 +362,7 @@ static int __init altera_jtaguart_console_setup(struct console *co,
384 if (co->index < 0 || co->index >= ALTERA_JTAGUART_MAXPORTS) 362 if (co->index < 0 || co->index >= ALTERA_JTAGUART_MAXPORTS)
385 return -EINVAL; 363 return -EINVAL;
386 port = &altera_jtaguart_ports[co->index].port; 364 port = &altera_jtaguart_ports[co->index].port;
387 if (port->membase == 0) 365 if (port->membase == NULL)
388 return -ENODEV; 366 return -ENODEV;
389 return 0; 367 return 0;
390} 368}
@@ -431,22 +409,45 @@ static int __devinit altera_jtaguart_probe(struct platform_device *pdev)
431{ 409{
432 struct altera_jtaguart_platform_uart *platp = pdev->dev.platform_data; 410 struct altera_jtaguart_platform_uart *platp = pdev->dev.platform_data;
433 struct uart_port *port; 411 struct uart_port *port;
434 int i; 412 struct resource *res_irq, *res_mem;
413 int i = pdev->id;
435 414
436 for (i = 0; i < ALTERA_JTAGUART_MAXPORTS && platp[i].mapbase; i++) { 415 /* -1 emphasizes that the platform must have one port, no .N suffix */
437 port = &altera_jtaguart_ports[i].port; 416 if (i == -1)
417 i = 0;
438 418
439 port->line = i; 419 if (i >= ALTERA_JTAGUART_MAXPORTS)
440 port->type = PORT_ALTERA_JTAGUART; 420 return -EINVAL;
441 port->mapbase = platp[i].mapbase;
442 port->membase = ioremap(port->mapbase, ALTERA_JTAGUART_SIZE);
443 port->iotype = SERIAL_IO_MEM;
444 port->irq = platp[i].irq;
445 port->ops = &altera_jtaguart_ops;
446 port->flags = ASYNC_BOOT_AUTOCONF;
447 421
448 uart_add_one_port(&altera_jtaguart_driver, port); 422 port = &altera_jtaguart_ports[i].port;
449 } 423
424 res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
425 if (res_mem)
426 port->mapbase = res_mem->start;
427 else if (platp)
428 port->mapbase = platp->mapbase;
429 else
430 return -ENODEV;
431
432 res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
433 if (res_irq)
434 port->irq = res_irq->start;
435 else if (platp)
436 port->irq = platp->irq;
437 else
438 return -ENODEV;
439
440 port->membase = ioremap(port->mapbase, ALTERA_JTAGUART_SIZE);
441 if (!port->membase)
442 return -ENOMEM;
443
444 port->line = i;
445 port->type = PORT_ALTERA_JTAGUART;
446 port->iotype = SERIAL_IO_MEM;
447 port->ops = &altera_jtaguart_ops;
448 port->flags = UPF_BOOT_AUTOCONF;
449
450 uart_add_one_port(&altera_jtaguart_driver, port);
450 451
451 return 0; 452 return 0;
452} 453}
@@ -454,13 +455,13 @@ static int __devinit altera_jtaguart_probe(struct platform_device *pdev)
454static int __devexit altera_jtaguart_remove(struct platform_device *pdev) 455static int __devexit altera_jtaguart_remove(struct platform_device *pdev)
455{ 456{
456 struct uart_port *port; 457 struct uart_port *port;
457 int i; 458 int i = pdev->id;
458 459
459 for (i = 0; i < ALTERA_JTAGUART_MAXPORTS; i++) { 460 if (i == -1)
460 port = &altera_jtaguart_ports[i].port; 461 i = 0;
461 if (port) 462
462 uart_remove_one_port(&altera_jtaguart_driver, port); 463 port = &altera_jtaguart_ports[i].port;
463 } 464 uart_remove_one_port(&altera_jtaguart_driver, port);
464 465
465 return 0; 466 return 0;
466} 467}
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 721216292a50..3a573528555e 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -86,16 +86,12 @@ struct altera_uart {
86 86
87static u32 altera_uart_readl(struct uart_port *port, int reg) 87static u32 altera_uart_readl(struct uart_port *port, int reg)
88{ 88{
89 struct altera_uart_platform_uart *platp = port->private_data; 89 return readl(port->membase + (reg << port->regshift));
90
91 return readl(port->membase + (reg << platp->bus_shift));
92} 90}
93 91
94static void altera_uart_writel(struct uart_port *port, u32 dat, int reg) 92static void altera_uart_writel(struct uart_port *port, u32 dat, int reg)
95{ 93{
96 struct altera_uart_platform_uart *platp = port->private_data; 94 writel(dat, port->membase + (reg << port->regshift));
97
98 writel(dat, port->membase + (reg << platp->bus_shift));
99} 95}
100 96
101static unsigned int altera_uart_tx_empty(struct uart_port *port) 97static unsigned int altera_uart_tx_empty(struct uart_port *port)
@@ -546,13 +542,17 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
546 if (!port->membase) 542 if (!port->membase)
547 return -ENOMEM; 543 return -ENOMEM;
548 544
545 if (platp)
546 port->regshift = platp->bus_shift;
547 else
548 port->regshift = 0;
549
549 port->line = i; 550 port->line = i;
550 port->type = PORT_ALTERA_UART; 551 port->type = PORT_ALTERA_UART;
551 port->iotype = SERIAL_IO_MEM; 552 port->iotype = SERIAL_IO_MEM;
552 port->uartclk = platp->uartclk; 553 port->uartclk = platp->uartclk;
553 port->ops = &altera_uart_ops; 554 port->ops = &altera_uart_ops;
554 port->flags = UPF_BOOT_AUTOCONF; 555 port->flags = UPF_BOOT_AUTOCONF;
555 port->private_data = platp;
556 556
557 uart_add_one_port(&altera_uart_driver, port); 557 uart_add_one_port(&altera_uart_driver, port);
558 558
@@ -561,9 +561,15 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
561 561
562static int __devexit altera_uart_remove(struct platform_device *pdev) 562static int __devexit altera_uart_remove(struct platform_device *pdev)
563{ 563{
564 struct uart_port *port = &altera_uart_ports[pdev->id].port; 564 struct uart_port *port;
565 int i = pdev->id;
565 566
567 if (i == -1)
568 i = 0;
569
570 port = &altera_uart_ports[i].port;
566 uart_remove_one_port(&altera_uart_driver, port); 571 uart_remove_one_port(&altera_uart_driver, port);
572
567 return 0; 573 return 0;
568} 574}
569 575
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 2a1d52fb4936..f119d1761106 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1240,6 +1240,21 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
1240 spin_unlock_irqrestore(&port->lock, flags); 1240 spin_unlock_irqrestore(&port->lock, flags);
1241} 1241}
1242 1242
1243static void atmel_set_ldisc(struct uart_port *port, int new)
1244{
1245 int line = port->line;
1246
1247 if (line >= port->state->port.tty->driver->num)
1248 return;
1249
1250 if (port->state->port.tty->ldisc->ops->num == N_PPS) {
1251 port->flags |= UPF_HARDPPS_CD;
1252 atmel_enable_ms(port);
1253 } else {
1254 port->flags &= ~UPF_HARDPPS_CD;
1255 }
1256}
1257
1243/* 1258/*
1244 * Return string describing the specified port 1259 * Return string describing the specified port
1245 */ 1260 */
@@ -1380,6 +1395,7 @@ static struct uart_ops atmel_pops = {
1380 .shutdown = atmel_shutdown, 1395 .shutdown = atmel_shutdown,
1381 .flush_buffer = atmel_flush_buffer, 1396 .flush_buffer = atmel_flush_buffer,
1382 .set_termios = atmel_set_termios, 1397 .set_termios = atmel_set_termios,
1398 .set_ldisc = atmel_set_ldisc,
1383 .type = atmel_type, 1399 .type = atmel_type,
1384 .release_port = atmel_release_port, 1400 .release_port = atmel_release_port,
1385 .request_port = atmel_request_port, 1401 .request_port = atmel_request_port,
diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c
index e95c524d9d18..c3ec0a61d859 100644
--- a/drivers/tty/serial/bfin_sport_uart.c
+++ b/drivers/tty/serial/bfin_sport_uart.c
@@ -788,7 +788,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
788 sport->port.mapbase = res->start; 788 sport->port.mapbase = res->start;
789 789
790 sport->port.irq = platform_get_irq(pdev, 0); 790 sport->port.irq = platform_get_irq(pdev, 0);
791 if (sport->port.irq < 0) { 791 if ((int)sport->port.irq < 0) {
792 dev_err(&pdev->dev, "No sport RX/TX IRQ specified\n"); 792 dev_err(&pdev->dev, "No sport RX/TX IRQ specified\n");
793 ret = -ENOENT; 793 ret = -ENOENT;
794 goto out_error_unmap; 794 goto out_error_unmap;
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index bcc31f2140ac..225123b37f19 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -3581,8 +3581,7 @@ rs_break(struct tty_struct *tty, int break_state)
3581} 3581}
3582 3582
3583static int 3583static int
3584rs_tiocmset(struct tty_struct *tty, struct file *file, 3584rs_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear)
3585 unsigned int set, unsigned int clear)
3586{ 3585{
3587 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 3586 struct e100_serial *info = (struct e100_serial *)tty->driver_data;
3588 unsigned long flags; 3587 unsigned long flags;
@@ -3614,7 +3613,7 @@ rs_tiocmset(struct tty_struct *tty, struct file *file,
3614} 3613}
3615 3614
3616static int 3615static int
3617rs_tiocmget(struct tty_struct *tty, struct file *file) 3616rs_tiocmget(struct tty_struct *tty)
3618{ 3617{
3619 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 3618 struct e100_serial *info = (struct e100_serial *)tty->driver_data;
3620 unsigned int result; 3619 unsigned int result;
@@ -3648,7 +3647,7 @@ rs_tiocmget(struct tty_struct *tty, struct file *file)
3648 3647
3649 3648
3650static int 3649static int
3651rs_ioctl(struct tty_struct *tty, struct file * file, 3650rs_ioctl(struct tty_struct *tty,
3652 unsigned int cmd, unsigned long arg) 3651 unsigned int cmd, unsigned long arg)
3653{ 3652{
3654 struct e100_serial * info = (struct e100_serial *)tty->driver_data; 3653 struct e100_serial * info = (struct e100_serial *)tty->driver_data;
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index ab93763862d5..8ee5a41d340d 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -8,7 +8,7 @@
8 * Jan Dumon <j.dumon@option.com> 8 * Jan Dumon <j.dumon@option.com>
9 * 9 *
10 * Copyright (C) 2009, 2010 Intel Corp 10 * Copyright (C) 2009, 2010 Intel Corp
11 * Russ Gorby <richardx.r.gorby@intel.com> 11 * Russ Gorby <russ.gorby@intel.com>
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
@@ -67,6 +67,7 @@
67#define IFX_SPI_MORE_MASK 0x10 67#define IFX_SPI_MORE_MASK 0x10
68#define IFX_SPI_MORE_BIT 12 /* bit position in u16 */ 68#define IFX_SPI_MORE_BIT 12 /* bit position in u16 */
69#define IFX_SPI_CTS_BIT 13 /* bit position in u16 */ 69#define IFX_SPI_CTS_BIT 13 /* bit position in u16 */
70#define IFX_SPI_MODE SPI_MODE_1
70#define IFX_SPI_TTY_ID 0 71#define IFX_SPI_TTY_ID 0
71#define IFX_SPI_TIMEOUT_SEC 2 72#define IFX_SPI_TIMEOUT_SEC 2
72#define IFX_SPI_HEADER_0 (-1) 73#define IFX_SPI_HEADER_0 (-1)
@@ -76,7 +77,7 @@
76static void ifx_spi_handle_srdy(struct ifx_spi_device *ifx_dev); 77static void ifx_spi_handle_srdy(struct ifx_spi_device *ifx_dev);
77 78
78/* local variables */ 79/* local variables */
79static int spi_b16 = 1; /* 8 or 16 bit word length */ 80static int spi_bpw = 16; /* 8, 16 or 32 bit word length */
80static struct tty_driver *tty_drv; 81static struct tty_driver *tty_drv;
81static struct ifx_spi_device *saved_ifx_dev; 82static struct ifx_spi_device *saved_ifx_dev;
82static struct lock_class_key ifx_spi_key; 83static struct lock_class_key ifx_spi_key;
@@ -244,7 +245,7 @@ static void ifx_spi_timeout(unsigned long arg)
244 * Map the signal state into Linux modem flags and report the value 245 * Map the signal state into Linux modem flags and report the value
245 * in Linux terms 246 * in Linux terms
246 */ 247 */
247static int ifx_spi_tiocmget(struct tty_struct *tty, struct file *filp) 248static int ifx_spi_tiocmget(struct tty_struct *tty)
248{ 249{
249 unsigned int value; 250 unsigned int value;
250 struct ifx_spi_device *ifx_dev = tty->driver_data; 251 struct ifx_spi_device *ifx_dev = tty->driver_data;
@@ -262,7 +263,6 @@ static int ifx_spi_tiocmget(struct tty_struct *tty, struct file *filp)
262/** 263/**
263 * ifx_spi_tiocmset - set modem bits 264 * ifx_spi_tiocmset - set modem bits
264 * @tty: the tty structure 265 * @tty: the tty structure
265 * @filp: file handle issuing the request
266 * @set: bits to set 266 * @set: bits to set
267 * @clear: bits to clear 267 * @clear: bits to clear
268 * 268 *
@@ -271,7 +271,7 @@ static int ifx_spi_tiocmget(struct tty_struct *tty, struct file *filp)
271 * 271 *
272 * FIXME: do we need to kick the tranfers when we do this ? 272 * FIXME: do we need to kick the tranfers when we do this ?
273 */ 273 */
274static int ifx_spi_tiocmset(struct tty_struct *tty, struct file *filp, 274static int ifx_spi_tiocmset(struct tty_struct *tty,
275 unsigned int set, unsigned int clear) 275 unsigned int set, unsigned int clear)
276{ 276{
277 struct ifx_spi_device *ifx_dev = tty->driver_data; 277 struct ifx_spi_device *ifx_dev = tty->driver_data;
@@ -722,9 +722,9 @@ static void ifx_spi_io(unsigned long data)
722 /* note len is BYTES, not transfers */ 722 /* note len is BYTES, not transfers */
723 ifx_dev->spi_xfer.len = IFX_SPI_TRANSFER_SIZE; 723 ifx_dev->spi_xfer.len = IFX_SPI_TRANSFER_SIZE;
724 ifx_dev->spi_xfer.cs_change = 0; 724 ifx_dev->spi_xfer.cs_change = 0;
725 ifx_dev->spi_xfer.speed_hz = 12500000; 725 ifx_dev->spi_xfer.speed_hz = ifx_dev->spi_dev->max_speed_hz;
726 /* ifx_dev->spi_xfer.speed_hz = 390625; */ 726 /* ifx_dev->spi_xfer.speed_hz = 390625; */
727 ifx_dev->spi_xfer.bits_per_word = spi_b16 ? 16 : 8; 727 ifx_dev->spi_xfer.bits_per_word = spi_bpw;
728 728
729 ifx_dev->spi_xfer.tx_buf = ifx_dev->tx_buffer; 729 ifx_dev->spi_xfer.tx_buf = ifx_dev->tx_buffer;
730 ifx_dev->spi_xfer.rx_buf = ifx_dev->rx_buffer; 730 ifx_dev->spi_xfer.rx_buf = ifx_dev->rx_buffer;
@@ -732,7 +732,7 @@ static void ifx_spi_io(unsigned long data)
732 /* 732 /*
733 * setup dma pointers 733 * setup dma pointers
734 */ 734 */
735 if (ifx_dev->is_6160) { 735 if (ifx_dev->use_dma) {
736 ifx_dev->spi_msg.is_dma_mapped = 1; 736 ifx_dev->spi_msg.is_dma_mapped = 1;
737 ifx_dev->tx_dma = ifx_dev->tx_bus; 737 ifx_dev->tx_dma = ifx_dev->tx_bus;
738 ifx_dev->rx_dma = ifx_dev->rx_bus; 738 ifx_dev->rx_dma = ifx_dev->rx_bus;
@@ -798,8 +798,8 @@ static int ifx_spi_create_port(struct ifx_spi_device *ifx_dev)
798 goto error_ret; 798 goto error_ret;
799 } 799 }
800 800
801 pport->ops = &ifx_tty_port_ops;
802 tty_port_init(pport); 801 tty_port_init(pport);
802 pport->ops = &ifx_tty_port_ops;
803 ifx_dev->minor = IFX_SPI_TTY_ID; 803 ifx_dev->minor = IFX_SPI_TTY_ID;
804 ifx_dev->tty_dev = tty_register_device(tty_drv, ifx_dev->minor, 804 ifx_dev->tty_dev = tty_register_device(tty_drv, ifx_dev->minor,
805 &ifx_dev->spi_dev->dev); 805 &ifx_dev->spi_dev->dev);
@@ -960,7 +960,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
960{ 960{
961 int ret; 961 int ret;
962 int srdy; 962 int srdy;
963 struct ifx_modem_platform_data *pl_data = NULL; 963 struct ifx_modem_platform_data *pl_data;
964 struct ifx_spi_device *ifx_dev; 964 struct ifx_spi_device *ifx_dev;
965 965
966 if (saved_ifx_dev) { 966 if (saved_ifx_dev) {
@@ -968,6 +968,12 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
968 return -ENODEV; 968 return -ENODEV;
969 } 969 }
970 970
971 pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data;
972 if (!pl_data) {
973 dev_err(&spi->dev, "missing platform data!");
974 return -ENODEV;
975 }
976
971 /* initialize structure to hold our device variables */ 977 /* initialize structure to hold our device variables */
972 ifx_dev = kzalloc(sizeof(struct ifx_spi_device), GFP_KERNEL); 978 ifx_dev = kzalloc(sizeof(struct ifx_spi_device), GFP_KERNEL);
973 if (!ifx_dev) { 979 if (!ifx_dev) {
@@ -983,14 +989,25 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
983 init_timer(&ifx_dev->spi_timer); 989 init_timer(&ifx_dev->spi_timer);
984 ifx_dev->spi_timer.function = ifx_spi_timeout; 990 ifx_dev->spi_timer.function = ifx_spi_timeout;
985 ifx_dev->spi_timer.data = (unsigned long)ifx_dev; 991 ifx_dev->spi_timer.data = (unsigned long)ifx_dev;
986 ifx_dev->is_6160 = pl_data->is_6160; 992 ifx_dev->modem = pl_data->modem_type;
993 ifx_dev->use_dma = pl_data->use_dma;
994 ifx_dev->max_hz = pl_data->max_hz;
995 /* initialize spi mode, etc */
996 spi->max_speed_hz = ifx_dev->max_hz;
997 spi->mode = IFX_SPI_MODE | (SPI_LOOP & spi->mode);
998 spi->bits_per_word = spi_bpw;
999 ret = spi_setup(spi);
1000 if (ret) {
1001 dev_err(&spi->dev, "SPI setup wasn't successful %d", ret);
1002 return -ENODEV;
1003 }
987 1004
988 /* ensure SPI protocol flags are initialized to enable transfer */ 1005 /* ensure SPI protocol flags are initialized to enable transfer */
989 ifx_dev->spi_more = 0; 1006 ifx_dev->spi_more = 0;
990 ifx_dev->spi_slave_cts = 0; 1007 ifx_dev->spi_slave_cts = 0;
991 1008
992 /*initialize transfer and dma buffers */ 1009 /*initialize transfer and dma buffers */
993 ifx_dev->tx_buffer = dma_alloc_coherent(&ifx_dev->spi_dev->dev, 1010 ifx_dev->tx_buffer = dma_alloc_coherent(ifx_dev->spi_dev->dev.parent,
994 IFX_SPI_TRANSFER_SIZE, 1011 IFX_SPI_TRANSFER_SIZE,
995 &ifx_dev->tx_bus, 1012 &ifx_dev->tx_bus,
996 GFP_KERNEL); 1013 GFP_KERNEL);
@@ -999,7 +1016,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
999 ret = -ENOMEM; 1016 ret = -ENOMEM;
1000 goto error_ret; 1017 goto error_ret;
1001 } 1018 }
1002 ifx_dev->rx_buffer = dma_alloc_coherent(&ifx_dev->spi_dev->dev, 1019 ifx_dev->rx_buffer = dma_alloc_coherent(ifx_dev->spi_dev->dev.parent,
1003 IFX_SPI_TRANSFER_SIZE, 1020 IFX_SPI_TRANSFER_SIZE,
1004 &ifx_dev->rx_bus, 1021 &ifx_dev->rx_bus,
1005 GFP_KERNEL); 1022 GFP_KERNEL);
@@ -1025,18 +1042,11 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
1025 goto error_ret; 1042 goto error_ret;
1026 } 1043 }
1027 1044
1028 pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data; 1045 ifx_dev->gpio.reset = pl_data->rst_pmu;
1029 if (pl_data) { 1046 ifx_dev->gpio.po = pl_data->pwr_on;
1030 ifx_dev->gpio.reset = pl_data->rst_pmu; 1047 ifx_dev->gpio.mrdy = pl_data->mrdy;
1031 ifx_dev->gpio.po = pl_data->pwr_on; 1048 ifx_dev->gpio.srdy = pl_data->srdy;
1032 ifx_dev->gpio.mrdy = pl_data->mrdy; 1049 ifx_dev->gpio.reset_out = pl_data->rst_out;
1033 ifx_dev->gpio.srdy = pl_data->srdy;
1034 ifx_dev->gpio.reset_out = pl_data->rst_out;
1035 } else {
1036 dev_err(&spi->dev, "missing platform data!");
1037 ret = -ENODEV;
1038 goto error_ret;
1039 }
1040 1050
1041 dev_info(&spi->dev, "gpios %d, %d, %d, %d, %d", 1051 dev_info(&spi->dev, "gpios %d, %d, %d, %d, %d",
1042 ifx_dev->gpio.reset, ifx_dev->gpio.po, ifx_dev->gpio.mrdy, 1052 ifx_dev->gpio.reset, ifx_dev->gpio.po, ifx_dev->gpio.mrdy,
@@ -1322,9 +1332,9 @@ static const struct spi_device_id ifx_id_table[] = {
1322MODULE_DEVICE_TABLE(spi, ifx_id_table); 1332MODULE_DEVICE_TABLE(spi, ifx_id_table);
1323 1333
1324/* spi operations */ 1334/* spi operations */
1325static const struct spi_driver ifx_spi_driver_6160 = { 1335static const struct spi_driver ifx_spi_driver = {
1326 .driver = { 1336 .driver = {
1327 .name = "ifx6160", 1337 .name = DRVNAME,
1328 .bus = &spi_bus_type, 1338 .bus = &spi_bus_type,
1329 .pm = &ifx_spi_pm, 1339 .pm = &ifx_spi_pm,
1330 .owner = THIS_MODULE}, 1340 .owner = THIS_MODULE},
@@ -1346,7 +1356,7 @@ static void __exit ifx_spi_exit(void)
1346{ 1356{
1347 /* unregister */ 1357 /* unregister */
1348 tty_unregister_driver(tty_drv); 1358 tty_unregister_driver(tty_drv);
1349 spi_unregister_driver((void *)&ifx_spi_driver_6160); 1359 spi_unregister_driver((void *)&ifx_spi_driver);
1350} 1360}
1351 1361
1352/** 1362/**
@@ -1388,7 +1398,7 @@ static int __init ifx_spi_init(void)
1388 return result; 1398 return result;
1389 } 1399 }
1390 1400
1391 result = spi_register_driver((void *)&ifx_spi_driver_6160); 1401 result = spi_register_driver((void *)&ifx_spi_driver);
1392 if (result) { 1402 if (result) {
1393 pr_err("%s: spi_register_driver failed(%d)", 1403 pr_err("%s: spi_register_driver failed(%d)",
1394 DRVNAME, result); 1404 DRVNAME, result);
diff --git a/drivers/tty/serial/ifx6x60.h b/drivers/tty/serial/ifx6x60.h
index deb7b8d977dc..e8464baf9e75 100644
--- a/drivers/tty/serial/ifx6x60.h
+++ b/drivers/tty/serial/ifx6x60.h
@@ -29,8 +29,6 @@
29#define DRVNAME "ifx6x60" 29#define DRVNAME "ifx6x60"
30#define TTYNAME "ttyIFX" 30#define TTYNAME "ttyIFX"
31 31
32/* #define IFX_THROTTLE_CODE */
33
34#define IFX_SPI_MAX_MINORS 1 32#define IFX_SPI_MAX_MINORS 1
35#define IFX_SPI_TRANSFER_SIZE 2048 33#define IFX_SPI_TRANSFER_SIZE 2048
36#define IFX_SPI_FIFO_SIZE 4096 34#define IFX_SPI_FIFO_SIZE 4096
@@ -88,7 +86,9 @@ struct ifx_spi_device {
88 dma_addr_t rx_dma; 86 dma_addr_t rx_dma;
89 dma_addr_t tx_dma; 87 dma_addr_t tx_dma;
90 88
91 int is_6160; /* Modem type */ 89 int modem; /* Modem type */
90 int use_dma; /* provide dma-able addrs in SPI msg */
91 long max_hz; /* max SPI frequency */
92 92
93 spinlock_t write_lock; 93 spinlock_t write_lock;
94 int write_pending; 94 int write_pending;
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index d40010a22ecd..c111f36f5d21 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -16,9 +16,7 @@
16 * 2/3 chan to port 1, 4/5 chan to port 3. Even number chans 16 * 2/3 chan to port 1, 4/5 chan to port 3. Even number chans
17 * are used for RX, odd chans for TX 17 * are used for RX, odd chans for TX
18 * 18 *
19 * 2. In A0 stepping, UART will not support TX half empty flag 19 * 2. The RI/DSR/DCD/DTR are not pinned out, DCD & DSR are always
20 *
21 * 3. The RI/DSR/DCD/DTR are not pinned out, DCD & DSR are always
22 * asserted, only when the HW is reset the DDCD and DDSR will 20 * asserted, only when the HW is reset the DDCD and DDSR will
23 * be triggered 21 * be triggered
24 */ 22 */
@@ -41,8 +39,6 @@
41#include <linux/io.h> 39#include <linux/io.h>
42#include <linux/debugfs.h> 40#include <linux/debugfs.h>
43 41
44#define MFD_HSU_A0_STEPPING 1
45
46#define HSU_DMA_BUF_SIZE 2048 42#define HSU_DMA_BUF_SIZE 2048
47 43
48#define chan_readl(chan, offset) readl(chan->reg + offset) 44#define chan_readl(chan, offset) readl(chan->reg + offset)
@@ -51,7 +47,10 @@
51#define mfd_readl(obj, offset) readl(obj->reg + offset) 47#define mfd_readl(obj, offset) readl(obj->reg + offset)
52#define mfd_writel(obj, offset, val) writel(val, obj->reg + offset) 48#define mfd_writel(obj, offset, val) writel(val, obj->reg + offset)
53 49
54#define HSU_DMA_TIMEOUT_CHECK_FREQ (HZ/10) 50static int hsu_dma_enable;
51module_param(hsu_dma_enable, int, 0);
52MODULE_PARM_DESC(hsu_dma_enable, "It is a bitmap to set working mode, if \
53bit[x] is 1, then port[x] will work in DMA mode, otherwise in PIO mode.");
55 54
56struct hsu_dma_buffer { 55struct hsu_dma_buffer {
57 u8 *buf; 56 u8 *buf;
@@ -65,7 +64,6 @@ struct hsu_dma_chan {
65 enum dma_data_direction dirt; 64 enum dma_data_direction dirt;
66 struct uart_hsu_port *uport; 65 struct uart_hsu_port *uport;
67 void __iomem *reg; 66 void __iomem *reg;
68 struct timer_list rx_timer; /* only needed by RX channel */
69}; 67};
70 68
71struct uart_hsu_port { 69struct uart_hsu_port {
@@ -355,8 +353,6 @@ void hsu_dma_start_rx_chan(struct hsu_dma_chan *rxc, struct hsu_dma_buffer *dbuf
355 | (0x1 << 24) /* timeout bit, see HSU Errata 1 */ 353 | (0x1 << 24) /* timeout bit, see HSU Errata 1 */
356 ); 354 );
357 chan_writel(rxc, HSU_CH_CR, 0x3); 355 chan_writel(rxc, HSU_CH_CR, 0x3);
358
359 mod_timer(&rxc->rx_timer, jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ);
360} 356}
361 357
362/* Protected by spin_lock_irqsave(port->lock) */ 358/* Protected by spin_lock_irqsave(port->lock) */
@@ -420,7 +416,6 @@ void hsu_dma_rx(struct uart_hsu_port *up, u32 int_sts)
420 chan_writel(chan, HSU_CH_CR, 0x3); 416 chan_writel(chan, HSU_CH_CR, 0x3);
421 return; 417 return;
422 } 418 }
423 del_timer(&chan->rx_timer);
424 419
425 dma_sync_single_for_cpu(port->dev, dbuf->dma_addr, 420 dma_sync_single_for_cpu(port->dev, dbuf->dma_addr,
426 dbuf->dma_size, DMA_FROM_DEVICE); 421 dbuf->dma_size, DMA_FROM_DEVICE);
@@ -448,8 +443,6 @@ void hsu_dma_rx(struct uart_hsu_port *up, u32 int_sts)
448 tty_flip_buffer_push(tty); 443 tty_flip_buffer_push(tty);
449 444
450 chan_writel(chan, HSU_CH_CR, 0x3); 445 chan_writel(chan, HSU_CH_CR, 0x3);
451 chan->rx_timer.expires = jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ;
452 add_timer(&chan->rx_timer);
453 446
454} 447}
455 448
@@ -551,16 +544,9 @@ static void transmit_chars(struct uart_hsu_port *up)
551 return; 544 return;
552 } 545 }
553 546
554#ifndef MFD_HSU_A0_STEPPING 547 /* The IRQ is for TX FIFO half-empty */
555 count = up->port.fifosize / 2; 548 count = up->port.fifosize / 2;
556#else 549
557 /*
558 * A0 only supports fully empty IRQ, and the first char written
559 * into it won't clear the EMPT bit, so we may need be cautious
560 * by useing a shorter buffer
561 */
562 count = up->port.fifosize - 4;
563#endif
564 do { 550 do {
565 serial_out(up, UART_TX, xmit->buf[xmit->tail]); 551 serial_out(up, UART_TX, xmit->buf[xmit->tail]);
566 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 552 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
@@ -769,9 +755,8 @@ static void serial_hsu_break_ctl(struct uart_port *port, int break_state)
769/* 755/*
770 * What special to do: 756 * What special to do:
771 * 1. chose the 64B fifo mode 757 * 1. chose the 64B fifo mode
772 * 2. make sure not to select half empty mode for A0 stepping 758 * 2. start dma or pio depends on configuration
773 * 3. start dma or pio depends on configuration 759 * 3. we only allocate dma memory when needed
774 * 4. we only allocate dma memory when needed
775 */ 760 */
776static int serial_hsu_startup(struct uart_port *port) 761static int serial_hsu_startup(struct uart_port *port)
777{ 762{
@@ -870,8 +855,6 @@ static void serial_hsu_shutdown(struct uart_port *port)
870 container_of(port, struct uart_hsu_port, port); 855 container_of(port, struct uart_hsu_port, port);
871 unsigned long flags; 856 unsigned long flags;
872 857
873 del_timer_sync(&up->rxc->rx_timer);
874
875 /* Disable interrupts from this port */ 858 /* Disable interrupts from this port */
876 up->ier = 0; 859 up->ier = 0;
877 serial_out(up, UART_IER, 0); 860 serial_out(up, UART_IER, 0);
@@ -977,10 +960,6 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
977 fcr = UART_FCR_ENABLE_FIFO | UART_FCR_HSU_64_32B; 960 fcr = UART_FCR_ENABLE_FIFO | UART_FCR_HSU_64_32B;
978 961
979 fcr |= UART_FCR_HSU_64B_FIFO; 962 fcr |= UART_FCR_HSU_64B_FIFO;
980#ifdef MFD_HSU_A0_STEPPING
981 /* A0 doesn't support half empty IRQ */
982 fcr |= UART_FCR_FULL_EMPT_TXI;
983#endif
984 963
985 /* 964 /*
986 * Ok, we're now changing the port state. Do it with 965 * Ok, we're now changing the port state. Do it with
@@ -1343,28 +1322,6 @@ err_disable:
1343 return ret; 1322 return ret;
1344} 1323}
1345 1324
1346static void hsu_dma_rx_timeout(unsigned long data)
1347{
1348 struct hsu_dma_chan *chan = (void *)data;
1349 struct uart_hsu_port *up = chan->uport;
1350 struct hsu_dma_buffer *dbuf = &up->rxbuf;
1351 int count = 0;
1352 unsigned long flags;
1353
1354 spin_lock_irqsave(&up->port.lock, flags);
1355
1356 count = chan_readl(chan, HSU_CH_D0SAR) - dbuf->dma_addr;
1357
1358 if (!count) {
1359 mod_timer(&chan->rx_timer, jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ);
1360 goto exit;
1361 }
1362
1363 hsu_dma_rx(up, 0);
1364exit:
1365 spin_unlock_irqrestore(&up->port.lock, flags);
1366}
1367
1368static void hsu_global_init(void) 1325static void hsu_global_init(void)
1369{ 1326{
1370 struct hsu_port *hsu; 1327 struct hsu_port *hsu;
@@ -1415,6 +1372,12 @@ static void hsu_global_init(void)
1415 1372
1416 serial_hsu_ports[i] = uport; 1373 serial_hsu_ports[i] = uport;
1417 uport->index = i; 1374 uport->index = i;
1375
1376 if (hsu_dma_enable & (1<<i))
1377 uport->use_dma = 1;
1378 else
1379 uport->use_dma = 0;
1380
1418 uport++; 1381 uport++;
1419 } 1382 }
1420 1383
@@ -1427,12 +1390,6 @@ static void hsu_global_init(void)
1427 dchan->reg = hsu->reg + HSU_DMA_CHANS_REG_OFFSET + 1390 dchan->reg = hsu->reg + HSU_DMA_CHANS_REG_OFFSET +
1428 i * HSU_DMA_CHANS_REG_LENGTH; 1391 i * HSU_DMA_CHANS_REG_LENGTH;
1429 1392
1430 /* Work around for RX */
1431 if (dchan->dirt == DMA_FROM_DEVICE) {
1432 init_timer(&dchan->rx_timer);
1433 dchan->rx_timer.function = hsu_dma_rx_timeout;
1434 dchan->rx_timer.data = (unsigned long)dchan;
1435 }
1436 dchan++; 1393 dchan++;
1437 } 1394 }
1438 1395
diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c
index b62857bf2fdb..37e13c3d91d9 100644
--- a/drivers/tty/serial/mrst_max3110.c
+++ b/drivers/tty/serial/mrst_max3110.c
@@ -51,7 +51,7 @@
51struct uart_max3110 { 51struct uart_max3110 {
52 struct uart_port port; 52 struct uart_port port;
53 struct spi_device *spi; 53 struct spi_device *spi;
54 char name[24]; 54 char name[SPI_NAME_SIZE];
55 55
56 wait_queue_head_t wq; 56 wait_queue_head_t wq;
57 struct task_struct *main_thread; 57 struct task_struct *main_thread;
diff --git a/drivers/tty/serial/msm_smd_tty.c b/drivers/tty/serial/msm_smd_tty.c
new file mode 100644
index 000000000000..beeff1e86093
--- /dev/null
+++ b/drivers/tty/serial/msm_smd_tty.c
@@ -0,0 +1,236 @@
1/* drivers/tty/serial/msm_smd_tty.c
2 *
3 * Copyright (C) 2007 Google, Inc.
4 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
5 * Author: Brian Swetland <swetland@google.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/module.h>
19#include <linux/fs.h>
20#include <linux/cdev.h>
21#include <linux/device.h>
22#include <linux/wait.h>
23
24#include <linux/tty.h>
25#include <linux/tty_driver.h>
26#include <linux/tty_flip.h>
27
28#include <mach/msm_smd.h>
29
30#define MAX_SMD_TTYS 32
31
32struct smd_tty_info {
33 struct tty_port port;
34 smd_channel_t *ch;
35};
36
37struct smd_tty_channel_desc {
38 int id;
39 const char *name;
40};
41
42static struct smd_tty_info smd_tty[MAX_SMD_TTYS];
43
44static const struct smd_tty_channel_desc smd_default_tty_channels[] = {
45 { .id = 0, .name = "SMD_DS" },
46 { .id = 27, .name = "SMD_GPSNMEA" },
47};
48
49static const struct smd_tty_channel_desc *smd_tty_channels =
50 smd_default_tty_channels;
51static int smd_tty_channels_len = ARRAY_SIZE(smd_default_tty_channels);
52
53static void smd_tty_notify(void *priv, unsigned event)
54{
55 unsigned char *ptr;
56 int avail;
57 struct smd_tty_info *info = priv;
58 struct tty_struct *tty;
59
60 if (event != SMD_EVENT_DATA)
61 return;
62
63 tty = tty_port_tty_get(&info->port);
64 if (!tty)
65 return;
66
67 for (;;) {
68 if (test_bit(TTY_THROTTLED, &tty->flags))
69 break;
70 avail = smd_read_avail(info->ch);
71 if (avail == 0)
72 break;
73
74 avail = tty_prepare_flip_string(tty, &ptr, avail);
75
76 if (smd_read(info->ch, ptr, avail) != avail) {
77 /* shouldn't be possible since we're in interrupt
78 ** context here and nobody else could 'steal' our
79 ** characters.
80 */
81 pr_err("OOPS - smd_tty_buffer mismatch?!");
82 }
83
84 tty_flip_buffer_push(tty);
85 }
86
87 /* XXX only when writable and necessary */
88 tty_wakeup(tty);
89 tty_kref_put(tty);
90}
91
92static int smd_tty_port_activate(struct tty_port *tport, struct tty_struct *tty)
93{
94 int i, res = 0;
95 int n = tty->index;
96 const char *name = NULL;
97 struct smd_tty_info *info = smd_tty + n;
98
99 for (i = 0; i < smd_tty_channels_len; i++) {
100 if (smd_tty_channels[i].id == n) {
101 name = smd_tty_channels[i].name;
102 break;
103 }
104 }
105 if (!name)
106 return -ENODEV;
107
108 if (info->ch)
109 smd_kick(info->ch);
110 else
111 res = smd_open(name, &info->ch, info, smd_tty_notify);
112
113 if (!res)
114 tty->driver_data = info;
115
116 return res;
117}
118
119static void smd_tty_port_shutdown(struct tty_port *tport)
120{
121 struct smd_tty_info *info;
122 struct tty_struct *tty = tty_port_tty_get(tport);
123
124 info = tty->driver_data;
125 if (info->ch) {
126 smd_close(info->ch);
127 info->ch = 0;
128 }
129
130 tty->driver_data = 0;
131 tty_kref_put(tty);
132}
133
134static int smd_tty_open(struct tty_struct *tty, struct file *f)
135{
136 struct smd_tty_info *info = smd_tty + tty->index;
137
138 return tty_port_open(&info->port, tty, f);
139}
140
141static void smd_tty_close(struct tty_struct *tty, struct file *f)
142{
143 struct smd_tty_info *info = tty->driver_data;
144
145 tty_port_close(&info->port, tty, f);
146}
147
148static int smd_tty_write(struct tty_struct *tty,
149 const unsigned char *buf, int len)
150{
151 struct smd_tty_info *info = tty->driver_data;
152 int avail;
153
154 /* if we're writing to a packet channel we will
155 ** never be able to write more data than there
156 ** is currently space for
157 */
158 avail = smd_write_avail(info->ch);
159 if (len > avail)
160 len = avail;
161
162 return smd_write(info->ch, buf, len);
163}
164
165static int smd_tty_write_room(struct tty_struct *tty)
166{
167 struct smd_tty_info *info = tty->driver_data;
168 return smd_write_avail(info->ch);
169}
170
171static int smd_tty_chars_in_buffer(struct tty_struct *tty)
172{
173 struct smd_tty_info *info = tty->driver_data;
174 return smd_read_avail(info->ch);
175}
176
177static void smd_tty_unthrottle(struct tty_struct *tty)
178{
179 struct smd_tty_info *info = tty->driver_data;
180 smd_kick(info->ch);
181}
182
183static const struct tty_port_operations smd_tty_port_ops = {
184 .shutdown = smd_tty_port_shutdown,
185 .activate = smd_tty_port_activate,
186};
187
188static const struct tty_operations smd_tty_ops = {
189 .open = smd_tty_open,
190 .close = smd_tty_close,
191 .write = smd_tty_write,
192 .write_room = smd_tty_write_room,
193 .chars_in_buffer = smd_tty_chars_in_buffer,
194 .unthrottle = smd_tty_unthrottle,
195};
196
197static struct tty_driver *smd_tty_driver;
198
199static int __init smd_tty_init(void)
200{
201 int ret, i;
202
203 smd_tty_driver = alloc_tty_driver(MAX_SMD_TTYS);
204 if (smd_tty_driver == 0)
205 return -ENOMEM;
206
207 smd_tty_driver->owner = THIS_MODULE;
208 smd_tty_driver->driver_name = "smd_tty_driver";
209 smd_tty_driver->name = "smd";
210 smd_tty_driver->major = 0;
211 smd_tty_driver->minor_start = 0;
212 smd_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
213 smd_tty_driver->subtype = SERIAL_TYPE_NORMAL;
214 smd_tty_driver->init_termios = tty_std_termios;
215 smd_tty_driver->init_termios.c_iflag = 0;
216 smd_tty_driver->init_termios.c_oflag = 0;
217 smd_tty_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
218 smd_tty_driver->init_termios.c_lflag = 0;
219 smd_tty_driver->flags = TTY_DRIVER_RESET_TERMIOS |
220 TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
221 tty_set_operations(smd_tty_driver, &smd_tty_ops);
222
223 ret = tty_register_driver(smd_tty_driver);
224 if (ret)
225 return ret;
226
227 for (i = 0; i < smd_tty_channels_len; i++) {
228 tty_port_init(&smd_tty[smd_tty_channels[i].id].port);
229 smd_tty[smd_tty_channels[i].id].port.ops = &smd_tty_port_ops;
230 tty_register_device(smd_tty_driver, smd_tty_channels[i].id, 0);
231 }
232
233 return 0;
234}
235
236module_init(smd_tty_init);
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 7f2f01058789..763537943a53 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -20,6 +20,10 @@
20 * this driver as required for the omap-platform. 20 * this driver as required for the omap-platform.
21 */ 21 */
22 22
23#if defined(CONFIG_SERIAL_OMAP_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
24#define SUPPORT_SYSRQ
25#endif
26
23#include <linux/module.h> 27#include <linux/module.h>
24#include <linux/init.h> 28#include <linux/init.h>
25#include <linux/console.h> 29#include <linux/console.h>
@@ -190,7 +194,6 @@ static inline void receive_chars(struct uart_omap_port *up, int *status)
190 if (up->port.line == up->port.cons->index) { 194 if (up->port.line == up->port.cons->index) {
191 /* Recover the break flag from console xmit */ 195 /* Recover the break flag from console xmit */
192 lsr |= up->lsr_break_flag; 196 lsr |= up->lsr_break_flag;
193 up->lsr_break_flag = 0;
194 } 197 }
195#endif 198#endif
196 if (lsr & UART_LSR_BI) 199 if (lsr & UART_LSR_BI)
@@ -517,6 +520,9 @@ static int serial_omap_startup(struct uart_port *port)
517 up->ier = UART_IER_RLSI | UART_IER_RDI; 520 up->ier = UART_IER_RLSI | UART_IER_RDI;
518 serial_out(up, UART_IER, up->ier); 521 serial_out(up, UART_IER, up->ier);
519 522
523 /* Enable module level wake up */
524 serial_out(up, UART_OMAP_WER, OMAP_UART_WER_MOD_WKUP);
525
520 up->port_activity = jiffies; 526 up->port_activity = jiffies;
521 return 0; 527 return 0;
522} 528}
@@ -824,9 +830,6 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
824 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 830 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
825 serial_out(up, UART_EFR, efr); 831 serial_out(up, UART_EFR, efr);
826 serial_out(up, UART_LCR, 0); 832 serial_out(up, UART_LCR, 0);
827 /* Enable module level wake up */
828 serial_out(up, UART_OMAP_WER,
829 (state != 0) ? OMAP_UART_WER_MOD_WKUP : 0);
830} 833}
831 834
832static void serial_omap_release_port(struct uart_port *port) 835static void serial_omap_release_port(struct uart_port *port)
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 70a61458ec42..a5ce9a5c018d 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -40,10 +40,11 @@ enum {
40 40
41#define PCH_UART_DRIVER_DEVICE "ttyPCH" 41#define PCH_UART_DRIVER_DEVICE "ttyPCH"
42 42
43#define PCH_UART_NR_GE_256FIFO 1 43/* Set the max number of UART port
44#define PCH_UART_NR_GE_64FIFO 3 44 * Intel EG20T PCH: 4 port
45#define PCH_UART_NR_GE (PCH_UART_NR_GE_256FIFO+PCH_UART_NR_GE_64FIFO) 45 * OKI SEMICONDUCTOR ML7213 IOH: 3 port
46#define PCH_UART_NR PCH_UART_NR_GE 46*/
47#define PCH_UART_NR 4
47 48
48#define PCH_UART_HANDLED_RX_INT (1<<((PCH_UART_HANDLED_RX_INT_SHIFT)<<1)) 49#define PCH_UART_HANDLED_RX_INT (1<<((PCH_UART_HANDLED_RX_INT_SHIFT)<<1))
49#define PCH_UART_HANDLED_TX_INT (1<<((PCH_UART_HANDLED_TX_INT_SHIFT)<<1)) 50#define PCH_UART_HANDLED_TX_INT (1<<((PCH_UART_HANDLED_TX_INT_SHIFT)<<1))
@@ -192,6 +193,8 @@ enum {
192#define PCH_UART_HAL_LOOP (PCH_UART_MCR_LOOP) 193#define PCH_UART_HAL_LOOP (PCH_UART_MCR_LOOP)
193#define PCH_UART_HAL_AFE (PCH_UART_MCR_AFE) 194#define PCH_UART_HAL_AFE (PCH_UART_MCR_AFE)
194 195
196#define PCI_VENDOR_ID_ROHM 0x10DB
197
195struct pch_uart_buffer { 198struct pch_uart_buffer {
196 unsigned char *buf; 199 unsigned char *buf;
197 int size; 200 int size;
@@ -215,6 +218,7 @@ struct eg20t_port {
215 struct pch_uart_buffer rxbuf; 218 struct pch_uart_buffer rxbuf;
216 unsigned int dmsr; 219 unsigned int dmsr;
217 unsigned int fcr; 220 unsigned int fcr;
221 unsigned int mcr;
218 unsigned int use_dma; 222 unsigned int use_dma;
219 unsigned int use_dma_flag; 223 unsigned int use_dma_flag;
220 struct dma_async_tx_descriptor *desc_tx; 224 struct dma_async_tx_descriptor *desc_tx;
@@ -223,13 +227,44 @@ struct eg20t_port {
223 struct pch_dma_slave param_rx; 227 struct pch_dma_slave param_rx;
224 struct dma_chan *chan_tx; 228 struct dma_chan *chan_tx;
225 struct dma_chan *chan_rx; 229 struct dma_chan *chan_rx;
226 struct scatterlist sg_tx; 230 struct scatterlist *sg_tx_p;
231 int nent;
227 struct scatterlist sg_rx; 232 struct scatterlist sg_rx;
228 int tx_dma_use; 233 int tx_dma_use;
229 void *rx_buf_virt; 234 void *rx_buf_virt;
230 dma_addr_t rx_buf_dma; 235 dma_addr_t rx_buf_dma;
231}; 236};
232 237
238/**
239 * struct pch_uart_driver_data - private data structure for UART-DMA
240 * @port_type: The number of DMA channel
241 * @line_no: UART port line number (0, 1, 2...)
242 */
243struct pch_uart_driver_data {
244 int port_type;
245 int line_no;
246};
247
248enum pch_uart_num_t {
249 pch_et20t_uart0 = 0,
250 pch_et20t_uart1,
251 pch_et20t_uart2,
252 pch_et20t_uart3,
253 pch_ml7213_uart0,
254 pch_ml7213_uart1,
255 pch_ml7213_uart2,
256};
257
258static struct pch_uart_driver_data drv_dat[] = {
259 [pch_et20t_uart0] = {PCH_UART_8LINE, 0},
260 [pch_et20t_uart1] = {PCH_UART_2LINE, 1},
261 [pch_et20t_uart2] = {PCH_UART_2LINE, 2},
262 [pch_et20t_uart3] = {PCH_UART_2LINE, 3},
263 [pch_ml7213_uart0] = {PCH_UART_8LINE, 0},
264 [pch_ml7213_uart1] = {PCH_UART_2LINE, 1},
265 [pch_ml7213_uart2] = {PCH_UART_2LINE, 2},
266};
267
233static unsigned int default_baud = 9600; 268static unsigned int default_baud = 9600;
234static const int trigger_level_256[4] = { 1, 64, 128, 224 }; 269static const int trigger_level_256[4] = { 1, 64, 128, 224 };
235static const int trigger_level_64[4] = { 1, 16, 32, 56 }; 270static const int trigger_level_64[4] = { 1, 16, 32, 56 };
@@ -278,7 +313,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud,
278 313
279 div = DIV_ROUND(priv->base_baud / 16, baud); 314 div = DIV_ROUND(priv->base_baud / 16, baud);
280 if (div < 0 || USHRT_MAX <= div) { 315 if (div < 0 || USHRT_MAX <= div) {
281 pr_err("Invalid Baud(div=0x%x)\n", div); 316 dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div);
282 return -EINVAL; 317 return -EINVAL;
283 } 318 }
284 319
@@ -286,17 +321,17 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud,
286 dlm = ((unsigned int)div >> 8) & 0x00FFU; 321 dlm = ((unsigned int)div >> 8) & 0x00FFU;
287 322
288 if (parity & ~(PCH_UART_LCR_PEN | PCH_UART_LCR_EPS | PCH_UART_LCR_SP)) { 323 if (parity & ~(PCH_UART_LCR_PEN | PCH_UART_LCR_EPS | PCH_UART_LCR_SP)) {
289 pr_err("Invalid parity(0x%x)\n", parity); 324 dev_err(priv->port.dev, "Invalid parity(0x%x)\n", parity);
290 return -EINVAL; 325 return -EINVAL;
291 } 326 }
292 327
293 if (bits & ~PCH_UART_LCR_WLS) { 328 if (bits & ~PCH_UART_LCR_WLS) {
294 pr_err("Invalid bits(0x%x)\n", bits); 329 dev_err(priv->port.dev, "Invalid bits(0x%x)\n", bits);
295 return -EINVAL; 330 return -EINVAL;
296 } 331 }
297 332
298 if (stb & ~PCH_UART_LCR_STB) { 333 if (stb & ~PCH_UART_LCR_STB) {
299 pr_err("Invalid STB(0x%x)\n", stb); 334 dev_err(priv->port.dev, "Invalid STB(0x%x)\n", stb);
300 return -EINVAL; 335 return -EINVAL;
301 } 336 }
302 337
@@ -304,7 +339,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud,
304 lcr |= bits; 339 lcr |= bits;
305 lcr |= stb; 340 lcr |= stb;
306 341
307 pr_debug("%s:baud = %d, div = %04x, lcr = %02x (%lu)\n", 342 dev_dbg(priv->port.dev, "%s:baud = %d, div = %04x, lcr = %02x (%lu)\n",
308 __func__, baud, div, lcr, jiffies); 343 __func__, baud, div, lcr, jiffies);
309 iowrite8(PCH_UART_LCR_DLAB, priv->membase + UART_LCR); 344 iowrite8(PCH_UART_LCR_DLAB, priv->membase + UART_LCR);
310 iowrite8(dll, priv->membase + PCH_UART_DLL); 345 iowrite8(dll, priv->membase + PCH_UART_DLL);
@@ -318,7 +353,8 @@ static int pch_uart_hal_fifo_reset(struct eg20t_port *priv,
318 unsigned int flag) 353 unsigned int flag)
319{ 354{
320 if (flag & ~(PCH_UART_FCR_TFR | PCH_UART_FCR_RFR)) { 355 if (flag & ~(PCH_UART_FCR_TFR | PCH_UART_FCR_RFR)) {
321 pr_err("%s:Invalid flag(0x%x)\n", __func__, flag); 356 dev_err(priv->port.dev, "%s:Invalid flag(0x%x)\n",
357 __func__, flag);
322 return -EINVAL; 358 return -EINVAL;
323 } 359 }
324 360
@@ -337,17 +373,20 @@ static int pch_uart_hal_set_fifo(struct eg20t_port *priv,
337 u8 fcr; 373 u8 fcr;
338 374
339 if (dmamode & ~PCH_UART_FCR_DMS) { 375 if (dmamode & ~PCH_UART_FCR_DMS) {
340 pr_err("%s:Invalid DMA Mode(0x%x)\n", __func__, dmamode); 376 dev_err(priv->port.dev, "%s:Invalid DMA Mode(0x%x)\n",
377 __func__, dmamode);
341 return -EINVAL; 378 return -EINVAL;
342 } 379 }
343 380
344 if (fifo_size & ~(PCH_UART_FCR_FIFOE | PCH_UART_FCR_FIFO256)) { 381 if (fifo_size & ~(PCH_UART_FCR_FIFOE | PCH_UART_FCR_FIFO256)) {
345 pr_err("%s:Invalid FIFO SIZE(0x%x)\n", __func__, fifo_size); 382 dev_err(priv->port.dev, "%s:Invalid FIFO SIZE(0x%x)\n",
383 __func__, fifo_size);
346 return -EINVAL; 384 return -EINVAL;
347 } 385 }
348 386
349 if (trigger & ~PCH_UART_FCR_RFTL) { 387 if (trigger & ~PCH_UART_FCR_RFTL) {
350 pr_err("%s:Invalid TRIGGER(0x%x)\n", __func__, trigger); 388 dev_err(priv->port.dev, "%s:Invalid TRIGGER(0x%x)\n",
389 __func__, trigger);
351 return -EINVAL; 390 return -EINVAL;
352 } 391 }
353 392
@@ -386,7 +425,7 @@ static u8 pch_uart_hal_get_modem(struct eg20t_port *priv)
386 return get_msr(priv, priv->membase); 425 return get_msr(priv, priv->membase);
387} 426}
388 427
389static int pch_uart_hal_write(struct eg20t_port *priv, 428static void pch_uart_hal_write(struct eg20t_port *priv,
390 const unsigned char *buf, int tx_size) 429 const unsigned char *buf, int tx_size)
391{ 430{
392 int i; 431 int i;
@@ -396,7 +435,6 @@ static int pch_uart_hal_write(struct eg20t_port *priv,
396 thr = buf[i++]; 435 thr = buf[i++];
397 iowrite8(thr, priv->membase + PCH_UART_THR); 436 iowrite8(thr, priv->membase + PCH_UART_THR);
398 } 437 }
399 return i;
400} 438}
401 439
402static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf, 440static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf,
@@ -452,7 +490,7 @@ static int push_rx(struct eg20t_port *priv, const unsigned char *buf,
452 port = &priv->port; 490 port = &priv->port;
453 tty = tty_port_tty_get(&port->state->port); 491 tty = tty_port_tty_get(&port->state->port);
454 if (!tty) { 492 if (!tty) {
455 pr_debug("%s:tty is busy now", __func__); 493 dev_dbg(priv->port.dev, "%s:tty is busy now", __func__);
456 return -EBUSY; 494 return -EBUSY;
457 } 495 }
458 496
@@ -469,8 +507,8 @@ static int pop_tx_x(struct eg20t_port *priv, unsigned char *buf)
469 struct uart_port *port = &priv->port; 507 struct uart_port *port = &priv->port;
470 508
471 if (port->x_char) { 509 if (port->x_char) {
472 pr_debug("%s:X character send %02x (%lu)\n", __func__, 510 dev_dbg(priv->port.dev, "%s:X character send %02x (%lu)\n",
473 port->x_char, jiffies); 511 __func__, port->x_char, jiffies);
474 buf[0] = port->x_char; 512 buf[0] = port->x_char;
475 port->x_char = 0; 513 port->x_char = 0;
476 ret = 1; 514 ret = 1;
@@ -490,7 +528,7 @@ static int dma_push_rx(struct eg20t_port *priv, int size)
490 port = &priv->port; 528 port = &priv->port;
491 tty = tty_port_tty_get(&port->state->port); 529 tty = tty_port_tty_get(&port->state->port);
492 if (!tty) { 530 if (!tty) {
493 pr_debug("%s:tty is busy now", __func__); 531 dev_dbg(priv->port.dev, "%s:tty is busy now", __func__);
494 return 0; 532 return 0;
495 } 533 }
496 534
@@ -560,11 +598,13 @@ static void pch_request_dma(struct uart_port *port)
560 /* Set Tx DMA */ 598 /* Set Tx DMA */
561 param = &priv->param_tx; 599 param = &priv->param_tx;
562 param->dma_dev = &dma_dev->dev; 600 param->dma_dev = &dma_dev->dev;
563 param->chan_id = priv->port.line; 601 param->chan_id = priv->port.line * 2; /* Tx = 0, 2, 4, ... */
602
564 param->tx_reg = port->mapbase + UART_TX; 603 param->tx_reg = port->mapbase + UART_TX;
565 chan = dma_request_channel(mask, filter, param); 604 chan = dma_request_channel(mask, filter, param);
566 if (!chan) { 605 if (!chan) {
567 pr_err("%s:dma_request_channel FAILS(Tx)\n", __func__); 606 dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Tx)\n",
607 __func__);
568 return; 608 return;
569 } 609 }
570 priv->chan_tx = chan; 610 priv->chan_tx = chan;
@@ -572,11 +612,13 @@ static void pch_request_dma(struct uart_port *port)
572 /* Set Rx DMA */ 612 /* Set Rx DMA */
573 param = &priv->param_rx; 613 param = &priv->param_rx;
574 param->dma_dev = &dma_dev->dev; 614 param->dma_dev = &dma_dev->dev;
575 param->chan_id = priv->port.line + 1; /* Rx = Tx + 1 */ 615 param->chan_id = priv->port.line * 2 + 1; /* Rx = Tx + 1 */
616
576 param->rx_reg = port->mapbase + UART_RX; 617 param->rx_reg = port->mapbase + UART_RX;
577 chan = dma_request_channel(mask, filter, param); 618 chan = dma_request_channel(mask, filter, param);
578 if (!chan) { 619 if (!chan) {
579 pr_err("%s:dma_request_channel FAILS(Rx)\n", __func__); 620 dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Rx)\n",
621 __func__);
580 dma_release_channel(priv->chan_tx); 622 dma_release_channel(priv->chan_tx);
581 return; 623 return;
582 } 624 }
@@ -592,16 +634,20 @@ static void pch_dma_rx_complete(void *arg)
592 struct eg20t_port *priv = arg; 634 struct eg20t_port *priv = arg;
593 struct uart_port *port = &priv->port; 635 struct uart_port *port = &priv->port;
594 struct tty_struct *tty = tty_port_tty_get(&port->state->port); 636 struct tty_struct *tty = tty_port_tty_get(&port->state->port);
637 int count;
595 638
596 if (!tty) { 639 if (!tty) {
597 pr_debug("%s:tty is busy now", __func__); 640 dev_dbg(priv->port.dev, "%s:tty is busy now", __func__);
598 return; 641 return;
599 } 642 }
600 643
601 if (dma_push_rx(priv, priv->trigger_level)) 644 dma_sync_sg_for_cpu(port->dev, &priv->sg_rx, 1, DMA_FROM_DEVICE);
645 count = dma_push_rx(priv, priv->trigger_level);
646 if (count)
602 tty_flip_buffer_push(tty); 647 tty_flip_buffer_push(tty);
603
604 tty_kref_put(tty); 648 tty_kref_put(tty);
649 async_tx_ack(priv->desc_rx);
650 pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT);
605} 651}
606 652
607static void pch_dma_tx_complete(void *arg) 653static void pch_dma_tx_complete(void *arg)
@@ -609,16 +655,23 @@ static void pch_dma_tx_complete(void *arg)
609 struct eg20t_port *priv = arg; 655 struct eg20t_port *priv = arg;
610 struct uart_port *port = &priv->port; 656 struct uart_port *port = &priv->port;
611 struct circ_buf *xmit = &port->state->xmit; 657 struct circ_buf *xmit = &port->state->xmit;
658 struct scatterlist *sg = priv->sg_tx_p;
659 int i;
612 660
613 xmit->tail += sg_dma_len(&priv->sg_tx); 661 for (i = 0; i < priv->nent; i++, sg++) {
662 xmit->tail += sg_dma_len(sg);
663 port->icount.tx += sg_dma_len(sg);
664 }
614 xmit->tail &= UART_XMIT_SIZE - 1; 665 xmit->tail &= UART_XMIT_SIZE - 1;
615 port->icount.tx += sg_dma_len(&priv->sg_tx);
616
617 async_tx_ack(priv->desc_tx); 666 async_tx_ack(priv->desc_tx);
667 dma_unmap_sg(port->dev, sg, priv->nent, DMA_TO_DEVICE);
618 priv->tx_dma_use = 0; 668 priv->tx_dma_use = 0;
669 priv->nent = 0;
670 kfree(priv->sg_tx_p);
671 pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT);
619} 672}
620 673
621static int pop_tx(struct eg20t_port *priv, unsigned char *buf, int size) 674static int pop_tx(struct eg20t_port *priv, int size)
622{ 675{
623 int count = 0; 676 int count = 0;
624 struct uart_port *port = &priv->port; 677 struct uart_port *port = &priv->port;
@@ -631,13 +684,13 @@ static int pop_tx(struct eg20t_port *priv, unsigned char *buf, int size)
631 int cnt_to_end = 684 int cnt_to_end =
632 CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); 685 CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
633 int sz = min(size - count, cnt_to_end); 686 int sz = min(size - count, cnt_to_end);
634 memcpy(&buf[count], &xmit->buf[xmit->tail], sz); 687 pch_uart_hal_write(priv, &xmit->buf[xmit->tail], sz);
635 xmit->tail = (xmit->tail + sz) & (UART_XMIT_SIZE - 1); 688 xmit->tail = (xmit->tail + sz) & (UART_XMIT_SIZE - 1);
636 count += sz; 689 count += sz;
637 } while (!uart_circ_empty(xmit) && count < size); 690 } while (!uart_circ_empty(xmit) && count < size);
638 691
639pop_tx_end: 692pop_tx_end:
640 pr_debug("%d characters. Remained %d characters. (%lu)\n", 693 dev_dbg(priv->port.dev, "%d characters. Remained %d characters.(%lu)\n",
641 count, size - count, jiffies); 694 count, size - count, jiffies);
642 695
643 return count; 696 return count;
@@ -679,7 +732,7 @@ static int dma_handle_rx(struct eg20t_port *priv)
679 732
680 sg_init_table(&priv->sg_rx, 1); /* Initialize SG table */ 733 sg_init_table(&priv->sg_rx, 1); /* Initialize SG table */
681 734
682 sg_dma_len(sg) = priv->fifo_size; 735 sg_dma_len(sg) = priv->trigger_level;
683 736
684 sg_set_page(&priv->sg_rx, virt_to_page(priv->rx_buf_virt), 737 sg_set_page(&priv->sg_rx, virt_to_page(priv->rx_buf_virt),
685 sg_dma_len(sg), (unsigned long)priv->rx_buf_virt & 738 sg_dma_len(sg), (unsigned long)priv->rx_buf_virt &
@@ -689,7 +742,8 @@ static int dma_handle_rx(struct eg20t_port *priv)
689 742
690 desc = priv->chan_rx->device->device_prep_slave_sg(priv->chan_rx, 743 desc = priv->chan_rx->device->device_prep_slave_sg(priv->chan_rx,
691 sg, 1, DMA_FROM_DEVICE, 744 sg, 1, DMA_FROM_DEVICE,
692 DMA_PREP_INTERRUPT); 745 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
746
693 if (!desc) 747 if (!desc)
694 return 0; 748 return 0;
695 749
@@ -706,14 +760,14 @@ static unsigned int handle_tx(struct eg20t_port *priv)
706{ 760{
707 struct uart_port *port = &priv->port; 761 struct uart_port *port = &priv->port;
708 struct circ_buf *xmit = &port->state->xmit; 762 struct circ_buf *xmit = &port->state->xmit;
709 int ret;
710 int fifo_size; 763 int fifo_size;
711 int tx_size; 764 int tx_size;
712 int size; 765 int size;
713 int tx_empty; 766 int tx_empty;
714 767
715 if (!priv->start_tx) { 768 if (!priv->start_tx) {
716 pr_info("%s:Tx isn't started. (%lu)\n", __func__, jiffies); 769 dev_info(priv->port.dev, "%s:Tx isn't started. (%lu)\n",
770 __func__, jiffies);
717 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 771 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT);
718 priv->tx_empty = 1; 772 priv->tx_empty = 1;
719 return 0; 773 return 0;
@@ -728,17 +782,21 @@ static unsigned int handle_tx(struct eg20t_port *priv)
728 fifo_size--; 782 fifo_size--;
729 } 783 }
730 size = min(xmit->head - xmit->tail, fifo_size); 784 size = min(xmit->head - xmit->tail, fifo_size);
731 tx_size = pop_tx(priv, xmit->buf, size); 785 if (size < 0)
786 size = fifo_size;
787
788 tx_size = pop_tx(priv, size);
732 if (tx_size > 0) { 789 if (tx_size > 0) {
733 ret = pch_uart_hal_write(priv, xmit->buf, tx_size); 790 port->icount.tx += tx_size;
734 port->icount.tx += ret;
735 tx_empty = 0; 791 tx_empty = 0;
736 } 792 }
737 793
738 priv->tx_empty = tx_empty; 794 priv->tx_empty = tx_empty;
739 795
740 if (tx_empty) 796 if (tx_empty) {
741 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 797 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT);
798 uart_write_wakeup(port);
799 }
742 800
743 return PCH_UART_HANDLED_TX_INT; 801 return PCH_UART_HANDLED_TX_INT;
744} 802}
@@ -747,14 +805,28 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv)
747{ 805{
748 struct uart_port *port = &priv->port; 806 struct uart_port *port = &priv->port;
749 struct circ_buf *xmit = &port->state->xmit; 807 struct circ_buf *xmit = &port->state->xmit;
750 struct scatterlist *sg = &priv->sg_tx; 808 struct scatterlist *sg;
751 int nent; 809 int nent;
752 int fifo_size; 810 int fifo_size;
753 int tx_empty; 811 int tx_empty;
754 struct dma_async_tx_descriptor *desc; 812 struct dma_async_tx_descriptor *desc;
813 int num;
814 int i;
815 int bytes;
816 int size;
817 int rem;
755 818
756 if (!priv->start_tx) { 819 if (!priv->start_tx) {
757 pr_info("%s:Tx isn't started. (%lu)\n", __func__, jiffies); 820 dev_info(priv->port.dev, "%s:Tx isn't started. (%lu)\n",
821 __func__, jiffies);
822 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT);
823 priv->tx_empty = 1;
824 return 0;
825 }
826
827 if (priv->tx_dma_use) {
828 dev_dbg(priv->port.dev, "%s:Tx is not completed. (%lu)\n",
829 __func__, jiffies);
758 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 830 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT);
759 priv->tx_empty = 1; 831 priv->tx_empty = 1;
760 return 0; 832 return 0;
@@ -769,37 +841,73 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv)
769 fifo_size--; 841 fifo_size--;
770 } 842 }
771 843
772 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 844 bytes = min((int)CIRC_CNT(xmit->head, xmit->tail,
845 UART_XMIT_SIZE), CIRC_CNT_TO_END(xmit->head,
846 xmit->tail, UART_XMIT_SIZE));
847 if (!bytes) {
848 dev_dbg(priv->port.dev, "%s 0 bytes return\n", __func__);
849 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT);
850 uart_write_wakeup(port);
851 return 0;
852 }
853
854 if (bytes > fifo_size) {
855 num = bytes / fifo_size + 1;
856 size = fifo_size;
857 rem = bytes % fifo_size;
858 } else {
859 num = 1;
860 size = bytes;
861 rem = bytes;
862 }
863
864 dev_dbg(priv->port.dev, "%s num=%d size=%d rem=%d\n",
865 __func__, num, size, rem);
773 866
774 priv->tx_dma_use = 1; 867 priv->tx_dma_use = 1;
775 868
776 sg_init_table(&priv->sg_tx, 1); /* Initialize SG table */ 869 priv->sg_tx_p = kzalloc(sizeof(struct scatterlist)*num, GFP_ATOMIC);
777 870
778 sg_set_page(&priv->sg_tx, virt_to_page(xmit->buf), 871 sg_init_table(priv->sg_tx_p, num); /* Initialize SG table */
779 UART_XMIT_SIZE, (int)xmit->buf & ~PAGE_MASK); 872 sg = priv->sg_tx_p;
780 873
781 nent = dma_map_sg(port->dev, &priv->sg_tx, 1, DMA_TO_DEVICE); 874 for (i = 0; i < num; i++, sg++) {
875 if (i == (num - 1))
876 sg_set_page(sg, virt_to_page(xmit->buf),
877 rem, fifo_size * i);
878 else
879 sg_set_page(sg, virt_to_page(xmit->buf),
880 size, fifo_size * i);
881 }
882
883 sg = priv->sg_tx_p;
884 nent = dma_map_sg(port->dev, sg, num, DMA_TO_DEVICE);
782 if (!nent) { 885 if (!nent) {
783 pr_err("%s:dma_map_sg Failed\n", __func__); 886 dev_err(priv->port.dev, "%s:dma_map_sg Failed\n", __func__);
784 return 0; 887 return 0;
785 } 888 }
786 889 priv->nent = nent;
787 sg->offset = xmit->tail & (UART_XMIT_SIZE - 1); 890
788 sg_dma_address(sg) = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + 891 for (i = 0; i < nent; i++, sg++) {
789 sg->offset; 892 sg->offset = (xmit->tail & (UART_XMIT_SIZE - 1)) +
790 sg_dma_len(sg) = min((int)CIRC_CNT(xmit->head, xmit->tail, 893 fifo_size * i;
791 UART_XMIT_SIZE), CIRC_CNT_TO_END(xmit->head, 894 sg_dma_address(sg) = (sg_dma_address(sg) &
792 xmit->tail, UART_XMIT_SIZE)); 895 ~(UART_XMIT_SIZE - 1)) + sg->offset;
896 if (i == (nent - 1))
897 sg_dma_len(sg) = rem;
898 else
899 sg_dma_len(sg) = size;
900 }
793 901
794 desc = priv->chan_tx->device->device_prep_slave_sg(priv->chan_tx, 902 desc = priv->chan_tx->device->device_prep_slave_sg(priv->chan_tx,
795 sg, nent, DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 903 priv->sg_tx_p, nent, DMA_TO_DEVICE,
904 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
796 if (!desc) { 905 if (!desc) {
797 pr_err("%s:device_prep_slave_sg Failed\n", __func__); 906 dev_err(priv->port.dev, "%s:device_prep_slave_sg Failed\n",
907 __func__);
798 return 0; 908 return 0;
799 } 909 }
800 910 dma_sync_sg_for_device(port->dev, priv->sg_tx_p, nent, DMA_TO_DEVICE);
801 dma_sync_sg_for_device(port->dev, sg, 1, DMA_TO_DEVICE);
802
803 priv->desc_tx = desc; 911 priv->desc_tx = desc;
804 desc->callback = pch_dma_tx_complete; 912 desc->callback = pch_dma_tx_complete;
805 desc->callback_param = priv; 913 desc->callback_param = priv;
@@ -854,10 +962,16 @@ static irqreturn_t pch_uart_interrupt(int irq, void *dev_id)
854 } 962 }
855 break; 963 break;
856 case PCH_UART_IID_RDR: /* Received Data Ready */ 964 case PCH_UART_IID_RDR: /* Received Data Ready */
857 if (priv->use_dma) 965 if (priv->use_dma) {
966 pch_uart_hal_disable_interrupt(priv,
967 PCH_UART_HAL_RX_INT);
858 ret = dma_handle_rx(priv); 968 ret = dma_handle_rx(priv);
859 else 969 if (!ret)
970 pch_uart_hal_enable_interrupt(priv,
971 PCH_UART_HAL_RX_INT);
972 } else {
860 ret = handle_rx(priv); 973 ret = handle_rx(priv);
974 }
861 break; 975 break;
862 case PCH_UART_IID_RDR_TO: /* Received Data Ready 976 case PCH_UART_IID_RDR_TO: /* Received Data Ready
863 (FIFO Timeout) */ 977 (FIFO Timeout) */
@@ -874,7 +988,8 @@ static irqreturn_t pch_uart_interrupt(int irq, void *dev_id)
874 ret = PCH_UART_HANDLED_MS_INT; 988 ret = PCH_UART_HANDLED_MS_INT;
875 break; 989 break;
876 default: /* Never junp to this label */ 990 default: /* Never junp to this label */
877 pr_err("%s:iid=%d (%lu)\n", __func__, iid, jiffies); 991 dev_err(priv->port.dev, "%s:iid=%d (%lu)\n", __func__,
992 iid, jiffies);
878 ret = -1; 993 ret = -1;
879 break; 994 break;
880 } 995 }
@@ -932,7 +1047,6 @@ static unsigned int pch_uart_get_mctrl(struct uart_port *port)
932static void pch_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) 1047static void pch_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
933{ 1048{
934 u32 mcr = 0; 1049 u32 mcr = 0;
935 unsigned int dat;
936 struct eg20t_port *priv = container_of(port, struct eg20t_port, port); 1050 struct eg20t_port *priv = container_of(port, struct eg20t_port, port);
937 1051
938 if (mctrl & TIOCM_DTR) 1052 if (mctrl & TIOCM_DTR)
@@ -942,11 +1056,11 @@ static void pch_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
942 if (mctrl & TIOCM_LOOP) 1056 if (mctrl & TIOCM_LOOP)
943 mcr |= UART_MCR_LOOP; 1057 mcr |= UART_MCR_LOOP;
944 1058
945 if (mctrl) { 1059 if (priv->mcr & UART_MCR_AFE)
946 dat = pch_uart_get_mctrl(port); 1060 mcr |= UART_MCR_AFE;
947 dat |= mcr; 1061
948 iowrite8(dat, priv->membase + UART_MCR); 1062 if (mctrl)
949 } 1063 iowrite8(mcr, priv->membase + UART_MCR);
950} 1064}
951 1065
952static void pch_uart_stop_tx(struct uart_port *port) 1066static void pch_uart_stop_tx(struct uart_port *port)
@@ -963,9 +1077,13 @@ static void pch_uart_start_tx(struct uart_port *port)
963 1077
964 priv = container_of(port, struct eg20t_port, port); 1078 priv = container_of(port, struct eg20t_port, port);
965 1079
966 if (priv->use_dma) 1080 if (priv->use_dma) {
967 if (priv->tx_dma_use) 1081 if (priv->tx_dma_use) {
1082 dev_dbg(priv->port.dev, "%s : Tx DMA is NOT empty.\n",
1083 __func__);
968 return; 1084 return;
1085 }
1086 }
969 1087
970 priv->start_tx = 1; 1088 priv->start_tx = 1;
971 pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT); 1089 pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT);
@@ -1010,7 +1128,12 @@ static int pch_uart_startup(struct uart_port *port)
1010 1128
1011 priv = container_of(port, struct eg20t_port, port); 1129 priv = container_of(port, struct eg20t_port, port);
1012 priv->tx_empty = 1; 1130 priv->tx_empty = 1;
1013 port->uartclk = priv->base_baud; 1131
1132 if (port->uartclk)
1133 priv->base_baud = port->uartclk;
1134 else
1135 port->uartclk = priv->base_baud;
1136
1014 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_ALL_INT); 1137 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_ALL_INT);
1015 ret = pch_uart_hal_set_line(priv, default_baud, 1138 ret = pch_uart_hal_set_line(priv, default_baud,
1016 PCH_UART_HAL_PARITY_NONE, PCH_UART_HAL_8BIT, 1139 PCH_UART_HAL_PARITY_NONE, PCH_UART_HAL_8BIT,
@@ -1081,7 +1204,8 @@ static void pch_uart_shutdown(struct uart_port *port)
1081 ret = pch_uart_hal_set_fifo(priv, PCH_UART_HAL_DMA_MODE0, 1204 ret = pch_uart_hal_set_fifo(priv, PCH_UART_HAL_DMA_MODE0,
1082 PCH_UART_HAL_FIFO_DIS, PCH_UART_HAL_TRIGGER1); 1205 PCH_UART_HAL_FIFO_DIS, PCH_UART_HAL_TRIGGER1);
1083 if (ret) 1206 if (ret)
1084 pr_err("pch_uart_hal_set_fifo Failed(ret=%d)\n", ret); 1207 dev_err(priv->port.dev,
1208 "pch_uart_hal_set_fifo Failed(ret=%d)\n", ret);
1085 1209
1086 if (priv->use_dma_flag) 1210 if (priv->use_dma_flag)
1087 pch_free_dma(port); 1211 pch_free_dma(port);
@@ -1130,6 +1254,13 @@ static void pch_uart_set_termios(struct uart_port *port,
1130 } else { 1254 } else {
1131 parity = PCH_UART_HAL_PARITY_NONE; 1255 parity = PCH_UART_HAL_PARITY_NONE;
1132 } 1256 }
1257
1258 /* Only UART0 has auto hardware flow function */
1259 if ((termios->c_cflag & CRTSCTS) && (priv->fifo_size == 256))
1260 priv->mcr |= UART_MCR_AFE;
1261 else
1262 priv->mcr &= ~UART_MCR_AFE;
1263
1133 termios->c_cflag &= ~CMSPAR; /* Mark/Space parity is not supported */ 1264 termios->c_cflag &= ~CMSPAR; /* Mark/Space parity is not supported */
1134 1265
1135 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); 1266 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
@@ -1202,17 +1333,19 @@ static int pch_uart_verify_port(struct uart_port *port,
1202 1333
1203 priv = container_of(port, struct eg20t_port, port); 1334 priv = container_of(port, struct eg20t_port, port);
1204 if (serinfo->flags & UPF_LOW_LATENCY) { 1335 if (serinfo->flags & UPF_LOW_LATENCY) {
1205 pr_info("PCH UART : Use PIO Mode (without DMA)\n"); 1336 dev_info(priv->port.dev,
1337 "PCH UART : Use PIO Mode (without DMA)\n");
1206 priv->use_dma = 0; 1338 priv->use_dma = 0;
1207 serinfo->flags &= ~UPF_LOW_LATENCY; 1339 serinfo->flags &= ~UPF_LOW_LATENCY;
1208 } else { 1340 } else {
1209#ifndef CONFIG_PCH_DMA 1341#ifndef CONFIG_PCH_DMA
1210 pr_err("%s : PCH DMA is not Loaded.\n", __func__); 1342 dev_err(priv->port.dev, "%s : PCH DMA is not Loaded.\n",
1343 __func__);
1211 return -EOPNOTSUPP; 1344 return -EOPNOTSUPP;
1212#endif 1345#endif
1213 priv->use_dma = 1; 1346 priv->use_dma = 1;
1214 priv->use_dma_flag = 1; 1347 priv->use_dma_flag = 1;
1215 pr_info("PCH UART : Use DMA Mode\n"); 1348 dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n");
1216 } 1349 }
1217 1350
1218 return 0; 1351 return 0;
@@ -1249,7 +1382,7 @@ static struct uart_driver pch_uart_driver = {
1249}; 1382};
1250 1383
1251static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, 1384static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1252 int port_type) 1385 const struct pci_device_id *id)
1253{ 1386{
1254 struct eg20t_port *priv; 1387 struct eg20t_port *priv;
1255 int ret; 1388 int ret;
@@ -1257,7 +1390,11 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1257 unsigned int mapbase; 1390 unsigned int mapbase;
1258 unsigned char *rxbuf; 1391 unsigned char *rxbuf;
1259 int fifosize, base_baud; 1392 int fifosize, base_baud;
1260 static int num; 1393 int port_type;
1394 struct pch_uart_driver_data *board;
1395
1396 board = &drv_dat[id->driver_data];
1397 port_type = board->port_type;
1261 1398
1262 priv = kzalloc(sizeof(struct eg20t_port), GFP_KERNEL); 1399 priv = kzalloc(sizeof(struct eg20t_port), GFP_KERNEL);
1263 if (priv == NULL) 1400 if (priv == NULL)
@@ -1269,11 +1406,11 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1269 1406
1270 switch (port_type) { 1407 switch (port_type) {
1271 case PORT_UNKNOWN: 1408 case PORT_UNKNOWN:
1272 fifosize = 256; /* UART0 */ 1409 fifosize = 256; /* EG20T/ML7213: UART0 */
1273 base_baud = 1843200; /* 1.8432MHz */ 1410 base_baud = 1843200; /* 1.8432MHz */
1274 break; 1411 break;
1275 case PORT_8250: 1412 case PORT_8250:
1276 fifosize = 64; /* UART1~3 */ 1413 fifosize = 64; /* EG20T:UART1~3 ML7213: UART1~2*/
1277 base_baud = 1843200; /* 1.8432MHz */ 1414 base_baud = 1843200; /* 1.8432MHz */
1278 break; 1415 break;
1279 default: 1416 default:
@@ -1302,11 +1439,14 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1302 priv->port.ops = &pch_uart_ops; 1439 priv->port.ops = &pch_uart_ops;
1303 priv->port.flags = UPF_BOOT_AUTOCONF; 1440 priv->port.flags = UPF_BOOT_AUTOCONF;
1304 priv->port.fifosize = fifosize; 1441 priv->port.fifosize = fifosize;
1305 priv->port.line = num++; 1442 priv->port.line = board->line_no;
1306 priv->trigger = PCH_UART_HAL_TRIGGER_M; 1443 priv->trigger = PCH_UART_HAL_TRIGGER_M;
1307 1444
1445 spin_lock_init(&priv->port.lock);
1446
1308 pci_set_drvdata(pdev, priv); 1447 pci_set_drvdata(pdev, priv);
1309 pch_uart_hal_request(pdev, fifosize, base_baud); 1448 pch_uart_hal_request(pdev, fifosize, base_baud);
1449
1310 ret = uart_add_one_port(&pch_uart_driver, &priv->port); 1450 ret = uart_add_one_port(&pch_uart_driver, &priv->port);
1311 if (ret < 0) 1451 if (ret < 0)
1312 goto init_port_hal_free; 1452 goto init_port_hal_free;
@@ -1377,13 +1517,19 @@ static int pch_uart_pci_resume(struct pci_dev *pdev)
1377 1517
1378static DEFINE_PCI_DEVICE_TABLE(pch_uart_pci_id) = { 1518static DEFINE_PCI_DEVICE_TABLE(pch_uart_pci_id) = {
1379 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8811), 1519 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8811),
1380 .driver_data = PCH_UART_8LINE}, 1520 .driver_data = pch_et20t_uart0},
1381 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8812), 1521 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8812),
1382 .driver_data = PCH_UART_2LINE}, 1522 .driver_data = pch_et20t_uart1},
1383 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8813), 1523 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8813),
1384 .driver_data = PCH_UART_2LINE}, 1524 .driver_data = pch_et20t_uart2},
1385 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8814), 1525 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8814),
1386 .driver_data = PCH_UART_2LINE}, 1526 .driver_data = pch_et20t_uart3},
1527 {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8027),
1528 .driver_data = pch_ml7213_uart0},
1529 {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8028),
1530 .driver_data = pch_ml7213_uart1},
1531 {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8029),
1532 .driver_data = pch_ml7213_uart2},
1387 {0,}, 1533 {0,},
1388}; 1534};
1389 1535
@@ -1397,7 +1543,7 @@ static int __devinit pch_uart_pci_probe(struct pci_dev *pdev,
1397 if (ret < 0) 1543 if (ret < 0)
1398 goto probe_error; 1544 goto probe_error;
1399 1545
1400 priv = pch_uart_init_port(pdev, id->driver_data); 1546 priv = pch_uart_init_port(pdev, id);
1401 if (!priv) { 1547 if (!priv) {
1402 ret = -EBUSY; 1548 ret = -EBUSY;
1403 goto probe_disable_device; 1549 goto probe_disable_device;
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 460a72d91bb7..733fe8e73f0f 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -905,7 +905,7 @@ static int uart_get_lsr_info(struct tty_struct *tty,
905 return put_user(result, value); 905 return put_user(result, value);
906} 906}
907 907
908static int uart_tiocmget(struct tty_struct *tty, struct file *file) 908static int uart_tiocmget(struct tty_struct *tty)
909{ 909{
910 struct uart_state *state = tty->driver_data; 910 struct uart_state *state = tty->driver_data;
911 struct tty_port *port = &state->port; 911 struct tty_port *port = &state->port;
@@ -913,10 +913,8 @@ static int uart_tiocmget(struct tty_struct *tty, struct file *file)
913 int result = -EIO; 913 int result = -EIO;
914 914
915 mutex_lock(&port->mutex); 915 mutex_lock(&port->mutex);
916 if ((!file || !tty_hung_up_p(file)) && 916 if (!(tty->flags & (1 << TTY_IO_ERROR))) {
917 !(tty->flags & (1 << TTY_IO_ERROR))) {
918 result = uport->mctrl; 917 result = uport->mctrl;
919
920 spin_lock_irq(&uport->lock); 918 spin_lock_irq(&uport->lock);
921 result |= uport->ops->get_mctrl(uport); 919 result |= uport->ops->get_mctrl(uport);
922 spin_unlock_irq(&uport->lock); 920 spin_unlock_irq(&uport->lock);
@@ -927,8 +925,7 @@ static int uart_tiocmget(struct tty_struct *tty, struct file *file)
927} 925}
928 926
929static int 927static int
930uart_tiocmset(struct tty_struct *tty, struct file *file, 928uart_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear)
931 unsigned int set, unsigned int clear)
932{ 929{
933 struct uart_state *state = tty->driver_data; 930 struct uart_state *state = tty->driver_data;
934 struct uart_port *uport = state->uart_port; 931 struct uart_port *uport = state->uart_port;
@@ -936,8 +933,7 @@ uart_tiocmset(struct tty_struct *tty, struct file *file,
936 int ret = -EIO; 933 int ret = -EIO;
937 934
938 mutex_lock(&port->mutex); 935 mutex_lock(&port->mutex);
939 if ((!file || !tty_hung_up_p(file)) && 936 if (!(tty->flags & (1 << TTY_IO_ERROR))) {
940 !(tty->flags & (1 << TTY_IO_ERROR))) {
941 uart_update_mctrl(uport, set, clear); 937 uart_update_mctrl(uport, set, clear);
942 ret = 0; 938 ret = 0;
943 } 939 }
@@ -1103,7 +1099,7 @@ static int uart_get_icount(struct tty_struct *tty,
1103 * Called via sys_ioctl. We can use spin_lock_irq() here. 1099 * Called via sys_ioctl. We can use spin_lock_irq() here.
1104 */ 1100 */
1105static int 1101static int
1106uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, 1102uart_ioctl(struct tty_struct *tty, unsigned int cmd,
1107 unsigned long arg) 1103 unsigned long arg)
1108{ 1104{
1109 struct uart_state *state = tty->driver_data; 1105 struct uart_state *state = tty->driver_data;
@@ -1156,7 +1152,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
1156 1152
1157 mutex_lock(&port->mutex); 1153 mutex_lock(&port->mutex);
1158 1154
1159 if (tty_hung_up_p(filp)) { 1155 if (tty->flags & (1 << TTY_IO_ERROR)) {
1160 ret = -EIO; 1156 ret = -EIO;
1161 goto out_up; 1157 goto out_up;
1162 } 1158 }
@@ -2064,7 +2060,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
2064 /* 2060 /*
2065 * Re-enable the console device after suspending. 2061 * Re-enable the console device after suspending.
2066 */ 2062 */
2067 if (console_suspend_enabled && uart_console(uport)) { 2063 if (uart_console(uport)) {
2068 /* 2064 /*
2069 * First try to use the console cflag setting. 2065 * First try to use the console cflag setting.
2070 */ 2066 */
@@ -2077,9 +2073,9 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
2077 if (port->tty && port->tty->termios && termios.c_cflag == 0) 2073 if (port->tty && port->tty->termios && termios.c_cflag == 0)
2078 termios = *(port->tty->termios); 2074 termios = *(port->tty->termios);
2079 2075
2080 uart_change_pm(state, 0);
2081 uport->ops->set_termios(uport, &termios, NULL); 2076 uport->ops->set_termios(uport, &termios, NULL);
2082 console_start(uport->cons); 2077 if (console_suspend_enabled)
2078 console_start(uport->cons);
2083 } 2079 }
2084 2080
2085 if (port->flags & ASYNC_SUSPENDED) { 2081 if (port->flags & ASYNC_SUSPENDED) {
diff --git a/drivers/char/synclink.c b/drivers/tty/synclink.c
index 3a6824f12be2..18888d005a0a 100644
--- a/drivers/char/synclink.c
+++ b/drivers/tty/synclink.c
@@ -823,8 +823,8 @@ static isr_dispatch_func UscIsrTable[7] =
823/* 823/*
824 * ioctl call handlers 824 * ioctl call handlers
825 */ 825 */
826static int tiocmget(struct tty_struct *tty, struct file *file); 826static int tiocmget(struct tty_struct *tty);
827static int tiocmset(struct tty_struct *tty, struct file *file, 827static int tiocmset(struct tty_struct *tty,
828 unsigned int set, unsigned int clear); 828 unsigned int set, unsigned int clear);
829static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount 829static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount
830 __user *user_icount); 830 __user *user_icount);
@@ -2846,7 +2846,7 @@ static int modem_input_wait(struct mgsl_struct *info,int arg)
2846 2846
2847/* return the state of the serial control and status signals 2847/* return the state of the serial control and status signals
2848 */ 2848 */
2849static int tiocmget(struct tty_struct *tty, struct file *file) 2849static int tiocmget(struct tty_struct *tty)
2850{ 2850{
2851 struct mgsl_struct *info = tty->driver_data; 2851 struct mgsl_struct *info = tty->driver_data;
2852 unsigned int result; 2852 unsigned int result;
@@ -2871,8 +2871,8 @@ static int tiocmget(struct tty_struct *tty, struct file *file)
2871 2871
2872/* set modem control signals (DTR/RTS) 2872/* set modem control signals (DTR/RTS)
2873 */ 2873 */
2874static int tiocmset(struct tty_struct *tty, struct file *file, 2874static int tiocmset(struct tty_struct *tty,
2875 unsigned int set, unsigned int clear) 2875 unsigned int set, unsigned int clear)
2876{ 2876{
2877 struct mgsl_struct *info = tty->driver_data; 2877 struct mgsl_struct *info = tty->driver_data;
2878 unsigned long flags; 2878 unsigned long flags;
@@ -2962,13 +2962,12 @@ static int msgl_get_icount(struct tty_struct *tty,
2962 * Arguments: 2962 * Arguments:
2963 * 2963 *
2964 * tty pointer to tty instance data 2964 * tty pointer to tty instance data
2965 * file pointer to associated file object for device
2966 * cmd IOCTL command code 2965 * cmd IOCTL command code
2967 * arg command argument/context 2966 * arg command argument/context
2968 * 2967 *
2969 * Return Value: 0 if success, otherwise error code 2968 * Return Value: 0 if success, otherwise error code
2970 */ 2969 */
2971static int mgsl_ioctl(struct tty_struct *tty, struct file * file, 2970static int mgsl_ioctl(struct tty_struct *tty,
2972 unsigned int cmd, unsigned long arg) 2971 unsigned int cmd, unsigned long arg)
2973{ 2972{
2974 struct mgsl_struct * info = tty->driver_data; 2973 struct mgsl_struct * info = tty->driver_data;
diff --git a/drivers/char/synclink_gt.c b/drivers/tty/synclink_gt.c
index d01fffeac951..a35dd549a008 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -154,7 +154,7 @@ static void flush_buffer(struct tty_struct *tty);
154static void tx_hold(struct tty_struct *tty); 154static void tx_hold(struct tty_struct *tty);
155static void tx_release(struct tty_struct *tty); 155static void tx_release(struct tty_struct *tty);
156 156
157static int ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg); 157static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
158static int chars_in_buffer(struct tty_struct *tty); 158static int chars_in_buffer(struct tty_struct *tty);
159static void throttle(struct tty_struct * tty); 159static void throttle(struct tty_struct * tty);
160static void unthrottle(struct tty_struct * tty); 160static void unthrottle(struct tty_struct * tty);
@@ -512,9 +512,9 @@ static int tx_abort(struct slgt_info *info);
512static int rx_enable(struct slgt_info *info, int enable); 512static int rx_enable(struct slgt_info *info, int enable);
513static int modem_input_wait(struct slgt_info *info,int arg); 513static int modem_input_wait(struct slgt_info *info,int arg);
514static int wait_mgsl_event(struct slgt_info *info, int __user *mask_ptr); 514static int wait_mgsl_event(struct slgt_info *info, int __user *mask_ptr);
515static int tiocmget(struct tty_struct *tty, struct file *file); 515static int tiocmget(struct tty_struct *tty);
516static int tiocmset(struct tty_struct *tty, struct file *file, 516static int tiocmset(struct tty_struct *tty,
517 unsigned int set, unsigned int clear); 517 unsigned int set, unsigned int clear);
518static int set_break(struct tty_struct *tty, int break_state); 518static int set_break(struct tty_struct *tty, int break_state);
519static int get_interface(struct slgt_info *info, int __user *if_mode); 519static int get_interface(struct slgt_info *info, int __user *if_mode);
520static int set_interface(struct slgt_info *info, int if_mode); 520static int set_interface(struct slgt_info *info, int if_mode);
@@ -1030,13 +1030,12 @@ static void tx_release(struct tty_struct *tty)
1030 * Arguments 1030 * Arguments
1031 * 1031 *
1032 * tty pointer to tty instance data 1032 * tty pointer to tty instance data
1033 * file pointer to associated file object for device
1034 * cmd IOCTL command code 1033 * cmd IOCTL command code
1035 * arg command argument/context 1034 * arg command argument/context
1036 * 1035 *
1037 * Return 0 if success, otherwise error code 1036 * Return 0 if success, otherwise error code
1038 */ 1037 */
1039static int ioctl(struct tty_struct *tty, struct file *file, 1038static int ioctl(struct tty_struct *tty,
1040 unsigned int cmd, unsigned long arg) 1039 unsigned int cmd, unsigned long arg)
1041{ 1040{
1042 struct slgt_info *info = tty->driver_data; 1041 struct slgt_info *info = tty->driver_data;
@@ -1200,7 +1199,7 @@ static long set_params32(struct slgt_info *info, struct MGSL_PARAMS32 __user *ne
1200 return 0; 1199 return 0;
1201} 1200}
1202 1201
1203static long slgt_compat_ioctl(struct tty_struct *tty, struct file *file, 1202static long slgt_compat_ioctl(struct tty_struct *tty,
1204 unsigned int cmd, unsigned long arg) 1203 unsigned int cmd, unsigned long arg)
1205{ 1204{
1206 struct slgt_info *info = tty->driver_data; 1205 struct slgt_info *info = tty->driver_data;
@@ -1239,7 +1238,7 @@ static long slgt_compat_ioctl(struct tty_struct *tty, struct file *file,
1239 case MGSL_IOCSIF: 1238 case MGSL_IOCSIF:
1240 case MGSL_IOCSXSYNC: 1239 case MGSL_IOCSXSYNC:
1241 case MGSL_IOCSXCTRL: 1240 case MGSL_IOCSXCTRL:
1242 rc = ioctl(tty, file, cmd, arg); 1241 rc = ioctl(tty, cmd, arg);
1243 break; 1242 break;
1244 } 1243 }
1245 1244
@@ -3195,7 +3194,7 @@ static int modem_input_wait(struct slgt_info *info,int arg)
3195/* 3194/*
3196 * return state of serial control and status signals 3195 * return state of serial control and status signals
3197 */ 3196 */
3198static int tiocmget(struct tty_struct *tty, struct file *file) 3197static int tiocmget(struct tty_struct *tty)
3199{ 3198{
3200 struct slgt_info *info = tty->driver_data; 3199 struct slgt_info *info = tty->driver_data;
3201 unsigned int result; 3200 unsigned int result;
@@ -3223,7 +3222,7 @@ static int tiocmget(struct tty_struct *tty, struct file *file)
3223 * TIOCMSET = set/clear signal values 3222 * TIOCMSET = set/clear signal values
3224 * value bit mask for command 3223 * value bit mask for command
3225 */ 3224 */
3226static int tiocmset(struct tty_struct *tty, struct file *file, 3225static int tiocmset(struct tty_struct *tty,
3227 unsigned int set, unsigned int clear) 3226 unsigned int set, unsigned int clear)
3228{ 3227{
3229 struct slgt_info *info = tty->driver_data; 3228 struct slgt_info *info = tty->driver_data;
diff --git a/drivers/char/synclinkmp.c b/drivers/tty/synclinkmp.c
index 2f9eb4b0dec1..327343694473 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -520,7 +520,7 @@ static void flush_buffer(struct tty_struct *tty);
520static void tx_hold(struct tty_struct *tty); 520static void tx_hold(struct tty_struct *tty);
521static void tx_release(struct tty_struct *tty); 521static void tx_release(struct tty_struct *tty);
522 522
523static int ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg); 523static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
524static int chars_in_buffer(struct tty_struct *tty); 524static int chars_in_buffer(struct tty_struct *tty);
525static void throttle(struct tty_struct * tty); 525static void throttle(struct tty_struct * tty);
526static void unthrottle(struct tty_struct * tty); 526static void unthrottle(struct tty_struct * tty);
@@ -546,9 +546,9 @@ static int tx_abort(SLMP_INFO *info);
546static int rx_enable(SLMP_INFO *info, int enable); 546static int rx_enable(SLMP_INFO *info, int enable);
547static int modem_input_wait(SLMP_INFO *info,int arg); 547static int modem_input_wait(SLMP_INFO *info,int arg);
548static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr); 548static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr);
549static int tiocmget(struct tty_struct *tty, struct file *file); 549static int tiocmget(struct tty_struct *tty);
550static int tiocmset(struct tty_struct *tty, struct file *file, 550static int tiocmset(struct tty_struct *tty,
551 unsigned int set, unsigned int clear); 551 unsigned int set, unsigned int clear);
552static int set_break(struct tty_struct *tty, int break_state); 552static int set_break(struct tty_struct *tty, int break_state);
553 553
554static void add_device(SLMP_INFO *info); 554static void add_device(SLMP_INFO *info);
@@ -1248,13 +1248,12 @@ static void tx_release(struct tty_struct *tty)
1248 * Arguments: 1248 * Arguments:
1249 * 1249 *
1250 * tty pointer to tty instance data 1250 * tty pointer to tty instance data
1251 * file pointer to associated file object for device
1252 * cmd IOCTL command code 1251 * cmd IOCTL command code
1253 * arg command argument/context 1252 * arg command argument/context
1254 * 1253 *
1255 * Return Value: 0 if success, otherwise error code 1254 * Return Value: 0 if success, otherwise error code
1256 */ 1255 */
1257static int ioctl(struct tty_struct *tty, struct file *file, 1256static int ioctl(struct tty_struct *tty,
1258 unsigned int cmd, unsigned long arg) 1257 unsigned int cmd, unsigned long arg)
1259{ 1258{
1260 SLMP_INFO *info = tty->driver_data; 1259 SLMP_INFO *info = tty->driver_data;
@@ -3207,7 +3206,7 @@ static int modem_input_wait(SLMP_INFO *info,int arg)
3207 3206
3208/* return the state of the serial control and status signals 3207/* return the state of the serial control and status signals
3209 */ 3208 */
3210static int tiocmget(struct tty_struct *tty, struct file *file) 3209static int tiocmget(struct tty_struct *tty)
3211{ 3210{
3212 SLMP_INFO *info = tty->driver_data; 3211 SLMP_INFO *info = tty->driver_data;
3213 unsigned int result; 3212 unsigned int result;
@@ -3232,8 +3231,8 @@ static int tiocmget(struct tty_struct *tty, struct file *file)
3232 3231
3233/* set modem control signals (DTR/RTS) 3232/* set modem control signals (DTR/RTS)
3234 */ 3233 */
3235static int tiocmset(struct tty_struct *tty, struct file *file, 3234static int tiocmset(struct tty_struct *tty,
3236 unsigned int set, unsigned int clear) 3235 unsigned int set, unsigned int clear)
3237{ 3236{
3238 SLMP_INFO *info = tty->driver_data; 3237 SLMP_INFO *info = tty->driver_data;
3239 unsigned long flags; 3238 unsigned long flags;
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 0065da4b11c1..8ef2d69470ec 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2465,12 +2465,12 @@ out:
2465 * Locking: none (up to the driver) 2465 * Locking: none (up to the driver)
2466 */ 2466 */
2467 2467
2468static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p) 2468static int tty_tiocmget(struct tty_struct *tty, int __user *p)
2469{ 2469{
2470 int retval = -EINVAL; 2470 int retval = -EINVAL;
2471 2471
2472 if (tty->ops->tiocmget) { 2472 if (tty->ops->tiocmget) {
2473 retval = tty->ops->tiocmget(tty, file); 2473 retval = tty->ops->tiocmget(tty);
2474 2474
2475 if (retval >= 0) 2475 if (retval >= 0)
2476 retval = put_user(retval, p); 2476 retval = put_user(retval, p);
@@ -2481,7 +2481,6 @@ static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p
2481/** 2481/**
2482 * tty_tiocmset - set modem status 2482 * tty_tiocmset - set modem status
2483 * @tty: tty device 2483 * @tty: tty device
2484 * @file: user file pointer
2485 * @cmd: command - clear bits, set bits or set all 2484 * @cmd: command - clear bits, set bits or set all
2486 * @p: pointer to desired bits 2485 * @p: pointer to desired bits
2487 * 2486 *
@@ -2491,7 +2490,7 @@ static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p
2491 * Locking: none (up to the driver) 2490 * Locking: none (up to the driver)
2492 */ 2491 */
2493 2492
2494static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int cmd, 2493static int tty_tiocmset(struct tty_struct *tty, unsigned int cmd,
2495 unsigned __user *p) 2494 unsigned __user *p)
2496{ 2495{
2497 int retval; 2496 int retval;
@@ -2518,7 +2517,7 @@ static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int
2518 } 2517 }
2519 set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; 2518 set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP;
2520 clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; 2519 clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP;
2521 return tty->ops->tiocmset(tty, file, set, clear); 2520 return tty->ops->tiocmset(tty, set, clear);
2522} 2521}
2523 2522
2524static int tty_tiocgicount(struct tty_struct *tty, void __user *arg) 2523static int tty_tiocgicount(struct tty_struct *tty, void __user *arg)
@@ -2627,6 +2626,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2627 return put_user(tty->ldisc->ops->num, (int __user *)p); 2626 return put_user(tty->ldisc->ops->num, (int __user *)p);
2628 case TIOCSETD: 2627 case TIOCSETD:
2629 return tiocsetd(tty, p); 2628 return tiocsetd(tty, p);
2629 case TIOCVHANGUP:
2630 if (!capable(CAP_SYS_ADMIN))
2631 return -EPERM;
2632 tty_vhangup(tty);
2633 return 0;
2630 case TIOCGDEV: 2634 case TIOCGDEV:
2631 { 2635 {
2632 unsigned int ret = new_encode_dev(tty_devnum(real_tty)); 2636 unsigned int ret = new_encode_dev(tty_devnum(real_tty));
@@ -2655,11 +2659,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2655 return send_break(tty, arg ? arg*100 : 250); 2659 return send_break(tty, arg ? arg*100 : 250);
2656 2660
2657 case TIOCMGET: 2661 case TIOCMGET:
2658 return tty_tiocmget(tty, file, p); 2662 return tty_tiocmget(tty, p);
2659 case TIOCMSET: 2663 case TIOCMSET:
2660 case TIOCMBIC: 2664 case TIOCMBIC:
2661 case TIOCMBIS: 2665 case TIOCMBIS:
2662 return tty_tiocmset(tty, file, cmd, p); 2666 return tty_tiocmset(tty, cmd, p);
2663 case TIOCGICOUNT: 2667 case TIOCGICOUNT:
2664 retval = tty_tiocgicount(tty, p); 2668 retval = tty_tiocgicount(tty, p);
2665 /* For the moment allow fall through to the old method */ 2669 /* For the moment allow fall through to the old method */
@@ -2677,7 +2681,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2677 break; 2681 break;
2678 } 2682 }
2679 if (tty->ops->ioctl) { 2683 if (tty->ops->ioctl) {
2680 retval = (tty->ops->ioctl)(tty, file, cmd, arg); 2684 retval = (tty->ops->ioctl)(tty, cmd, arg);
2681 if (retval != -ENOIOCTLCMD) 2685 if (retval != -ENOIOCTLCMD)
2682 return retval; 2686 return retval;
2683 } 2687 }
@@ -2705,7 +2709,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
2705 return -EINVAL; 2709 return -EINVAL;
2706 2710
2707 if (tty->ops->compat_ioctl) { 2711 if (tty->ops->compat_ioctl) {
2708 retval = (tty->ops->compat_ioctl)(tty, file, cmd, arg); 2712 retval = (tty->ops->compat_ioctl)(tty, cmd, arg);
2709 if (retval != -ENOIOCTLCMD) 2713 if (retval != -ENOIOCTLCMD)
2710 return retval; 2714 return retval;
2711 } 2715 }
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 0c1889971459..1a1135d580a2 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -486,7 +486,7 @@ int tty_termios_hw_change(struct ktermios *a, struct ktermios *b)
486EXPORT_SYMBOL(tty_termios_hw_change); 486EXPORT_SYMBOL(tty_termios_hw_change);
487 487
488/** 488/**
489 * change_termios - update termios values 489 * tty_set_termios - update termios values
490 * @tty: tty to update 490 * @tty: tty to update
491 * @new_termios: desired new value 491 * @new_termios: desired new value
492 * 492 *
@@ -497,7 +497,7 @@ EXPORT_SYMBOL(tty_termios_hw_change);
497 * Locking: termios_mutex 497 * Locking: termios_mutex
498 */ 498 */
499 499
500static void change_termios(struct tty_struct *tty, struct ktermios *new_termios) 500int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
501{ 501{
502 struct ktermios old_termios; 502 struct ktermios old_termios;
503 struct tty_ldisc *ld; 503 struct tty_ldisc *ld;
@@ -553,7 +553,9 @@ static void change_termios(struct tty_struct *tty, struct ktermios *new_termios)
553 tty_ldisc_deref(ld); 553 tty_ldisc_deref(ld);
554 } 554 }
555 mutex_unlock(&tty->termios_mutex); 555 mutex_unlock(&tty->termios_mutex);
556 return 0;
556} 557}
558EXPORT_SYMBOL_GPL(tty_set_termios);
557 559
558/** 560/**
559 * set_termios - set termios values for a tty 561 * set_termios - set termios values for a tty
@@ -562,7 +564,7 @@ static void change_termios(struct tty_struct *tty, struct ktermios *new_termios)
562 * @opt: option information 564 * @opt: option information
563 * 565 *
564 * Helper function to prepare termios data and run necessary other 566 * Helper function to prepare termios data and run necessary other
565 * functions before using change_termios to do the actual changes. 567 * functions before using tty_set_termios to do the actual changes.
566 * 568 *
567 * Locking: 569 * Locking:
568 * Called functions take ldisc and termios_mutex locks 570 * Called functions take ldisc and termios_mutex locks
@@ -620,7 +622,7 @@ static int set_termios(struct tty_struct *tty, void __user *arg, int opt)
620 return -EINTR; 622 return -EINTR;
621 } 623 }
622 624
623 change_termios(tty, &tmp_termios); 625 tty_set_termios(tty, &tmp_termios);
624 626
625 /* FIXME: Arguably if tmp_termios == tty->termios AND the 627 /* FIXME: Arguably if tmp_termios == tty->termios AND the
626 actual requested termios was not tmp_termios then we may 628 actual requested termios was not tmp_termios then we may
@@ -797,7 +799,7 @@ static int set_sgttyb(struct tty_struct *tty, struct sgttyb __user *sgttyb)
797 termios.c_ospeed); 799 termios.c_ospeed);
798#endif 800#endif
799 mutex_unlock(&tty->termios_mutex); 801 mutex_unlock(&tty->termios_mutex);
800 change_termios(tty, &termios); 802 tty_set_termios(tty, &termios);
801 return 0; 803 return 0;
802} 804}
803#endif 805#endif
@@ -951,6 +953,8 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
951 int ret = 0; 953 int ret = 0;
952 struct ktermios kterm; 954 struct ktermios kterm;
953 955
956 BUG_ON(file == NULL);
957
954 if (tty->driver->type == TTY_DRIVER_TYPE_PTY && 958 if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
955 tty->driver->subtype == PTY_TYPE_MASTER) 959 tty->driver->subtype == PTY_TYPE_MASTER)
956 real_tty = tty->link; 960 real_tty = tty->link;
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 4214d58276f7..c42f402db9ba 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -535,6 +535,19 @@ static int tty_ldisc_halt(struct tty_struct *tty)
535} 535}
536 536
537/** 537/**
538 * tty_ldisc_flush_works - flush all works of a tty
539 * @tty: tty device to flush works for
540 *
541 * Sync flush all works belonging to @tty.
542 */
543static void tty_ldisc_flush_works(struct tty_struct *tty)
544{
545 flush_work_sync(&tty->hangup_work);
546 flush_work_sync(&tty->SAK_work);
547 flush_delayed_work_sync(&tty->buf.work);
548}
549
550/**
538 * tty_ldisc_wait_idle - wait for the ldisc to become idle 551 * tty_ldisc_wait_idle - wait for the ldisc to become idle
539 * @tty: tty to wait for 552 * @tty: tty to wait for
540 * 553 *
@@ -653,7 +666,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
653 666
654 mutex_unlock(&tty->ldisc_mutex); 667 mutex_unlock(&tty->ldisc_mutex);
655 668
656 flush_scheduled_work(); 669 tty_ldisc_flush_works(tty);
657 670
658 retval = tty_ldisc_wait_idle(tty); 671 retval = tty_ldisc_wait_idle(tty);
659 672
@@ -905,7 +918,7 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
905 918
906 tty_unlock(); 919 tty_unlock();
907 tty_ldisc_halt(tty); 920 tty_ldisc_halt(tty);
908 flush_scheduled_work(); 921 tty_ldisc_flush_works(tty);
909 tty_lock(); 922 tty_lock();
910 923
911 mutex_lock(&tty->ldisc_mutex); 924 mutex_lock(&tty->ldisc_mutex);
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index e95d7876ca6b..6dd3c68c13ad 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -654,7 +654,8 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
654 if (value >= ARRAY_SIZE(fn_handler)) 654 if (value >= ARRAY_SIZE(fn_handler))
655 return; 655 return;
656 if ((kbd->kbdmode == VC_RAW || 656 if ((kbd->kbdmode == VC_RAW ||
657 kbd->kbdmode == VC_MEDIUMRAW) && 657 kbd->kbdmode == VC_MEDIUMRAW ||
658 kbd->kbdmode == VC_OFF) &&
658 value != KVAL(K_SAK)) 659 value != KVAL(K_SAK))
659 return; /* SAK is allowed even in raw mode */ 660 return; /* SAK is allowed even in raw mode */
660 fn_handler[value](vc); 661 fn_handler[value](vc);
@@ -1295,7 +1296,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
1295 if (rc == NOTIFY_STOP) 1296 if (rc == NOTIFY_STOP)
1296 return; 1297 return;
1297 1298
1298 if (raw_mode && type != KT_SPEC && type != KT_SHIFT) 1299 if ((raw_mode || kbd->kbdmode == VC_OFF) && type != KT_SPEC && type != KT_SHIFT)
1299 return; 1300 return;
1300 1301
1301 (*k_handler[type])(vc, keysym & 0xff, !down); 1302 (*k_handler[type])(vc, keysym & 0xff, !down);
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index a672ed192d33..7b3bfbe2e6de 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -28,7 +28,6 @@
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/mutex.h>
32#include <linux/vt_kern.h> 31#include <linux/vt_kern.h>
33#include <linux/selection.h> 32#include <linux/selection.h>
34#include <linux/kbd_kern.h> 33#include <linux/kbd_kern.h>
@@ -51,6 +50,8 @@
51#undef addr 50#undef addr
52#define HEADER_SIZE 4 51#define HEADER_SIZE 4
53 52
53#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
54
54struct vcs_poll_data { 55struct vcs_poll_data {
55 struct notifier_block notifier; 56 struct notifier_block notifier;
56 unsigned int cons_num; 57 unsigned int cons_num;
@@ -131,21 +132,45 @@ vcs_poll_data_get(struct file *file)
131 return poll; 132 return poll;
132} 133}
133 134
135/*
136 * Returns VC for inode.
137 * Must be called with console_lock.
138 */
139static struct vc_data*
140vcs_vc(struct inode *inode, int *viewed)
141{
142 unsigned int currcons = iminor(inode) & 127;
143
144 WARN_CONSOLE_UNLOCKED();
145
146 if (currcons == 0) {
147 currcons = fg_console;
148 if (viewed)
149 *viewed = 1;
150 } else {
151 currcons--;
152 if (viewed)
153 *viewed = 0;
154 }
155 return vc_cons[currcons].d;
156}
157
158/*
159 * Returns size for VC carried by inode.
160 * Must be called with console_lock.
161 */
134static int 162static int
135vcs_size(struct inode *inode) 163vcs_size(struct inode *inode)
136{ 164{
137 int size; 165 int size;
138 int minor = iminor(inode); 166 int minor = iminor(inode);
139 int currcons = minor & 127;
140 struct vc_data *vc; 167 struct vc_data *vc;
141 168
142 if (currcons == 0) 169 WARN_CONSOLE_UNLOCKED();
143 currcons = fg_console; 170
144 else 171 vc = vcs_vc(inode, NULL);
145 currcons--; 172 if (!vc)
146 if (!vc_cons_allocated(currcons))
147 return -ENXIO; 173 return -ENXIO;
148 vc = vc_cons[currcons].d;
149 174
150 size = vc->vc_rows * vc->vc_cols; 175 size = vc->vc_rows * vc->vc_cols;
151 176
@@ -158,11 +183,13 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
158{ 183{
159 int size; 184 int size;
160 185
161 mutex_lock(&con_buf_mtx); 186 console_lock();
162 size = vcs_size(file->f_path.dentry->d_inode); 187 size = vcs_size(file->f_path.dentry->d_inode);
188 console_unlock();
189 if (size < 0)
190 return size;
163 switch (orig) { 191 switch (orig) {
164 default: 192 default:
165 mutex_unlock(&con_buf_mtx);
166 return -EINVAL; 193 return -EINVAL;
167 case 2: 194 case 2:
168 offset += size; 195 offset += size;
@@ -173,11 +200,9 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
173 break; 200 break;
174 } 201 }
175 if (offset < 0 || offset > size) { 202 if (offset < 0 || offset > size) {
176 mutex_unlock(&con_buf_mtx);
177 return -EINVAL; 203 return -EINVAL;
178 } 204 }
179 file->f_pos = offset; 205 file->f_pos = offset;
180 mutex_unlock(&con_buf_mtx);
181 return file->f_pos; 206 return file->f_pos;
182} 207}
183 208
@@ -190,12 +215,15 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
190 struct vc_data *vc; 215 struct vc_data *vc;
191 struct vcs_poll_data *poll; 216 struct vcs_poll_data *poll;
192 long pos; 217 long pos;
193 long viewed, attr, read; 218 long attr, read;
194 int col, maxcol; 219 int col, maxcol, viewed;
195 unsigned short *org = NULL; 220 unsigned short *org = NULL;
196 ssize_t ret; 221 ssize_t ret;
222 char *con_buf;
197 223
198 mutex_lock(&con_buf_mtx); 224 con_buf = (char *) __get_free_page(GFP_KERNEL);
225 if (!con_buf)
226 return -ENOMEM;
199 227
200 pos = *ppos; 228 pos = *ppos;
201 229
@@ -205,18 +233,10 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
205 console_lock(); 233 console_lock();
206 234
207 attr = (currcons & 128); 235 attr = (currcons & 128);
208 currcons = (currcons & 127);
209 if (currcons == 0) {
210 currcons = fg_console;
211 viewed = 1;
212 } else {
213 currcons--;
214 viewed = 0;
215 }
216 ret = -ENXIO; 236 ret = -ENXIO;
217 if (!vc_cons_allocated(currcons)) 237 vc = vcs_vc(inode, &viewed);
238 if (!vc)
218 goto unlock_out; 239 goto unlock_out;
219 vc = vc_cons[currcons].d;
220 240
221 ret = -EINVAL; 241 ret = -EINVAL;
222 if (pos < 0) 242 if (pos < 0)
@@ -237,6 +257,12 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
237 * could sleep. 257 * could sleep.
238 */ 258 */
239 size = vcs_size(inode); 259 size = vcs_size(inode);
260 if (size < 0) {
261 if (read)
262 break;
263 ret = size;
264 goto unlock_out;
265 }
240 if (pos >= size) 266 if (pos >= size)
241 break; 267 break;
242 if (count > size - pos) 268 if (count > size - pos)
@@ -355,7 +381,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
355 ret = read; 381 ret = read;
356unlock_out: 382unlock_out:
357 console_unlock(); 383 console_unlock();
358 mutex_unlock(&con_buf_mtx); 384 free_page((unsigned long) con_buf);
359 return ret; 385 return ret;
360} 386}
361 387
@@ -366,13 +392,16 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
366 unsigned int currcons = iminor(inode); 392 unsigned int currcons = iminor(inode);
367 struct vc_data *vc; 393 struct vc_data *vc;
368 long pos; 394 long pos;
369 long viewed, attr, size, written; 395 long attr, size, written;
370 char *con_buf0; 396 char *con_buf0;
371 int col, maxcol; 397 int col, maxcol, viewed;
372 u16 *org0 = NULL, *org = NULL; 398 u16 *org0 = NULL, *org = NULL;
373 size_t ret; 399 size_t ret;
400 char *con_buf;
374 401
375 mutex_lock(&con_buf_mtx); 402 con_buf = (char *) __get_free_page(GFP_KERNEL);
403 if (!con_buf)
404 return -ENOMEM;
376 405
377 pos = *ppos; 406 pos = *ppos;
378 407
@@ -382,19 +411,10 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
382 console_lock(); 411 console_lock();
383 412
384 attr = (currcons & 128); 413 attr = (currcons & 128);
385 currcons = (currcons & 127);
386
387 if (currcons == 0) {
388 currcons = fg_console;
389 viewed = 1;
390 } else {
391 currcons--;
392 viewed = 0;
393 }
394 ret = -ENXIO; 414 ret = -ENXIO;
395 if (!vc_cons_allocated(currcons)) 415 vc = vcs_vc(inode, &viewed);
416 if (!vc)
396 goto unlock_out; 417 goto unlock_out;
397 vc = vc_cons[currcons].d;
398 418
399 size = vcs_size(inode); 419 size = vcs_size(inode);
400 ret = -EINVAL; 420 ret = -EINVAL;
@@ -436,6 +456,12 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
436 * Return data written up to now on failure. 456 * Return data written up to now on failure.
437 */ 457 */
438 size = vcs_size(inode); 458 size = vcs_size(inode);
459 if (size < 0) {
460 if (written)
461 break;
462 ret = size;
463 goto unlock_out;
464 }
439 if (pos >= size) 465 if (pos >= size)
440 break; 466 break;
441 if (this_round > size - pos) 467 if (this_round > size - pos)
@@ -543,9 +569,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
543 569
544unlock_out: 570unlock_out:
545 console_unlock(); 571 console_unlock();
546 572 free_page((unsigned long) con_buf);
547 mutex_unlock(&con_buf_mtx);
548
549 return ret; 573 return ret;
550} 574}
551 575
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 147ede3423df..798df6f89110 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2068,18 +2068,6 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
2068 } 2068 }
2069} 2069}
2070 2070
2071/* This is a temporary buffer used to prepare a tty console write
2072 * so that we can easily avoid touching user space while holding the
2073 * console spinlock. It is allocated in con_init and is shared by
2074 * this code and the vc_screen read/write tty calls.
2075 *
2076 * We have to allocate this statically in the kernel data section
2077 * since console_init (and thus con_init) are called before any
2078 * kernel memory allocation is available.
2079 */
2080char con_buf[CON_BUF_SIZE];
2081DEFINE_MUTEX(con_buf_mtx);
2082
2083/* is_double_width() is based on the wcwidth() implementation by 2071/* is_double_width() is based on the wcwidth() implementation by
2084 * Markus Kuhn -- 2007-05-26 (Unicode 5.0) 2072 * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
2085 * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c 2073 * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
@@ -2157,10 +2145,10 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
2157 2145
2158 currcons = vc->vc_num; 2146 currcons = vc->vc_num;
2159 if (!vc_cons_allocated(currcons)) { 2147 if (!vc_cons_allocated(currcons)) {
2160 /* could this happen? */ 2148 /* could this happen? */
2161 printk_once("con_write: tty %d not allocated\n", currcons+1); 2149 pr_warn_once("con_write: tty %d not allocated\n", currcons+1);
2162 console_unlock(); 2150 console_unlock();
2163 return 0; 2151 return 0;
2164 } 2152 }
2165 2153
2166 himask = vc->vc_hi_font_mask; 2154 himask = vc->vc_hi_font_mask;
@@ -2940,7 +2928,7 @@ static int __init con_init(void)
2940 gotoxy(vc, vc->vc_x, vc->vc_y); 2928 gotoxy(vc, vc->vc_x, vc->vc_y);
2941 csi_J(vc, 0); 2929 csi_J(vc, 0);
2942 update_screen(vc); 2930 update_screen(vc);
2943 printk("Console: %s %s %dx%d", 2931 pr_info("Console: %s %s %dx%d",
2944 vc->vc_can_do_color ? "colour" : "mono", 2932 vc->vc_can_do_color ? "colour" : "mono",
2945 display_desc, vc->vc_cols, vc->vc_rows); 2933 display_desc, vc->vc_cols, vc->vc_rows);
2946 printable = 1; 2934 printable = 1;
@@ -3103,7 +3091,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last,
3103 clear_buffer_attributes(vc); 3091 clear_buffer_attributes(vc);
3104 } 3092 }
3105 3093
3106 printk("Console: switching "); 3094 pr_info("Console: switching ");
3107 if (!deflt) 3095 if (!deflt)
3108 printk("consoles %d-%d ", first+1, last+1); 3096 printk("consoles %d-%d ", first+1, last+1);
3109 if (j >= 0) { 3097 if (j >= 0) {
@@ -3809,7 +3797,8 @@ void do_unblank_screen(int leaving_gfx)
3809 return; 3797 return;
3810 if (!vc_cons_allocated(fg_console)) { 3798 if (!vc_cons_allocated(fg_console)) {
3811 /* impossible */ 3799 /* impossible */
3812 printk("unblank_screen: tty %d not allocated ??\n", fg_console+1); 3800 pr_warning("unblank_screen: tty %d not allocated ??\n",
3801 fg_console+1);
3813 return; 3802 return;
3814 } 3803 }
3815 vc = vc_cons[fg_console].d; 3804 vc = vc_cons[fg_console].d;
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index 1235ebda6e1c..b64804965316 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -495,7 +495,7 @@ do_unimap_ioctl(int cmd, struct unimapdesc __user *user_ud, int perm, struct vc_
495 * We handle the console-specific ioctl's here. We allow the 495 * We handle the console-specific ioctl's here. We allow the
496 * capability to modify any console, not just the fg_console. 496 * capability to modify any console, not just the fg_console.
497 */ 497 */
498int vt_ioctl(struct tty_struct *tty, struct file * file, 498int vt_ioctl(struct tty_struct *tty,
499 unsigned int cmd, unsigned long arg) 499 unsigned int cmd, unsigned long arg)
500{ 500{
501 struct vc_data *vc = tty->driver_data; 501 struct vc_data *vc = tty->driver_data;
@@ -688,6 +688,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
688 kbd->kbdmode = VC_UNICODE; 688 kbd->kbdmode = VC_UNICODE;
689 compute_shiftstate(); 689 compute_shiftstate();
690 break; 690 break;
691 case K_OFF:
692 kbd->kbdmode = VC_OFF;
693 break;
691 default: 694 default:
692 ret = -EINVAL; 695 ret = -EINVAL;
693 goto out; 696 goto out;
@@ -1007,8 +1010,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
1007 if (ret) 1010 if (ret)
1008 break; 1011 break;
1009 /* Commence switch and lock */ 1012 /* Commence switch and lock */
1010 set_console(arg); 1013 set_console(vsa.console);
1011 } 1014 }
1015 break;
1012 } 1016 }
1013 1017
1014 /* 1018 /*
@@ -1491,7 +1495,7 @@ compat_unimap_ioctl(unsigned int cmd, struct compat_unimapdesc __user *user_ud,
1491 return 0; 1495 return 0;
1492} 1496}
1493 1497
1494long vt_compat_ioctl(struct tty_struct *tty, struct file * file, 1498long vt_compat_ioctl(struct tty_struct *tty,
1495 unsigned int cmd, unsigned long arg) 1499 unsigned int cmd, unsigned long arg)
1496{ 1500{
1497 struct vc_data *vc = tty->driver_data; 1501 struct vc_data *vc = tty->driver_data;
@@ -1577,7 +1581,7 @@ out:
1577 1581
1578fallback: 1582fallback:
1579 tty_unlock(); 1583 tty_unlock();
1580 return vt_ioctl(tty, file, cmd, arg); 1584 return vt_ioctl(tty, cmd, arg);
1581} 1585}
1582 1586
1583 1587
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 4ab49d4eebf4..f492a7f2b6ee 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -776,7 +776,7 @@ static int acm_tty_break_ctl(struct tty_struct *tty, int state)
776 return retval; 776 return retval;
777} 777}
778 778
779static int acm_tty_tiocmget(struct tty_struct *tty, struct file *file) 779static int acm_tty_tiocmget(struct tty_struct *tty)
780{ 780{
781 struct acm *acm = tty->driver_data; 781 struct acm *acm = tty->driver_data;
782 782
@@ -791,7 +791,7 @@ static int acm_tty_tiocmget(struct tty_struct *tty, struct file *file)
791 TIOCM_CTS; 791 TIOCM_CTS;
792} 792}
793 793
794static int acm_tty_tiocmset(struct tty_struct *tty, struct file *file, 794static int acm_tty_tiocmset(struct tty_struct *tty,
795 unsigned int set, unsigned int clear) 795 unsigned int set, unsigned int clear)
796{ 796{
797 struct acm *acm = tty->driver_data; 797 struct acm *acm = tty->driver_data;
@@ -813,7 +813,7 @@ static int acm_tty_tiocmset(struct tty_struct *tty, struct file *file,
813 return acm_set_control(acm, acm->ctrlout = newctrl); 813 return acm_set_control(acm, acm->ctrlout = newctrl);
814} 814}
815 815
816static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, 816static int acm_tty_ioctl(struct tty_struct *tty,
817 unsigned int cmd, unsigned long arg) 817 unsigned int cmd, unsigned long arg)
818{ 818{
819 struct acm *acm = tty->driver_data; 819 struct acm *acm = tty->driver_data;
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 8f1d4fb19d24..5cdb9d912275 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -431,7 +431,7 @@ static int ark3116_get_icount(struct tty_struct *tty,
431 return 0; 431 return 0;
432} 432}
433 433
434static int ark3116_ioctl(struct tty_struct *tty, struct file *file, 434static int ark3116_ioctl(struct tty_struct *tty,
435 unsigned int cmd, unsigned long arg) 435 unsigned int cmd, unsigned long arg)
436{ 436{
437 struct usb_serial_port *port = tty->driver_data; 437 struct usb_serial_port *port = tty->driver_data;
@@ -485,7 +485,7 @@ static int ark3116_ioctl(struct tty_struct *tty, struct file *file,
485 return -ENOIOCTLCMD; 485 return -ENOIOCTLCMD;
486} 486}
487 487
488static int ark3116_tiocmget(struct tty_struct *tty, struct file *file) 488static int ark3116_tiocmget(struct tty_struct *tty)
489{ 489{
490 struct usb_serial_port *port = tty->driver_data; 490 struct usb_serial_port *port = tty->driver_data;
491 struct ark3116_private *priv = usb_get_serial_port_data(port); 491 struct ark3116_private *priv = usb_get_serial_port_data(port);
@@ -511,7 +511,7 @@ static int ark3116_tiocmget(struct tty_struct *tty, struct file *file)
511 (ctrl & UART_MCR_OUT2 ? TIOCM_OUT2 : 0); 511 (ctrl & UART_MCR_OUT2 ? TIOCM_OUT2 : 0);
512} 512}
513 513
514static int ark3116_tiocmset(struct tty_struct *tty, struct file *file, 514static int ark3116_tiocmset(struct tty_struct *tty,
515 unsigned set, unsigned clr) 515 unsigned set, unsigned clr)
516{ 516{
517 struct usb_serial_port *port = tty->driver_data; 517 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 36df35295db2..d6921fa1403c 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -100,8 +100,8 @@ static void belkin_sa_process_read_urb(struct urb *urb);
100static void belkin_sa_set_termios(struct tty_struct *tty, 100static void belkin_sa_set_termios(struct tty_struct *tty,
101 struct usb_serial_port *port, struct ktermios * old); 101 struct usb_serial_port *port, struct ktermios * old);
102static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state); 102static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state);
103static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file); 103static int belkin_sa_tiocmget(struct tty_struct *tty);
104static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file, 104static int belkin_sa_tiocmset(struct tty_struct *tty,
105 unsigned int set, unsigned int clear); 105 unsigned int set, unsigned int clear);
106 106
107 107
@@ -497,7 +497,7 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state)
497 dev_err(&port->dev, "Set break_ctl %d\n", break_state); 497 dev_err(&port->dev, "Set break_ctl %d\n", break_state);
498} 498}
499 499
500static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file) 500static int belkin_sa_tiocmget(struct tty_struct *tty)
501{ 501{
502 struct usb_serial_port *port = tty->driver_data; 502 struct usb_serial_port *port = tty->driver_data;
503 struct belkin_sa_private *priv = usb_get_serial_port_data(port); 503 struct belkin_sa_private *priv = usb_get_serial_port_data(port);
@@ -513,7 +513,7 @@ static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file)
513 return control_state; 513 return control_state;
514} 514}
515 515
516static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file, 516static int belkin_sa_tiocmset(struct tty_struct *tty,
517 unsigned int set, unsigned int clear) 517 unsigned int set, unsigned int clear)
518{ 518{
519 struct usb_serial_port *port = tty->driver_data; 519 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 7b8815ddf368..d0b9feac5dc3 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -431,7 +431,7 @@ out:
431 kfree(break_reg); 431 kfree(break_reg);
432} 432}
433 433
434static int ch341_tiocmset(struct tty_struct *tty, struct file *file, 434static int ch341_tiocmset(struct tty_struct *tty,
435 unsigned int set, unsigned int clear) 435 unsigned int set, unsigned int clear)
436{ 436{
437 struct usb_serial_port *port = tty->driver_data; 437 struct usb_serial_port *port = tty->driver_data;
@@ -552,8 +552,7 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
552 return 0; 552 return 0;
553} 553}
554 554
555/*static int ch341_ioctl(struct usb_serial_port *port, struct file *file,*/ 555static int ch341_ioctl(struct tty_struct *tty,
556static int ch341_ioctl(struct tty_struct *tty, struct file *file,
557 unsigned int cmd, unsigned long arg) 556 unsigned int cmd, unsigned long arg)
558{ 557{
559 struct usb_serial_port *port = tty->driver_data; 558 struct usb_serial_port *port = tty->driver_data;
@@ -572,7 +571,7 @@ static int ch341_ioctl(struct tty_struct *tty, struct file *file,
572 return -ENOIOCTLCMD; 571 return -ENOIOCTLCMD;
573} 572}
574 573
575static int ch341_tiocmget(struct tty_struct *tty, struct file *file) 574static int ch341_tiocmget(struct tty_struct *tty)
576{ 575{
577 struct usb_serial_port *port = tty->driver_data; 576 struct usb_serial_port *port = tty->driver_data;
578 struct ch341_private *priv = usb_get_serial_port_data(port); 577 struct ch341_private *priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 735ea03157ab..4df3e0cecbae 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -41,10 +41,9 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
41 unsigned int *cflagp, unsigned int *baudp); 41 unsigned int *cflagp, unsigned int *baudp);
42static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *, 42static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *,
43 struct ktermios*); 43 struct ktermios*);
44static int cp210x_tiocmget(struct tty_struct *, struct file *); 44static int cp210x_tiocmget(struct tty_struct *);
45static int cp210x_tiocmset(struct tty_struct *, struct file *, 45static int cp210x_tiocmset(struct tty_struct *, unsigned int, unsigned int);
46 unsigned int, unsigned int); 46static int cp210x_tiocmset_port(struct usb_serial_port *port,
47static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *,
48 unsigned int, unsigned int); 47 unsigned int, unsigned int);
49static void cp210x_break_ctl(struct tty_struct *, int); 48static void cp210x_break_ctl(struct tty_struct *, int);
50static int cp210x_startup(struct usb_serial *); 49static int cp210x_startup(struct usb_serial *);
@@ -698,14 +697,14 @@ static void cp210x_set_termios(struct tty_struct *tty,
698 697
699} 698}
700 699
701static int cp210x_tiocmset (struct tty_struct *tty, struct file *file, 700static int cp210x_tiocmset (struct tty_struct *tty,
702 unsigned int set, unsigned int clear) 701 unsigned int set, unsigned int clear)
703{ 702{
704 struct usb_serial_port *port = tty->driver_data; 703 struct usb_serial_port *port = tty->driver_data;
705 return cp210x_tiocmset_port(port, file, set, clear); 704 return cp210x_tiocmset_port(port, set, clear);
706} 705}
707 706
708static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *file, 707static int cp210x_tiocmset_port(struct usb_serial_port *port,
709 unsigned int set, unsigned int clear) 708 unsigned int set, unsigned int clear)
710{ 709{
711 unsigned int control = 0; 710 unsigned int control = 0;
@@ -737,12 +736,12 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *file,
737static void cp210x_dtr_rts(struct usb_serial_port *p, int on) 736static void cp210x_dtr_rts(struct usb_serial_port *p, int on)
738{ 737{
739 if (on) 738 if (on)
740 cp210x_tiocmset_port(p, NULL, TIOCM_DTR|TIOCM_RTS, 0); 739 cp210x_tiocmset_port(p, TIOCM_DTR|TIOCM_RTS, 0);
741 else 740 else
742 cp210x_tiocmset_port(p, NULL, 0, TIOCM_DTR|TIOCM_RTS); 741 cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS);
743} 742}
744 743
745static int cp210x_tiocmget (struct tty_struct *tty, struct file *file) 744static int cp210x_tiocmget (struct tty_struct *tty)
746{ 745{
747 struct usb_serial_port *port = tty->driver_data; 746 struct usb_serial_port *port = tty->driver_data;
748 unsigned int control; 747 unsigned int control;
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 2edf238b00b9..987e9bf7bd02 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -169,12 +169,12 @@ static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port,
169 const unsigned char *buf, int count); 169 const unsigned char *buf, int count);
170static void cypress_send(struct usb_serial_port *port); 170static void cypress_send(struct usb_serial_port *port);
171static int cypress_write_room(struct tty_struct *tty); 171static int cypress_write_room(struct tty_struct *tty);
172static int cypress_ioctl(struct tty_struct *tty, struct file *file, 172static int cypress_ioctl(struct tty_struct *tty,
173 unsigned int cmd, unsigned long arg); 173 unsigned int cmd, unsigned long arg);
174static void cypress_set_termios(struct tty_struct *tty, 174static void cypress_set_termios(struct tty_struct *tty,
175 struct usb_serial_port *port, struct ktermios *old); 175 struct usb_serial_port *port, struct ktermios *old);
176static int cypress_tiocmget(struct tty_struct *tty, struct file *file); 176static int cypress_tiocmget(struct tty_struct *tty);
177static int cypress_tiocmset(struct tty_struct *tty, struct file *file, 177static int cypress_tiocmset(struct tty_struct *tty,
178 unsigned int set, unsigned int clear); 178 unsigned int set, unsigned int clear);
179static int cypress_chars_in_buffer(struct tty_struct *tty); 179static int cypress_chars_in_buffer(struct tty_struct *tty);
180static void cypress_throttle(struct tty_struct *tty); 180static void cypress_throttle(struct tty_struct *tty);
@@ -864,7 +864,7 @@ static int cypress_write_room(struct tty_struct *tty)
864} 864}
865 865
866 866
867static int cypress_tiocmget(struct tty_struct *tty, struct file *file) 867static int cypress_tiocmget(struct tty_struct *tty)
868{ 868{
869 struct usb_serial_port *port = tty->driver_data; 869 struct usb_serial_port *port = tty->driver_data;
870 struct cypress_private *priv = usb_get_serial_port_data(port); 870 struct cypress_private *priv = usb_get_serial_port_data(port);
@@ -892,7 +892,7 @@ static int cypress_tiocmget(struct tty_struct *tty, struct file *file)
892} 892}
893 893
894 894
895static int cypress_tiocmset(struct tty_struct *tty, struct file *file, 895static int cypress_tiocmset(struct tty_struct *tty,
896 unsigned int set, unsigned int clear) 896 unsigned int set, unsigned int clear)
897{ 897{
898 struct usb_serial_port *port = tty->driver_data; 898 struct usb_serial_port *port = tty->driver_data;
@@ -917,7 +917,7 @@ static int cypress_tiocmset(struct tty_struct *tty, struct file *file,
917} 917}
918 918
919 919
920static int cypress_ioctl(struct tty_struct *tty, struct file *file, 920static int cypress_ioctl(struct tty_struct *tty,
921 unsigned int cmd, unsigned long arg) 921 unsigned int cmd, unsigned long arg)
922{ 922{
923 struct usb_serial_port *port = tty->driver_data; 923 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 666e5a6edd82..86fbba6336c9 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -445,11 +445,11 @@ static void digi_rx_unthrottle(struct tty_struct *tty);
445static void digi_set_termios(struct tty_struct *tty, 445static void digi_set_termios(struct tty_struct *tty,
446 struct usb_serial_port *port, struct ktermios *old_termios); 446 struct usb_serial_port *port, struct ktermios *old_termios);
447static void digi_break_ctl(struct tty_struct *tty, int break_state); 447static void digi_break_ctl(struct tty_struct *tty, int break_state);
448static int digi_tiocmget(struct tty_struct *tty, struct file *file); 448static int digi_tiocmget(struct tty_struct *tty);
449static int digi_tiocmset(struct tty_struct *tty, struct file *file, 449static int digi_tiocmset(struct tty_struct *tty, unsigned int set,
450 unsigned int set, unsigned int clear); 450 unsigned int clear);
451static int digi_write(struct tty_struct *tty, struct usb_serial_port *port, 451static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
452 const unsigned char *buf, int count); 452 const unsigned char *buf, int count);
453static void digi_write_bulk_callback(struct urb *urb); 453static void digi_write_bulk_callback(struct urb *urb);
454static int digi_write_room(struct tty_struct *tty); 454static int digi_write_room(struct tty_struct *tty);
455static int digi_chars_in_buffer(struct tty_struct *tty); 455static int digi_chars_in_buffer(struct tty_struct *tty);
@@ -1118,7 +1118,7 @@ static void digi_break_ctl(struct tty_struct *tty, int break_state)
1118} 1118}
1119 1119
1120 1120
1121static int digi_tiocmget(struct tty_struct *tty, struct file *file) 1121static int digi_tiocmget(struct tty_struct *tty)
1122{ 1122{
1123 struct usb_serial_port *port = tty->driver_data; 1123 struct usb_serial_port *port = tty->driver_data;
1124 struct digi_port *priv = usb_get_serial_port_data(port); 1124 struct digi_port *priv = usb_get_serial_port_data(port);
@@ -1134,8 +1134,8 @@ static int digi_tiocmget(struct tty_struct *tty, struct file *file)
1134} 1134}
1135 1135
1136 1136
1137static int digi_tiocmset(struct tty_struct *tty, struct file *file, 1137static int digi_tiocmset(struct tty_struct *tty,
1138 unsigned int set, unsigned int clear) 1138 unsigned int set, unsigned int clear)
1139{ 1139{
1140 struct usb_serial_port *port = tty->driver_data; 1140 struct usb_serial_port *port = tty->driver_data;
1141 struct digi_port *priv = usb_get_serial_port_data(port); 1141 struct digi_port *priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index f349a3629d00..997326ea15bd 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -864,10 +864,10 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port,
864 void *dest, size_t size); 864 void *dest, size_t size);
865static void ftdi_set_termios(struct tty_struct *tty, 865static void ftdi_set_termios(struct tty_struct *tty,
866 struct usb_serial_port *port, struct ktermios *old); 866 struct usb_serial_port *port, struct ktermios *old);
867static int ftdi_tiocmget(struct tty_struct *tty, struct file *file); 867static int ftdi_tiocmget(struct tty_struct *tty);
868static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, 868static int ftdi_tiocmset(struct tty_struct *tty,
869 unsigned int set, unsigned int clear); 869 unsigned int set, unsigned int clear);
870static int ftdi_ioctl(struct tty_struct *tty, struct file *file, 870static int ftdi_ioctl(struct tty_struct *tty,
871 unsigned int cmd, unsigned long arg); 871 unsigned int cmd, unsigned long arg);
872static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 872static void ftdi_break_ctl(struct tty_struct *tty, int break_state);
873 873
@@ -2176,7 +2176,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
2176 } 2176 }
2177} 2177}
2178 2178
2179static int ftdi_tiocmget(struct tty_struct *tty, struct file *file) 2179static int ftdi_tiocmget(struct tty_struct *tty)
2180{ 2180{
2181 struct usb_serial_port *port = tty->driver_data; 2181 struct usb_serial_port *port = tty->driver_data;
2182 struct ftdi_private *priv = usb_get_serial_port_data(port); 2182 struct ftdi_private *priv = usb_get_serial_port_data(port);
@@ -2229,7 +2229,7 @@ out:
2229 return ret; 2229 return ret;
2230} 2230}
2231 2231
2232static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, 2232static int ftdi_tiocmset(struct tty_struct *tty,
2233 unsigned int set, unsigned int clear) 2233 unsigned int set, unsigned int clear)
2234{ 2234{
2235 struct usb_serial_port *port = tty->driver_data; 2235 struct usb_serial_port *port = tty->driver_data;
@@ -2237,7 +2237,7 @@ static int ftdi_tiocmset(struct tty_struct *tty, struct file *file,
2237 return update_mctrl(port, set, clear); 2237 return update_mctrl(port, set, clear);
2238} 2238}
2239 2239
2240static int ftdi_ioctl(struct tty_struct *tty, struct file *file, 2240static int ftdi_ioctl(struct tty_struct *tty,
2241 unsigned int cmd, unsigned long arg) 2241 unsigned int cmd, unsigned long arg)
2242{ 2242{
2243 struct usb_serial_port *port = tty->driver_data; 2243 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 3b246d93cf22..c675a326023f 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -216,11 +216,11 @@ static void edge_unthrottle(struct tty_struct *tty);
216static void edge_set_termios(struct tty_struct *tty, 216static void edge_set_termios(struct tty_struct *tty,
217 struct usb_serial_port *port, 217 struct usb_serial_port *port,
218 struct ktermios *old_termios); 218 struct ktermios *old_termios);
219static int edge_ioctl(struct tty_struct *tty, struct file *file, 219static int edge_ioctl(struct tty_struct *tty,
220 unsigned int cmd, unsigned long arg); 220 unsigned int cmd, unsigned long arg);
221static void edge_break(struct tty_struct *tty, int break_state); 221static void edge_break(struct tty_struct *tty, int break_state);
222static int edge_tiocmget(struct tty_struct *tty, struct file *file); 222static int edge_tiocmget(struct tty_struct *tty);
223static int edge_tiocmset(struct tty_struct *tty, struct file *file, 223static int edge_tiocmset(struct tty_struct *tty,
224 unsigned int set, unsigned int clear); 224 unsigned int set, unsigned int clear);
225static int edge_get_icount(struct tty_struct *tty, 225static int edge_get_icount(struct tty_struct *tty,
226 struct serial_icounter_struct *icount); 226 struct serial_icounter_struct *icount);
@@ -1568,7 +1568,7 @@ static int get_lsr_info(struct edgeport_port *edge_port,
1568 return 0; 1568 return 0;
1569} 1569}
1570 1570
1571static int edge_tiocmset(struct tty_struct *tty, struct file *file, 1571static int edge_tiocmset(struct tty_struct *tty,
1572 unsigned int set, unsigned int clear) 1572 unsigned int set, unsigned int clear)
1573{ 1573{
1574 struct usb_serial_port *port = tty->driver_data; 1574 struct usb_serial_port *port = tty->driver_data;
@@ -1599,7 +1599,7 @@ static int edge_tiocmset(struct tty_struct *tty, struct file *file,
1599 return 0; 1599 return 0;
1600} 1600}
1601 1601
1602static int edge_tiocmget(struct tty_struct *tty, struct file *file) 1602static int edge_tiocmget(struct tty_struct *tty)
1603{ 1603{
1604 struct usb_serial_port *port = tty->driver_data; 1604 struct usb_serial_port *port = tty->driver_data;
1605 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 1605 struct edgeport_port *edge_port = usb_get_serial_port_data(port);
@@ -1679,7 +1679,7 @@ static int get_serial_info(struct edgeport_port *edge_port,
1679 * SerialIoctl 1679 * SerialIoctl
1680 * this function handles any ioctl calls to the driver 1680 * this function handles any ioctl calls to the driver
1681 *****************************************************************************/ 1681 *****************************************************************************/
1682static int edge_ioctl(struct tty_struct *tty, struct file *file, 1682static int edge_ioctl(struct tty_struct *tty,
1683 unsigned int cmd, unsigned long arg) 1683 unsigned int cmd, unsigned long arg)
1684{ 1684{
1685 struct usb_serial_port *port = tty->driver_data; 1685 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 22506b095c4f..d8434910fa7b 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2444,7 +2444,7 @@ static void edge_set_termios(struct tty_struct *tty,
2444 change_port_settings(tty, edge_port, old_termios); 2444 change_port_settings(tty, edge_port, old_termios);
2445} 2445}
2446 2446
2447static int edge_tiocmset(struct tty_struct *tty, struct file *file, 2447static int edge_tiocmset(struct tty_struct *tty,
2448 unsigned int set, unsigned int clear) 2448 unsigned int set, unsigned int clear)
2449{ 2449{
2450 struct usb_serial_port *port = tty->driver_data; 2450 struct usb_serial_port *port = tty->driver_data;
@@ -2477,7 +2477,7 @@ static int edge_tiocmset(struct tty_struct *tty, struct file *file,
2477 return 0; 2477 return 0;
2478} 2478}
2479 2479
2480static int edge_tiocmget(struct tty_struct *tty, struct file *file) 2480static int edge_tiocmget(struct tty_struct *tty)
2481{ 2481{
2482 struct usb_serial_port *port = tty->driver_data; 2482 struct usb_serial_port *port = tty->driver_data;
2483 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 2483 struct edgeport_port *edge_port = usb_get_serial_port_data(port);
@@ -2552,7 +2552,7 @@ static int get_serial_info(struct edgeport_port *edge_port,
2552 return 0; 2552 return 0;
2553} 2553}
2554 2554
2555static int edge_ioctl(struct tty_struct *tty, struct file *file, 2555static int edge_ioctl(struct tty_struct *tty,
2556 unsigned int cmd, unsigned long arg) 2556 unsigned int cmd, unsigned long arg)
2557{ 2557{
2558 struct usb_serial_port *port = tty->driver_data; 2558 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index 99b97c04896f..6aca631a407a 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -150,7 +150,7 @@ static void iuu_release(struct usb_serial *serial)
150 } 150 }
151} 151}
152 152
153static int iuu_tiocmset(struct tty_struct *tty, struct file *file, 153static int iuu_tiocmset(struct tty_struct *tty,
154 unsigned int set, unsigned int clear) 154 unsigned int set, unsigned int clear)
155{ 155{
156 struct usb_serial_port *port = tty->driver_data; 156 struct usb_serial_port *port = tty->driver_data;
@@ -179,7 +179,7 @@ static int iuu_tiocmset(struct tty_struct *tty, struct file *file,
179 * When no card , the reader respond with TIOCM_CD 179 * When no card , the reader respond with TIOCM_CD
180 * This is known as CD autodetect mechanism 180 * This is known as CD autodetect mechanism
181 */ 181 */
182static int iuu_tiocmget(struct tty_struct *tty, struct file *file) 182static int iuu_tiocmget(struct tty_struct *tty)
183{ 183{
184 struct usb_serial_port *port = tty->driver_data; 184 struct usb_serial_port *port = tty->driver_data;
185 struct iuu_private *priv = usb_get_serial_port_data(port); 185 struct iuu_private *priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 0791778a66f3..c6e968f24e04 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -301,7 +301,7 @@ static void keyspan_set_termios(struct tty_struct *tty,
301 keyspan_send_setup(port, 0); 301 keyspan_send_setup(port, 0);
302} 302}
303 303
304static int keyspan_tiocmget(struct tty_struct *tty, struct file *file) 304static int keyspan_tiocmget(struct tty_struct *tty)
305{ 305{
306 struct usb_serial_port *port = tty->driver_data; 306 struct usb_serial_port *port = tty->driver_data;
307 struct keyspan_port_private *p_priv = usb_get_serial_port_data(port); 307 struct keyspan_port_private *p_priv = usb_get_serial_port_data(port);
@@ -317,7 +317,7 @@ static int keyspan_tiocmget(struct tty_struct *tty, struct file *file)
317 return value; 317 return value;
318} 318}
319 319
320static int keyspan_tiocmset(struct tty_struct *tty, struct file *file, 320static int keyspan_tiocmset(struct tty_struct *tty,
321 unsigned int set, unsigned int clear) 321 unsigned int set, unsigned int clear)
322{ 322{
323 struct usb_serial_port *port = tty->driver_data; 323 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
index ce134dc28ddf..13fa1d1cc900 100644
--- a/drivers/usb/serial/keyspan.h
+++ b/drivers/usb/serial/keyspan.h
@@ -58,10 +58,9 @@ static void keyspan_set_termios (struct tty_struct *tty,
58 struct ktermios *old); 58 struct ktermios *old);
59static void keyspan_break_ctl (struct tty_struct *tty, 59static void keyspan_break_ctl (struct tty_struct *tty,
60 int break_state); 60 int break_state);
61static int keyspan_tiocmget (struct tty_struct *tty, 61static int keyspan_tiocmget (struct tty_struct *tty);
62 struct file *file);
63static int keyspan_tiocmset (struct tty_struct *tty, 62static int keyspan_tiocmset (struct tty_struct *tty,
64 struct file *file, unsigned int set, 63 unsigned int set,
65 unsigned int clear); 64 unsigned int clear);
66static int keyspan_fake_startup (struct usb_serial *serial); 65static int keyspan_fake_startup (struct usb_serial *serial);
67 66
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 554a8693a463..207caabdc4ff 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -457,7 +457,7 @@ static int keyspan_pda_set_modem_info(struct usb_serial *serial,
457 return rc; 457 return rc;
458} 458}
459 459
460static int keyspan_pda_tiocmget(struct tty_struct *tty, struct file *file) 460static int keyspan_pda_tiocmget(struct tty_struct *tty)
461{ 461{
462 struct usb_serial_port *port = tty->driver_data; 462 struct usb_serial_port *port = tty->driver_data;
463 struct usb_serial *serial = port->serial; 463 struct usb_serial *serial = port->serial;
@@ -478,7 +478,7 @@ static int keyspan_pda_tiocmget(struct tty_struct *tty, struct file *file)
478 return value; 478 return value;
479} 479}
480 480
481static int keyspan_pda_tiocmset(struct tty_struct *tty, struct file *file, 481static int keyspan_pda_tiocmset(struct tty_struct *tty,
482 unsigned int set, unsigned int clear) 482 unsigned int set, unsigned int clear)
483{ 483{
484 struct usb_serial_port *port = tty->driver_data; 484 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index e8a65ce45a2f..19373cb7c5bf 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -68,8 +68,8 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port);
68static void klsi_105_close(struct usb_serial_port *port); 68static void klsi_105_close(struct usb_serial_port *port);
69static void klsi_105_set_termios(struct tty_struct *tty, 69static void klsi_105_set_termios(struct tty_struct *tty,
70 struct usb_serial_port *port, struct ktermios *old); 70 struct usb_serial_port *port, struct ktermios *old);
71static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file); 71static int klsi_105_tiocmget(struct tty_struct *tty);
72static int klsi_105_tiocmset(struct tty_struct *tty, struct file *file, 72static int klsi_105_tiocmset(struct tty_struct *tty,
73 unsigned int set, unsigned int clear); 73 unsigned int set, unsigned int clear);
74static void klsi_105_process_read_urb(struct urb *urb); 74static void klsi_105_process_read_urb(struct urb *urb);
75static int klsi_105_prepare_write_buffer(struct usb_serial_port *port, 75static int klsi_105_prepare_write_buffer(struct usb_serial_port *port,
@@ -637,7 +637,7 @@ static void mct_u232_break_ctl(struct tty_struct *tty, int break_state)
637} 637}
638#endif 638#endif
639 639
640static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file) 640static int klsi_105_tiocmget(struct tty_struct *tty)
641{ 641{
642 struct usb_serial_port *port = tty->driver_data; 642 struct usb_serial_port *port = tty->driver_data;
643 struct klsi_105_private *priv = usb_get_serial_port_data(port); 643 struct klsi_105_private *priv = usb_get_serial_port_data(port);
@@ -661,7 +661,7 @@ static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file)
661 return (int)line_state; 661 return (int)line_state;
662} 662}
663 663
664static int klsi_105_tiocmset(struct tty_struct *tty, struct file *file, 664static int klsi_105_tiocmset(struct tty_struct *tty,
665 unsigned int set, unsigned int clear) 665 unsigned int set, unsigned int clear)
666{ 666{
667 int retval = -EINVAL; 667 int retval = -EINVAL;
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index bd5bd8589e04..667863ef0625 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -75,10 +75,10 @@ static void kobil_close(struct usb_serial_port *port);
75static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, 75static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
76 const unsigned char *buf, int count); 76 const unsigned char *buf, int count);
77static int kobil_write_room(struct tty_struct *tty); 77static int kobil_write_room(struct tty_struct *tty);
78static int kobil_ioctl(struct tty_struct *tty, struct file *file, 78static int kobil_ioctl(struct tty_struct *tty,
79 unsigned int cmd, unsigned long arg); 79 unsigned int cmd, unsigned long arg);
80static int kobil_tiocmget(struct tty_struct *tty, struct file *file); 80static int kobil_tiocmget(struct tty_struct *tty);
81static int kobil_tiocmset(struct tty_struct *tty, struct file *file, 81static int kobil_tiocmset(struct tty_struct *tty,
82 unsigned int set, unsigned int clear); 82 unsigned int set, unsigned int clear);
83static void kobil_read_int_callback(struct urb *urb); 83static void kobil_read_int_callback(struct urb *urb);
84static void kobil_write_callback(struct urb *purb); 84static void kobil_write_callback(struct urb *purb);
@@ -504,7 +504,7 @@ static int kobil_write_room(struct tty_struct *tty)
504} 504}
505 505
506 506
507static int kobil_tiocmget(struct tty_struct *tty, struct file *file) 507static int kobil_tiocmget(struct tty_struct *tty)
508{ 508{
509 struct usb_serial_port *port = tty->driver_data; 509 struct usb_serial_port *port = tty->driver_data;
510 struct kobil_private *priv; 510 struct kobil_private *priv;
@@ -544,7 +544,7 @@ static int kobil_tiocmget(struct tty_struct *tty, struct file *file)
544 return result; 544 return result;
545} 545}
546 546
547static int kobil_tiocmset(struct tty_struct *tty, struct file *file, 547static int kobil_tiocmset(struct tty_struct *tty,
548 unsigned int set, unsigned int clear) 548 unsigned int set, unsigned int clear)
549{ 549{
550 struct usb_serial_port *port = tty->driver_data; 550 struct usb_serial_port *port = tty->driver_data;
@@ -668,7 +668,7 @@ static void kobil_set_termios(struct tty_struct *tty,
668 ); 668 );
669} 669}
670 670
671static int kobil_ioctl(struct tty_struct *tty, struct file *file, 671static int kobil_ioctl(struct tty_struct *tty,
672 unsigned int cmd, unsigned long arg) 672 unsigned int cmd, unsigned long arg)
673{ 673{
674 struct usb_serial_port *port = tty->driver_data; 674 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index 2849f8c32015..ef49902c5a51 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -101,8 +101,8 @@ static void mct_u232_read_int_callback(struct urb *urb);
101static void mct_u232_set_termios(struct tty_struct *tty, 101static void mct_u232_set_termios(struct tty_struct *tty,
102 struct usb_serial_port *port, struct ktermios *old); 102 struct usb_serial_port *port, struct ktermios *old);
103static void mct_u232_break_ctl(struct tty_struct *tty, int break_state); 103static void mct_u232_break_ctl(struct tty_struct *tty, int break_state);
104static int mct_u232_tiocmget(struct tty_struct *tty, struct file *file); 104static int mct_u232_tiocmget(struct tty_struct *tty);
105static int mct_u232_tiocmset(struct tty_struct *tty, struct file *file, 105static int mct_u232_tiocmset(struct tty_struct *tty,
106 unsigned int set, unsigned int clear); 106 unsigned int set, unsigned int clear);
107static void mct_u232_throttle(struct tty_struct *tty); 107static void mct_u232_throttle(struct tty_struct *tty);
108static void mct_u232_unthrottle(struct tty_struct *tty); 108static void mct_u232_unthrottle(struct tty_struct *tty);
@@ -762,7 +762,7 @@ static void mct_u232_break_ctl(struct tty_struct *tty, int break_state)
762} /* mct_u232_break_ctl */ 762} /* mct_u232_break_ctl */
763 763
764 764
765static int mct_u232_tiocmget(struct tty_struct *tty, struct file *file) 765static int mct_u232_tiocmget(struct tty_struct *tty)
766{ 766{
767 struct usb_serial_port *port = tty->driver_data; 767 struct usb_serial_port *port = tty->driver_data;
768 struct mct_u232_private *priv = usb_get_serial_port_data(port); 768 struct mct_u232_private *priv = usb_get_serial_port_data(port);
@@ -778,7 +778,7 @@ static int mct_u232_tiocmget(struct tty_struct *tty, struct file *file)
778 return control_state; 778 return control_state;
779} 779}
780 780
781static int mct_u232_tiocmset(struct tty_struct *tty, struct file *file, 781static int mct_u232_tiocmset(struct tty_struct *tty,
782 unsigned int set, unsigned int clear) 782 unsigned int set, unsigned int clear)
783{ 783{
784 struct usb_serial_port *port = tty->driver_data; 784 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 7d3bc9a3e2b6..d8b3e8fa14e9 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1833,7 +1833,7 @@ static int get_lsr_info(struct tty_struct *tty,
1833 return 0; 1833 return 0;
1834} 1834}
1835 1835
1836static int mos7720_tiocmget(struct tty_struct *tty, struct file *file) 1836static int mos7720_tiocmget(struct tty_struct *tty)
1837{ 1837{
1838 struct usb_serial_port *port = tty->driver_data; 1838 struct usb_serial_port *port = tty->driver_data;
1839 struct moschip_port *mos7720_port = usb_get_serial_port_data(port); 1839 struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
@@ -1858,14 +1858,14 @@ static int mos7720_tiocmget(struct tty_struct *tty, struct file *file)
1858 return result; 1858 return result;
1859} 1859}
1860 1860
1861static int mos7720_tiocmset(struct tty_struct *tty, struct file *file, 1861static int mos7720_tiocmset(struct tty_struct *tty,
1862 unsigned int set, unsigned int clear) 1862 unsigned int set, unsigned int clear)
1863{ 1863{
1864 struct usb_serial_port *port = tty->driver_data; 1864 struct usb_serial_port *port = tty->driver_data;
1865 struct moschip_port *mos7720_port = usb_get_serial_port_data(port); 1865 struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
1866 unsigned int mcr ; 1866 unsigned int mcr ;
1867 dbg("%s - port %d", __func__, port->number); 1867 dbg("%s - port %d", __func__, port->number);
1868 dbg("he was at tiocmget"); 1868 dbg("he was at tiocmset");
1869 1869
1870 mcr = mos7720_port->shadowMCR; 1870 mcr = mos7720_port->shadowMCR;
1871 1871
@@ -1987,7 +1987,7 @@ static int get_serial_info(struct moschip_port *mos7720_port,
1987 return 0; 1987 return 0;
1988} 1988}
1989 1989
1990static int mos7720_ioctl(struct tty_struct *tty, struct file *file, 1990static int mos7720_ioctl(struct tty_struct *tty,
1991 unsigned int cmd, unsigned long arg) 1991 unsigned int cmd, unsigned long arg)
1992{ 1992{
1993 struct usb_serial_port *port = tty->driver_data; 1993 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 5627993f9e41..7b50aa122752 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1644,7 +1644,7 @@ static void mos7840_unthrottle(struct tty_struct *tty)
1644 } 1644 }
1645} 1645}
1646 1646
1647static int mos7840_tiocmget(struct tty_struct *tty, struct file *file) 1647static int mos7840_tiocmget(struct tty_struct *tty)
1648{ 1648{
1649 struct usb_serial_port *port = tty->driver_data; 1649 struct usb_serial_port *port = tty->driver_data;
1650 struct moschip_port *mos7840_port; 1650 struct moschip_port *mos7840_port;
@@ -1674,7 +1674,7 @@ static int mos7840_tiocmget(struct tty_struct *tty, struct file *file)
1674 return result; 1674 return result;
1675} 1675}
1676 1676
1677static int mos7840_tiocmset(struct tty_struct *tty, struct file *file, 1677static int mos7840_tiocmset(struct tty_struct *tty,
1678 unsigned int set, unsigned int clear) 1678 unsigned int set, unsigned int clear)
1679{ 1679{
1680 struct usb_serial_port *port = tty->driver_data; 1680 struct usb_serial_port *port = tty->driver_data;
@@ -2235,7 +2235,7 @@ static int mos7840_get_icount(struct tty_struct *tty,
2235 * this function handles any ioctl calls to the driver 2235 * this function handles any ioctl calls to the driver
2236 *****************************************************************************/ 2236 *****************************************************************************/
2237 2237
2238static int mos7840_ioctl(struct tty_struct *tty, struct file *file, 2238static int mos7840_ioctl(struct tty_struct *tty,
2239 unsigned int cmd, unsigned long arg) 2239 unsigned int cmd, unsigned long arg)
2240{ 2240{
2241 struct usb_serial_port *port = tty->driver_data; 2241 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index eda1f9266c4e..8d603a1ca2eb 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -352,7 +352,7 @@ static void opticon_unthrottle(struct tty_struct *tty)
352 } 352 }
353} 353}
354 354
355static int opticon_tiocmget(struct tty_struct *tty, struct file *file) 355static int opticon_tiocmget(struct tty_struct *tty)
356{ 356{
357 struct usb_serial_port *port = tty->driver_data; 357 struct usb_serial_port *port = tty->driver_data;
358 struct opticon_private *priv = usb_get_serial_data(port->serial); 358 struct opticon_private *priv = usb_get_serial_data(port->serial);
@@ -396,7 +396,7 @@ static int get_serial_info(struct opticon_private *priv,
396 return 0; 396 return 0;
397} 397}
398 398
399static int opticon_ioctl(struct tty_struct *tty, struct file *file, 399static int opticon_ioctl(struct tty_struct *tty,
400 unsigned int cmd, unsigned long arg) 400 unsigned int cmd, unsigned long arg)
401{ 401{
402 struct usb_serial_port *port = tty->driver_data; 402 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 73613205be7a..4c29e6c2bda7 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -135,7 +135,7 @@ static void oti6858_close(struct usb_serial_port *port);
135static void oti6858_set_termios(struct tty_struct *tty, 135static void oti6858_set_termios(struct tty_struct *tty,
136 struct usb_serial_port *port, struct ktermios *old); 136 struct usb_serial_port *port, struct ktermios *old);
137static void oti6858_init_termios(struct tty_struct *tty); 137static void oti6858_init_termios(struct tty_struct *tty);
138static int oti6858_ioctl(struct tty_struct *tty, struct file *file, 138static int oti6858_ioctl(struct tty_struct *tty,
139 unsigned int cmd, unsigned long arg); 139 unsigned int cmd, unsigned long arg);
140static void oti6858_read_int_callback(struct urb *urb); 140static void oti6858_read_int_callback(struct urb *urb);
141static void oti6858_read_bulk_callback(struct urb *urb); 141static void oti6858_read_bulk_callback(struct urb *urb);
@@ -144,8 +144,8 @@ static int oti6858_write(struct tty_struct *tty, struct usb_serial_port *port,
144 const unsigned char *buf, int count); 144 const unsigned char *buf, int count);
145static int oti6858_write_room(struct tty_struct *tty); 145static int oti6858_write_room(struct tty_struct *tty);
146static int oti6858_chars_in_buffer(struct tty_struct *tty); 146static int oti6858_chars_in_buffer(struct tty_struct *tty);
147static int oti6858_tiocmget(struct tty_struct *tty, struct file *file); 147static int oti6858_tiocmget(struct tty_struct *tty);
148static int oti6858_tiocmset(struct tty_struct *tty, struct file *file, 148static int oti6858_tiocmset(struct tty_struct *tty,
149 unsigned int set, unsigned int clear); 149 unsigned int set, unsigned int clear);
150static int oti6858_startup(struct usb_serial *serial); 150static int oti6858_startup(struct usb_serial *serial);
151static void oti6858_release(struct usb_serial *serial); 151static void oti6858_release(struct usb_serial *serial);
@@ -624,7 +624,7 @@ static void oti6858_close(struct usb_serial_port *port)
624 usb_kill_urb(port->interrupt_in_urb); 624 usb_kill_urb(port->interrupt_in_urb);
625} 625}
626 626
627static int oti6858_tiocmset(struct tty_struct *tty, struct file *file, 627static int oti6858_tiocmset(struct tty_struct *tty,
628 unsigned int set, unsigned int clear) 628 unsigned int set, unsigned int clear)
629{ 629{
630 struct usb_serial_port *port = tty->driver_data; 630 struct usb_serial_port *port = tty->driver_data;
@@ -657,7 +657,7 @@ static int oti6858_tiocmset(struct tty_struct *tty, struct file *file,
657 return 0; 657 return 0;
658} 658}
659 659
660static int oti6858_tiocmget(struct tty_struct *tty, struct file *file) 660static int oti6858_tiocmget(struct tty_struct *tty)
661{ 661{
662 struct usb_serial_port *port = tty->driver_data; 662 struct usb_serial_port *port = tty->driver_data;
663 struct oti6858_private *priv = usb_get_serial_port_data(port); 663 struct oti6858_private *priv = usb_get_serial_port_data(port);
@@ -728,7 +728,7 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
728 return 0; 728 return 0;
729} 729}
730 730
731static int oti6858_ioctl(struct tty_struct *tty, struct file *file, 731static int oti6858_ioctl(struct tty_struct *tty,
732 unsigned int cmd, unsigned long arg) 732 unsigned int cmd, unsigned long arg)
733{ 733{
734 struct usb_serial_port *port = tty->driver_data; 734 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 08c9181b8e48..30461fcc2206 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -505,7 +505,7 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
505 return 0; 505 return 0;
506} 506}
507 507
508static int pl2303_tiocmset(struct tty_struct *tty, struct file *file, 508static int pl2303_tiocmset(struct tty_struct *tty,
509 unsigned int set, unsigned int clear) 509 unsigned int set, unsigned int clear)
510{ 510{
511 struct usb_serial_port *port = tty->driver_data; 511 struct usb_serial_port *port = tty->driver_data;
@@ -531,7 +531,7 @@ static int pl2303_tiocmset(struct tty_struct *tty, struct file *file,
531 return set_control_lines(port->serial->dev, control); 531 return set_control_lines(port->serial->dev, control);
532} 532}
533 533
534static int pl2303_tiocmget(struct tty_struct *tty, struct file *file) 534static int pl2303_tiocmget(struct tty_struct *tty)
535{ 535{
536 struct usb_serial_port *port = tty->driver_data; 536 struct usb_serial_port *port = tty->driver_data;
537 struct pl2303_private *priv = usb_get_serial_port_data(port); 537 struct pl2303_private *priv = usb_get_serial_port_data(port);
@@ -606,7 +606,7 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
606 return 0; 606 return 0;
607} 607}
608 608
609static int pl2303_ioctl(struct tty_struct *tty, struct file *file, 609static int pl2303_ioctl(struct tty_struct *tty,
610 unsigned int cmd, unsigned long arg) 610 unsigned int cmd, unsigned long arg)
611{ 611{
612 struct serial_struct ser; 612 struct serial_struct ser;
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 7481ff8a49e4..79ee6c79ad54 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -389,7 +389,7 @@ static void sierra_set_termios(struct tty_struct *tty,
389 sierra_send_setup(port); 389 sierra_send_setup(port);
390} 390}
391 391
392static int sierra_tiocmget(struct tty_struct *tty, struct file *file) 392static int sierra_tiocmget(struct tty_struct *tty)
393{ 393{
394 struct usb_serial_port *port = tty->driver_data; 394 struct usb_serial_port *port = tty->driver_data;
395 unsigned int value; 395 unsigned int value;
@@ -408,7 +408,7 @@ static int sierra_tiocmget(struct tty_struct *tty, struct file *file)
408 return value; 408 return value;
409} 409}
410 410
411static int sierra_tiocmset(struct tty_struct *tty, struct file *file, 411static int sierra_tiocmset(struct tty_struct *tty,
412 unsigned int set, unsigned int clear) 412 unsigned int set, unsigned int clear)
413{ 413{
414 struct usb_serial_port *port = tty->driver_data; 414 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index cbfb70bffdd0..180ea6c7911c 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -576,7 +576,7 @@ static int spcp8x5_wait_modem_info(struct usb_serial_port *port,
576 return 0; 576 return 0;
577} 577}
578 578
579static int spcp8x5_ioctl(struct tty_struct *tty, struct file *file, 579static int spcp8x5_ioctl(struct tty_struct *tty,
580 unsigned int cmd, unsigned long arg) 580 unsigned int cmd, unsigned long arg)
581{ 581{
582 struct usb_serial_port *port = tty->driver_data; 582 struct usb_serial_port *port = tty->driver_data;
@@ -595,7 +595,7 @@ static int spcp8x5_ioctl(struct tty_struct *tty, struct file *file,
595 return -ENOIOCTLCMD; 595 return -ENOIOCTLCMD;
596} 596}
597 597
598static int spcp8x5_tiocmset(struct tty_struct *tty, struct file *file, 598static int spcp8x5_tiocmset(struct tty_struct *tty,
599 unsigned int set, unsigned int clear) 599 unsigned int set, unsigned int clear)
600{ 600{
601 struct usb_serial_port *port = tty->driver_data; 601 struct usb_serial_port *port = tty->driver_data;
@@ -618,7 +618,7 @@ static int spcp8x5_tiocmset(struct tty_struct *tty, struct file *file,
618 return spcp8x5_set_ctrlLine(port->serial->dev, control , priv->type); 618 return spcp8x5_set_ctrlLine(port->serial->dev, control , priv->type);
619} 619}
620 620
621static int spcp8x5_tiocmget(struct tty_struct *tty, struct file *file) 621static int spcp8x5_tiocmget(struct tty_struct *tty)
622{ 622{
623 struct usb_serial_port *port = tty->driver_data; 623 struct usb_serial_port *port = tty->driver_data;
624 struct spcp8x5_private *priv = usb_get_serial_port_data(port); 624 struct spcp8x5_private *priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 8359ec798959..87362e48796e 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -439,7 +439,7 @@ static int ssu100_get_icount(struct tty_struct *tty,
439 439
440 440
441 441
442static int ssu100_ioctl(struct tty_struct *tty, struct file *file, 442static int ssu100_ioctl(struct tty_struct *tty,
443 unsigned int cmd, unsigned long arg) 443 unsigned int cmd, unsigned long arg)
444{ 444{
445 struct usb_serial_port *port = tty->driver_data; 445 struct usb_serial_port *port = tty->driver_data;
@@ -484,7 +484,7 @@ static int ssu100_attach(struct usb_serial *serial)
484 return ssu100_initdevice(serial->dev); 484 return ssu100_initdevice(serial->dev);
485} 485}
486 486
487static int ssu100_tiocmget(struct tty_struct *tty, struct file *file) 487static int ssu100_tiocmget(struct tty_struct *tty)
488{ 488{
489 struct usb_serial_port *port = tty->driver_data; 489 struct usb_serial_port *port = tty->driver_data;
490 struct usb_device *dev = port->serial->dev; 490 struct usb_device *dev = port->serial->dev;
@@ -517,7 +517,7 @@ mget_out:
517 return r; 517 return r;
518} 518}
519 519
520static int ssu100_tiocmset(struct tty_struct *tty, struct file *file, 520static int ssu100_tiocmset(struct tty_struct *tty,
521 unsigned int set, unsigned int clear) 521 unsigned int set, unsigned int clear)
522{ 522{
523 struct usb_serial_port *port = tty->driver_data; 523 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index a910004f4079..c6d92a530086 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -106,14 +106,14 @@ static int ti_write_room(struct tty_struct *tty);
106static int ti_chars_in_buffer(struct tty_struct *tty); 106static int ti_chars_in_buffer(struct tty_struct *tty);
107static void ti_throttle(struct tty_struct *tty); 107static void ti_throttle(struct tty_struct *tty);
108static void ti_unthrottle(struct tty_struct *tty); 108static void ti_unthrottle(struct tty_struct *tty);
109static int ti_ioctl(struct tty_struct *tty, struct file *file, 109static int ti_ioctl(struct tty_struct *tty,
110 unsigned int cmd, unsigned long arg); 110 unsigned int cmd, unsigned long arg);
111static int ti_get_icount(struct tty_struct *tty, 111static int ti_get_icount(struct tty_struct *tty,
112 struct serial_icounter_struct *icount); 112 struct serial_icounter_struct *icount);
113static void ti_set_termios(struct tty_struct *tty, 113static void ti_set_termios(struct tty_struct *tty,
114 struct usb_serial_port *port, struct ktermios *old_termios); 114 struct usb_serial_port *port, struct ktermios *old_termios);
115static int ti_tiocmget(struct tty_struct *tty, struct file *file); 115static int ti_tiocmget(struct tty_struct *tty);
116static int ti_tiocmset(struct tty_struct *tty, struct file *file, 116static int ti_tiocmset(struct tty_struct *tty,
117 unsigned int set, unsigned int clear); 117 unsigned int set, unsigned int clear);
118static void ti_break(struct tty_struct *tty, int break_state); 118static void ti_break(struct tty_struct *tty, int break_state);
119static void ti_interrupt_callback(struct urb *urb); 119static void ti_interrupt_callback(struct urb *urb);
@@ -818,7 +818,7 @@ static int ti_get_icount(struct tty_struct *tty,
818 return 0; 818 return 0;
819} 819}
820 820
821static int ti_ioctl(struct tty_struct *tty, struct file *file, 821static int ti_ioctl(struct tty_struct *tty,
822 unsigned int cmd, unsigned long arg) 822 unsigned int cmd, unsigned long arg)
823{ 823{
824 struct usb_serial_port *port = tty->driver_data; 824 struct usb_serial_port *port = tty->driver_data;
@@ -1000,7 +1000,7 @@ static void ti_set_termios(struct tty_struct *tty,
1000} 1000}
1001 1001
1002 1002
1003static int ti_tiocmget(struct tty_struct *tty, struct file *file) 1003static int ti_tiocmget(struct tty_struct *tty)
1004{ 1004{
1005 struct usb_serial_port *port = tty->driver_data; 1005 struct usb_serial_port *port = tty->driver_data;
1006 struct ti_port *tport = usb_get_serial_port_data(port); 1006 struct ti_port *tport = usb_get_serial_port_data(port);
@@ -1033,8 +1033,8 @@ static int ti_tiocmget(struct tty_struct *tty, struct file *file)
1033} 1033}
1034 1034
1035 1035
1036static int ti_tiocmset(struct tty_struct *tty, struct file *file, 1036static int ti_tiocmset(struct tty_struct *tty,
1037 unsigned int set, unsigned int clear) 1037 unsigned int set, unsigned int clear)
1038{ 1038{
1039 struct usb_serial_port *port = tty->driver_data; 1039 struct usb_serial_port *port = tty->driver_data;
1040 struct ti_port *tport = usb_get_serial_port_data(port); 1040 struct ti_port *tport = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 546a52179bec..a72575349744 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -406,7 +406,7 @@ static void serial_unthrottle(struct tty_struct *tty)
406 port->serial->type->unthrottle(tty); 406 port->serial->type->unthrottle(tty);
407} 407}
408 408
409static int serial_ioctl(struct tty_struct *tty, struct file *file, 409static int serial_ioctl(struct tty_struct *tty,
410 unsigned int cmd, unsigned long arg) 410 unsigned int cmd, unsigned long arg)
411{ 411{
412 struct usb_serial_port *port = tty->driver_data; 412 struct usb_serial_port *port = tty->driver_data;
@@ -417,7 +417,7 @@ static int serial_ioctl(struct tty_struct *tty, struct file *file,
417 /* pass on to the driver specific version of this function 417 /* pass on to the driver specific version of this function
418 if it is available */ 418 if it is available */
419 if (port->serial->type->ioctl) { 419 if (port->serial->type->ioctl) {
420 retval = port->serial->type->ioctl(tty, file, cmd, arg); 420 retval = port->serial->type->ioctl(tty, cmd, arg);
421 } else 421 } else
422 retval = -ENOIOCTLCMD; 422 retval = -ENOIOCTLCMD;
423 return retval; 423 return retval;
@@ -496,18 +496,18 @@ static const struct file_operations serial_proc_fops = {
496 .release = single_release, 496 .release = single_release,
497}; 497};
498 498
499static int serial_tiocmget(struct tty_struct *tty, struct file *file) 499static int serial_tiocmget(struct tty_struct *tty)
500{ 500{
501 struct usb_serial_port *port = tty->driver_data; 501 struct usb_serial_port *port = tty->driver_data;
502 502
503 dbg("%s - port %d", __func__, port->number); 503 dbg("%s - port %d", __func__, port->number);
504 504
505 if (port->serial->type->tiocmget) 505 if (port->serial->type->tiocmget)
506 return port->serial->type->tiocmget(tty, file); 506 return port->serial->type->tiocmget(tty);
507 return -EINVAL; 507 return -EINVAL;
508} 508}
509 509
510static int serial_tiocmset(struct tty_struct *tty, struct file *file, 510static int serial_tiocmset(struct tty_struct *tty,
511 unsigned int set, unsigned int clear) 511 unsigned int set, unsigned int clear)
512{ 512{
513 struct usb_serial_port *port = tty->driver_data; 513 struct usb_serial_port *port = tty->driver_data;
@@ -515,7 +515,7 @@ static int serial_tiocmset(struct tty_struct *tty, struct file *file,
515 dbg("%s - port %d", __func__, port->number); 515 dbg("%s - port %d", __func__, port->number);
516 516
517 if (port->serial->type->tiocmset) 517 if (port->serial->type->tiocmset)
518 return port->serial->type->tiocmset(tty, file, set, clear); 518 return port->serial->type->tiocmset(tty, set, clear);
519 return -EINVAL; 519 return -EINVAL;
520} 520}
521 521
diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h
index 3ab77c5d9819..c47b6ec03063 100644
--- a/drivers/usb/serial/usb-wwan.h
+++ b/drivers/usb/serial/usb-wwan.h
@@ -15,10 +15,10 @@ extern int usb_wwan_write_room(struct tty_struct *tty);
15extern void usb_wwan_set_termios(struct tty_struct *tty, 15extern void usb_wwan_set_termios(struct tty_struct *tty,
16 struct usb_serial_port *port, 16 struct usb_serial_port *port,
17 struct ktermios *old); 17 struct ktermios *old);
18extern int usb_wwan_tiocmget(struct tty_struct *tty, struct file *file); 18extern int usb_wwan_tiocmget(struct tty_struct *tty);
19extern int usb_wwan_tiocmset(struct tty_struct *tty, struct file *file, 19extern int usb_wwan_tiocmset(struct tty_struct *tty,
20 unsigned int set, unsigned int clear); 20 unsigned int set, unsigned int clear);
21extern int usb_wwan_ioctl(struct tty_struct *tty, struct file *file, 21extern int usb_wwan_ioctl(struct tty_struct *tty,
22 unsigned int cmd, unsigned long arg); 22 unsigned int cmd, unsigned long arg);
23extern int usb_wwan_send_setup(struct usb_serial_port *port); 23extern int usb_wwan_send_setup(struct usb_serial_port *port);
24extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, 24extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index b004b2a485c3..b38d77b389d4 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -79,7 +79,7 @@ void usb_wwan_set_termios(struct tty_struct *tty,
79} 79}
80EXPORT_SYMBOL(usb_wwan_set_termios); 80EXPORT_SYMBOL(usb_wwan_set_termios);
81 81
82int usb_wwan_tiocmget(struct tty_struct *tty, struct file *file) 82int usb_wwan_tiocmget(struct tty_struct *tty)
83{ 83{
84 struct usb_serial_port *port = tty->driver_data; 84 struct usb_serial_port *port = tty->driver_data;
85 unsigned int value; 85 unsigned int value;
@@ -98,7 +98,7 @@ int usb_wwan_tiocmget(struct tty_struct *tty, struct file *file)
98} 98}
99EXPORT_SYMBOL(usb_wwan_tiocmget); 99EXPORT_SYMBOL(usb_wwan_tiocmget);
100 100
101int usb_wwan_tiocmset(struct tty_struct *tty, struct file *file, 101int usb_wwan_tiocmset(struct tty_struct *tty,
102 unsigned int set, unsigned int clear) 102 unsigned int set, unsigned int clear)
103{ 103{
104 struct usb_serial_port *port = tty->driver_data; 104 struct usb_serial_port *port = tty->driver_data;
@@ -178,7 +178,7 @@ static int set_serial_info(struct usb_serial_port *port,
178 return retval; 178 return retval;
179} 179}
180 180
181int usb_wwan_ioctl(struct tty_struct *tty, struct file *file, 181int usb_wwan_ioctl(struct tty_struct *tty,
182 unsigned int cmd, unsigned long arg) 182 unsigned int cmd, unsigned long arg)
183{ 183{
184 struct usb_serial_port *port = tty->driver_data; 184 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 3f9ac88d588c..5b073bcc807b 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -152,12 +152,12 @@ static int whiteheat_write(struct tty_struct *tty,
152 struct usb_serial_port *port, 152 struct usb_serial_port *port,
153 const unsigned char *buf, int count); 153 const unsigned char *buf, int count);
154static int whiteheat_write_room(struct tty_struct *tty); 154static int whiteheat_write_room(struct tty_struct *tty);
155static int whiteheat_ioctl(struct tty_struct *tty, struct file *file, 155static int whiteheat_ioctl(struct tty_struct *tty,
156 unsigned int cmd, unsigned long arg); 156 unsigned int cmd, unsigned long arg);
157static void whiteheat_set_termios(struct tty_struct *tty, 157static void whiteheat_set_termios(struct tty_struct *tty,
158 struct usb_serial_port *port, struct ktermios *old); 158 struct usb_serial_port *port, struct ktermios *old);
159static int whiteheat_tiocmget(struct tty_struct *tty, struct file *file); 159static int whiteheat_tiocmget(struct tty_struct *tty);
160static int whiteheat_tiocmset(struct tty_struct *tty, struct file *file, 160static int whiteheat_tiocmset(struct tty_struct *tty,
161 unsigned int set, unsigned int clear); 161 unsigned int set, unsigned int clear);
162static void whiteheat_break_ctl(struct tty_struct *tty, int break_state); 162static void whiteheat_break_ctl(struct tty_struct *tty, int break_state);
163static int whiteheat_chars_in_buffer(struct tty_struct *tty); 163static int whiteheat_chars_in_buffer(struct tty_struct *tty);
@@ -833,7 +833,7 @@ static int whiteheat_write_room(struct tty_struct *tty)
833 return (room); 833 return (room);
834} 834}
835 835
836static int whiteheat_tiocmget(struct tty_struct *tty, struct file *file) 836static int whiteheat_tiocmget(struct tty_struct *tty)
837{ 837{
838 struct usb_serial_port *port = tty->driver_data; 838 struct usb_serial_port *port = tty->driver_data;
839 struct whiteheat_private *info = usb_get_serial_port_data(port); 839 struct whiteheat_private *info = usb_get_serial_port_data(port);
@@ -850,7 +850,7 @@ static int whiteheat_tiocmget(struct tty_struct *tty, struct file *file)
850 return modem_signals; 850 return modem_signals;
851} 851}
852 852
853static int whiteheat_tiocmset(struct tty_struct *tty, struct file *file, 853static int whiteheat_tiocmset(struct tty_struct *tty,
854 unsigned int set, unsigned int clear) 854 unsigned int set, unsigned int clear)
855{ 855{
856 struct usb_serial_port *port = tty->driver_data; 856 struct usb_serial_port *port = tty->driver_data;
@@ -874,7 +874,7 @@ static int whiteheat_tiocmset(struct tty_struct *tty, struct file *file,
874} 874}
875 875
876 876
877static int whiteheat_ioctl(struct tty_struct *tty, struct file *file, 877static int whiteheat_ioctl(struct tty_struct *tty,
878 unsigned int cmd, unsigned long arg) 878 unsigned int cmd, unsigned long arg)
879{ 879{
880 struct usb_serial_port *port = tty->driver_data; 880 struct usb_serial_port *port = tty->driver_data;