diff options
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index eaec37c9d83d..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); |
@@ -442,6 +465,7 @@ extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | |||
442 | size_t size); | 465 | size_t size); |
443 | extern void tty_audit_exit(void); | 466 | extern void tty_audit_exit(void); |
444 | extern void tty_audit_fork(struct signal_struct *sig); | 467 | extern void tty_audit_fork(struct signal_struct *sig); |
468 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | ||
445 | extern void tty_audit_push(struct tty_struct *tty); | 469 | extern void tty_audit_push(struct tty_struct *tty); |
446 | extern void tty_audit_push_task(struct task_struct *tsk, | 470 | extern void tty_audit_push_task(struct task_struct *tsk, |
447 | uid_t loginuid, u32 sessionid); | 471 | uid_t loginuid, u32 sessionid); |
@@ -450,6 +474,9 @@ static inline void tty_audit_add_data(struct tty_struct *tty, | |||
450 | unsigned char *data, size_t size) | 474 | unsigned char *data, size_t size) |
451 | { | 475 | { |
452 | } | 476 | } |
477 | static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) | ||
478 | { | ||
479 | } | ||
453 | static inline void tty_audit_exit(void) | 480 | static inline void tty_audit_exit(void) |
454 | { | 481 | { |
455 | } | 482 | } |