aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/console.h5
-rw-r--r--include/linux/kgdb.h1
-rw-r--r--include/linux/of_serial.h17
-rw-r--r--include/linux/pci_ids.h15
-rw-r--r--include/linux/platform_data/s3c-hsotg.h2
-rw-r--r--include/linux/platform_data/serial-sccnxp.h (renamed from include/linux/platform_data/sccnxp.h)6
-rw-r--r--include/linux/pps_kernel.h17
-rw-r--r--include/linux/proc_fs.h5
-rw-r--r--include/linux/serial_8250.h4
-rw-r--r--include/linux/serial_core.h26
-rw-r--r--include/linux/sunserialcore.h4
-rw-r--r--include/linux/tty.h50
-rw-r--r--include/linux/tty_driver.h1
-rw-r--r--include/linux/tty_flip.h28
-rw-r--r--include/linux/tty_ldisc.h11
15 files changed, 129 insertions, 63 deletions
diff --git a/include/linux/console.h b/include/linux/console.h
index dedb082fe50f..3b709da1786e 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -157,7 +157,12 @@ extern int is_console_locked(void);
157extern int braille_register_console(struct console *, int index, 157extern int braille_register_console(struct console *, int index,
158 char *console_options, char *braille_options); 158 char *console_options, char *braille_options);
159extern int braille_unregister_console(struct console *); 159extern int braille_unregister_console(struct console *);
160#ifdef CONFIG_TTY
160extern void console_sysfs_notify(void); 161extern void console_sysfs_notify(void);
162#else
163static inline void console_sysfs_notify(void)
164{ }
165#endif
161extern bool console_suspend_enabled; 166extern bool console_suspend_enabled;
162 167
163/* Suspend and resume console messages over PM events */ 168/* Suspend and resume console messages over PM events */
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index 4dff0c6ed58f..c6e091bf39a5 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -13,7 +13,6 @@
13#ifndef _KGDB_H_ 13#ifndef _KGDB_H_
14#define _KGDB_H_ 14#define _KGDB_H_
15 15
16#include <linux/serial_8250.h>
17#include <linux/linkage.h> 16#include <linux/linkage.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/atomic.h> 18#include <linux/atomic.h>
diff --git a/include/linux/of_serial.h b/include/linux/of_serial.h
deleted file mode 100644
index 4a73ed80b4c0..000000000000
--- a/include/linux/of_serial.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef __LINUX_OF_SERIAL_H
2#define __LINUX_OF_SERIAL_H
3
4/*
5 * FIXME remove this file when tegra finishes conversion to open firmware,
6 * expectation is that all quirks will then be self-contained in
7 * drivers/tty/serial/of_serial.c.
8 */
9#ifdef CONFIG_ARCH_TEGRA
10extern void tegra_serial_handle_break(struct uart_port *port);
11#else
12static inline void tegra_serial_handle_break(struct uart_port *port)
13{
14}
15#endif
16
17#endif /* __LINUX_OF_SERIAL */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 6938ccfa42d5..31717bd287fd 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1870,8 +1870,23 @@
1870#define PCI_VENDOR_ID_QUATECH 0x135C 1870#define PCI_VENDOR_ID_QUATECH 0x135C
1871#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 1871#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
1872#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 1872#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
1873#define PCI_DEVICE_ID_QUATECH_DSC200 0x0030
1874#define PCI_DEVICE_ID_QUATECH_QSC200 0x0040
1873#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 1875#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
1874#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 1876#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
1877#define PCI_DEVICE_ID_QUATECH_QSCP100 0x0120
1878#define PCI_DEVICE_ID_QUATECH_DSCP100 0x0130
1879#define PCI_DEVICE_ID_QUATECH_QSCP200 0x0140
1880#define PCI_DEVICE_ID_QUATECH_DSCP200 0x0150
1881#define PCI_DEVICE_ID_QUATECH_QSCLP100 0x0170
1882#define PCI_DEVICE_ID_QUATECH_DSCLP100 0x0180
1883#define PCI_DEVICE_ID_QUATECH_DSC100E 0x0181
1884#define PCI_DEVICE_ID_QUATECH_SSCLP100 0x0190
1885#define PCI_DEVICE_ID_QUATECH_QSCLP200 0x01A0
1886#define PCI_DEVICE_ID_QUATECH_DSCLP200 0x01B0
1887#define PCI_DEVICE_ID_QUATECH_DSC200E 0x01B1
1888#define PCI_DEVICE_ID_QUATECH_SSCLP200 0x01C0
1889#define PCI_DEVICE_ID_QUATECH_ESCLP100 0x01E0
1875#define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278 1890#define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278
1876 1891
1877#define PCI_VENDOR_ID_SEALEVEL 0x135e 1892#define PCI_VENDOR_ID_SEALEVEL 0x135e
diff --git a/include/linux/platform_data/s3c-hsotg.h b/include/linux/platform_data/s3c-hsotg.h
index 8b79e0967f9c..3f1cbf95ec3b 100644
--- a/include/linux/platform_data/s3c-hsotg.h
+++ b/include/linux/platform_data/s3c-hsotg.h
@@ -15,6 +15,8 @@
15#ifndef __LINUX_USB_S3C_HSOTG_H 15#ifndef __LINUX_USB_S3C_HSOTG_H
16#define __LINUX_USB_S3C_HSOTG_H 16#define __LINUX_USB_S3C_HSOTG_H
17 17
18struct platform_device;
19
18enum s3c_hsotg_dmamode { 20enum s3c_hsotg_dmamode {
19 S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ 21 S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */
20 S3C_HSOTG_DMA_ONLY, /* always use DMA */ 22 S3C_HSOTG_DMA_ONLY, /* always use DMA */
diff --git a/include/linux/platform_data/sccnxp.h b/include/linux/platform_data/serial-sccnxp.h
index 7311ccd3217f..215574d1e81d 100644
--- a/include/linux/platform_data/sccnxp.h
+++ b/include/linux/platform_data/serial-sccnxp.h
@@ -11,8 +11,8 @@
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13 13
14#ifndef __SCCNXP_H 14#ifndef _PLATFORM_DATA_SERIAL_SCCNXP_H_
15#define __SCCNXP_H 15#define _PLATFORM_DATA_SERIAL_SCCNXP_H_
16 16
17#define SCCNXP_MAX_UARTS 2 17#define SCCNXP_MAX_UARTS 2
18 18
@@ -84,6 +84,8 @@ struct sccnxp_pdata {
84 const u8 reg_shift; 84 const u8 reg_shift;
85 /* Modem control lines configuration */ 85 /* Modem control lines configuration */
86 const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; 86 const u32 mctrl_cfg[SCCNXP_MAX_UARTS];
87 /* Timer value for polling mode (usecs) */
88 const unsigned int poll_time_us;
87 /* Called during startup */ 89 /* Called during startup */
88 void (*init)(void); 90 void (*init)(void);
89 /* Called before finish */ 91 /* Called before finish */
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 0cc45ae1afd5..7db3eb93a079 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -43,7 +43,7 @@ struct pps_source_info {
43 int event, void *data); /* PPS echo function */ 43 int event, void *data); /* PPS echo function */
44 44
45 struct module *owner; 45 struct module *owner;
46 struct device *dev; 46 struct device *dev; /* Parent device for device_create */
47}; 47};
48 48
49struct pps_event_time { 49struct pps_event_time {
@@ -69,6 +69,7 @@ struct pps_device {
69 wait_queue_head_t queue; /* PPS event queue */ 69 wait_queue_head_t queue; /* PPS event queue */
70 70
71 unsigned int id; /* PPS source unique ID */ 71 unsigned int id; /* PPS source unique ID */
72 void const *lookup_cookie; /* pps_lookup_dev only */
72 struct cdev cdev; 73 struct cdev cdev;
73 struct device *dev; 74 struct device *dev;
74 struct fasync_struct *async_queue; /* fasync method */ 75 struct fasync_struct *async_queue; /* fasync method */
@@ -82,16 +83,26 @@ struct pps_device {
82extern struct device_attribute pps_attrs[]; 83extern struct device_attribute pps_attrs[];
83 84
84/* 85/*
86 * Internal functions.
87 *
88 * These are not actually part of the exported API, but this is a
89 * convenient header file to put them in.
90 */
91
92extern int pps_register_cdev(struct pps_device *pps);
93extern void pps_unregister_cdev(struct pps_device *pps);
94
95/*
85 * Exported functions 96 * Exported functions
86 */ 97 */
87 98
88extern struct pps_device *pps_register_source( 99extern struct pps_device *pps_register_source(
89 struct pps_source_info *info, int default_params); 100 struct pps_source_info *info, int default_params);
90extern void pps_unregister_source(struct pps_device *pps); 101extern void pps_unregister_source(struct pps_device *pps);
91extern int pps_register_cdev(struct pps_device *pps);
92extern void pps_unregister_cdev(struct pps_device *pps);
93extern void pps_event(struct pps_device *pps, 102extern void pps_event(struct pps_device *pps,
94 struct pps_event_time *ts, int event, void *data); 103 struct pps_event_time *ts, int event, void *data);
104/* Look up a pps device by magic cookie */
105struct pps_device *pps_lookup_dev(void const *cookie);
95 106
96static inline void timespec_to_pps_ktime(struct pps_ktime *kt, 107static inline void timespec_to_pps_ktime(struct pps_ktime *kt,
97 struct timespec ts) 108 struct timespec ts)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index d0a1f2ca1c3f..8307f2f94d86 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -127,7 +127,12 @@ extern void pid_ns_release_proc(struct pid_namespace *ns);
127 * proc_tty.c 127 * proc_tty.c
128 */ 128 */
129struct tty_driver; 129struct tty_driver;
130#ifdef CONFIG_TTY
130extern void proc_tty_init(void); 131extern void proc_tty_init(void);
132#else
133static inline void proc_tty_init(void)
134{ }
135#endif
131extern void proc_tty_register_driver(struct tty_driver *driver); 136extern void proc_tty_register_driver(struct tty_driver *driver);
132extern void proc_tty_unregister_driver(struct tty_driver *driver); 137extern void proc_tty_unregister_driver(struct tty_driver *driver);
133 138
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index c490d20b3fb8..af47a8af6024 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -59,6 +59,8 @@ enum {
59 PLAT8250_DEV_SM501, 59 PLAT8250_DEV_SM501,
60}; 60};
61 61
62struct uart_8250_dma;
63
62/* 64/*
63 * This should be used by drivers which want to register 65 * This should be used by drivers which want to register
64 * their own 8250 ports without registering their own 66 * their own 8250 ports without registering their own
@@ -91,6 +93,8 @@ struct uart_8250_port {
91#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA 93#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
92 unsigned char msr_saved_flags; 94 unsigned char msr_saved_flags;
93 95
96 struct uart_8250_dma *dma;
97
94 /* 8250 specific callbacks */ 98 /* 8250 specific callbacks */
95 int (*dl_read)(struct uart_8250_port *); 99 int (*dl_read)(struct uart_8250_port *);
96 void (*dl_write)(struct uart_8250_port *, int); 100 void (*dl_write)(struct uart_8250_port *, int);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c6690a2a27fb..87d4bbc773fc 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -29,7 +29,6 @@
29#include <linux/tty.h> 29#include <linux/tty.h>
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/sysrq.h> 31#include <linux/sysrq.h>
32#include <linux/pps_kernel.h>
33#include <uapi/linux/serial_core.h> 32#include <uapi/linux/serial_core.h>
34 33
35struct uart_port; 34struct uart_port;
@@ -37,8 +36,8 @@ struct serial_struct;
37struct device; 36struct device;
38 37
39/* 38/*
40 * This structure describes all the operations that can be 39 * This structure describes all the operations that can be done on the
41 * done on the physical hardware. 40 * physical hardware. See Documentation/serial/driver for details.
42 */ 41 */
43struct uart_ops { 42struct uart_ops {
44 unsigned int (*tx_empty)(struct uart_port *); 43 unsigned int (*tx_empty)(struct uart_port *);
@@ -65,7 +64,7 @@ struct uart_ops {
65 /* 64 /*
66 * Return a string describing the type of the port 65 * Return a string describing the type of the port
67 */ 66 */
68 const char *(*type)(struct uart_port *); 67 const char *(*type)(struct uart_port *);
69 68
70 /* 69 /*
71 * Release IO and memory resources used by the port. 70 * Release IO and memory resources used by the port.
@@ -83,7 +82,7 @@ struct uart_ops {
83 int (*ioctl)(struct uart_port *, unsigned int, unsigned long); 82 int (*ioctl)(struct uart_port *, unsigned int, unsigned long);
84#ifdef CONFIG_CONSOLE_POLL 83#ifdef CONFIG_CONSOLE_POLL
85 int (*poll_init)(struct uart_port *); 84 int (*poll_init)(struct uart_port *);
86 void (*poll_put_char)(struct uart_port *, unsigned char); 85 void (*poll_put_char)(struct uart_port *, unsigned char);
87 int (*poll_get_char)(struct uart_port *); 86 int (*poll_get_char)(struct uart_port *);
88#endif 87#endif
89}; 88};
@@ -134,9 +133,8 @@ struct uart_port {
134#define UPIO_HUB6 (1) 133#define UPIO_HUB6 (1)
135#define UPIO_MEM (2) 134#define UPIO_MEM (2)
136#define UPIO_MEM32 (3) 135#define UPIO_MEM32 (3)
137#define UPIO_AU (4) /* Au1x00 type IO */ 136#define UPIO_AU (4) /* Au1x00 and RT288x type IO */
138#define UPIO_TSI (5) /* Tsi108/109 type IO */ 137#define UPIO_TSI (5) /* Tsi108/109 type IO */
139#define UPIO_RM9000 (6) /* RM9000 type IO */
140 138
141 unsigned int read_status_mask; /* driver specific */ 139 unsigned int read_status_mask; /* driver specific */
142 unsigned int ignore_status_mask; /* driver specific */ 140 unsigned int ignore_status_mask; /* driver specific */
@@ -208,13 +206,25 @@ static inline void serial_port_out(struct uart_port *up, int offset, int value)
208 up->serial_out(up, offset, value); 206 up->serial_out(up, offset, value);
209} 207}
210 208
209/**
210 * enum uart_pm_state - power states for UARTs
211 * @UART_PM_STATE_ON: UART is powered, up and operational
212 * @UART_PM_STATE_OFF: UART is powered off
213 * @UART_PM_STATE_UNDEFINED: sentinel
214 */
215enum uart_pm_state {
216 UART_PM_STATE_ON = 0,
217 UART_PM_STATE_OFF = 3, /* number taken from ACPI */
218 UART_PM_STATE_UNDEFINED,
219};
220
211/* 221/*
212 * This is the state information which is persistent across opens. 222 * This is the state information which is persistent across opens.
213 */ 223 */
214struct uart_state { 224struct uart_state {
215 struct tty_port port; 225 struct tty_port port;
216 226
217 int pm_state; 227 enum uart_pm_state pm_state;
218 struct circ_buf xmit; 228 struct circ_buf xmit;
219 229
220 struct uart_port *uart_port; 230 struct uart_port *uart_port;
diff --git a/include/linux/sunserialcore.h b/include/linux/sunserialcore.h
index 68e7430bb0fe..dbe4d7fca1b8 100644
--- a/include/linux/sunserialcore.h
+++ b/include/linux/sunserialcore.h
@@ -13,6 +13,10 @@
13#ifndef _SERIAL_SUN_H 13#ifndef _SERIAL_SUN_H
14#define _SERIAL_SUN_H 14#define _SERIAL_SUN_H
15 15
16#include <linux/device.h>
17#include <linux/serial_core.h>
18#include <linux/console.h>
19
16/* Serial keyboard defines for L1-A processing... */ 20/* Serial keyboard defines for L1-A processing... */
17#define SUNKBD_RESET 0xff 21#define SUNKBD_RESET 0xff
18#define SUNKBD_L1 0x01 22#define SUNKBD_L1 0x01
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 8db1b569c37a..c75d886b0307 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -202,7 +202,8 @@ struct tty_port {
202 unsigned long iflags; /* TTYP_ internal flags */ 202 unsigned long iflags; /* TTYP_ internal flags */
203#define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ 203#define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */
204#define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ 204#define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */
205 unsigned char console:1; /* port is a console */ 205 unsigned char console:1, /* port is a console */
206 low_latency:1; /* direct buffer flush */
206 struct mutex mutex; /* Locking */ 207 struct mutex mutex; /* Locking */
207 struct mutex buf_mutex; /* Buffer alloc lock */ 208 struct mutex buf_mutex; /* Buffer alloc lock */
208 unsigned char *xmit_buf; /* Optional buffer */ 209 unsigned char *xmit_buf; /* Optional buffer */
@@ -254,7 +255,7 @@ struct tty_struct {
254 int count; 255 int count;
255 struct winsize winsize; /* termios mutex */ 256 struct winsize winsize; /* termios mutex */
256 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;
257 unsigned char low_latency:1, warned:1; 258 unsigned char warned:1;
258 unsigned char ctrl_status; /* ctrl_lock */ 259 unsigned char ctrl_status; /* ctrl_lock */
259 unsigned int receive_room; /* Bytes free for queue */ 260 unsigned int receive_room; /* Bytes free for queue */
260 261
@@ -317,11 +318,43 @@ struct tty_file_private {
317 318
318#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 319#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
319 320
321#ifdef CONFIG_TTY
322extern void console_init(void);
323extern void tty_kref_put(struct tty_struct *tty);
324extern struct pid *tty_get_pgrp(struct tty_struct *tty);
325extern void tty_vhangup_self(void);
326extern void disassociate_ctty(int priv);
327extern dev_t tty_devnum(struct tty_struct *tty);
328extern void proc_clear_tty(struct task_struct *p);
329extern struct tty_struct *get_current_tty(void);
330/* tty_io.c */
331extern int __init tty_init(void);
332#else
333static inline void console_init(void)
334{ }
335static inline void tty_kref_put(struct tty_struct *tty)
336{ }
337static inline struct pid *tty_get_pgrp(struct tty_struct *tty)
338{ return NULL; }
339static inline void tty_vhangup_self(void)
340{ }
341static inline void disassociate_ctty(int priv)
342{ }
343static inline dev_t tty_devnum(struct tty_struct *tty)
344{ return 0; }
345static inline void proc_clear_tty(struct task_struct *p)
346{ }
347static inline struct tty_struct *get_current_tty(void)
348{ return NULL; }
349/* tty_io.c */
350static inline int __init tty_init(void)
351{ return 0; }
352#endif
353
320extern void tty_write_flush(struct tty_struct *); 354extern void tty_write_flush(struct tty_struct *);
321 355
322extern struct ktermios tty_std_termios; 356extern struct ktermios tty_std_termios;
323 357
324extern void console_init(void);
325extern int vcs_init(void); 358extern int vcs_init(void);
326 359
327extern struct class *tty_class; 360extern struct class *tty_class;
@@ -341,7 +374,6 @@ static inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
341 kref_get(&tty->kref); 374 kref_get(&tty->kref);
342 return tty; 375 return tty;
343} 376}
344extern void tty_kref_put(struct tty_struct *tty);
345 377
346extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, 378extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
347 const char *routine); 379 const char *routine);
@@ -373,20 +405,16 @@ extern void tty_driver_remove_tty(struct tty_driver *driver,
373 struct tty_struct *tty); 405 struct tty_struct *tty);
374extern void tty_free_termios(struct tty_struct *tty); 406extern void tty_free_termios(struct tty_struct *tty);
375extern int is_current_pgrp_orphaned(void); 407extern int is_current_pgrp_orphaned(void);
376extern struct pid *tty_get_pgrp(struct tty_struct *tty);
377extern int is_ignored(int sig); 408extern int is_ignored(int sig);
378extern int tty_signal(int sig, struct tty_struct *tty); 409extern int tty_signal(int sig, struct tty_struct *tty);
379extern void tty_hangup(struct tty_struct *tty); 410extern void tty_hangup(struct tty_struct *tty);
380extern void tty_vhangup(struct tty_struct *tty); 411extern void tty_vhangup(struct tty_struct *tty);
381extern void tty_vhangup_locked(struct tty_struct *tty); 412extern void tty_vhangup_locked(struct tty_struct *tty);
382extern void tty_vhangup_self(void);
383extern void tty_unhangup(struct file *filp); 413extern void tty_unhangup(struct file *filp);
384extern int tty_hung_up_p(struct file *filp); 414extern int tty_hung_up_p(struct file *filp);
385extern void do_SAK(struct tty_struct *tty); 415extern void do_SAK(struct tty_struct *tty);
386extern void __do_SAK(struct tty_struct *tty); 416extern void __do_SAK(struct tty_struct *tty);
387extern void disassociate_ctty(int priv);
388extern void no_tty(void); 417extern void no_tty(void);
389extern void tty_flip_buffer_push(struct tty_struct *tty);
390extern void tty_flush_to_ldisc(struct tty_struct *tty); 418extern void tty_flush_to_ldisc(struct tty_struct *tty);
391extern void tty_buffer_free_all(struct tty_port *port); 419extern void tty_buffer_free_all(struct tty_port *port);
392extern void tty_buffer_flush(struct tty_struct *tty); 420extern void tty_buffer_flush(struct tty_struct *tty);
@@ -415,9 +443,6 @@ extern long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
415extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, 443extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
416 unsigned int cmd, unsigned long arg); 444 unsigned int cmd, unsigned long arg);
417extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); 445extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg);
418extern dev_t tty_devnum(struct tty_struct *tty);
419extern void proc_clear_tty(struct task_struct *p);
420extern struct tty_struct *get_current_tty(void);
421extern void tty_default_fops(struct file_operations *fops); 446extern void tty_default_fops(struct file_operations *fops);
422extern struct tty_struct *alloc_tty_struct(void); 447extern struct tty_struct *alloc_tty_struct(void);
423extern int tty_alloc_file(struct file *file); 448extern int tty_alloc_file(struct file *file);
@@ -543,9 +568,6 @@ static inline int tty_audit_push_task(struct task_struct *tsk,
543} 568}
544#endif 569#endif
545 570
546/* tty_io.c */
547extern int __init tty_init(void);
548
549/* tty_ioctl.c */ 571/* tty_ioctl.c */
550extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, 572extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
551 unsigned int cmd, unsigned long arg); 573 unsigned int cmd, unsigned long arg);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index dd976cfb6131..756a60989294 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -40,6 +40,7 @@
40 * void (*close)(struct tty_struct * tty, struct file * filp); 40 * void (*close)(struct tty_struct * tty, struct file * filp);
41 * 41 *
42 * This routine is called when a particular tty device is closed. 42 * This routine is called when a particular tty device is closed.
43 * Note: called even if the corresponding open() failed.
43 * 44 *
44 * Required method. 45 * Required method.
45 * 46 *
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 2002344ed36a..e0f252633b47 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -1,28 +1,34 @@
1#ifndef _LINUX_TTY_FLIP_H 1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); 4extern int tty_buffer_request_room(struct tty_port *port, size_t size);
5extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); 5extern int tty_insert_flip_string_flags(struct tty_port *port,
6extern int tty_insert_flip_string_fixed_flag(struct tty_struct *tty, const unsigned char *chars, char flag, size_t size); 6 const unsigned char *chars, const char *flags, size_t size);
7extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); 7extern int tty_insert_flip_string_fixed_flag(struct tty_port *port,
8extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); 8 const unsigned char *chars, char flag, size_t size);
9void tty_schedule_flip(struct tty_struct *tty); 9extern int tty_prepare_flip_string(struct tty_port *port,
10 unsigned char **chars, size_t size);
11extern int tty_prepare_flip_string_flags(struct tty_port *port,
12 unsigned char **chars, char **flags, size_t size);
13extern void tty_flip_buffer_push(struct tty_port *port);
14void tty_schedule_flip(struct tty_port *port);
10 15
11static inline int tty_insert_flip_char(struct tty_struct *tty, 16static inline int tty_insert_flip_char(struct tty_port *port,
12 unsigned char ch, char flag) 17 unsigned char ch, char flag)
13{ 18{
14 struct tty_buffer *tb = tty->port->buf.tail; 19 struct tty_buffer *tb = port->buf.tail;
15 if (tb && tb->used < tb->size) { 20 if (tb && tb->used < tb->size) {
16 tb->flag_buf_ptr[tb->used] = flag; 21 tb->flag_buf_ptr[tb->used] = flag;
17 tb->char_buf_ptr[tb->used++] = ch; 22 tb->char_buf_ptr[tb->used++] = ch;
18 return 1; 23 return 1;
19 } 24 }
20 return tty_insert_flip_string_flags(tty, &ch, &flag, 1); 25 return tty_insert_flip_string_flags(port, &ch, &flag, 1);
21} 26}
22 27
23static inline int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size) 28static inline int tty_insert_flip_string(struct tty_port *port,
29 const unsigned char *chars, size_t size)
24{ 30{
25 return tty_insert_flip_string_fixed_flag(tty, chars, TTY_NORMAL, size); 31 return tty_insert_flip_string_fixed_flag(port, chars, TTY_NORMAL, size);
26} 32}
27 33
28#endif /* _LINUX_TTY_FLIP_H */ 34#endif /* _LINUX_TTY_FLIP_H */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index fb79dd8d1537..455a0d7bf220 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -100,16 +100,14 @@
100 * seek to perform this action quickly but should wait until 100 * seek to perform this action quickly but should wait until
101 * any pending driver I/O is completed. 101 * any pending driver I/O is completed.
102 * 102 *
103 * void (*dcd_change)(struct tty_struct *tty, unsigned int status, 103 * void (*dcd_change)(struct tty_struct *tty, unsigned int status)
104 * struct pps_event_time *ts)
105 * 104 *
106 * Tells the discipline that the DCD pin has changed its status and 105 * Tells the discipline that the DCD pin has changed its status.
107 * the relative timestamp. Pointer ts cannot be NULL. 106 * Used exclusively by the N_PPS (Pulse-Per-Second) line discipline.
108 */ 107 */
109 108
110#include <linux/fs.h> 109#include <linux/fs.h>
111#include <linux/wait.h> 110#include <linux/wait.h>
112#include <linux/pps_kernel.h>
113#include <linux/wait.h> 111#include <linux/wait.h>
114 112
115struct tty_ldisc_ops { 113struct tty_ldisc_ops {
@@ -144,8 +142,7 @@ struct tty_ldisc_ops {
144 void (*receive_buf)(struct tty_struct *, const unsigned char *cp, 142 void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
145 char *fp, int count); 143 char *fp, int count);
146 void (*write_wakeup)(struct tty_struct *); 144 void (*write_wakeup)(struct tty_struct *);
147 void (*dcd_change)(struct tty_struct *, unsigned int, 145 void (*dcd_change)(struct tty_struct *, unsigned int);
148 struct pps_event_time *);
149 146
150 struct module *owner; 147 struct module *owner;
151 148