diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/8250_pci.h | 2 | ||||
-rw-r--r-- | include/linux/generic_serial.h | 1 | ||||
-rw-r--r-- | include/linux/istallion.h | 2 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
-rw-r--r-- | include/linux/serial.h | 3 | ||||
-rw-r--r-- | include/linux/serial_8250.h | 3 | ||||
-rw-r--r-- | include/linux/serial_core.h | 69 | ||||
-rw-r--r-- | include/linux/tty.h | 27 | ||||
-rw-r--r-- | include/linux/tty_driver.h | 6 |
9 files changed, 75 insertions, 40 deletions
diff --git a/include/linux/8250_pci.h b/include/linux/8250_pci.h index 3209dd46ea7d..b24ff086a662 100644 --- a/include/linux/8250_pci.h +++ b/include/linux/8250_pci.h | |||
@@ -31,7 +31,7 @@ struct pciserial_board { | |||
31 | struct serial_private; | 31 | struct serial_private; |
32 | 32 | ||
33 | struct serial_private * | 33 | struct serial_private * |
34 | pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board); | 34 | pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board); |
35 | void pciserial_remove_ports(struct serial_private *priv); | 35 | void pciserial_remove_ports(struct serial_private *priv); |
36 | void pciserial_suspend_ports(struct serial_private *priv); | 36 | void pciserial_suspend_ports(struct serial_private *priv); |
37 | void pciserial_resume_ports(struct serial_private *priv); | 37 | void pciserial_resume_ports(struct serial_private *priv); |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 4cc913939817..fadff28505bb 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -21,7 +21,6 @@ struct real_driver { | |||
21 | void (*enable_tx_interrupts) (void *); | 21 | void (*enable_tx_interrupts) (void *); |
22 | void (*disable_rx_interrupts) (void *); | 22 | void (*disable_rx_interrupts) (void *); |
23 | void (*enable_rx_interrupts) (void *); | 23 | void (*enable_rx_interrupts) (void *); |
24 | int (*get_CD) (void *); | ||
25 | void (*shutdown_port) (void*); | 24 | void (*shutdown_port) (void*); |
26 | int (*set_real_termios) (void*); | 25 | int (*set_real_termios) (void*); |
27 | int (*chars_in_buffer) (void*); | 26 | int (*chars_in_buffer) (void*); |
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 0d1840723249..7faca98c7d14 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -59,9 +59,7 @@ struct stliport { | |||
59 | unsigned int devnr; | 59 | unsigned int devnr; |
60 | int baud_base; | 60 | int baud_base; |
61 | int custom_divisor; | 61 | int custom_divisor; |
62 | int close_delay; | ||
63 | int closing_wait; | 62 | int closing_wait; |
64 | int openwaitcnt; | ||
65 | int rc; | 63 | int rc; |
66 | int argsize; | 64 | int argsize; |
67 | void *argp; | 65 | void *argp; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b6e694454280..218c73b1e6d4 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1766,6 +1766,7 @@ | |||
1766 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 | 1766 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 |
1767 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 | 1767 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 |
1768 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 | 1768 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 |
1769 | #define PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL 0x2530 | ||
1769 | 1770 | ||
1770 | #define PCI_VENDOR_ID_RADISYS 0x1331 | 1771 | #define PCI_VENDOR_ID_RADISYS 0x1331 |
1771 | 1772 | ||
@@ -1795,6 +1796,7 @@ | |||
1795 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202 | 1796 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202 |
1796 | #define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401 | 1797 | #define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401 |
1797 | #define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801 | 1798 | #define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801 |
1799 | #define PCI_DEVICE_ID_SEALEVEL_7803 0x7803 | ||
1798 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804 | 1800 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804 |
1799 | 1801 | ||
1800 | #define PCI_VENDOR_ID_HYPERCOPE 0x1365 | 1802 | #define PCI_VENDOR_ID_HYPERCOPE 0x1365 |
diff --git a/include/linux/serial.h b/include/linux/serial.h index 1ea8d9265bf6..9136cc5608c3 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -10,8 +10,9 @@ | |||
10 | #ifndef _LINUX_SERIAL_H | 10 | #ifndef _LINUX_SERIAL_H |
11 | #define _LINUX_SERIAL_H | 11 | #define _LINUX_SERIAL_H |
12 | 12 | ||
13 | #ifdef __KERNEL__ | ||
14 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | |||
15 | #ifdef __KERNEL__ | ||
15 | #include <asm/page.h> | 16 | #include <asm/page.h> |
16 | 17 | ||
17 | /* | 18 | /* |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 3d37c94abbc8..d4d2a78ad43e 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -28,6 +28,9 @@ struct plat_serial8250_port { | |||
28 | unsigned char iotype; /* UPIO_* */ | 28 | unsigned char iotype; /* UPIO_* */ |
29 | unsigned char hub6; | 29 | unsigned char hub6; |
30 | upf_t flags; /* UPF_* flags */ | 30 | upf_t flags; /* UPF_* flags */ |
31 | unsigned int type; /* If UPF_FIXED_TYPE */ | ||
32 | unsigned int (*serial_in)(struct uart_port *, int); | ||
33 | void (*serial_out)(struct uart_port *, int, int); | ||
31 | }; | 34 | }; |
32 | 35 | ||
33 | /* | 36 | /* |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index feb3b939ec4b..b4199841f1fc 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -40,7 +40,8 @@ | |||
40 | #define PORT_NS16550A 14 | 40 | #define PORT_NS16550A 14 |
41 | #define PORT_XSCALE 15 | 41 | #define PORT_XSCALE 15 |
42 | #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ | 42 | #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ |
43 | #define PORT_MAX_8250 16 /* max port ID */ | 43 | #define PORT_OCTEON 17 /* Cavium OCTEON internal UART */ |
44 | #define PORT_MAX_8250 17 /* max port ID */ | ||
44 | 45 | ||
45 | /* | 46 | /* |
46 | * ARM specific type numbers. These are not currently guaranteed | 47 | * ARM specific type numbers. These are not currently guaranteed |
@@ -248,6 +249,8 @@ struct uart_port { | |||
248 | spinlock_t lock; /* port lock */ | 249 | spinlock_t lock; /* port lock */ |
249 | unsigned long iobase; /* in/out[bwl] */ | 250 | unsigned long iobase; /* in/out[bwl] */ |
250 | unsigned char __iomem *membase; /* read/write[bwl] */ | 251 | unsigned char __iomem *membase; /* read/write[bwl] */ |
252 | unsigned int (*serial_in)(struct uart_port *, int); | ||
253 | void (*serial_out)(struct uart_port *, int, int); | ||
251 | unsigned int irq; /* irq number */ | 254 | unsigned int irq; /* irq number */ |
252 | unsigned int uartclk; /* base uart clock */ | 255 | unsigned int uartclk; /* base uart clock */ |
253 | unsigned int fifosize; /* tx fifo size */ | 256 | unsigned int fifosize; /* tx fifo size */ |
@@ -293,6 +296,8 @@ struct uart_port { | |||
293 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) | 296 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) |
294 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 297 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
295 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 298 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
299 | /* The exact UART type is known and should not be probed. */ | ||
300 | #define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) | ||
296 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) | 301 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
297 | #define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) | 302 | #define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) |
298 | #define UPF_DEAD ((__force upf_t) (1 << 30)) | 303 | #define UPF_DEAD ((__force upf_t) (1 << 30)) |
@@ -316,35 +321,13 @@ struct uart_port { | |||
316 | }; | 321 | }; |
317 | 322 | ||
318 | /* | 323 | /* |
319 | * This is the state information which is persistent across opens. | ||
320 | * The low level driver must not to touch any elements contained | ||
321 | * within. | ||
322 | */ | ||
323 | struct uart_state { | ||
324 | unsigned int close_delay; /* msec */ | ||
325 | unsigned int closing_wait; /* msec */ | ||
326 | |||
327 | #define USF_CLOSING_WAIT_INF (0) | ||
328 | #define USF_CLOSING_WAIT_NONE (~0U) | ||
329 | |||
330 | int count; | ||
331 | int pm_state; | ||
332 | struct uart_info *info; | ||
333 | struct uart_port *port; | ||
334 | |||
335 | struct mutex mutex; | ||
336 | }; | ||
337 | |||
338 | #define UART_XMIT_SIZE PAGE_SIZE | ||
339 | |||
340 | typedef unsigned int __bitwise__ uif_t; | ||
341 | |||
342 | /* | ||
343 | * This is the state information which is only valid when the port | 324 | * This is the state information which is only valid when the port |
344 | * is open; it may be freed by the core driver once the device has | 325 | * is open; it may be cleared the core driver once the device has |
345 | * been closed. Either the low level driver or the core can modify | 326 | * been closed. Either the low level driver or the core can modify |
346 | * stuff here. | 327 | * stuff here. |
347 | */ | 328 | */ |
329 | typedef unsigned int __bitwise__ uif_t; | ||
330 | |||
348 | struct uart_info { | 331 | struct uart_info { |
349 | struct tty_port port; | 332 | struct tty_port port; |
350 | struct circ_buf xmit; | 333 | struct circ_buf xmit; |
@@ -366,6 +349,29 @@ struct uart_info { | |||
366 | wait_queue_head_t delta_msr_wait; | 349 | wait_queue_head_t delta_msr_wait; |
367 | }; | 350 | }; |
368 | 351 | ||
352 | /* | ||
353 | * This is the state information which is persistent across opens. | ||
354 | * The low level driver must not to touch any elements contained | ||
355 | * within. | ||
356 | */ | ||
357 | struct uart_state { | ||
358 | unsigned int close_delay; /* msec */ | ||
359 | unsigned int closing_wait; /* msec */ | ||
360 | |||
361 | #define USF_CLOSING_WAIT_INF (0) | ||
362 | #define USF_CLOSING_WAIT_NONE (~0U) | ||
363 | |||
364 | int count; | ||
365 | int pm_state; | ||
366 | struct uart_info info; | ||
367 | struct uart_port *port; | ||
368 | |||
369 | struct mutex mutex; | ||
370 | }; | ||
371 | |||
372 | #define UART_XMIT_SIZE PAGE_SIZE | ||
373 | |||
374 | |||
369 | /* number of characters left in xmit buffer before we ask for more */ | 375 | /* number of characters left in xmit buffer before we ask for more */ |
370 | #define WAKEUP_CHARS 256 | 376 | #define WAKEUP_CHARS 256 |
371 | 377 | ||
@@ -439,8 +445,13 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); | |||
439 | #define uart_circ_chars_free(circ) \ | 445 | #define uart_circ_chars_free(circ) \ |
440 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) | 446 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) |
441 | 447 | ||
442 | #define uart_tx_stopped(portp) \ | 448 | static inline int uart_tx_stopped(struct uart_port *port) |
443 | ((portp)->info->port.tty->stopped || (portp)->info->port.tty->hw_stopped) | 449 | { |
450 | struct tty_struct *tty = port->info->port.tty; | ||
451 | if(tty->stopped || tty->hw_stopped) | ||
452 | return 1; | ||
453 | return 0; | ||
454 | } | ||
444 | 455 | ||
445 | /* | 456 | /* |
446 | * The following are helper functions for the low level drivers. | 457 | * The following are helper functions for the low level drivers. |
@@ -451,7 +462,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | |||
451 | #ifdef SUPPORT_SYSRQ | 462 | #ifdef SUPPORT_SYSRQ |
452 | if (port->sysrq) { | 463 | if (port->sysrq) { |
453 | if (ch && time_before(jiffies, port->sysrq)) { | 464 | if (ch && time_before(jiffies, port->sysrq)) { |
454 | handle_sysrq(ch, port->info ? port->info->port.tty : NULL); | 465 | handle_sysrq(ch, port->info->port.tty); |
455 | port->sysrq = 0; | 466 | port->sysrq = 0; |
456 | return 1; | 467 | return 1; |
457 | } | 468 | } |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 3f4954c55e53..fc39db95499f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -180,8 +180,17 @@ struct signal_struct; | |||
180 | * until a hangup so don't use the wrong path. | 180 | * until a hangup so don't use the wrong path. |
181 | */ | 181 | */ |
182 | 182 | ||
183 | struct tty_port; | ||
184 | |||
185 | struct tty_port_operations { | ||
186 | /* Return 1 if the carrier is raised */ | ||
187 | int (*carrier_raised)(struct tty_port *port); | ||
188 | void (*raise_dtr_rts)(struct tty_port *port); | ||
189 | }; | ||
190 | |||
183 | struct tty_port { | 191 | struct tty_port { |
184 | struct tty_struct *tty; /* Back pointer */ | 192 | struct tty_struct *tty; /* Back pointer */ |
193 | const struct tty_port_operations *ops; /* Port operations */ | ||
185 | spinlock_t lock; /* Lock protecting tty field */ | 194 | spinlock_t lock; /* Lock protecting tty field */ |
186 | int blocked_open; /* Waiting to open */ | 195 | int blocked_open; /* Waiting to open */ |
187 | int count; /* Usage count */ | 196 | int count; /* Usage count */ |
@@ -253,6 +262,7 @@ struct tty_struct { | |||
253 | unsigned int column; | 262 | unsigned int column; |
254 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; | 263 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; |
255 | unsigned char closing:1; | 264 | unsigned char closing:1; |
265 | unsigned char echo_overrun:1; | ||
256 | unsigned short minimum_to_wake; | 266 | unsigned short minimum_to_wake; |
257 | unsigned long overrun_time; | 267 | unsigned long overrun_time; |
258 | int num_overrun; | 268 | int num_overrun; |
@@ -262,11 +272,16 @@ struct tty_struct { | |||
262 | int read_tail; | 272 | int read_tail; |
263 | int read_cnt; | 273 | int read_cnt; |
264 | unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; | 274 | unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; |
275 | unsigned char *echo_buf; | ||
276 | unsigned int echo_pos; | ||
277 | unsigned int echo_cnt; | ||
265 | int canon_data; | 278 | int canon_data; |
266 | unsigned long canon_head; | 279 | unsigned long canon_head; |
267 | unsigned int canon_column; | 280 | unsigned int canon_column; |
268 | struct mutex atomic_read_lock; | 281 | struct mutex atomic_read_lock; |
269 | struct mutex atomic_write_lock; | 282 | struct mutex atomic_write_lock; |
283 | struct mutex output_lock; | ||
284 | struct mutex echo_lock; | ||
270 | unsigned char *write_buf; | 285 | unsigned char *write_buf; |
271 | int write_cnt; | 286 | int write_cnt; |
272 | spinlock_t read_lock; | 287 | spinlock_t read_lock; |
@@ -295,6 +310,7 @@ struct tty_struct { | |||
295 | #define TTY_PUSH 6 /* n_tty private */ | 310 | #define TTY_PUSH 6 /* n_tty private */ |
296 | #define TTY_CLOSING 7 /* ->close() in progress */ | 311 | #define TTY_CLOSING 7 /* ->close() in progress */ |
297 | #define TTY_LDISC 9 /* Line discipline attached */ | 312 | #define TTY_LDISC 9 /* Line discipline attached */ |
313 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ | ||
298 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ | 314 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ |
299 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ | 315 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ |
300 | #define TTY_PTY_LOCK 16 /* pty private */ | 316 | #define TTY_PTY_LOCK 16 /* pty private */ |
@@ -354,8 +370,7 @@ extern int tty_write_room(struct tty_struct *tty); | |||
354 | extern void tty_driver_flush_buffer(struct tty_struct *tty); | 370 | extern void tty_driver_flush_buffer(struct tty_struct *tty); |
355 | extern void tty_throttle(struct tty_struct *tty); | 371 | extern void tty_throttle(struct tty_struct *tty); |
356 | extern void tty_unthrottle(struct tty_struct *tty); | 372 | extern void tty_unthrottle(struct tty_struct *tty); |
357 | extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, | 373 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); |
358 | struct winsize *ws); | ||
359 | extern void tty_shutdown(struct tty_struct *tty); | 374 | extern void tty_shutdown(struct tty_struct *tty); |
360 | extern void tty_free_termios(struct tty_struct *tty); | 375 | extern void tty_free_termios(struct tty_struct *tty); |
361 | extern int is_current_pgrp_orphaned(void); | 376 | extern int is_current_pgrp_orphaned(void); |
@@ -421,6 +436,14 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port); | |||
421 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 436 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
422 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | 437 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); |
423 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | 438 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); |
439 | extern int tty_port_carrier_raised(struct tty_port *port); | ||
440 | extern void tty_port_raise_dtr_rts(struct tty_port *port); | ||
441 | extern void tty_port_hangup(struct tty_port *port); | ||
442 | extern int tty_port_block_til_ready(struct tty_port *port, | ||
443 | struct tty_struct *tty, struct file *filp); | ||
444 | extern int tty_port_close_start(struct tty_port *port, | ||
445 | struct tty_struct *tty, struct file *filp); | ||
446 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); | ||
424 | 447 | ||
425 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); | 448 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); |
426 | extern int tty_unregister_ldisc(int disc); | 449 | extern int tty_unregister_ldisc(int disc); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 78416b901589..08e088334dba 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -196,8 +196,7 @@ | |||
196 | * Optional: If not provided then the write method is called under | 196 | * Optional: If not provided then the write method is called under |
197 | * the atomic write lock to keep it serialized with the ldisc. | 197 | * the atomic write lock to keep it serialized with the ldisc. |
198 | * | 198 | * |
199 | * int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | 199 | * int (*resize)(struct tty_struct *tty, struct winsize *ws) |
200 | * unsigned int rows, unsigned int cols); | ||
201 | * | 200 | * |
202 | * Called when a termios request is issued which changes the | 201 | * Called when a termios request is issued which changes the |
203 | * requested terminal geometry. | 202 | * requested terminal geometry. |
@@ -258,8 +257,7 @@ struct tty_operations { | |||
258 | int (*tiocmget)(struct tty_struct *tty, struct file *file); | 257 | int (*tiocmget)(struct tty_struct *tty, struct file *file); |
259 | int (*tiocmset)(struct tty_struct *tty, struct file *file, | 258 | int (*tiocmset)(struct tty_struct *tty, struct file *file, |
260 | unsigned int set, unsigned int clear); | 259 | unsigned int set, unsigned int clear); |
261 | int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | 260 | int (*resize)(struct tty_struct *tty, struct winsize *ws); |
262 | struct winsize *ws); | ||
263 | int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); | 261 | int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); |
264 | #ifdef CONFIG_CONSOLE_POLL | 262 | #ifdef CONFIG_CONSOLE_POLL |
265 | int (*poll_init)(struct tty_driver *driver, int line, char *options); | 263 | int (*poll_init)(struct tty_driver *driver, int line, char *options); |