diff options
Diffstat (limited to 'include/linux/tty.h')
| -rw-r--r-- | include/linux/tty.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index dd8e08fe8855..7f7121f9c968 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -177,27 +177,33 @@ struct signal_struct; | |||
| 177 | * size each time the window is created or resized anyway. | 177 | * size each time the window is created or resized anyway. |
| 178 | * - TYT, 9/14/92 | 178 | * - TYT, 9/14/92 |
| 179 | */ | 179 | */ |
| 180 | |||
| 181 | struct tty_operations; | ||
| 182 | |||
| 180 | struct tty_struct { | 183 | struct tty_struct { |
| 181 | int magic; | 184 | int magic; |
| 182 | struct tty_driver *driver; | 185 | struct tty_driver *driver; |
| 186 | const struct tty_operations *ops; | ||
| 183 | int index; | 187 | int index; |
| 184 | struct tty_ldisc ldisc; | 188 | struct tty_ldisc ldisc; |
| 185 | struct mutex termios_mutex; | 189 | struct mutex termios_mutex; |
| 190 | spinlock_t ctrl_lock; | ||
| 191 | /* Termios values are protected by the termios mutex */ | ||
| 186 | struct ktermios *termios, *termios_locked; | 192 | struct ktermios *termios, *termios_locked; |
| 187 | char name[64]; | 193 | char name[64]; |
| 188 | struct pid *pgrp; | 194 | struct pid *pgrp; /* Protected by ctrl lock */ |
| 189 | struct pid *session; | 195 | struct pid *session; |
| 190 | unsigned long flags; | 196 | unsigned long flags; |
| 191 | int count; | 197 | int count; |
| 192 | struct winsize winsize; | 198 | struct winsize winsize; /* termios mutex */ |
| 193 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; | 199 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; |
| 194 | unsigned char low_latency:1, warned:1; | 200 | unsigned char low_latency:1, warned:1; |
| 195 | unsigned char ctrl_status; | 201 | unsigned char ctrl_status; /* ctrl_lock */ |
| 196 | unsigned int receive_room; /* Bytes free for queue */ | 202 | unsigned int receive_room; /* Bytes free for queue */ |
| 197 | 203 | ||
| 198 | struct tty_struct *link; | 204 | struct tty_struct *link; |
| 199 | struct fasync_struct *fasync; | 205 | struct fasync_struct *fasync; |
| 200 | struct tty_bufhead buf; | 206 | struct tty_bufhead buf; /* Locked internally */ |
| 201 | int alt_speed; /* For magic substitution of 38400 bps */ | 207 | int alt_speed; /* For magic substitution of 38400 bps */ |
| 202 | wait_queue_head_t write_wait; | 208 | wait_queue_head_t write_wait; |
| 203 | wait_queue_head_t read_wait; | 209 | wait_queue_head_t read_wait; |
| @@ -211,6 +217,7 @@ struct tty_struct { | |||
| 211 | /* | 217 | /* |
| 212 | * The following is data for the N_TTY line discipline. For | 218 | * The following is data for the N_TTY line discipline. For |
| 213 | * historical reasons, this is included in the tty structure. | 219 | * historical reasons, this is included in the tty structure. |
| 220 | * Mostly locked by the BKL. | ||
| 214 | */ | 221 | */ |
| 215 | unsigned int column; | 222 | unsigned int column; |
| 216 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; | 223 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; |
| @@ -292,15 +299,21 @@ extern void tty_unregister_device(struct tty_driver *driver, unsigned index); | |||
| 292 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, | 299 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, |
| 293 | int buflen); | 300 | int buflen); |
| 294 | extern void tty_write_message(struct tty_struct *tty, char *msg); | 301 | extern void tty_write_message(struct tty_struct *tty, char *msg); |
| 302 | extern int tty_put_char(struct tty_struct *tty, unsigned char c); | ||
| 303 | extern int tty_chars_in_buffer(struct tty_struct *tty); | ||
| 304 | extern int tty_write_room(struct tty_struct *tty); | ||
| 305 | extern void tty_driver_flush_buffer(struct tty_struct *tty); | ||
| 306 | extern void tty_throttle(struct tty_struct *tty); | ||
| 307 | extern void tty_unthrottle(struct tty_struct *tty); | ||
| 295 | 308 | ||
| 296 | extern int is_current_pgrp_orphaned(void); | 309 | extern int is_current_pgrp_orphaned(void); |
| 310 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | ||
| 297 | extern int is_ignored(int sig); | 311 | extern int is_ignored(int sig); |
| 298 | extern int tty_signal(int sig, struct tty_struct *tty); | 312 | extern int tty_signal(int sig, struct tty_struct *tty); |
| 299 | extern void tty_hangup(struct tty_struct * tty); | 313 | extern void tty_hangup(struct tty_struct * tty); |
| 300 | extern void tty_vhangup(struct tty_struct * tty); | 314 | extern void tty_vhangup(struct tty_struct * tty); |
| 301 | extern void tty_unhangup(struct file *filp); | 315 | extern void tty_unhangup(struct file *filp); |
| 302 | extern int tty_hung_up_p(struct file * filp); | 316 | extern int tty_hung_up_p(struct file * filp); |
| 303 | extern int is_tty(struct file *filp); | ||
| 304 | extern void do_SAK(struct tty_struct *tty); | 317 | extern void do_SAK(struct tty_struct *tty); |
| 305 | extern void __do_SAK(struct tty_struct *tty); | 318 | extern void __do_SAK(struct tty_struct *tty); |
| 306 | extern void disassociate_ctty(int priv); | 319 | extern void disassociate_ctty(int priv); |
| @@ -324,8 +337,7 @@ extern void tty_ldisc_put(int); | |||
| 324 | extern void tty_wakeup(struct tty_struct *tty); | 337 | extern void tty_wakeup(struct tty_struct *tty); |
| 325 | extern void tty_ldisc_flush(struct tty_struct *tty); | 338 | extern void tty_ldisc_flush(struct tty_struct *tty); |
| 326 | 339 | ||
| 327 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 340 | extern long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
| 328 | unsigned long arg); | ||
| 329 | extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, | 341 | extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, |
| 330 | unsigned int cmd, unsigned long arg); | 342 | unsigned int cmd, unsigned long arg); |
| 331 | extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); | 343 | extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); |
| @@ -351,8 +363,7 @@ extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | |||
| 351 | extern void tty_audit_exit(void); | 363 | extern void tty_audit_exit(void); |
| 352 | extern void tty_audit_fork(struct signal_struct *sig); | 364 | extern void tty_audit_fork(struct signal_struct *sig); |
| 353 | extern void tty_audit_push(struct tty_struct *tty); | 365 | extern void tty_audit_push(struct tty_struct *tty); |
| 354 | extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid); | 366 | extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid); |
| 355 | extern void tty_audit_opening(void); | ||
| 356 | #else | 367 | #else |
| 357 | static inline void tty_audit_add_data(struct tty_struct *tty, | 368 | static inline void tty_audit_add_data(struct tty_struct *tty, |
| 358 | unsigned char *data, size_t size) | 369 | unsigned char *data, size_t size) |
| @@ -367,10 +378,7 @@ static inline void tty_audit_fork(struct signal_struct *sig) | |||
| 367 | static inline void tty_audit_push(struct tty_struct *tty) | 378 | static inline void tty_audit_push(struct tty_struct *tty) |
| 368 | { | 379 | { |
| 369 | } | 380 | } |
| 370 | static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid) | 381 | static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid) |
| 371 | { | ||
| 372 | } | ||
| 373 | static inline void tty_audit_opening(void) | ||
| 374 | { | 382 | { |
| 375 | } | 383 | } |
| 376 | #endif | 384 | #endif |
