aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h34
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
181struct tty_operations;
182
180struct tty_struct { 183struct 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);
292extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 299extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
293 int buflen); 300 int buflen);
294extern void tty_write_message(struct tty_struct *tty, char *msg); 301extern void tty_write_message(struct tty_struct *tty, char *msg);
302extern int tty_put_char(struct tty_struct *tty, unsigned char c);
303extern int tty_chars_in_buffer(struct tty_struct *tty);
304extern int tty_write_room(struct tty_struct *tty);
305extern void tty_driver_flush_buffer(struct tty_struct *tty);
306extern void tty_throttle(struct tty_struct *tty);
307extern void tty_unthrottle(struct tty_struct *tty);
295 308
296extern int is_current_pgrp_orphaned(void); 309extern int is_current_pgrp_orphaned(void);
310extern struct pid *tty_get_pgrp(struct tty_struct *tty);
297extern int is_ignored(int sig); 311extern int is_ignored(int sig);
298extern int tty_signal(int sig, struct tty_struct *tty); 312extern int tty_signal(int sig, struct tty_struct *tty);
299extern void tty_hangup(struct tty_struct * tty); 313extern void tty_hangup(struct tty_struct * tty);
300extern void tty_vhangup(struct tty_struct * tty); 314extern void tty_vhangup(struct tty_struct * tty);
301extern void tty_unhangup(struct file *filp); 315extern void tty_unhangup(struct file *filp);
302extern int tty_hung_up_p(struct file * filp); 316extern int tty_hung_up_p(struct file * filp);
303extern int is_tty(struct file *filp);
304extern void do_SAK(struct tty_struct *tty); 317extern void do_SAK(struct tty_struct *tty);
305extern void __do_SAK(struct tty_struct *tty); 318extern void __do_SAK(struct tty_struct *tty);
306extern void disassociate_ctty(int priv); 319extern void disassociate_ctty(int priv);
@@ -324,8 +337,7 @@ extern void tty_ldisc_put(int);
324extern void tty_wakeup(struct tty_struct *tty); 337extern void tty_wakeup(struct tty_struct *tty);
325extern void tty_ldisc_flush(struct tty_struct *tty); 338extern void tty_ldisc_flush(struct tty_struct *tty);
326 339
327extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 340extern long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
328 unsigned long arg);
329extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, 341extern 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);
331extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); 343extern 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,
351extern void tty_audit_exit(void); 363extern void tty_audit_exit(void);
352extern void tty_audit_fork(struct signal_struct *sig); 364extern void tty_audit_fork(struct signal_struct *sig);
353extern void tty_audit_push(struct tty_struct *tty); 365extern void tty_audit_push(struct tty_struct *tty);
354extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid); 366extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid);
355extern void tty_audit_opening(void);
356#else 367#else
357static inline void tty_audit_add_data(struct tty_struct *tty, 368static 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)
367static inline void tty_audit_push(struct tty_struct *tty) 378static inline void tty_audit_push(struct tty_struct *tty)
368{ 379{
369} 380}
370static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid) 381static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid)
371{
372}
373static inline void tty_audit_opening(void)
374{ 382{
375} 383}
376#endif 384#endif