aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 09:11:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 09:11:09 -0400
commitefb8d21b2c6db3497655cc6a033ae8a9883e4063 (patch)
treea14a0dbb9fec3a6db5e542ba7ed4a49681706420 /include/linux
parent3cb603284b3d256ae9ae9e65887cee8416bfef15 (diff)
parentd208a3bf77f902283894f546b6b5383202cf7882 (diff)
Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (79 commits) TTY: serial_core: Fix crash if DCD drop during suspend tty/serial: atmel_serial: bootconsole removed from auto-enumerates Revert "TTY: call tty_driver_lookup_tty unconditionally" tty/serial: atmel_serial: add device tree support tty/serial: atmel_serial: auto-enumerate ports tty/serial: atmel_serial: whitespace and braces modifications tty/serial: atmel_serial: change platform_data variable name tty/serial: RS485 bindings for device tree TTY: call tty_driver_lookup_tty unconditionally TTY: pty, release tty in all ptmx_open fail paths TTY: make tty_add_file non-failing TTY: drop driver reference in tty_open fail path 8250_pci: Fix kernel panic when pch_uart is disabled h8300: drivers/serial/Kconfig was moved parport_pc: release IO region properly if unsupported ITE887x card is found tty: Support compat_ioctl get/set termios_locked hvc_console: display printk messages on console. TTY: snyclinkmp: forever loop in tx_load_dma_buffer() tty/n_gsm: avoid fifo overflow in gsm_dlci_data_output tty/n_gsm: fix a bug in gsm_dlci_data_output (adaption = 2 case) ... Fix up Conflicts in: - drivers/tty/serial/8250_pci.c Trivial conflict with removed duplicate device ID - drivers/tty/serial/atmel_serial.c Annoying silly conflict between "specify the port num via platform_data" and other changes to atmel_console_init
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/serial.h1
-rw-r--r--include/linux/serial_8250.h2
-rw-r--r--include/linux/serial_core.h10
-rw-r--r--include/linux/serial_reg.h1
-rw-r--r--include/linux/tty.h26
5 files changed, 32 insertions, 8 deletions
diff --git a/include/linux/serial.h b/include/linux/serial.h
index ef914061511e..97ff8e27a6cc 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -211,6 +211,7 @@ struct serial_rs485 {
211#define SER_RS485_RTS_ON_SEND (1 << 1) 211#define SER_RS485_RTS_ON_SEND (1 << 1)
212#define SER_RS485_RTS_AFTER_SEND (1 << 2) 212#define SER_RS485_RTS_AFTER_SEND (1 << 2)
213#define SER_RS485_RTS_BEFORE_SEND (1 << 3) 213#define SER_RS485_RTS_BEFORE_SEND (1 << 3)
214#define SER_RS485_RX_DURING_TX (1 << 4)
214 __u32 delay_rts_before_send; /* Milliseconds */ 215 __u32 delay_rts_before_send; /* Milliseconds */
215 __u32 delay_rts_after_send; /* Milliseconds */ 216 __u32 delay_rts_after_send; /* Milliseconds */
216 __u32 padding[5]; /* Memory is cheap, new structs 217 __u32 padding[5]; /* Memory is cheap, new structs
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 97f5b45bbc07..1f05bbeac01e 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -35,6 +35,7 @@ struct plat_serial8250_port {
35 void (*set_termios)(struct uart_port *, 35 void (*set_termios)(struct uart_port *,
36 struct ktermios *new, 36 struct ktermios *new,
37 struct ktermios *old); 37 struct ktermios *old);
38 int (*handle_irq)(struct uart_port *);
38 void (*pm)(struct uart_port *, unsigned int state, 39 void (*pm)(struct uart_port *, unsigned int state,
39 unsigned old); 40 unsigned old);
40}; 41};
@@ -80,6 +81,7 @@ extern void serial8250_do_set_termios(struct uart_port *port,
80 struct ktermios *termios, struct ktermios *old); 81 struct ktermios *termios, struct ktermios *old);
81extern void serial8250_do_pm(struct uart_port *port, unsigned int state, 82extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
82 unsigned int oldstate); 83 unsigned int oldstate);
84int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
83 85
84extern void serial8250_set_isa_configurator(void (*v) 86extern void serial8250_set_isa_configurator(void (*v)
85 (int port, struct uart_port *up, 87 (int port, struct uart_port *up,
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a5c31146a337..eadf33d0abba 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -46,7 +46,8 @@
46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */ 46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */
47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */ 47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ 48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
49#define PORT_MAX_8250 20 /* max port ID */ 49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
50#define PORT_MAX_8250 21 /* max port ID */
50 51
51/* 52/*
52 * ARM specific type numbers. These are not currently guaranteed 53 * ARM specific type numbers. These are not currently guaranteed
@@ -300,6 +301,7 @@ struct uart_port {
300 void (*set_termios)(struct uart_port *, 301 void (*set_termios)(struct uart_port *,
301 struct ktermios *new, 302 struct ktermios *new,
302 struct ktermios *old); 303 struct ktermios *old);
304 int (*handle_irq)(struct uart_port *);
303 void (*pm)(struct uart_port *, unsigned int state, 305 void (*pm)(struct uart_port *, unsigned int state,
304 unsigned int old); 306 unsigned int old);
305 unsigned int irq; /* irq number */ 307 unsigned int irq; /* irq number */
@@ -317,9 +319,7 @@ struct uart_port {
317#define UPIO_MEM32 (3) 319#define UPIO_MEM32 (3)
318#define UPIO_AU (4) /* Au1x00 type IO */ 320#define UPIO_AU (4) /* Au1x00 type IO */
319#define UPIO_TSI (5) /* Tsi108/109 type IO */ 321#define UPIO_TSI (5) /* Tsi108/109 type IO */
320#define UPIO_DWAPB (6) /* DesignWare APB UART */ 322#define UPIO_RM9000 (6) /* RM9000 type IO */
321#define UPIO_RM9000 (7) /* RM9000 type IO */
322#define UPIO_DWAPB32 (8) /* DesignWare APB UART (32 bit accesses) */
323 323
324 unsigned int read_status_mask; /* driver specific */ 324 unsigned int read_status_mask; /* driver specific */
325 unsigned int ignore_status_mask; /* driver specific */ 325 unsigned int ignore_status_mask; /* driver specific */
@@ -350,6 +350,7 @@ struct uart_port {
350#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) 350#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
353#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
353/* The exact UART type is known and should not be probed. */ 354/* The exact UART type is known and should not be probed. */
354#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) 355#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
355#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 356#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
@@ -384,7 +385,6 @@ struct uart_state {
384 int pm_state; 385 int pm_state;
385 struct circ_buf xmit; 386 struct circ_buf xmit;
386 387
387 struct tasklet_struct tlet;
388 struct uart_port *uart_port; 388 struct uart_port *uart_port;
389}; 389};
390 390
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index c75bda37c18e..8ce70d76f836 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -152,6 +152,7 @@
152 * LCR=0xBF (or DLAB=1 for 16C660) 152 * LCR=0xBF (or DLAB=1 for 16C660)
153 */ 153 */
154#define UART_EFR 2 /* I/O: Extended Features Register */ 154#define UART_EFR 2 /* I/O: Extended Features Register */
155#define UART_XR_EFR 9 /* I/O: Extended Features Register (XR17D15x) */
155#define UART_EFR_CTS 0x80 /* CTS flow control */ 156#define UART_EFR_CTS 0x80 /* CTS flow control */
156#define UART_EFR_RTS 0x40 /* RTS flow control */ 157#define UART_EFR_RTS 0x40 /* RTS flow control */
157#define UART_EFR_SCD 0x20 /* Special character detect */ 158#define UART_EFR_SCD 0x20 /* Special character detect */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 5f2ede82b3d6..5dbb3cb05a82 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -473,7 +473,9 @@ extern void proc_clear_tty(struct task_struct *p);
473extern struct tty_struct *get_current_tty(void); 473extern struct tty_struct *get_current_tty(void);
474extern void tty_default_fops(struct file_operations *fops); 474extern void tty_default_fops(struct file_operations *fops);
475extern struct tty_struct *alloc_tty_struct(void); 475extern struct tty_struct *alloc_tty_struct(void);
476extern int tty_add_file(struct tty_struct *tty, struct file *file); 476extern int tty_alloc_file(struct file *file);
477extern void tty_add_file(struct tty_struct *tty, struct file *file);
478extern void tty_free_file(struct file *file);
477extern void free_tty_struct(struct tty_struct *tty); 479extern void free_tty_struct(struct tty_struct *tty);
478extern void initialize_tty_struct(struct tty_struct *tty, 480extern void initialize_tty_struct(struct tty_struct *tty,
479 struct tty_driver *driver, int idx); 481 struct tty_driver *driver, int idx);
@@ -581,6 +583,8 @@ extern int __init tty_init(void);
581/* tty_ioctl.c */ 583/* tty_ioctl.c */
582extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, 584extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
583 unsigned int cmd, unsigned long arg); 585 unsigned int cmd, unsigned long arg);
586extern long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file,
587 unsigned int cmd, unsigned long arg);
584 588
585/* serial.c */ 589/* serial.c */
586 590
@@ -602,8 +606,24 @@ extern long vt_compat_ioctl(struct tty_struct *tty,
602/* functions for preparation of BKL removal */ 606/* functions for preparation of BKL removal */
603extern void __lockfunc tty_lock(void) __acquires(tty_lock); 607extern void __lockfunc tty_lock(void) __acquires(tty_lock);
604extern void __lockfunc tty_unlock(void) __releases(tty_lock); 608extern void __lockfunc tty_unlock(void) __releases(tty_lock);
605extern struct task_struct *__big_tty_mutex_owner; 609
606#define tty_locked() (current == __big_tty_mutex_owner) 610/*
611 * this shall be called only from where BTM is held (like close)
612 *
613 * We need this to ensure nobody waits for us to finish while we are waiting.
614 * Without this we were encountering system stalls.
615 *
616 * This should be indeed removed with BTM removal later.
617 *
618 * Locking: BTM required. Nobody is allowed to hold port->mutex.
619 */
620static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
621 long timeout)
622{
623 tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */
624 tty_wait_until_sent(tty, timeout);
625 tty_lock();
626}
607 627
608/* 628/*
609 * wait_event_interruptible_tty -- wait for a condition with the tty lock held 629 * wait_event_interruptible_tty -- wait for a condition with the tty lock held