diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 13:25:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 13:26:01 -0500 |
commit | d2fde28ce793c09c1ea36d981cb6765174fd1eea (patch) | |
tree | d1922f6572702374900dace5dcbb9d794fecc522 /include/linux/tty.h | |
parent | 609e5b71d0eca163df017ecfcf917b149875e744 (diff) | |
parent | e65f0f8271b1b0452334e5da37fd35413a000de4 (diff) |
Merge branch 'tty-updates' from Alan
* tty-updates: (75 commits)
serial_8250: support for Sealevel Systems Model 7803 COMM+8
hso maintainers update patch
hso modem detect fix patch against Alan Cox'es tty tree
tty: Fix an ircomm warning and note another bug
drivers/char/cyclades.c: cy_pci_probe: fix error path
Serial: UART driver changes for Cavium OCTEON.
Serial: Allow port type to be specified when calling serial8250_register_port.
8250: Serial driver changes to support future Cavium OCTEON serial patches.
8250: Don't clobber spinlocks.
fix for tty-serial-move-port
tty: We want the port object to be persistent
__FUNCTION__ is gcc-specific, use __func__
serial: RS485 ioctl structure uses __u32 include linux/types.h
tty: Drop the lock_kernel in the private ioctl hook
synclink_cs: Convert to tty_port
tty: use port methods for the rocket driver
tty: kref the rocket driver
tty: make rocketport use standard port->flags
tty: Redo the rocket driver locking
tty: Make epca use the port helpers
...
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 27 |
1 files changed, 25 insertions, 2 deletions
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); |