aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 15:16:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 15:16:17 -0400
commit507ffe4f3840ac24890a8123c702cf1b7fe4d33c (patch)
tree1046888f9db00f268a0056d7f6e427e21502f84c /include
parentfdc719b63ae35d6a2d8a2a2c76eed813294664bf (diff)
parent45efcb2d32d35f6509543e477568842d8467035d (diff)
Merge tag 'tty-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver update from Greg Kroah-Hartman: "Here's the big tty/serial driver merge request for 3.10-rc1 Once again, Jiri has a number of TTY driver fixes and cleanups, and Peter Hurley came through with a bunch of ldisc fixes that resolve a number of reported issues. There are some other serial driver cleanups as well. All of these have been in the linux-next tree for a while" * tag 'tty-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (117 commits) tty/serial/sirf: fix MODULE_DEVICE_TABLE serial: mxs: drop superfluous {get|put}_device serial: mxs: fix buffer overflow ARM: PL011: add support for extended FIFO-size of PL011-r1p5 serial_core.c: add put_device() after device_find_child() tty: Fix unsafe bit ops in tty_throttle_safe/unthrottle_safe serial: sccnxp: Replace pdata.init/exit with regulator API serial: sccnxp: Do not override device name TTY: pty, fix compilation warning TTY: rocket, fix compilation warning TTY: ircomm: fix DTR being raised on hang up TTY: synclinkmp: fix DTR being raised on hang up TTY: synclink_gt: fix DTR being raised on hang up TTY: synclink: fix DTR being raised on hang up serial: 8250_dw: Fix the stub for dw8250_probe_acpi() serial: 8250_dw: Convert to devm_ioremap() serial: 8250_dw: Set port capabilities based on CPR register serial: 8250_dw: Let ACPI code extract the DMA client info serial: 8250_dw: Support clk framework also with ACPI serial: 8250_dw: Enable runtime PM ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/amba/serial.h3
-rw-r--r--include/linux/platform_data/serial-sccnxp.h4
-rw-r--r--include/linux/serial_s3c.h260
-rw-r--r--include/linux/tty.h41
-rw-r--r--include/linux/tty_ldisc.h132
5 files changed, 366 insertions, 74 deletions
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h
index f612c783170f..62d9303c2837 100644
--- a/include/linux/amba/serial.h
+++ b/include/linux/amba/serial.h
@@ -203,6 +203,9 @@ struct amba_pl011_data {
203 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 203 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
204 void *dma_rx_param; 204 void *dma_rx_param;
205 void *dma_tx_param; 205 void *dma_tx_param;
206 bool dma_rx_poll_enable;
207 unsigned int dma_rx_poll_rate;
208 unsigned int dma_rx_poll_timeout;
206 void (*init) (void); 209 void (*init) (void);
207 void (*exit) (void); 210 void (*exit) (void);
208}; 211};
diff --git a/include/linux/platform_data/serial-sccnxp.h b/include/linux/platform_data/serial-sccnxp.h
index 215574d1e81d..bdc510d03245 100644
--- a/include/linux/platform_data/serial-sccnxp.h
+++ b/include/linux/platform_data/serial-sccnxp.h
@@ -86,10 +86,6 @@ struct sccnxp_pdata {
86 const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; 86 const u32 mctrl_cfg[SCCNXP_MAX_UARTS];
87 /* Timer value for polling mode (usecs) */ 87 /* Timer value for polling mode (usecs) */
88 const unsigned int poll_time_us; 88 const unsigned int poll_time_us;
89 /* Called during startup */
90 void (*init)(void);
91 /* Called before finish */
92 void (*exit)(void);
93}; 89};
94 90
95#endif 91#endif
diff --git a/include/linux/serial_s3c.h b/include/linux/serial_s3c.h
new file mode 100644
index 000000000000..907d9d1d56cf
--- /dev/null
+++ b/include/linux/serial_s3c.h
@@ -0,0 +1,260 @@
1/*
2 * Internal header file for Samsung S3C2410 serial ports (UART0-2)
3 *
4 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
5 *
6 * Additional defines, Copyright 2003 Simtec Electronics (linux@simtec.co.uk)
7 *
8 * Adapted from:
9 *
10 * Internal header file for MX1ADS serial ports (UART1 & 2)
11 *
12 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27*/
28
29#ifndef __ASM_ARM_REGS_SERIAL_H
30#define __ASM_ARM_REGS_SERIAL_H
31
32#define S3C2410_URXH (0x24)
33#define S3C2410_UTXH (0x20)
34#define S3C2410_ULCON (0x00)
35#define S3C2410_UCON (0x04)
36#define S3C2410_UFCON (0x08)
37#define S3C2410_UMCON (0x0C)
38#define S3C2410_UBRDIV (0x28)
39#define S3C2410_UTRSTAT (0x10)
40#define S3C2410_UERSTAT (0x14)
41#define S3C2410_UFSTAT (0x18)
42#define S3C2410_UMSTAT (0x1C)
43
44#define S3C2410_LCON_CFGMASK ((0xF<<3)|(0x3))
45
46#define S3C2410_LCON_CS5 (0x0)
47#define S3C2410_LCON_CS6 (0x1)
48#define S3C2410_LCON_CS7 (0x2)
49#define S3C2410_LCON_CS8 (0x3)
50#define S3C2410_LCON_CSMASK (0x3)
51
52#define S3C2410_LCON_PNONE (0x0)
53#define S3C2410_LCON_PEVEN (0x5 << 3)
54#define S3C2410_LCON_PODD (0x4 << 3)
55#define S3C2410_LCON_PMASK (0x7 << 3)
56
57#define S3C2410_LCON_STOPB (1<<2)
58#define S3C2410_LCON_IRM (1<<6)
59
60#define S3C2440_UCON_CLKMASK (3<<10)
61#define S3C2440_UCON_CLKSHIFT (10)
62#define S3C2440_UCON_PCLK (0<<10)
63#define S3C2440_UCON_UCLK (1<<10)
64#define S3C2440_UCON_PCLK2 (2<<10)
65#define S3C2440_UCON_FCLK (3<<10)
66#define S3C2443_UCON_EPLL (3<<10)
67
68#define S3C6400_UCON_CLKMASK (3<<10)
69#define S3C6400_UCON_CLKSHIFT (10)
70#define S3C6400_UCON_PCLK (0<<10)
71#define S3C6400_UCON_PCLK2 (2<<10)
72#define S3C6400_UCON_UCLK0 (1<<10)
73#define S3C6400_UCON_UCLK1 (3<<10)
74
75#define S3C2440_UCON2_FCLK_EN (1<<15)
76#define S3C2440_UCON0_DIVMASK (15 << 12)
77#define S3C2440_UCON1_DIVMASK (15 << 12)
78#define S3C2440_UCON2_DIVMASK (7 << 12)
79#define S3C2440_UCON_DIVSHIFT (12)
80
81#define S3C2412_UCON_CLKMASK (3<<10)
82#define S3C2412_UCON_CLKSHIFT (10)
83#define S3C2412_UCON_UCLK (1<<10)
84#define S3C2412_UCON_USYSCLK (3<<10)
85#define S3C2412_UCON_PCLK (0<<10)
86#define S3C2412_UCON_PCLK2 (2<<10)
87
88#define S3C2410_UCON_CLKMASK (1 << 10)
89#define S3C2410_UCON_CLKSHIFT (10)
90#define S3C2410_UCON_UCLK (1<<10)
91#define S3C2410_UCON_SBREAK (1<<4)
92
93#define S3C2410_UCON_TXILEVEL (1<<9)
94#define S3C2410_UCON_RXILEVEL (1<<8)
95#define S3C2410_UCON_TXIRQMODE (1<<2)
96#define S3C2410_UCON_RXIRQMODE (1<<0)
97#define S3C2410_UCON_RXFIFO_TOI (1<<7)
98#define S3C2443_UCON_RXERR_IRQEN (1<<6)
99#define S3C2443_UCON_LOOPBACK (1<<5)
100
101#define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
102 S3C2410_UCON_RXILEVEL | \
103 S3C2410_UCON_TXIRQMODE | \
104 S3C2410_UCON_RXIRQMODE | \
105 S3C2410_UCON_RXFIFO_TOI)
106
107#define S3C2410_UFCON_FIFOMODE (1<<0)
108#define S3C2410_UFCON_TXTRIG0 (0<<6)
109#define S3C2410_UFCON_RXTRIG8 (1<<4)
110#define S3C2410_UFCON_RXTRIG12 (2<<4)
111
112/* S3C2440 FIFO trigger levels */
113#define S3C2440_UFCON_RXTRIG1 (0<<4)
114#define S3C2440_UFCON_RXTRIG8 (1<<4)
115#define S3C2440_UFCON_RXTRIG16 (2<<4)
116#define S3C2440_UFCON_RXTRIG32 (3<<4)
117
118#define S3C2440_UFCON_TXTRIG0 (0<<6)
119#define S3C2440_UFCON_TXTRIG16 (1<<6)
120#define S3C2440_UFCON_TXTRIG32 (2<<6)
121#define S3C2440_UFCON_TXTRIG48 (3<<6)
122
123#define S3C2410_UFCON_RESETBOTH (3<<1)
124#define S3C2410_UFCON_RESETTX (1<<2)
125#define S3C2410_UFCON_RESETRX (1<<1)
126
127#define S3C2410_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
128 S3C2410_UFCON_TXTRIG0 | \
129 S3C2410_UFCON_RXTRIG8 )
130
131#define S3C2410_UMCOM_AFC (1<<4)
132#define S3C2410_UMCOM_RTS_LOW (1<<0)
133
134#define S3C2412_UMCON_AFC_63 (0<<5) /* same as s3c2443 */
135#define S3C2412_UMCON_AFC_56 (1<<5)
136#define S3C2412_UMCON_AFC_48 (2<<5)
137#define S3C2412_UMCON_AFC_40 (3<<5)
138#define S3C2412_UMCON_AFC_32 (4<<5)
139#define S3C2412_UMCON_AFC_24 (5<<5)
140#define S3C2412_UMCON_AFC_16 (6<<5)
141#define S3C2412_UMCON_AFC_8 (7<<5)
142
143#define S3C2410_UFSTAT_TXFULL (1<<9)
144#define S3C2410_UFSTAT_RXFULL (1<<8)
145#define S3C2410_UFSTAT_TXMASK (15<<4)
146#define S3C2410_UFSTAT_TXSHIFT (4)
147#define S3C2410_UFSTAT_RXMASK (15<<0)
148#define S3C2410_UFSTAT_RXSHIFT (0)
149
150/* UFSTAT S3C2443 same as S3C2440 */
151#define S3C2440_UFSTAT_TXFULL (1<<14)
152#define S3C2440_UFSTAT_RXFULL (1<<6)
153#define S3C2440_UFSTAT_TXSHIFT (8)
154#define S3C2440_UFSTAT_RXSHIFT (0)
155#define S3C2440_UFSTAT_TXMASK (63<<8)
156#define S3C2440_UFSTAT_RXMASK (63)
157
158#define S3C2410_UTRSTAT_TXE (1<<2)
159#define S3C2410_UTRSTAT_TXFE (1<<1)
160#define S3C2410_UTRSTAT_RXDR (1<<0)
161
162#define S3C2410_UERSTAT_OVERRUN (1<<0)
163#define S3C2410_UERSTAT_FRAME (1<<2)
164#define S3C2410_UERSTAT_BREAK (1<<3)
165#define S3C2443_UERSTAT_PARITY (1<<1)
166
167#define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \
168 S3C2410_UERSTAT_FRAME | \
169 S3C2410_UERSTAT_BREAK)
170
171#define S3C2410_UMSTAT_CTS (1<<0)
172#define S3C2410_UMSTAT_DeltaCTS (1<<2)
173
174#define S3C2443_DIVSLOT (0x2C)
175
176/* S3C64XX interrupt registers. */
177#define S3C64XX_UINTP 0x30
178#define S3C64XX_UINTSP 0x34
179#define S3C64XX_UINTM 0x38
180
181#define S3C64XX_UINTM_RXD (0)
182#define S3C64XX_UINTM_TXD (2)
183#define S3C64XX_UINTM_RXD_MSK (1 << S3C64XX_UINTM_RXD)
184#define S3C64XX_UINTM_TXD_MSK (1 << S3C64XX_UINTM_TXD)
185
186/* Following are specific to S5PV210 */
187#define S5PV210_UCON_CLKMASK (1<<10)
188#define S5PV210_UCON_CLKSHIFT (10)
189#define S5PV210_UCON_PCLK (0<<10)
190#define S5PV210_UCON_UCLK (1<<10)
191
192#define S5PV210_UFCON_TXTRIG0 (0<<8)
193#define S5PV210_UFCON_TXTRIG4 (1<<8)
194#define S5PV210_UFCON_TXTRIG8 (2<<8)
195#define S5PV210_UFCON_TXTRIG16 (3<<8)
196#define S5PV210_UFCON_TXTRIG32 (4<<8)
197#define S5PV210_UFCON_TXTRIG64 (5<<8)
198#define S5PV210_UFCON_TXTRIG128 (6<<8)
199#define S5PV210_UFCON_TXTRIG256 (7<<8)
200
201#define S5PV210_UFCON_RXTRIG1 (0<<4)
202#define S5PV210_UFCON_RXTRIG4 (1<<4)
203#define S5PV210_UFCON_RXTRIG8 (2<<4)
204#define S5PV210_UFCON_RXTRIG16 (3<<4)
205#define S5PV210_UFCON_RXTRIG32 (4<<4)
206#define S5PV210_UFCON_RXTRIG64 (5<<4)
207#define S5PV210_UFCON_RXTRIG128 (6<<4)
208#define S5PV210_UFCON_RXTRIG256 (7<<4)
209
210#define S5PV210_UFSTAT_TXFULL (1<<24)
211#define S5PV210_UFSTAT_RXFULL (1<<8)
212#define S5PV210_UFSTAT_TXMASK (255<<16)
213#define S5PV210_UFSTAT_TXSHIFT (16)
214#define S5PV210_UFSTAT_RXMASK (255<<0)
215#define S5PV210_UFSTAT_RXSHIFT (0)
216
217#define S3C2410_UCON_CLKSEL0 (1 << 0)
218#define S3C2410_UCON_CLKSEL1 (1 << 1)
219#define S3C2410_UCON_CLKSEL2 (1 << 2)
220#define S3C2410_UCON_CLKSEL3 (1 << 3)
221
222/* Default values for s5pv210 UCON and UFCON uart registers */
223#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
224 S3C2410_UCON_RXILEVEL | \
225 S3C2410_UCON_TXIRQMODE | \
226 S3C2410_UCON_RXIRQMODE | \
227 S3C2410_UCON_RXFIFO_TOI | \
228 S3C2443_UCON_RXERR_IRQEN)
229
230#define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
231 S5PV210_UFCON_TXTRIG4 | \
232 S5PV210_UFCON_RXTRIG4)
233
234#ifndef __ASSEMBLY__
235
236/* configuration structure for per-machine configurations for the
237 * serial port
238 *
239 * the pointer is setup by the machine specific initialisation from the
240 * arch/arm/mach-s3c2410/ directory.
241*/
242
243struct s3c2410_uartcfg {
244 unsigned char hwport; /* hardware port number */
245 unsigned char unused;
246 unsigned short flags;
247 upf_t uart_flags; /* default uart flags */
248 unsigned int clk_sel;
249
250 unsigned int has_fracval;
251
252 unsigned long ucon; /* value of ucon for port */
253 unsigned long ulcon; /* value of ulcon for port */
254 unsigned long ufcon; /* value of ufcon for port */
255};
256
257#endif /* __ASSEMBLY__ */
258
259#endif /* __ASM_ARM_REGS_SERIAL_H */
260
diff --git a/include/linux/tty.h b/include/linux/tty.h
index c75d886b0307..367a9dfc4ea2 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -255,9 +255,9 @@ struct tty_struct {
255 int count; 255 int count;
256 struct winsize winsize; /* termios mutex */ 256 struct winsize winsize; /* termios mutex */
257 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; 257 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1;
258 unsigned char warned:1;
259 unsigned char ctrl_status; /* ctrl_lock */ 258 unsigned char ctrl_status; /* ctrl_lock */
260 unsigned int receive_room; /* Bytes free for queue */ 259 unsigned int receive_room; /* Bytes free for queue */
260 int flow_change;
261 261
262 struct tty_struct *link; 262 struct tty_struct *link;
263 struct fasync_struct *fasync; 263 struct fasync_struct *fasync;
@@ -315,9 +315,25 @@ struct tty_file_private {
315#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 315#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
316#define TTY_HUPPED 18 /* Post driver->hangup() */ 316#define TTY_HUPPED 18 /* Post driver->hangup() */
317#define TTY_HUPPING 21 /* ->hangup() in progress */ 317#define TTY_HUPPING 21 /* ->hangup() in progress */
318#define TTY_LDISC_HALTED 22 /* Line discipline is halted */
318 319
319#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 320#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
320 321
322/* Values for tty->flow_change */
323#define TTY_THROTTLE_SAFE 1
324#define TTY_UNTHROTTLE_SAFE 2
325
326static inline void __tty_set_flow_change(struct tty_struct *tty, int val)
327{
328 tty->flow_change = val;
329}
330
331static inline void tty_set_flow_change(struct tty_struct *tty, int val)
332{
333 tty->flow_change = val;
334 smp_mb();
335}
336
321#ifdef CONFIG_TTY 337#ifdef CONFIG_TTY
322extern void console_init(void); 338extern void console_init(void);
323extern void tty_kref_put(struct tty_struct *tty); 339extern void tty_kref_put(struct tty_struct *tty);
@@ -400,6 +416,8 @@ extern int tty_write_room(struct tty_struct *tty);
400extern void tty_driver_flush_buffer(struct tty_struct *tty); 416extern void tty_driver_flush_buffer(struct tty_struct *tty);
401extern void tty_throttle(struct tty_struct *tty); 417extern void tty_throttle(struct tty_struct *tty);
402extern void tty_unthrottle(struct tty_struct *tty); 418extern void tty_unthrottle(struct tty_struct *tty);
419extern int tty_throttle_safe(struct tty_struct *tty);
420extern int tty_unthrottle_safe(struct tty_struct *tty);
403extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); 421extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
404extern void tty_driver_remove_tty(struct tty_driver *driver, 422extern void tty_driver_remove_tty(struct tty_driver *driver,
405 struct tty_struct *tty); 423 struct tty_struct *tty);
@@ -419,13 +437,28 @@ extern void tty_flush_to_ldisc(struct tty_struct *tty);
419extern void tty_buffer_free_all(struct tty_port *port); 437extern void tty_buffer_free_all(struct tty_port *port);
420extern void tty_buffer_flush(struct tty_struct *tty); 438extern void tty_buffer_flush(struct tty_struct *tty);
421extern void tty_buffer_init(struct tty_port *port); 439extern void tty_buffer_init(struct tty_port *port);
422extern speed_t tty_get_baud_rate(struct tty_struct *tty);
423extern speed_t tty_termios_baud_rate(struct ktermios *termios); 440extern speed_t tty_termios_baud_rate(struct ktermios *termios);
424extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); 441extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
425extern void tty_termios_encode_baud_rate(struct ktermios *termios, 442extern void tty_termios_encode_baud_rate(struct ktermios *termios,
426 speed_t ibaud, speed_t obaud); 443 speed_t ibaud, speed_t obaud);
427extern void tty_encode_baud_rate(struct tty_struct *tty, 444extern void tty_encode_baud_rate(struct tty_struct *tty,
428 speed_t ibaud, speed_t obaud); 445 speed_t ibaud, speed_t obaud);
446
447/**
448 * tty_get_baud_rate - get tty bit rates
449 * @tty: tty to query
450 *
451 * Returns the baud rate as an integer for this terminal. The
452 * termios lock must be held by the caller and the terminal bit
453 * flags may be updated.
454 *
455 * Locking: none
456 */
457static inline speed_t tty_get_baud_rate(struct tty_struct *tty)
458{
459 return tty_termios_baud_rate(&tty->termios);
460}
461
429extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); 462extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);
430extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); 463extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b);
431extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); 464extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
@@ -502,6 +535,8 @@ extern int tty_port_carrier_raised(struct tty_port *port);
502extern void tty_port_raise_dtr_rts(struct tty_port *port); 535extern void tty_port_raise_dtr_rts(struct tty_port *port);
503extern void tty_port_lower_dtr_rts(struct tty_port *port); 536extern void tty_port_lower_dtr_rts(struct tty_port *port);
504extern void tty_port_hangup(struct tty_port *port); 537extern void tty_port_hangup(struct tty_port *port);
538extern void tty_port_tty_hangup(struct tty_port *port, bool check_clocal);
539extern void tty_port_tty_wakeup(struct tty_port *port);
505extern int tty_port_block_til_ready(struct tty_port *port, 540extern int tty_port_block_til_ready(struct tty_port *port,
506 struct tty_struct *tty, struct file *filp); 541 struct tty_struct *tty, struct file *filp);
507extern int tty_port_close_start(struct tty_port *port, 542extern int tty_port_close_start(struct tty_port *port,
@@ -526,8 +561,6 @@ extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty);
526extern void tty_ldisc_init(struct tty_struct *tty); 561extern void tty_ldisc_init(struct tty_struct *tty);
527extern void tty_ldisc_deinit(struct tty_struct *tty); 562extern void tty_ldisc_deinit(struct tty_struct *tty);
528extern void tty_ldisc_begin(void); 563extern void tty_ldisc_begin(void);
529/* This last one is just for the tty layer internals and shouldn't be used elsewhere */
530extern void tty_ldisc_enable(struct tty_struct *tty);
531 564
532 565
533/* n_tty.c */ 566/* n_tty.c */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 455a0d7bf220..58390c73df8b 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -9,89 +9,89 @@
9 * 9 *
10 * int (*open)(struct tty_struct *); 10 * int (*open)(struct tty_struct *);
11 * 11 *
12 * This function is called when the line discipline is associated 12 * This function is called when the line discipline is associated
13 * with the tty. The line discipline can use this as an 13 * with the tty. The line discipline can use this as an
14 * opportunity to initialize any state needed by the ldisc routines. 14 * opportunity to initialize any state needed by the ldisc routines.
15 * 15 *
16 * void (*close)(struct tty_struct *); 16 * void (*close)(struct tty_struct *);
17 * 17 *
18 * This function is called when the line discipline is being 18 * This function is called when the line discipline is being
19 * shutdown, either because the tty is being closed or because 19 * shutdown, either because the tty is being closed or because
20 * the tty is being changed to use a new line discipline 20 * the tty is being changed to use a new line discipline
21 * 21 *
22 * void (*flush_buffer)(struct tty_struct *tty); 22 * void (*flush_buffer)(struct tty_struct *tty);
23 * 23 *
24 * This function instructs the line discipline to clear its 24 * This function instructs the line discipline to clear its
25 * buffers of any input characters it may have queued to be 25 * buffers of any input characters it may have queued to be
26 * delivered to the user mode process. 26 * delivered to the user mode process.
27 * 27 *
28 * ssize_t (*chars_in_buffer)(struct tty_struct *tty); 28 * ssize_t (*chars_in_buffer)(struct tty_struct *tty);
29 * 29 *
30 * This function returns the number of input characters the line 30 * This function returns the number of input characters the line
31 * discipline may have queued up to be delivered to the user mode 31 * discipline may have queued up to be delivered to the user mode
32 * process. 32 * process.
33 * 33 *
34 * ssize_t (*read)(struct tty_struct * tty, struct file * file, 34 * ssize_t (*read)(struct tty_struct * tty, struct file * file,
35 * unsigned char * buf, size_t nr); 35 * unsigned char * buf, size_t nr);
36 * 36 *
37 * This function is called when the user requests to read from 37 * This function is called when the user requests to read from
38 * the tty. The line discipline will return whatever characters 38 * the tty. The line discipline will return whatever characters
39 * it has buffered up for the user. If this function is not 39 * it has buffered up for the user. If this function is not
40 * defined, the user will receive an EIO error. 40 * defined, the user will receive an EIO error.
41 * 41 *
42 * ssize_t (*write)(struct tty_struct * tty, struct file * file, 42 * ssize_t (*write)(struct tty_struct * tty, struct file * file,
43 * const unsigned char * buf, size_t nr); 43 * const unsigned char * buf, size_t nr);
44 * 44 *
45 * This function is called when the user requests to write to the 45 * This function is called when the user requests to write to the
46 * tty. The line discipline will deliver the characters to the 46 * tty. The line discipline will deliver the characters to the
47 * low-level tty device for transmission, optionally performing 47 * low-level tty device for transmission, optionally performing
48 * some processing on the characters first. If this function is 48 * some processing on the characters first. If this function is
49 * not defined, the user will receive an EIO error. 49 * not defined, the user will receive an EIO error.
50 * 50 *
51 * int (*ioctl)(struct tty_struct * tty, struct file * file, 51 * int (*ioctl)(struct tty_struct * tty, struct file * file,
52 * unsigned int cmd, unsigned long arg); 52 * unsigned int cmd, unsigned long arg);
53 * 53 *
54 * This function is called when the user requests an ioctl which 54 * This function is called when the user requests an ioctl which
55 * is not handled by the tty layer or the low-level tty driver. 55 * is not handled by the tty layer or the low-level tty driver.
56 * It is intended for ioctls which affect line discpline 56 * It is intended for ioctls which affect line discpline
57 * operation. Note that the search order for ioctls is (1) tty 57 * operation. Note that the search order for ioctls is (1) tty
58 * layer, (2) tty low-level driver, (3) line discpline. So a 58 * layer, (2) tty low-level driver, (3) line discpline. So a
59 * low-level driver can "grab" an ioctl request before the line 59 * low-level driver can "grab" an ioctl request before the line
60 * discpline has a chance to see it. 60 * discpline has a chance to see it.
61 * 61 *
62 * long (*compat_ioctl)(struct tty_struct * tty, struct file * file, 62 * long (*compat_ioctl)(struct tty_struct * tty, struct file * file,
63 * unsigned int cmd, unsigned long arg); 63 * unsigned int cmd, unsigned long arg);
64 * 64 *
65 * Process ioctl calls from 32-bit process on 64-bit system 65 * Process ioctl calls from 32-bit process on 64-bit system
66 * 66 *
67 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); 67 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
68 * 68 *
69 * This function notifies the line discpline that a change has 69 * This function notifies the line discpline that a change has
70 * been made to the termios structure. 70 * been made to the termios structure.
71 * 71 *
72 * int (*poll)(struct tty_struct * tty, struct file * file, 72 * int (*poll)(struct tty_struct * tty, struct file * file,
73 * poll_table *wait); 73 * poll_table *wait);
74 * 74 *
75 * This function is called when a user attempts to select/poll on a 75 * This function is called when a user attempts to select/poll on a
76 * tty device. It is solely the responsibility of the line 76 * tty device. It is solely the responsibility of the line
77 * discipline to handle poll requests. 77 * discipline to handle poll requests.
78 * 78 *
79 * void (*receive_buf)(struct tty_struct *, const unsigned char *cp, 79 * void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
80 * char *fp, int count); 80 * char *fp, int count);
81 * 81 *
82 * This function is called by the low-level tty driver to send 82 * This function is called by the low-level tty driver to send
83 * characters received by the hardware to the line discpline for 83 * characters received by the hardware to the line discpline for
84 * processing. <cp> is a pointer to the buffer of input 84 * processing. <cp> is a pointer to the buffer of input
85 * character received by the device. <fp> is a pointer to a 85 * character received by the device. <fp> is a pointer to a
86 * pointer of flag bytes which indicate whether a character was 86 * pointer of flag bytes which indicate whether a character was
87 * received with a parity error, etc. 87 * received with a parity error, etc.
88 * 88 *
89 * void (*write_wakeup)(struct tty_struct *); 89 * void (*write_wakeup)(struct tty_struct *);
90 * 90 *
91 * This function is called by the low-level tty driver to signal 91 * This function is called by the low-level tty driver to signal
92 * that line discpline should try to send more characters to the 92 * that line discpline should try to send more characters to the
93 * low-level driver for transmission. If the line discpline does 93 * low-level driver for transmission. If the line discpline does
94 * not have any more data to send, it can just return. 94 * not have any more data to send, it can just return.
95 * 95 *
96 * int (*hangup)(struct tty_struct *) 96 * int (*hangup)(struct tty_struct *)
97 * 97 *
@@ -115,7 +115,7 @@ struct tty_ldisc_ops {
115 char *name; 115 char *name;
116 int num; 116 int num;
117 int flags; 117 int flags;
118 118
119 /* 119 /*
120 * The following routines are called from above. 120 * The following routines are called from above.
121 */ 121 */
@@ -123,19 +123,19 @@ struct tty_ldisc_ops {
123 void (*close)(struct tty_struct *); 123 void (*close)(struct tty_struct *);
124 void (*flush_buffer)(struct tty_struct *tty); 124 void (*flush_buffer)(struct tty_struct *tty);
125 ssize_t (*chars_in_buffer)(struct tty_struct *tty); 125 ssize_t (*chars_in_buffer)(struct tty_struct *tty);
126 ssize_t (*read)(struct tty_struct * tty, struct file * file, 126 ssize_t (*read)(struct tty_struct *tty, struct file *file,
127 unsigned char __user * buf, size_t nr); 127 unsigned char __user *buf, size_t nr);
128 ssize_t (*write)(struct tty_struct * tty, struct file * file, 128 ssize_t (*write)(struct tty_struct *tty, struct file *file,
129 const unsigned char * buf, size_t nr); 129 const unsigned char *buf, size_t nr);
130 int (*ioctl)(struct tty_struct * tty, struct file * file, 130 int (*ioctl)(struct tty_struct *tty, struct file *file,
131 unsigned int cmd, unsigned long arg); 131 unsigned int cmd, unsigned long arg);
132 long (*compat_ioctl)(struct tty_struct * tty, struct file * file, 132 long (*compat_ioctl)(struct tty_struct *tty, struct file *file,
133 unsigned int cmd, unsigned long arg); 133 unsigned int cmd, unsigned long arg);
134 void (*set_termios)(struct tty_struct *tty, struct ktermios * old); 134 void (*set_termios)(struct tty_struct *tty, struct ktermios *old);
135 unsigned int (*poll)(struct tty_struct *, struct file *, 135 unsigned int (*poll)(struct tty_struct *, struct file *,
136 struct poll_table_struct *); 136 struct poll_table_struct *);
137 int (*hangup)(struct tty_struct *tty); 137 int (*hangup)(struct tty_struct *tty);
138 138
139 /* 139 /*
140 * The following routines are called from below. 140 * The following routines are called from below.
141 */ 141 */
@@ -145,7 +145,7 @@ struct tty_ldisc_ops {
145 void (*dcd_change)(struct tty_struct *, unsigned int); 145 void (*dcd_change)(struct tty_struct *, unsigned int);
146 146
147 struct module *owner; 147 struct module *owner;
148 148
149 int refcount; 149 int refcount;
150}; 150};
151 151