diff options
Diffstat (limited to 'include/linux/tty.h')
| -rw-r--r-- | include/linux/tty.h | 20 | 
1 files changed, 16 insertions, 4 deletions
| diff --git a/include/linux/tty.h b/include/linux/tty.h index 1437da3ddc62..2a754748dd5f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #define N_V253 19 /* Codec control over voice modem */ | 50 | #define N_V253 19 /* Codec control over voice modem */ | 
| 51 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ | 51 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ | 
| 52 | #define N_GSM0710 21 /* GSM 0710 Mux */ | 52 | #define N_GSM0710 21 /* GSM 0710 Mux */ | 
| 53 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ | ||
| 53 | 54 | ||
| 54 | /* | 55 | /* | 
| 55 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 56 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 
| @@ -256,6 +257,7 @@ struct tty_operations; | |||
| 256 | struct tty_struct { | 257 | struct tty_struct { | 
| 257 | int magic; | 258 | int magic; | 
| 258 | struct kref kref; | 259 | struct kref kref; | 
| 260 | struct device *dev; | ||
| 259 | struct tty_driver *driver; | 261 | struct tty_driver *driver; | 
| 260 | const struct tty_operations *ops; | 262 | const struct tty_operations *ops; | 
| 261 | int index; | 263 | int index; | 
| @@ -329,6 +331,13 @@ struct tty_struct { | |||
| 329 | struct tty_port *port; | 331 | struct tty_port *port; | 
| 330 | }; | 332 | }; | 
| 331 | 333 | ||
| 334 | /* Each of a tty's open files has private_data pointing to tty_file_private */ | ||
| 335 | struct tty_file_private { | ||
| 336 | struct tty_struct *tty; | ||
| 337 | struct file *file; | ||
| 338 | struct list_head list; | ||
| 339 | }; | ||
| 340 | |||
| 332 | /* tty magic number */ | 341 | /* tty magic number */ | 
| 333 | #define TTY_MAGIC 0x5401 | 342 | #define TTY_MAGIC 0x5401 | 
| 334 | 343 | ||
| @@ -458,6 +467,7 @@ extern void proc_clear_tty(struct task_struct *p); | |||
| 458 | extern struct tty_struct *get_current_tty(void); | 467 | extern struct tty_struct *get_current_tty(void); | 
| 459 | extern void tty_default_fops(struct file_operations *fops); | 468 | extern void tty_default_fops(struct file_operations *fops); | 
| 460 | extern struct tty_struct *alloc_tty_struct(void); | 469 | extern struct tty_struct *alloc_tty_struct(void); | 
| 470 | extern int tty_add_file(struct tty_struct *tty, struct file *file); | ||
| 461 | extern void free_tty_struct(struct tty_struct *tty); | 471 | extern void free_tty_struct(struct tty_struct *tty); | 
| 462 | extern void initialize_tty_struct(struct tty_struct *tty, | 472 | extern void initialize_tty_struct(struct tty_struct *tty, | 
| 463 | struct tty_driver *driver, int idx); | 473 | struct tty_driver *driver, int idx); | 
| @@ -470,6 +480,7 @@ extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty); | |||
| 470 | extern struct tty_struct *tty_pair_get_pty(struct tty_struct *tty); | 480 | extern struct tty_struct *tty_pair_get_pty(struct tty_struct *tty); | 
| 471 | 481 | ||
| 472 | extern struct mutex tty_mutex; | 482 | extern struct mutex tty_mutex; | 
| 483 | extern spinlock_t tty_files_lock; | ||
| 473 | 484 | ||
| 474 | extern void tty_write_unlock(struct tty_struct *tty); | 485 | extern void tty_write_unlock(struct tty_struct *tty); | 
| 475 | extern int tty_write_lock(struct tty_struct *tty, int ndelay); | 486 | extern int tty_write_lock(struct tty_struct *tty, int ndelay); | 
| @@ -530,8 +541,8 @@ extern void tty_audit_exit(void); | |||
| 530 | extern void tty_audit_fork(struct signal_struct *sig); | 541 | extern void tty_audit_fork(struct signal_struct *sig); | 
| 531 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 542 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 
| 532 | extern void tty_audit_push(struct tty_struct *tty); | 543 | extern void tty_audit_push(struct tty_struct *tty); | 
| 533 | extern void tty_audit_push_task(struct task_struct *tsk, | 544 | extern int tty_audit_push_task(struct task_struct *tsk, | 
| 534 | uid_t loginuid, u32 sessionid); | 545 | uid_t loginuid, u32 sessionid); | 
| 535 | #else | 546 | #else | 
| 536 | static inline void tty_audit_add_data(struct tty_struct *tty, | 547 | static inline void tty_audit_add_data(struct tty_struct *tty, | 
| 537 | unsigned char *data, size_t size) | 548 | unsigned char *data, size_t size) | 
| @@ -549,9 +560,10 @@ static inline void tty_audit_fork(struct signal_struct *sig) | |||
| 549 | static inline void tty_audit_push(struct tty_struct *tty) | 560 | static inline void tty_audit_push(struct tty_struct *tty) | 
| 550 | { | 561 | { | 
| 551 | } | 562 | } | 
| 552 | static inline void tty_audit_push_task(struct task_struct *tsk, | 563 | static inline int tty_audit_push_task(struct task_struct *tsk, | 
| 553 | uid_t loginuid, u32 sessionid) | 564 | uid_t loginuid, u32 sessionid) | 
| 554 | { | 565 | { | 
| 566 | return 0; | ||
| 555 | } | 567 | } | 
| 556 | #endif | 568 | #endif | 
| 557 | 569 | ||
