summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 15:03:42 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 15:03:42 -0700
commitfc385c313275b114bc6ad36e60c5177d63250548 (patch)
tree3436184ec3af11e6506df5233889700a74427055 /include
parenta92b166e6b8c3c0037493690b2800b0b0dd92063 (diff)
parent235dae5d094c415fcf0fc79fa637f1901bc8afe2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (68 commits) U6715 16550A serial driver support Char: nozomi, set tty->driver_data appropriately Char: nozomi, fix tty->count counting serial: max3107: Fix gpiolib support hsu: call PCI pm hooks in suspend/resume function hsu: some code cleanup hsu: add a periodic timer to check dma rx channel hsu: driver for Medfield High Speed UART device mxser: remove unnesesary NULL check serial: add support for OX16PCI958 card serial: 68328serial.c: remove dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS) timbuart: use __devinit and __devexit macros for probe and remove serial: MMIO32 support for 8250_early.c serial: mcf: don't take spinlocks in already protected functions serial: general fixes in the serial_rs485 structure serial: fix missing bit coverage of ASYNC_FLAGS serial: "altera_uart: simplify altera_uart_console_putc()" checkpatch fixes serial: crisv10: formatting of pointers in printk() vt: Fix warning: statement with no effect due to vt_kern.h tty_io: remove casts from void* ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/ioctls.h8
-rw-r--r--include/asm-generic/termbits.h1
-rw-r--r--include/linux/console_struct.h4
-rw-r--r--include/linux/fb.h4
-rw-r--r--include/linux/istallion.h2
-rw-r--r--include/linux/serial.h9
-rw-r--r--include/linux/serial_8250.h5
-rw-r--r--include/linux/serial_core.h11
-rw-r--r--include/linux/serial_mfd.h47
-rw-r--r--include/linux/serial_reg.h16
-rw-r--r--include/linux/tty.h52
-rw-r--r--include/linux/vt_kern.h64
12 files changed, 202 insertions, 21 deletions
diff --git a/include/asm-generic/ioctls.h b/include/asm-generic/ioctls.h
index a799e20a769e..8554cb6a81b9 100644
--- a/include/asm-generic/ioctls.h
+++ b/include/asm-generic/ioctls.h
@@ -69,6 +69,7 @@
#define TCSETX 0x5433
#define TCSETXF 0x5434
#define TCSETXW 0x5435
+#define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */
#define FIONCLEX 0x5450
#define FIOCLEX 0x5451
@@ -87,12 +88,10 @@
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
/*
- * some architectures define FIOQSIZE as 0x545E, which is used for
- * TIOCGHAYESESP on others
+ * Some arches already define FIOQSIZE due to a historical
+ * conflict with a Hayes modem-specific ioctl value.
*/
#ifndef FIOQSIZE
-# define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
-# define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
# define FIOQSIZE 0x5460
#endif
@@ -104,6 +103,7 @@
#define TIOCPKT_START 8
#define TIOCPKT_NOSTOP 16
#define TIOCPKT_DOSTOP 32
+#define TIOCPKT_IOCTL 64
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
diff --git a/include/asm-generic/termbits.h b/include/asm-generic/termbits.h
index 1c9773d48cb0..232b4781aef3 100644
--- a/include/asm-generic/termbits.h
+++ b/include/asm-generic/termbits.h
@@ -178,6 +178,7 @@ struct ktermios {
#define FLUSHO 0010000
#define PENDIN 0040000
#define IEXTEN 0100000
+#define EXTPROC 0200000
/* tcflow() and TCXONC use these */
#define TCOOFF 0
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 38fe59dc89ae..7f0c32908568 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -21,6 +21,8 @@ struct vt_struct;
#define NPAR 16
struct vc_data {
+ struct tty_port port; /* Upper level data */
+
unsigned short vc_num; /* Console number */
unsigned int vc_cols; /* [#] Console size */
unsigned int vc_rows;
@@ -56,7 +58,6 @@ struct vc_data {
/* VT terminal data */
unsigned int vc_state; /* Escape sequence parser state */
unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */
- struct tty_struct *vc_tty; /* TTY we are attached to */
/* data for manual vt switching */
struct vt_mode vt_mode;
struct pid *vt_pid;
@@ -105,6 +106,7 @@ struct vc_data {
struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
unsigned long vc_uni_pagedir;
unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
+ bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */
/* additional information is in vt_kern.h */
};
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 0c5659c41b01..f0268deca658 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -825,6 +825,10 @@ struct fb_tile_ops {
*/
#define FBINFO_BE_MATH 0x100000
+/* report to the VT layer that this fb driver can accept forced console
+ output like oopses */
+#define FBINFO_CAN_FORCE_OUTPUT 0x200000
+
struct fb_info {
int node;
int flags;
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 7faca98c7d14..ad700a60c158 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -86,7 +86,7 @@ struct stlibrd {
unsigned long magic;
unsigned int brdnr;
unsigned int brdtype;
- unsigned int state;
+ unsigned long state;
unsigned int nrpanels;
unsigned int nrports;
unsigned int nrdevs;
diff --git a/include/linux/serial.h b/include/linux/serial.h
index c8613c3ff9d3..1ebc694a6d52 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -77,7 +77,8 @@ struct serial_struct {
#define PORT_16654 11
#define PORT_16850 12
#define PORT_RSA 13 /* RSA-DV II/S card */
-#define PORT_MAX 13
+#define PORT_U6_16550A 14
+#define PORT_MAX 14
#define SERIAL_IO_PORT 0
#define SERIAL_IO_HUB6 1
@@ -151,7 +152,7 @@ struct serial_uart_config {
#define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART)
#define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE)
-#define ASYNC_FLAGS ((1U << ASYNCB_LAST_USER) - 1)
+#define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1)
#define ASYNC_USR_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI| \
ASYNC_CALLOUT_NOHUP|ASYNC_SPD_SHI|ASYNC_LOW_LATENCY)
#define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI)
@@ -210,8 +211,10 @@ struct serial_rs485 {
#define SER_RS485_ENABLED (1 << 0)
#define SER_RS485_RTS_ON_SEND (1 << 1)
#define SER_RS485_RTS_AFTER_SEND (1 << 2)
+#define SER_RS485_RTS_BEFORE_SEND (1 << 3)
__u32 delay_rts_before_send; /* Milliseconds */
- __u32 padding[6]; /* Memory is cheap, new structs
+ __u32 delay_rts_after_send; /* Milliseconds */
+ __u32 padding[5]; /* Memory is cheap, new structs
are a royal PITA .. */
};
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index fb46aba11fb5..7638deaaba65 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -32,6 +32,9 @@ struct plat_serial8250_port {
unsigned int type; /* If UPF_FIXED_TYPE */
unsigned int (*serial_in)(struct uart_port *, int);
void (*serial_out)(struct uart_port *, int, int);
+ void (*set_termios)(struct uart_port *,
+ struct ktermios *new,
+ struct ktermios *old);
};
/*
@@ -71,5 +74,7 @@ extern int early_serial_setup(struct uart_port *port);
extern int serial8250_find_port(struct uart_port *p);
extern int serial8250_find_port_for_earlycon(void);
extern int setup_early_serial8250_console(char *cmdline);
+extern void serial8250_do_set_termios(struct uart_port *port,
+ struct ktermios *termios, struct ktermios *old);
#endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index f10db6e5f3b5..8129ca2d57e3 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -186,6 +186,12 @@
#define PORT_ALTERA_JTAGUART 91
#define PORT_ALTERA_UART 92
+/* MAX3107 */
+#define PORT_MAX3107 94
+
+/* High Speed UART for Medfield */
+#define PORT_MFD 95
+
#ifdef __KERNEL__
#include <linux/compiler.h>
@@ -220,7 +226,7 @@ struct uart_ops {
void (*flush_buffer)(struct uart_port *);
void (*set_termios)(struct uart_port *, struct ktermios *new,
struct ktermios *old);
- void (*set_ldisc)(struct uart_port *);
+ void (*set_ldisc)(struct uart_port *, int new);
void (*pm)(struct uart_port *, unsigned int state,
unsigned int oldstate);
int (*set_wake)(struct uart_port *, unsigned int state);
@@ -276,6 +282,9 @@ struct uart_port {
unsigned char __iomem *membase; /* read/write[bwl] */
unsigned int (*serial_in)(struct uart_port *, int);
void (*serial_out)(struct uart_port *, int, int);
+ void (*set_termios)(struct uart_port *,
+ struct ktermios *new,
+ struct ktermios *old);
unsigned int irq; /* irq number */
unsigned long irqflags; /* irq flags */
unsigned int uartclk; /* base uart clock */
diff --git a/include/linux/serial_mfd.h b/include/linux/serial_mfd.h
new file mode 100644
index 000000000000..2b071e0b034d
--- /dev/null
+++ b/include/linux/serial_mfd.h
@@ -0,0 +1,47 @@
+#ifndef _SERIAL_MFD_H_
+#define _SERIAL_MFD_H_
+
+/* HW register offset definition */
+#define UART_FOR 0x08
+#define UART_PS 0x0C
+#define UART_MUL 0x0D
+#define UART_DIV 0x0E
+
+#define HSU_GBL_IEN 0x0
+#define HSU_GBL_IST 0x4
+
+#define HSU_GBL_INT_BIT_PORT0 0x0
+#define HSU_GBL_INT_BIT_PORT1 0x1
+#define HSU_GBL_INT_BIT_PORT2 0x2
+#define HSU_GBL_INT_BIT_IRI 0x3
+#define HSU_GBL_INT_BIT_HDLC 0x4
+#define HSU_GBL_INT_BIT_DMA 0x5
+
+#define HSU_GBL_ISR 0x8
+#define HSU_GBL_DMASR 0x400
+#define HSU_GBL_DMAISR 0x404
+
+#define HSU_PORT_REG_OFFSET 0x80
+#define HSU_PORT0_REG_OFFSET 0x80
+#define HSU_PORT1_REG_OFFSET 0x100
+#define HSU_PORT2_REG_OFFSET 0x180
+#define HSU_PORT_REG_LENGTH 0x80
+
+#define HSU_DMA_CHANS_REG_OFFSET 0x500
+#define HSU_DMA_CHANS_REG_LENGTH 0x40
+
+#define HSU_CH_SR 0x0 /* channel status reg */
+#define HSU_CH_CR 0x4 /* control reg */
+#define HSU_CH_DCR 0x8 /* descriptor control reg */
+#define HSU_CH_BSR 0x10 /* max fifo buffer size reg */
+#define HSU_CH_MOTSR 0x14 /* minimum ocp transfer size */
+#define HSU_CH_D0SAR 0x20 /* desc 0 start addr */
+#define HSU_CH_D0TSR 0x24 /* desc 0 transfer size */
+#define HSU_CH_D1SAR 0x28
+#define HSU_CH_D1TSR 0x2C
+#define HSU_CH_D2SAR 0x30
+#define HSU_CH_D2TSR 0x34
+#define HSU_CH_D3SAR 0x38
+#define HSU_CH_D3TSR 0x3C
+
+#endif
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index cf9327c051ad..c7a0ce11cd47 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -221,8 +221,24 @@
#define UART_FCR_PXAR16 0x80 /* receive FIFO threshold = 16 */
#define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */
+/*
+ * Intel MID on-chip HSU (High Speed UART) defined bits
+ */
+#define UART_FCR_HSU_64_1B 0x00 /* receive FIFO treshold = 1 */
+#define UART_FCR_HSU_64_16B 0x40 /* receive FIFO treshold = 16 */
+#define UART_FCR_HSU_64_32B 0x80 /* receive FIFO treshold = 32 */
+#define UART_FCR_HSU_64_56B 0xc0 /* receive FIFO treshold = 56 */
+
+#define UART_FCR_HSU_16_1B 0x00 /* receive FIFO treshold = 1 */
+#define UART_FCR_HSU_16_4B 0x40 /* receive FIFO treshold = 4 */
+#define UART_FCR_HSU_16_8B 0x80 /* receive FIFO treshold = 8 */
+#define UART_FCR_HSU_16_14B 0xc0 /* receive FIFO treshold = 14 */
+#define UART_FCR_HSU_64B_FIFO 0x20 /* chose 64 bytes FIFO */
+#define UART_FCR_HSU_16B_FIFO 0x00 /* chose 16 bytes FIFO */
+#define UART_FCR_HALF_EMPT_TXI 0x00 /* trigger TX_EMPT IRQ for half empty */
+#define UART_FCR_FULL_EMPT_TXI 0x08 /* trigger TX_EMPT IRQ for full empty */
/*
* These register definitions are for the 16C950
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 7802a243ee13..1437da3ddc62 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -13,6 +13,7 @@
#include <linux/tty_driver.h>
#include <linux/tty_ldisc.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#include <asm/system.h>
@@ -179,6 +180,7 @@ struct tty_bufhead {
#define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO)
#define L_PENDIN(tty) _L_FLAG((tty), PENDIN)
#define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN)
+#define L_EXTPROC(tty) _L_FLAG((tty), EXTPROC)
struct device;
struct signal_struct;
@@ -415,6 +417,7 @@ extern int is_ignored(int sig);
extern int tty_signal(int sig, struct tty_struct *tty);
extern void tty_hangup(struct tty_struct *tty);
extern void tty_vhangup(struct tty_struct *tty);
+extern void tty_vhangup_locked(struct tty_struct *tty);
extern void tty_vhangup_self(void);
extern void tty_unhangup(struct file *filp);
extern int tty_hung_up_p(struct file *filp);
@@ -575,5 +578,54 @@ extern int vt_ioctl(struct tty_struct *tty, struct file *file,
extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg);
+/* tty_mutex.c */
+/* functions for preparation of BKL removal */
+extern void __lockfunc tty_lock(void) __acquires(tty_lock);
+extern void __lockfunc tty_unlock(void) __releases(tty_lock);
+extern struct task_struct *__big_tty_mutex_owner;
+#define tty_locked() (current == __big_tty_mutex_owner)
+
+/*
+ * wait_event_interruptible_tty -- wait for a condition with the tty lock held
+ *
+ * The condition we are waiting for might take a long time to
+ * become true, or might depend on another thread taking the
+ * BTM. In either case, we need to drop the BTM to guarantee
+ * forward progress. This is a leftover from the conversion
+ * from the BKL and should eventually get removed as the BTM
+ * falls out of use.
+ *
+ * Do not use in new code.
+ */
+#define wait_event_interruptible_tty(wq, condition) \
+({ \
+ int __ret = 0; \
+ if (!(condition)) { \
+ __wait_event_interruptible_tty(wq, condition, __ret); \
+ } \
+ __ret; \
+})
+
+#define __wait_event_interruptible_tty(wq, condition, ret) \
+do { \
+ DEFINE_WAIT(__wait); \
+ \
+ for (;;) { \
+ prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
+ if (condition) \
+ break; \
+ if (!signal_pending(current)) { \
+ tty_unlock(); \
+ schedule(); \
+ tty_lock(); \
+ continue; \
+ } \
+ ret = -ERESTARTSYS; \
+ break; \
+ } \
+ finish_wait(&wq, &__wait); \
+} while (0)
+
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 7f56db4a79f0..6625cc1ab758 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -76,17 +76,52 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
#define vc_translate(vc, c) ((vc)->vc_translate[(c) | \
((vc)->vc_toggle_meta ? 0x80 : 0)])
#else
-#define con_set_trans_old(arg) (0)
-#define con_get_trans_old(arg) (-EINVAL)
-#define con_set_trans_new(arg) (0)
-#define con_get_trans_new(arg) (-EINVAL)
-#define con_clear_unimap(vc, ui) (0)
-#define con_set_unimap(vc, ct, list) (0)
-#define con_set_default_unimap(vc) (0)
-#define con_copy_unimap(d, s) (0)
-#define con_get_unimap(vc, ct, uct, list) (-EINVAL)
-#define con_free_unimap(vc) do { ; } while (0)
-#define con_protect_unimap(vc, rdonly) do { ; } while (0)
+static inline int con_set_trans_old(unsigned char __user *table)
+{
+ return 0;
+}
+static inline int con_get_trans_old(unsigned char __user *table)
+{
+ return -EINVAL;
+}
+static inline int con_set_trans_new(unsigned short __user *table)
+{
+ return 0;
+}
+static inline int con_get_trans_new(unsigned short __user *table)
+{
+ return -EINVAL;
+}
+static inline int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
+{
+ return 0;
+}
+static inline
+int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
+{
+ return 0;
+}
+static inline
+int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct,
+ struct unipair __user *list)
+{
+ return -EINVAL;
+}
+static inline int con_set_default_unimap(struct vc_data *vc)
+{
+ return 0;
+}
+static inline void con_free_unimap(struct vc_data *vc)
+{
+}
+static inline void con_protect_unimap(struct vc_data *vc, int rdonly)
+{
+}
+static inline
+int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc)
+{
+ return 0;
+}
#define vc_translate(vc, c) (c)
#endif
@@ -100,6 +135,13 @@ extern int unbind_con_driver(const struct consw *csw, int first, int last,
int deflt);
int vty_init(const struct file_operations *console_fops);
+static inline bool vt_force_oops_output(struct vc_data *vc)
+{
+ if (oops_in_progress && vc->vc_panic_force_write)
+ return true;
+ return false;
+}
+
/*
* vc_screen.c shares this temporary buffer with the console write code so that
* we can easily avoid touching user space while holding the console spinlock.