tag | line | file | source code |
tty | 464 | fs/open.c | struct tty_struct *tty; |
tty | 469 | fs/open.c | if (current->tty < 0) |
tty | 471 | fs/open.c | tty = TTY_TABLE(MINOR(current->tty)); |
tty | 472 | fs/open.c | tty_vhangup(tty); |
tty | 201 | fs/proc/array.c | tty_pgrp = (*p)->tty; |
tty | 215 | fs/proc/array.c | (*p)->tty, |
tty | 190 | include/linux/sched.h | int tty; /* -1 if no tty, so it must be signed */ |
tty | 25 | include/linux/serial.h | struct tty_struct *tty; |
tty | 137 | include/linux/tty.h | #define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR]) |
tty | 138 | include/linux/tty.h | #define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT]) |
tty | 139 | include/linux/tty.h | #define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE]) |
tty | 140 | include/linux/tty.h | #define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL]) |
tty | 141 | include/linux/tty.h | #define WERASE_CHAR(tty) ((tty)->termios->c_cc[VWERASE]) |
tty | 142 | include/linux/tty.h | #define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF]) |
tty | 143 | include/linux/tty.h | #define START_CHAR(tty) ((tty)->termios->c_cc[VSTART]) |
tty | 144 | include/linux/tty.h | #define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP]) |
tty | 145 | include/linux/tty.h | #define SUSPEND_CHAR(tty) ((tty)->termios->c_cc[VSUSP]) |
tty | 146 | include/linux/tty.h | #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) |
tty | 148 | include/linux/tty.h | #define _L_FLAG(tty,f) ((tty)->termios->c_lflag & f) |
tty | 149 | include/linux/tty.h | #define _I_FLAG(tty,f) ((tty)->termios->c_iflag & f) |
tty | 150 | include/linux/tty.h | #define _O_FLAG(tty,f) ((tty)->termios->c_oflag & f) |
tty | 151 | include/linux/tty.h | #define _C_FLAG(tty,f) ((tty)->termios->c_cflag & f) |
tty | 153 | include/linux/tty.h | #define L_CANON(tty) _L_FLAG((tty),ICANON) |
tty | 154 | include/linux/tty.h | #define L_ISIG(tty) _L_FLAG((tty),ISIG) |
tty | 155 | include/linux/tty.h | #define L_ECHO(tty) _L_FLAG((tty),ECHO) |
tty | 156 | include/linux/tty.h | #define L_ECHOE(tty) _L_FLAG((tty),ECHOE) |
tty | 157 | include/linux/tty.h | #define L_ECHOK(tty) _L_FLAG((tty),ECHOK) |
tty | 158 | include/linux/tty.h | #define L_ECHONL(tty) _L_FLAG((tty),ECHONL) |
tty | 159 | include/linux/tty.h | #define L_ECHOCTL(tty) _L_FLAG((tty),ECHOCTL) |
tty | 160 | include/linux/tty.h | #define L_ECHOKE(tty) _L_FLAG((tty),ECHOKE) |
tty | 161 | include/linux/tty.h | #define L_TOSTOP(tty) _L_FLAG((tty),TOSTOP) |
tty | 163 | include/linux/tty.h | #define I_IGNBRK(tty) _I_FLAG((tty),IGNBRK) |
tty | 164 | include/linux/tty.h | #define I_BRKINT(tty) _I_FLAG((tty),BRKINT) |
tty | 165 | include/linux/tty.h | #define I_IGNPAR(tty) _I_FLAG((tty),IGNPAR) |
tty | 166 | include/linux/tty.h | #define I_PARMRK(tty) _I_FLAG((tty),PARMRK) |
tty | 167 | include/linux/tty.h | #define I_INPCK(tty) _I_FLAG((tty),INPCK) |
tty | 168 | include/linux/tty.h | #define I_UCLC(tty) _I_FLAG((tty),IUCLC) |
tty | 169 | include/linux/tty.h | #define I_NLCR(tty) _I_FLAG((tty),INLCR) |
tty | 170 | include/linux/tty.h | #define I_CRNL(tty) _I_FLAG((tty),ICRNL) |
tty | 171 | include/linux/tty.h | #define I_NOCR(tty) _I_FLAG((tty),IGNCR) |
tty | 172 | include/linux/tty.h | #define I_IXON(tty) _I_FLAG((tty),IXON) |
tty | 173 | include/linux/tty.h | #define I_IXANY(tty) _I_FLAG((tty),IXANY) |
tty | 174 | include/linux/tty.h | #define I_STRP(tty) _I_FLAG((tty),ISTRIP) |
tty | 176 | include/linux/tty.h | #define O_POST(tty) _O_FLAG((tty),OPOST) |
tty | 177 | include/linux/tty.h | #define O_NLCR(tty) _O_FLAG((tty),ONLCR) |
tty | 178 | include/linux/tty.h | #define O_CRNL(tty) _O_FLAG((tty),OCRNL) |
tty | 179 | include/linux/tty.h | #define O_NLRET(tty) _O_FLAG((tty),ONLRET) |
tty | 180 | include/linux/tty.h | #define O_LCUC(tty) _O_FLAG((tty),OLCUC) |
tty | 182 | include/linux/tty.h | #define C_LOCAL(tty) _C_FLAG((tty),CLOCAL) |
tty | 183 | include/linux/tty.h | #define C_RTSCTS(tty) _C_FLAG((tty),CRTSCTS) |
tty | 184 | include/linux/tty.h | #define C_SPEED(tty) ((tty)->termios->c_cflag & CBAUD) |
tty | 185 | include/linux/tty.h | #define C_HUP(tty) (C_SPEED((tty)) == B0) |
tty | 213 | include/linux/tty.h | int (*open)(struct tty_struct * tty, struct file * filp); |
tty | 214 | include/linux/tty.h | void (*close)(struct tty_struct * tty, struct file * filp); |
tty | 215 | include/linux/tty.h | void (*write)(struct tty_struct * tty); |
tty | 216 | include/linux/tty.h | int (*ioctl)(struct tty_struct *tty, struct file * file, |
tty | 218 | include/linux/tty.h | void (*throttle)(struct tty_struct * tty, int status); |
tty | 219 | include/linux/tty.h | void (*set_termios)(struct tty_struct *tty, struct termios * old); |
tty | 238 | include/linux/tty.h | int (*read)(struct tty_struct * tty, struct file * file, |
tty | 240 | include/linux/tty.h | int (*write)(struct tty_struct * tty, struct file * file, |
tty | 242 | include/linux/tty.h | int (*ioctl)(struct tty_struct * tty, struct file * file, |
tty | 307 | include/linux/tty.h | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
tty | 308 | include/linux/tty.h | #define TTY_READ_FLUSH(tty) tty_read_flush((tty)) |
tty | 338 | include/linux/tty.h | extern void flush_input(struct tty_struct * tty); |
tty | 339 | include/linux/tty.h | extern void flush_output(struct tty_struct * tty); |
tty | 340 | include/linux/tty.h | extern void wait_until_sent(struct tty_struct * tty); |
tty | 341 | include/linux/tty.h | extern void copy_to_cooked(struct tty_struct * tty); |
tty | 347 | include/linux/tty.h | extern int tty_signal(int sig, struct tty_struct *tty); |
tty | 350 | include/linux/tty.h | extern void tty_hangup(struct tty_struct * tty); |
tty | 351 | include/linux/tty.h | extern void tty_vhangup(struct tty_struct * tty); |
tty | 354 | include/linux/tty.h | extern void do_SAK(struct tty_struct *tty); |
tty | 358 | include/linux/tty.h | extern void rs_write(struct tty_struct * tty); |
tty | 359 | include/linux/tty.h | extern void con_write(struct tty_struct * tty); |
tty | 363 | include/linux/tty.h | extern int rs_open(struct tty_struct * tty, struct file * filp); |
tty | 367 | include/linux/tty.h | extern int pty_open(struct tty_struct * tty, struct file * filp); |
tty | 371 | include/linux/tty.h | extern int con_open(struct tty_struct * tty, struct file * filp); |
tty | 378 | include/linux/tty.h | extern int vt_ioctl(struct tty_struct *tty, struct file * file, |
tty | 599 | kernel/chr_drv/console.c | static void respond_string(char * p, int currcons, struct tty_struct * tty) |
tty | 602 | kernel/chr_drv/console.c | put_tty_queue(*p, &tty->read_q); |
tty | 605 | kernel/chr_drv/console.c | TTY_READ_FLUSH(tty); |
tty | 608 | kernel/chr_drv/console.c | static void respond_num(unsigned int n, int currcons, struct tty_struct * tty) |
tty | 618 | kernel/chr_drv/console.c | put_tty_queue(buff[i], &tty->read_q); |
tty | 623 | kernel/chr_drv/console.c | static void cursor_report(int currcons, struct tty_struct * tty) |
tty | 625 | kernel/chr_drv/console.c | put_tty_queue('\033', &tty->read_q); |
tty | 626 | kernel/chr_drv/console.c | put_tty_queue('[', &tty->read_q); |
tty | 627 | kernel/chr_drv/console.c | respond_num(y + (decom ? top+1 : 1), currcons, tty); |
tty | 628 | kernel/chr_drv/console.c | put_tty_queue(';', &tty->read_q); |
tty | 629 | kernel/chr_drv/console.c | respond_num(x+1, currcons, tty); |
tty | 630 | kernel/chr_drv/console.c | put_tty_queue('R', &tty->read_q); |
tty | 631 | kernel/chr_drv/console.c | TTY_READ_FLUSH(tty); |
tty | 634 | kernel/chr_drv/console.c | static inline void status_report(int currcons, struct tty_struct * tty) |
tty | 636 | kernel/chr_drv/console.c | respond_string("\033[0n", currcons, tty); /* Terminal ok */ |
tty | 639 | kernel/chr_drv/console.c | static inline void respond_ID(int currcons, struct tty_struct * tty) |
tty | 641 | kernel/chr_drv/console.c | respond_string(VT102ID, currcons, tty); |
tty | 893 | kernel/chr_drv/console.c | void con_write(struct tty_struct * tty) |
tty | 898 | kernel/chr_drv/console.c | wake_up_interruptible(&tty->write_q.proc_list); |
tty | 899 | kernel/chr_drv/console.c | currcons = tty->line - 1; |
tty | 904 | kernel/chr_drv/console.c | while (!tty->stopped && (c = get_tty_queue(&tty->write_q)) >= 0) { |
tty | 993 | kernel/chr_drv/console.c | respond_ID(currcons,tty); |
tty | 1054 | kernel/chr_drv/console.c | status_report(currcons,tty); |
tty | 1056 | kernel/chr_drv/console.c | cursor_report(currcons,tty); |
tty | 1118 | kernel/chr_drv/console.c | respond_ID(currcons,tty); |
tty | 1497 | kernel/chr_drv/console.c | int con_open(struct tty_struct *tty, struct file * filp) |
tty | 1499 | kernel/chr_drv/console.c | tty->write = con_write; |
tty | 1500 | kernel/chr_drv/console.c | tty->ioctl = vt_ioctl; |
tty | 1501 | kernel/chr_drv/console.c | if (tty->line > NR_CONSOLES) |
tty | 59 | kernel/chr_drv/keyboard.c | static struct tty_struct * tty = NULL; |
tty | 107 | kernel/chr_drv/keyboard.c | tty = TTY_TABLE(0); |
tty | 136 | kernel/chr_drv/keyboard.c | (vc_kbd_flag(kbd,VC_REPEAT) && tty && |
tty | 137 | kernel/chr_drv/keyboard.c | (L_ECHO(tty) || (EMPTY(&tty->secondary) && EMPTY(&tty->read_q))))) |
tty | 149 | kernel/chr_drv/keyboard.c | if (!tty) |
tty | 151 | kernel/chr_drv/keyboard.c | qp = &tty->read_q; |
tty | 166 | kernel/chr_drv/keyboard.c | if (!tty) |
tty | 168 | kernel/chr_drv/keyboard.c | qp = &tty->read_q; |
tty | 269 | kernel/chr_drv/keyboard.c | put_queue(INTR_CHAR(tty)); |
tty | 280 | kernel/chr_drv/keyboard.c | put_queue(START_CHAR(tty)); |
tty | 284 | kernel/chr_drv/keyboard.c | put_queue(STOP_CHAR(tty)); |
tty | 24 | kernel/chr_drv/pty.c | static void pty_close(struct tty_struct * tty, struct file * filp) |
tty | 26 | kernel/chr_drv/pty.c | if (!tty || (tty->count > 1)) |
tty | 28 | kernel/chr_drv/pty.c | wake_up_interruptible(&tty->read_q.proc_list); |
tty | 29 | kernel/chr_drv/pty.c | if (!tty->link) |
tty | 31 | kernel/chr_drv/pty.c | wake_up_interruptible(&tty->link->write_q.proc_list); |
tty | 32 | kernel/chr_drv/pty.c | if (IS_A_PTY_MASTER(tty->line)) { |
tty | 33 | kernel/chr_drv/pty.c | tty_hangup(tty->link); |
tty | 34 | kernel/chr_drv/pty.c | flush_input(tty); |
tty | 35 | kernel/chr_drv/pty.c | flush_output(tty); |
tty | 68 | kernel/chr_drv/pty.c | static void pty_write(struct tty_struct * tty) |
tty | 70 | kernel/chr_drv/pty.c | if (tty->link) |
tty | 71 | kernel/chr_drv/pty.c | pty_copy(tty,tty->link); |
tty | 74 | kernel/chr_drv/pty.c | int pty_open(struct tty_struct *tty, struct file * filp) |
tty | 76 | kernel/chr_drv/pty.c | if (!tty || !tty->link) |
tty | 78 | kernel/chr_drv/pty.c | tty->write = tty->link->write = pty_write; |
tty | 79 | kernel/chr_drv/pty.c | tty->close = tty->link->close = pty_close; |
tty | 80 | kernel/chr_drv/pty.c | wake_up_interruptible(&tty->read_q.proc_list); |
tty | 83 | kernel/chr_drv/pty.c | while (!tty->link->count && !(current->signal & ~current->blocked)) |
tty | 84 | kernel/chr_drv/pty.c | interruptible_sleep_on(&tty->link->read_q.proc_list); |
tty | 85 | kernel/chr_drv/pty.c | if (!tty->link->count) |
tty | 145 | kernel/chr_drv/serial.c | static void rs_throttle(struct tty_struct * tty, int status); |
tty | 213 | kernel/chr_drv/serial.c | queue = &info->tty->read_q; |
tty | 225 | kernel/chr_drv/serial.c | set_bit(head, &info->tty->readq_flags); |
tty | 240 | kernel/chr_drv/serial.c | &info->tty->flags)) |
tty | 241 | kernel/chr_drv/serial.c | rs_throttle(info->tty, TTY_THROTTLE_RQ_FULL); |
tty | 250 | kernel/chr_drv/serial.c | queue = &info->tty->write_q; |
tty | 268 | kernel/chr_drv/serial.c | if (info->tty->write_data_cnt) { |
tty | 269 | kernel/chr_drv/serial.c | set_bit(info->tty->line, &tty_check_write); |
tty | 285 | kernel/chr_drv/serial.c | if ((status & UART_MSR_DDCD) && !C_LOCAL(info->tty)) { |
tty | 291 | kernel/chr_drv/serial.c | if (C_RTSCTS(info->tty)) { |
tty | 292 | kernel/chr_drv/serial.c | if (info->tty->stopped) { |
tty | 294 | kernel/chr_drv/serial.c | info->tty->stopped = 0; |
tty | 298 | kernel/chr_drv/serial.c | info->tty->stopped = !(status & UART_MSR_CTS); |
tty | 345 | kernel/chr_drv/serial.c | !info->tty->stopped) { |
tty | 397 | kernel/chr_drv/serial.c | do_SAK(info->tty); |
tty | 399 | kernel/chr_drv/serial.c | if (I_BRKINT(info->tty)) { |
tty | 400 | kernel/chr_drv/serial.c | flush_input(info->tty); |
tty | 401 | kernel/chr_drv/serial.c | flush_output(info->tty); |
tty | 402 | kernel/chr_drv/serial.c | if (info->tty->pgrp > 0) |
tty | 403 | kernel/chr_drv/serial.c | kill_pg(info->tty->pgrp, SIGINT,1); |
tty | 423 | kernel/chr_drv/serial.c | if (!info->tty) |
tty | 426 | kernel/chr_drv/serial.c | TTY_READ_FLUSH(info->tty); |
tty | 429 | kernel/chr_drv/serial.c | wake_up_interruptible(&info->tty->write_q.proc_list); |
tty | 432 | kernel/chr_drv/serial.c | tty_hangup(info->tty); |
tty | 574 | kernel/chr_drv/serial.c | if (info->tty) |
tty | 575 | kernel/chr_drv/serial.c | clear_bit(TTY_IO_ERROR, &info->tty->flags); |
tty | 579 | kernel/chr_drv/serial.c | if (info->tty && info->tty->termios && I_INPCK(info->tty)) |
tty | 597 | kernel/chr_drv/serial.c | if (info->tty && !(info->tty->termios->c_cflag & HUPCL)) |
tty | 605 | kernel/chr_drv/serial.c | if (info->tty) |
tty | 606 | kernel/chr_drv/serial.c | set_bit(TTY_IO_ERROR, &info->tty->flags); |
tty | 625 | kernel/chr_drv/serial.c | if (!info->tty || !info->tty->termios) |
tty | 627 | kernel/chr_drv/serial.c | cflag = info->tty->termios->c_cflag; |
tty | 697 | kernel/chr_drv/serial.c | queue = &info->tty->write_q; |
tty | 716 | kernel/chr_drv/serial.c | void rs_write(struct tty_struct * tty) |
tty | 720 | kernel/chr_drv/serial.c | if (!tty || tty->stopped) |
tty | 722 | kernel/chr_drv/serial.c | info = rs_table + DEV_TO_SL(tty->line); |
tty | 737 | kernel/chr_drv/serial.c | static void rs_throttle(struct tty_struct * tty, int status) |
tty | 743 | kernel/chr_drv/serial.c | printk("throttle tty%d: %d (%d, %d)....\n", DEV_TO_SL(tty->line), |
tty | 744 | kernel/chr_drv/serial.c | status, LEFT(&tty->read_q), LEFT(&tty->secondary)); |
tty | 748 | kernel/chr_drv/serial.c | info = rs_table + DEV_TO_SL(tty->line); |
tty | 749 | kernel/chr_drv/serial.c | if (tty->termios->c_iflag & IXOFF) { |
tty | 750 | kernel/chr_drv/serial.c | info->x_char = STOP_CHAR(tty); |
tty | 758 | kernel/chr_drv/serial.c | info = rs_table + DEV_TO_SL(tty->line); |
tty | 759 | kernel/chr_drv/serial.c | if (tty->termios->c_iflag & IXOFF) { |
tty | 764 | kernel/chr_drv/serial.c | info->x_char = START_CHAR(tty); |
tty | 972 | kernel/chr_drv/serial.c | static int rs_ioctl(struct tty_struct *tty, struct file * file, |
tty | 978 | kernel/chr_drv/serial.c | line = DEV_TO_SL(tty->line); |
tty | 985 | kernel/chr_drv/serial.c | wait_until_sent(tty); |
tty | 990 | kernel/chr_drv/serial.c | wait_until_sent(tty); |
tty | 997 | kernel/chr_drv/serial.c | put_fs_long(C_LOCAL(tty) ? 1 : 0, |
tty | 1002 | kernel/chr_drv/serial.c | tty->termios->c_cflag = |
tty | 1003 | kernel/chr_drv/serial.c | ((tty->termios->c_cflag & ~CLOCAL) | |
tty | 1032 | kernel/chr_drv/serial.c | static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios) |
tty | 1036 | kernel/chr_drv/serial.c | if (tty->termios->c_cflag == old_termios->c_cflag) |
tty | 1039 | kernel/chr_drv/serial.c | info = &rs_table[DEV_TO_SL(tty->line)]; |
tty | 1041 | kernel/chr_drv/serial.c | change_speed(DEV_TO_SL(tty->line)); |
tty | 1044 | kernel/chr_drv/serial.c | !(tty->termios->c_cflag & CRTSCTS)) { |
tty | 1045 | kernel/chr_drv/serial.c | tty->stopped = 0; |
tty | 1046 | kernel/chr_drv/serial.c | rs_write(tty); |
tty | 1050 | kernel/chr_drv/serial.c | (tty->termios->c_cflag & CLOCAL)) |
tty | 1053 | kernel/chr_drv/serial.c | if (I_INPCK(tty)) |
tty | 1070 | kernel/chr_drv/serial.c | static void rs_close(struct tty_struct *tty, struct file * filp) |
tty | 1075 | kernel/chr_drv/serial.c | line = DEV_TO_SL(tty->line); |
tty | 1084 | kernel/chr_drv/serial.c | tty->stopped = 0; /* Force flush to succeed */ |
tty | 1085 | kernel/chr_drv/serial.c | wait_until_sent(tty); |
tty | 1115 | kernel/chr_drv/serial.c | info->tty = 0; |
tty | 1123 | kernel/chr_drv/serial.c | static int block_til_ready(struct tty_struct *tty, struct file * filp, |
tty | 1178 | kernel/chr_drv/serial.c | (C_LOCAL(tty) || |
tty | 1211 | kernel/chr_drv/serial.c | int rs_open(struct tty_struct *tty, struct file * filp) |
tty | 1217 | kernel/chr_drv/serial.c | line = DEV_TO_SL(tty->line); |
tty | 1225 | kernel/chr_drv/serial.c | info->tty = tty; |
tty | 1227 | kernel/chr_drv/serial.c | tty->write = rs_write; |
tty | 1228 | kernel/chr_drv/serial.c | tty->close = rs_close; |
tty | 1229 | kernel/chr_drv/serial.c | tty->ioctl = rs_ioctl; |
tty | 1230 | kernel/chr_drv/serial.c | tty->throttle = rs_throttle; |
tty | 1231 | kernel/chr_drv/serial.c | tty->set_termios = rs_set_termios; |
tty | 1235 | kernel/chr_drv/serial.c | set_bit(TTY_IO_ERROR, &tty->flags); |
tty | 1269 | kernel/chr_drv/serial.c | retval = block_til_ready(tty, filp, info); |
tty | 1536 | kernel/chr_drv/serial.c | info->tty = 0; |
tty | 69 | kernel/chr_drv/tty_io.c | static void initialize_tty_struct(int line, struct tty_struct *tty); |
tty | 126 | kernel/chr_drv/tty_io.c | int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, int buflen) |
tty | 134 | kernel/chr_drv/tty_io.c | tail = tty->read_q.tail; |
tty | 135 | kernel/chr_drv/tty_io.c | head = tty->read_q.head; |
tty | 137 | kernel/chr_drv/tty_io.c | *p++ = tty->read_q.buf[tail++]; |
tty | 141 | kernel/chr_drv/tty_io.c | tty->read_q.tail = tail; |
tty | 147 | kernel/chr_drv/tty_io.c | void tty_write_flush(struct tty_struct * tty) |
tty | 149 | kernel/chr_drv/tty_io.c | if (!tty->write || EMPTY(&tty->write_q)) |
tty | 151 | kernel/chr_drv/tty_io.c | if (set_bit(TTY_WRITE_BUSY,&tty->flags)) |
tty | 153 | kernel/chr_drv/tty_io.c | tty->write(tty); |
tty | 154 | kernel/chr_drv/tty_io.c | if (clear_bit(TTY_WRITE_BUSY,&tty->flags)) |
tty | 158 | kernel/chr_drv/tty_io.c | void tty_read_flush(struct tty_struct * tty) |
tty | 160 | kernel/chr_drv/tty_io.c | if (!tty || EMPTY(&tty->read_q)) |
tty | 162 | kernel/chr_drv/tty_io.c | if (set_bit(TTY_READ_BUSY, &tty->flags)) |
tty | 164 | kernel/chr_drv/tty_io.c | ldiscs[tty->disc].handler(tty); |
tty | 165 | kernel/chr_drv/tty_io.c | if (clear_bit(TTY_READ_BUSY, &tty->flags)) |
tty | 231 | kernel/chr_drv/tty_io.c | void do_tty_hangup(struct tty_struct * tty, struct file_operations *fops) |
tty | 237 | kernel/chr_drv/tty_io.c | if (!tty) |
tty | 239 | kernel/chr_drv/tty_io.c | dev = 0x0400 + tty->line; |
tty | 252 | kernel/chr_drv/tty_io.c | wake_up_interruptible(&tty->secondary.proc_list); |
tty | 253 | kernel/chr_drv/tty_io.c | wake_up_interruptible(&tty->read_q.proc_list); |
tty | 254 | kernel/chr_drv/tty_io.c | wake_up_interruptible(&tty->write_q.proc_list); |
tty | 255 | kernel/chr_drv/tty_io.c | if (tty->session > 0) |
tty | 256 | kernel/chr_drv/tty_io.c | kill_sl(tty->session,SIGHUP,1); |
tty | 257 | kernel/chr_drv/tty_io.c | tty->session = 0; |
tty | 258 | kernel/chr_drv/tty_io.c | tty->pgrp = -1; |
tty | 260 | kernel/chr_drv/tty_io.c | if ((*p) && (*p)->tty == tty->line) |
tty | 261 | kernel/chr_drv/tty_io.c | (*p)->tty = -1; |
tty | 265 | kernel/chr_drv/tty_io.c | void tty_hangup(struct tty_struct * tty) |
tty | 267 | kernel/chr_drv/tty_io.c | do_tty_hangup(tty, &hung_up_tty_fops); |
tty | 270 | kernel/chr_drv/tty_io.c | void tty_vhangup(struct tty_struct * tty) |
tty | 272 | kernel/chr_drv/tty_io.c | do_tty_hangup(tty, &vhung_up_tty_fops); |
tty | 466 | kernel/chr_drv/tty_io.c | void copy_to_cooked(struct tty_struct * tty) |
tty | 471 | kernel/chr_drv/tty_io.c | if (!tty) { |
tty | 475 | kernel/chr_drv/tty_io.c | if (!tty->write) { |
tty | 477 | kernel/chr_drv/tty_io.c | tty->line); |
tty | 485 | kernel/chr_drv/tty_io.c | c = LEFT(&tty->secondary); |
tty | 486 | kernel/chr_drv/tty_io.c | if (tty->throttle && (c < SQ_THRESHOLD_LW) |
tty | 487 | kernel/chr_drv/tty_io.c | && !set_bit(TTY_SQ_THROTTLED, &tty->flags)) |
tty | 488 | kernel/chr_drv/tty_io.c | tty->throttle(tty, TTY_THROTTLE_SQ_FULL); |
tty | 492 | kernel/chr_drv/tty_io.c | if (tty->read_q.tail != tty->read_q.head) { |
tty | 493 | kernel/chr_drv/tty_io.c | c = 0xff & tty->read_q.buf[tty->read_q.tail]; |
tty | 494 | kernel/chr_drv/tty_io.c | special_flag = !clear_bit(tty->read_q.tail, |
tty | 495 | kernel/chr_drv/tty_io.c | &tty->readq_flags); |
tty | 496 | kernel/chr_drv/tty_io.c | tty->read_q.tail = (tty->read_q.tail + 1) & |
tty | 504 | kernel/chr_drv/tty_io.c | tty->char_error = c & 3; |
tty | 507 | kernel/chr_drv/tty_io.c | if (tty->char_error) { |
tty | 508 | kernel/chr_drv/tty_io.c | if (tty->char_error == TTY_BREAK) { |
tty | 509 | kernel/chr_drv/tty_io.c | tty->char_error = 0; |
tty | 510 | kernel/chr_drv/tty_io.c | if (I_IGNBRK(tty)) |
tty | 512 | kernel/chr_drv/tty_io.c | if (I_PARMRK(tty)) { |
tty | 513 | kernel/chr_drv/tty_io.c | put_tty_queue(0377, &tty->secondary); |
tty | 514 | kernel/chr_drv/tty_io.c | put_tty_queue(0, &tty->secondary); |
tty | 516 | kernel/chr_drv/tty_io.c | put_tty_queue(0, &tty->secondary); |
tty | 520 | kernel/chr_drv/tty_io.c | tty->char_error = 0; |
tty | 521 | kernel/chr_drv/tty_io.c | if (I_IGNPAR(tty)) { |
tty | 524 | kernel/chr_drv/tty_io.c | if (I_PARMRK(tty)) { |
tty | 525 | kernel/chr_drv/tty_io.c | put_tty_queue(0377, &tty->secondary); |
tty | 526 | kernel/chr_drv/tty_io.c | put_tty_queue(0, &tty->secondary); |
tty | 527 | kernel/chr_drv/tty_io.c | put_tty_queue(c, &tty->secondary); |
tty | 529 | kernel/chr_drv/tty_io.c | put_tty_queue(0, &tty->secondary); |
tty | 532 | kernel/chr_drv/tty_io.c | if (I_STRP(tty)) |
tty | 534 | kernel/chr_drv/tty_io.c | else if (I_PARMRK(tty) && (c == 0377)) |
tty | 535 | kernel/chr_drv/tty_io.c | put_tty_queue(0377, &tty->secondary); |
tty | 537 | kernel/chr_drv/tty_io.c | if (I_CRNL(tty)) |
tty | 539 | kernel/chr_drv/tty_io.c | else if (I_NOCR(tty)) |
tty | 541 | kernel/chr_drv/tty_io.c | } else if (c==10 && I_NLCR(tty)) |
tty | 543 | kernel/chr_drv/tty_io.c | if (I_UCLC(tty)) |
tty | 546 | kernel/chr_drv/tty_io.c | tty->lnext = 1; |
tty | 547 | kernel/chr_drv/tty_io.c | if (L_CANON(tty) && !tty->lnext) { |
tty | 548 | kernel/chr_drv/tty_io.c | if (c == KILL_CHAR(tty) || c == WERASE_CHAR(tty)) { |
tty | 550 | kernel/chr_drv/tty_io.c | (c == WERASE_CHAR(tty)) ? 0 : -1; |
tty | 553 | kernel/chr_drv/tty_io.c | while(!(EMPTY(&tty->secondary) || |
tty | 554 | kernel/chr_drv/tty_io.c | (c=LAST(&tty->secondary))==10 || |
tty | 555 | kernel/chr_drv/tty_io.c | ((EOF_CHAR(tty) != __DISABLED_CHAR) && |
tty | 556 | kernel/chr_drv/tty_io.c | (c==EOF_CHAR(tty))))) { |
tty | 566 | kernel/chr_drv/tty_io.c | if (L_ECHO(tty)) { |
tty | 568 | kernel/chr_drv/tty_io.c | put_tty_queue(8, &tty->write_q); |
tty | 569 | kernel/chr_drv/tty_io.c | put_tty_queue(' ', &tty->write_q); |
tty | 570 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 572 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 573 | kernel/chr_drv/tty_io.c | put_tty_queue(' ',&tty->write_q); |
tty | 574 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 576 | kernel/chr_drv/tty_io.c | DEC(tty->secondary.head); |
tty | 580 | kernel/chr_drv/tty_io.c | if (c == ERASE_CHAR(tty)) { |
tty | 581 | kernel/chr_drv/tty_io.c | if (EMPTY(&tty->secondary) || |
tty | 582 | kernel/chr_drv/tty_io.c | (c=LAST(&tty->secondary))==10 || |
tty | 583 | kernel/chr_drv/tty_io.c | ((EOF_CHAR(tty) != __DISABLED_CHAR) && |
tty | 584 | kernel/chr_drv/tty_io.c | (c==EOF_CHAR(tty)))) |
tty | 586 | kernel/chr_drv/tty_io.c | if (L_ECHO(tty)) { |
tty | 588 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 589 | kernel/chr_drv/tty_io.c | put_tty_queue(' ',&tty->write_q); |
tty | 590 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 592 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 593 | kernel/chr_drv/tty_io.c | put_tty_queue(32,&tty->write_q); |
tty | 594 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 596 | kernel/chr_drv/tty_io.c | DEC(tty->secondary.head); |
tty | 599 | kernel/chr_drv/tty_io.c | if (c == LNEXT_CHAR(tty)) { |
tty | 600 | kernel/chr_drv/tty_io.c | tty->lnext = 1; |
tty | 601 | kernel/chr_drv/tty_io.c | if (L_ECHO(tty)) { |
tty | 602 | kernel/chr_drv/tty_io.c | put_tty_queue('^',&tty->write_q); |
tty | 603 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 608 | kernel/chr_drv/tty_io.c | if (I_IXON(tty) && !tty->lnext) { |
tty | 609 | kernel/chr_drv/tty_io.c | if (c == STOP_CHAR(tty)) { |
tty | 610 | kernel/chr_drv/tty_io.c | tty->status_changed = 1; |
tty | 611 | kernel/chr_drv/tty_io.c | tty->ctrl_status |= TIOCPKT_STOP; |
tty | 612 | kernel/chr_drv/tty_io.c | tty->stopped=1; |
tty | 613 | kernel/chr_drv/tty_io.c | if (IS_A_CONSOLE(tty->line)) { |
tty | 619 | kernel/chr_drv/tty_io.c | if (((I_IXANY(tty)) && tty->stopped) || |
tty | 620 | kernel/chr_drv/tty_io.c | (c == START_CHAR(tty))) { |
tty | 621 | kernel/chr_drv/tty_io.c | tty->status_changed = 1; |
tty | 622 | kernel/chr_drv/tty_io.c | tty->ctrl_status |= TIOCPKT_START; |
tty | 623 | kernel/chr_drv/tty_io.c | tty->stopped=0; |
tty | 624 | kernel/chr_drv/tty_io.c | if (IS_A_CONSOLE(tty->line)) { |
tty | 631 | kernel/chr_drv/tty_io.c | if (L_ISIG(tty) && !tty->lnext) { |
tty | 632 | kernel/chr_drv/tty_io.c | if (c == INTR_CHAR(tty)) { |
tty | 633 | kernel/chr_drv/tty_io.c | kill_pg(tty->pgrp, SIGINT, 1); |
tty | 634 | kernel/chr_drv/tty_io.c | flush_input(tty); |
tty | 637 | kernel/chr_drv/tty_io.c | if (c == QUIT_CHAR(tty)) { |
tty | 638 | kernel/chr_drv/tty_io.c | kill_pg(tty->pgrp, SIGQUIT, 1); |
tty | 639 | kernel/chr_drv/tty_io.c | flush_input(tty); |
tty | 642 | kernel/chr_drv/tty_io.c | if (c == SUSPEND_CHAR(tty)) { |
tty | 643 | kernel/chr_drv/tty_io.c | if (!is_orphaned_pgrp(tty->pgrp)) { |
tty | 644 | kernel/chr_drv/tty_io.c | kill_pg(tty->pgrp, SIGTSTP, 1); |
tty | 645 | kernel/chr_drv/tty_io.c | flush_input(tty); |
tty | 650 | kernel/chr_drv/tty_io.c | if (c==10 || (EOF_CHAR(tty) != __DISABLED_CHAR && |
tty | 651 | kernel/chr_drv/tty_io.c | c==EOF_CHAR(tty))) |
tty | 652 | kernel/chr_drv/tty_io.c | tty->secondary.data++; |
tty | 653 | kernel/chr_drv/tty_io.c | if ((c==10) && (L_ECHO(tty) || (L_CANON(tty) && L_ECHONL(tty)))) { |
tty | 654 | kernel/chr_drv/tty_io.c | put_tty_queue(10,&tty->write_q); |
tty | 655 | kernel/chr_drv/tty_io.c | put_tty_queue(13,&tty->write_q); |
tty | 656 | kernel/chr_drv/tty_io.c | } else if (L_ECHO(tty)) { |
tty | 657 | kernel/chr_drv/tty_io.c | if (c<32 && L_ECHOCTL(tty)) { |
tty | 658 | kernel/chr_drv/tty_io.c | put_tty_queue('^',&tty->write_q); |
tty | 659 | kernel/chr_drv/tty_io.c | put_tty_queue(c+64, &tty->write_q); |
tty | 660 | kernel/chr_drv/tty_io.c | if (EOF_CHAR(tty) != __DISABLED_CHAR && |
tty | 661 | kernel/chr_drv/tty_io.c | c==EOF_CHAR(tty) && !tty->lnext) { |
tty | 662 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 663 | kernel/chr_drv/tty_io.c | put_tty_queue(8,&tty->write_q); |
tty | 666 | kernel/chr_drv/tty_io.c | put_tty_queue(c, &tty->write_q); |
tty | 668 | kernel/chr_drv/tty_io.c | tty->lnext = 0; |
tty | 669 | kernel/chr_drv/tty_io.c | put_tty_queue(c, &tty->secondary); |
tty | 671 | kernel/chr_drv/tty_io.c | TTY_WRITE_FLUSH(tty); |
tty | 672 | kernel/chr_drv/tty_io.c | if (!EMPTY(&tty->secondary)) |
tty | 673 | kernel/chr_drv/tty_io.c | wake_up_interruptible(&tty->secondary.proc_list); |
tty | 674 | kernel/chr_drv/tty_io.c | if (tty->write_q.proc_list && LEFT(&tty->write_q) > TTY_BUF_SIZE/2) |
tty | 675 | kernel/chr_drv/tty_io.c | wake_up_interruptible(&tty->write_q.proc_list); |
tty | 676 | kernel/chr_drv/tty_io.c | if (tty->throttle && (LEFT(&tty->read_q) >= RQ_THRESHOLD_HW) |
tty | 677 | kernel/chr_drv/tty_io.c | && !clear_bit(TTY_RQ_THROTTLED, &tty->flags)) |
tty | 678 | kernel/chr_drv/tty_io.c | tty->throttle(tty, TTY_THROTTLE_RQ_AVAIL); |
tty | 679 | kernel/chr_drv/tty_io.c | if (tty->throttle && (LEFT(&tty->secondary) >= SQ_THRESHOLD_HW) |
tty | 680 | kernel/chr_drv/tty_io.c | && !clear_bit(TTY_SQ_THROTTLED, &tty->flags)) |
tty | 681 | kernel/chr_drv/tty_io.c | tty->throttle(tty, TTY_THROTTLE_SQ_AVAIL); |
tty | 693 | kernel/chr_drv/tty_io.c | static void wait_for_canon_input(struct file * file, struct tty_struct * tty) |
tty | 695 | kernel/chr_drv/tty_io.c | if (!available_canon_input(tty)) { |
tty | 698 | kernel/chr_drv/tty_io.c | __wait_for_canon_input(file, tty); |
tty | 702 | kernel/chr_drv/tty_io.c | static int read_chan(struct tty_struct * tty, struct file * file, char * buf, int nr) |
tty | 709 | kernel/chr_drv/tty_io.c | if (L_CANON(tty)) |
tty | 712 | kernel/chr_drv/tty_io.c | time = 10L*tty->termios->c_cc[VTIME]; |
tty | 713 | kernel/chr_drv/tty_io.c | minimum = tty->termios->c_cc[VMIN]; |
tty | 727 | kernel/chr_drv/tty_io.c | if (L_CANON(tty)) { |
tty | 728 | kernel/chr_drv/tty_io.c | if (!available_canon_input(tty)) |
tty | 731 | kernel/chr_drv/tty_io.c | } else if (L_CANON(tty)) { |
tty | 732 | kernel/chr_drv/tty_io.c | wait_for_canon_input(file, tty); |
tty | 740 | kernel/chr_drv/tty_io.c | if (tty->packet && tty->link && tty->link->status_changed) { |
tty | 741 | kernel/chr_drv/tty_io.c | put_fs_byte (tty->link->ctrl_status, b); |
tty | 742 | kernel/chr_drv/tty_io.c | tty->link->status_changed = 0; |
tty | 747 | kernel/chr_drv/tty_io.c | if (tty->packet) { |
tty | 755 | kernel/chr_drv/tty_io.c | add_wait_queue(&tty->secondary.proc_list, &wait); |
tty | 761 | kernel/chr_drv/tty_io.c | TTY_READ_FLUSH(tty); |
tty | 762 | kernel/chr_drv/tty_io.c | if (tty->link) |
tty | 763 | kernel/chr_drv/tty_io.c | TTY_WRITE_FLUSH(tty->link); |
tty | 764 | kernel/chr_drv/tty_io.c | while (nr > 0 && ((c = get_tty_queue(&tty->secondary)) >= 0)) { |
tty | 765 | kernel/chr_drv/tty_io.c | if ((EOF_CHAR(tty) != __DISABLED_CHAR && |
tty | 766 | kernel/chr_drv/tty_io.c | c==EOF_CHAR(tty)) || c==10) |
tty | 767 | kernel/chr_drv/tty_io.c | tty->secondary.data--; |
tty | 768 | kernel/chr_drv/tty_io.c | if ((EOF_CHAR(tty) != __DISABLED_CHAR && |
tty | 769 | kernel/chr_drv/tty_io.c | c==EOF_CHAR(tty)) && L_CANON(tty)) |
tty | 775 | kernel/chr_drv/tty_io.c | if (c==10 && L_CANON(tty)) |
tty | 778 | kernel/chr_drv/tty_io.c | wake_up_interruptible(&tty->read_q.proc_list); |
tty | 783 | kernel/chr_drv/tty_io.c | if (tty->throttle && (LEFT(&tty->secondary) >= SQ_THRESHOLD_HW) |
tty | 784 | kernel/chr_drv/tty_io.c | && !clear_bit(TTY_SQ_THROTTLED, &tty->flags)) |
tty | 785 | kernel/chr_drv/tty_io.c | tty->throttle(tty, TTY_THROTTLE_SQ_AVAIL); |
tty | 790 | kernel/chr_drv/tty_io.c | if (tty->link && !tty->link->count) |
tty | 792 | kernel/chr_drv/tty_io.c | TTY_READ_FLUSH(tty); |
tty | 793 | kernel/chr_drv/tty_io.c | if (tty->link) |
tty | 794 | kernel/chr_drv/tty_io.c | TTY_WRITE_FLUSH(tty->link); |
tty | 795 | kernel/chr_drv/tty_io.c | if (!EMPTY(&tty->secondary)) |
tty | 798 | kernel/chr_drv/tty_io.c | if (EMPTY(&tty->secondary)) |
tty | 802 | kernel/chr_drv/tty_io.c | remove_wait_queue(&tty->secondary.proc_list, &wait); |
tty | 803 | kernel/chr_drv/tty_io.c | TTY_READ_FLUSH(tty); |
tty | 804 | kernel/chr_drv/tty_io.c | if (tty->link && tty->link->write) |
tty | 805 | kernel/chr_drv/tty_io.c | TTY_WRITE_FLUSH(tty->link); |
tty | 810 | kernel/chr_drv/tty_io.c | if (tty->packet) { |
tty | 825 | kernel/chr_drv/tty_io.c | static void __wait_for_canon_input(struct file * file, struct tty_struct * tty) |
tty | 829 | kernel/chr_drv/tty_io.c | add_wait_queue(&tty->secondary.proc_list, &wait); |
tty | 832 | kernel/chr_drv/tty_io.c | if (available_canon_input(tty)) |
tty | 841 | kernel/chr_drv/tty_io.c | remove_wait_queue(&tty->secondary.proc_list, &wait); |
tty | 844 | kernel/chr_drv/tty_io.c | static int available_canon_input(struct tty_struct * tty) |
tty | 846 | kernel/chr_drv/tty_io.c | TTY_READ_FLUSH(tty); |
tty | 847 | kernel/chr_drv/tty_io.c | if (tty->link) |
tty | 848 | kernel/chr_drv/tty_io.c | if (tty->link->count) |
tty | 849 | kernel/chr_drv/tty_io.c | TTY_WRITE_FLUSH(tty->link); |
tty | 852 | kernel/chr_drv/tty_io.c | if (FULL(&tty->read_q)) |
tty | 854 | kernel/chr_drv/tty_io.c | if (tty->secondary.data) |
tty | 859 | kernel/chr_drv/tty_io.c | static int write_chan(struct tty_struct * tty, struct file * file, char * buf, int nr) |
tty | 868 | kernel/chr_drv/tty_io.c | add_wait_queue(&tty->write_q.proc_list, &wait); |
tty | 874 | kernel/chr_drv/tty_io.c | if (tty->link && !tty->link->count) { |
tty | 879 | kernel/chr_drv/tty_io.c | if (FULL(&tty->write_q)) { |
tty | 880 | kernel/chr_drv/tty_io.c | TTY_WRITE_FLUSH(tty); |
tty | 881 | kernel/chr_drv/tty_io.c | if (FULL(&tty->write_q)) |
tty | 887 | kernel/chr_drv/tty_io.c | while (nr>0 && !FULL(&tty->write_q)) { |
tty | 889 | kernel/chr_drv/tty_io.c | if (O_POST(tty)) { |
tty | 890 | kernel/chr_drv/tty_io.c | if (c=='\r' && O_CRNL(tty)) |
tty | 892 | kernel/chr_drv/tty_io.c | else if (c=='\n' && O_NLRET(tty)) |
tty | 894 | kernel/chr_drv/tty_io.c | if (c=='\n' && O_NLCR(tty) && |
tty | 895 | kernel/chr_drv/tty_io.c | !set_bit(TTY_CR_PENDING,&tty->flags)) { |
tty | 896 | kernel/chr_drv/tty_io.c | put_tty_queue(13,&tty->write_q); |
tty | 899 | kernel/chr_drv/tty_io.c | if (O_LCUC(tty)) |
tty | 903 | kernel/chr_drv/tty_io.c | clear_bit(TTY_CR_PENDING,&tty->flags); |
tty | 904 | kernel/chr_drv/tty_io.c | put_tty_queue(c,&tty->write_q); |
tty | 909 | kernel/chr_drv/tty_io.c | remove_wait_queue(&tty->write_q.proc_list, &wait); |
tty | 910 | kernel/chr_drv/tty_io.c | TTY_WRITE_FLUSH(tty); |
tty | 913 | kernel/chr_drv/tty_io.c | if (tty->link && !tty->link->count) |
tty | 923 | kernel/chr_drv/tty_io.c | struct tty_struct * tty; |
tty | 931 | kernel/chr_drv/tty_io.c | tty = TTY_TABLE(dev); |
tty | 932 | kernel/chr_drv/tty_io.c | if (!tty || (tty->flags & (1 << TTY_IO_ERROR))) |
tty | 935 | kernel/chr_drv/tty_io.c | (tty->pgrp > 0) && |
tty | 936 | kernel/chr_drv/tty_io.c | (current->tty == dev) && |
tty | 937 | kernel/chr_drv/tty_io.c | (tty->pgrp != current->pgrp)) |
tty | 944 | kernel/chr_drv/tty_io.c | if (ldiscs[tty->disc].read) |
tty | 945 | kernel/chr_drv/tty_io.c | i = (ldiscs[tty->disc].read)(tty,file,buf,count); |
tty | 956 | kernel/chr_drv/tty_io.c | struct tty_struct * tty; |
tty | 966 | kernel/chr_drv/tty_io.c | tty = redirect; |
tty | 968 | kernel/chr_drv/tty_io.c | tty = TTY_TABLE(dev); |
tty | 969 | kernel/chr_drv/tty_io.c | if (!tty || !tty->write || (tty->flags & (1 << TTY_IO_ERROR))) |
tty | 971 | kernel/chr_drv/tty_io.c | if (!is_console && L_TOSTOP(tty) && (tty->pgrp > 0) && |
tty | 972 | kernel/chr_drv/tty_io.c | (current->tty == dev) && (tty->pgrp != current->pgrp)) { |
tty | 980 | kernel/chr_drv/tty_io.c | if (ldiscs[tty->disc].write) |
tty | 981 | kernel/chr_drv/tty_io.c | i = (ldiscs[tty->disc].write)(tty,file,buf,count); |
tty | 996 | kernel/chr_drv/tty_io.c | struct tty_struct *tty, *o_tty; |
tty | 1002 | kernel/chr_drv/tty_io.c | tty = o_tty = NULL; |
tty | 1009 | kernel/chr_drv/tty_io.c | if (!tty_table[dev] && !tty) { |
tty | 1010 | kernel/chr_drv/tty_io.c | tty = (struct tty_struct *) get_free_page(GFP_KERNEL); |
tty | 1011 | kernel/chr_drv/tty_io.c | if (!tty) |
tty | 1013 | kernel/chr_drv/tty_io.c | initialize_tty_struct(dev, tty); |
tty | 1045 | kernel/chr_drv/tty_io.c | tty->termios = tty_termios[dev]; |
tty | 1046 | kernel/chr_drv/tty_io.c | tty_table[dev] = tty; |
tty | 1047 | kernel/chr_drv/tty_io.c | tty = NULL; |
tty | 1067 | kernel/chr_drv/tty_io.c | if (tty) |
tty | 1068 | kernel/chr_drv/tty_io.c | free_page((unsigned long) tty); |
tty | 1085 | kernel/chr_drv/tty_io.c | struct tty_struct *tty, *o_tty; |
tty | 1089 | kernel/chr_drv/tty_io.c | tty = tty_table[dev]; |
tty | 1093 | kernel/chr_drv/tty_io.c | if (!tty) { |
tty | 1112 | kernel/chr_drv/tty_io.c | if (tty->link != o_tty || o_tty->link != tty) { |
tty | 1117 | kernel/chr_drv/tty_io.c | tty->write_data_cnt = 0; /* Clear out pending trash */ |
tty | 1118 | kernel/chr_drv/tty_io.c | if (tty->close) |
tty | 1119 | kernel/chr_drv/tty_io.c | tty->close(tty, filp); |
tty | 1121 | kernel/chr_drv/tty_io.c | if (--tty->link->count < 0) { |
tty | 1123 | kernel/chr_drv/tty_io.c | dev, tty->count); |
tty | 1124 | kernel/chr_drv/tty_io.c | tty->link->count = 0; |
tty | 1127 | kernel/chr_drv/tty_io.c | if (--tty->count < 0) { |
tty | 1129 | kernel/chr_drv/tty_io.c | dev, tty->count); |
tty | 1130 | kernel/chr_drv/tty_io.c | tty->count = 0; |
tty | 1132 | kernel/chr_drv/tty_io.c | if (tty->count) |
tty | 1140 | kernel/chr_drv/tty_io.c | if ((*p) && (*p)->tty == tty->line) |
tty | 1141 | kernel/chr_drv/tty_io.c | (*p)->tty = -1; |
tty | 1144 | kernel/chr_drv/tty_io.c | if (ldiscs[tty->disc].close != NULL) |
tty | 1145 | kernel/chr_drv/tty_io.c | ldiscs[tty->disc].close(tty); |
tty | 1160 | kernel/chr_drv/tty_io.c | if (tty == redirect || o_tty == redirect) |
tty | 1162 | kernel/chr_drv/tty_io.c | free_page((unsigned long) tty); |
tty | 1183 | kernel/chr_drv/tty_io.c | struct tty_struct *tty; |
tty | 1193 | kernel/chr_drv/tty_io.c | minor = current->tty; |
tty | 1213 | kernel/chr_drv/tty_io.c | tty = tty_table[minor]; |
tty | 1222 | kernel/chr_drv/tty_io.c | tty->status_changed = 0; |
tty | 1223 | kernel/chr_drv/tty_io.c | tty->ctrl_status = 0; |
tty | 1224 | kernel/chr_drv/tty_io.c | tty->packet = 0; |
tty | 1226 | kernel/chr_drv/tty_io.c | if (tty->open) { |
tty | 1227 | kernel/chr_drv/tty_io.c | retval = tty->open(tty, filp); |
tty | 1237 | kernel/chr_drv/tty_io.c | current->tty<0 && |
tty | 1238 | kernel/chr_drv/tty_io.c | tty->session==0) { |
tty | 1239 | kernel/chr_drv/tty_io.c | current->tty = minor; |
tty | 1240 | kernel/chr_drv/tty_io.c | tty->session = current->session; |
tty | 1241 | kernel/chr_drv/tty_io.c | tty->pgrp = current->pgrp; |
tty | 1272 | kernel/chr_drv/tty_io.c | struct tty_struct * tty; |
tty | 1280 | kernel/chr_drv/tty_io.c | tty = TTY_TABLE(dev); |
tty | 1281 | kernel/chr_drv/tty_io.c | if (!tty) { |
tty | 1287 | kernel/chr_drv/tty_io.c | if (L_CANON(tty)) { |
tty | 1288 | kernel/chr_drv/tty_io.c | if (available_canon_input(tty)) |
tty | 1290 | kernel/chr_drv/tty_io.c | } else if (!EMPTY(&tty->secondary)) |
tty | 1292 | kernel/chr_drv/tty_io.c | if (tty->link && !tty->link->count) |
tty | 1296 | kernel/chr_drv/tty_io.c | if (tty->packet && tty->link && |
tty | 1297 | kernel/chr_drv/tty_io.c | tty->link->status_changed) |
tty | 1300 | kernel/chr_drv/tty_io.c | select_wait(&tty->secondary.proc_list, wait); |
tty | 1303 | kernel/chr_drv/tty_io.c | if (!FULL(&tty->write_q)) |
tty | 1305 | kernel/chr_drv/tty_io.c | select_wait(&tty->write_q.proc_list, wait); |
tty | 1308 | kernel/chr_drv/tty_io.c | if (tty->link && !tty->link->count) |
tty | 1327 | kernel/chr_drv/tty_io.c | void do_SAK( struct tty_struct *tty) |
tty | 1330 | kernel/chr_drv/tty_io.c | int line = tty->line; |
tty | 1331 | kernel/chr_drv/tty_io.c | int session = tty->session; |
tty | 1335 | kernel/chr_drv/tty_io.c | flush_input(tty); |
tty | 1336 | kernel/chr_drv/tty_io.c | flush_output(tty); |
tty | 1340 | kernel/chr_drv/tty_io.c | if (((*p)->tty == line) || |
tty | 1371 | kernel/chr_drv/tty_io.c | int tty_write_data(struct tty_struct *tty, char *bufp, int buflen, |
tty | 1381 | kernel/chr_drv/tty_io.c | if (tty->write_data_cnt) { |
tty | 1386 | kernel/chr_drv/tty_io.c | head = tty->write_q.head; |
tty | 1387 | kernel/chr_drv/tty_io.c | tail = tty->write_q.tail; |
tty | 1392 | kernel/chr_drv/tty_io.c | tty->write_q.buf[head++] = *p++; |
tty | 1395 | kernel/chr_drv/tty_io.c | tty->write_q.head = head; |
tty | 1397 | kernel/chr_drv/tty_io.c | tty->write_data_cnt = count; |
tty | 1398 | kernel/chr_drv/tty_io.c | tty->write_data_ptr = p; |
tty | 1399 | kernel/chr_drv/tty_io.c | tty->write_data_callback = callback; |
tty | 1400 | kernel/chr_drv/tty_io.c | tty->write_data_arg = callarg; |
tty | 1419 | kernel/chr_drv/tty_io.c | struct tty_struct * tty; |
tty | 1428 | kernel/chr_drv/tty_io.c | tty = tty_table[line]; |
tty | 1429 | kernel/chr_drv/tty_io.c | if (!tty || !tty->write_data_cnt) |
tty | 1432 | kernel/chr_drv/tty_io.c | head = tty->write_q.head; |
tty | 1433 | kernel/chr_drv/tty_io.c | tail = tty->write_q.tail; |
tty | 1434 | kernel/chr_drv/tty_io.c | count = tty->write_data_cnt; |
tty | 1435 | kernel/chr_drv/tty_io.c | p = tty->write_data_ptr; |
tty | 1438 | kernel/chr_drv/tty_io.c | tty->write_q.buf[head++] = *p++; |
tty | 1441 | kernel/chr_drv/tty_io.c | tty->write_q.head = head; |
tty | 1442 | kernel/chr_drv/tty_io.c | tty->write_data_ptr = p; |
tty | 1443 | kernel/chr_drv/tty_io.c | tty->write_data_cnt = count; |
tty | 1446 | kernel/chr_drv/tty_io.c | (tty->write_data_callback) |
tty | 1447 | kernel/chr_drv/tty_io.c | (tty->write_data_arg); |
tty | 1458 | kernel/chr_drv/tty_io.c | static void initialize_tty_struct(int line, struct tty_struct *tty) |
tty | 1460 | kernel/chr_drv/tty_io.c | memset(tty, 0, sizeof(struct tty_struct)); |
tty | 1461 | kernel/chr_drv/tty_io.c | tty->line = line; |
tty | 1462 | kernel/chr_drv/tty_io.c | tty->disc = N_TTY; |
tty | 1463 | kernel/chr_drv/tty_io.c | tty->pgrp = -1; |
tty | 1464 | kernel/chr_drv/tty_io.c | tty->winsize.ws_row = 0; |
tty | 1465 | kernel/chr_drv/tty_io.c | tty->winsize.ws_col = 0; |
tty | 1467 | kernel/chr_drv/tty_io.c | tty->open = con_open; |
tty | 1468 | kernel/chr_drv/tty_io.c | tty->winsize.ws_row = video_num_lines; |
tty | 1469 | kernel/chr_drv/tty_io.c | tty->winsize.ws_col = video_num_columns; |
tty | 1471 | kernel/chr_drv/tty_io.c | tty->open = rs_open; |
tty | 1473 | kernel/chr_drv/tty_io.c | tty->open = pty_open; |
tty | 44 | kernel/chr_drv/tty_ioctl.c | void flush_input(struct tty_struct * tty) |
tty | 46 | kernel/chr_drv/tty_ioctl.c | tty->status_changed = 1; |
tty | 47 | kernel/chr_drv/tty_ioctl.c | tty->ctrl_status |= TIOCPKT_FLUSHREAD; |
tty | 48 | kernel/chr_drv/tty_ioctl.c | flush(&tty->read_q); |
tty | 49 | kernel/chr_drv/tty_ioctl.c | wake_up_interruptible(&tty->read_q.proc_list); |
tty | 50 | kernel/chr_drv/tty_ioctl.c | flush(&tty->secondary); |
tty | 51 | kernel/chr_drv/tty_ioctl.c | tty->secondary.data = 0; |
tty | 53 | kernel/chr_drv/tty_ioctl.c | if ((tty = tty->link) != NULL) { |
tty | 54 | kernel/chr_drv/tty_ioctl.c | flush(&tty->write_q); |
tty | 55 | kernel/chr_drv/tty_ioctl.c | wake_up_interruptible(&tty->write_q.proc_list); |
tty | 59 | kernel/chr_drv/tty_ioctl.c | void flush_output(struct tty_struct * tty) |
tty | 61 | kernel/chr_drv/tty_ioctl.c | tty->status_changed = 1; |
tty | 62 | kernel/chr_drv/tty_ioctl.c | tty->ctrl_status |= TIOCPKT_FLUSHWRITE; |
tty | 63 | kernel/chr_drv/tty_ioctl.c | flush(&tty->write_q); |
tty | 64 | kernel/chr_drv/tty_ioctl.c | wake_up_interruptible(&tty->write_q.proc_list); |
tty | 65 | kernel/chr_drv/tty_ioctl.c | if ((tty = tty->link) != NULL) { |
tty | 66 | kernel/chr_drv/tty_ioctl.c | flush(&tty->read_q); |
tty | 67 | kernel/chr_drv/tty_ioctl.c | wake_up_interruptible(&tty->read_q.proc_list); |
tty | 68 | kernel/chr_drv/tty_ioctl.c | flush(&tty->secondary); |
tty | 69 | kernel/chr_drv/tty_ioctl.c | tty->secondary.data = 0; |
tty | 73 | kernel/chr_drv/tty_ioctl.c | void wait_until_sent(struct tty_struct * tty) |
tty | 77 | kernel/chr_drv/tty_ioctl.c | TTY_WRITE_FLUSH(tty); |
tty | 78 | kernel/chr_drv/tty_ioctl.c | if (EMPTY(&tty->write_q)) |
tty | 80 | kernel/chr_drv/tty_ioctl.c | add_wait_queue(&tty->write_q.proc_list, &wait); |
tty | 86 | kernel/chr_drv/tty_ioctl.c | TTY_WRITE_FLUSH(tty); |
tty | 87 | kernel/chr_drv/tty_ioctl.c | if (EMPTY(&tty->write_q)) |
tty | 92 | kernel/chr_drv/tty_ioctl.c | remove_wait_queue(&tty->write_q.proc_list, &wait); |
tty | 124 | kernel/chr_drv/tty_ioctl.c | static int get_termios(struct tty_struct * tty, struct termios * termios) |
tty | 132 | kernel/chr_drv/tty_ioctl.c | put_fs_byte( ((char *)tty->termios)[i] , i+(char *)termios ); |
tty | 136 | kernel/chr_drv/tty_ioctl.c | static int check_change(struct tty_struct * tty, int channel) |
tty | 141 | kernel/chr_drv/tty_ioctl.c | if (current->tty != channel) |
tty | 143 | kernel/chr_drv/tty_ioctl.c | if (tty->pgrp <= 0 || tty->pgrp == current->pgrp) |
tty | 153 | kernel/chr_drv/tty_ioctl.c | static int set_termios(struct tty_struct * tty, struct termios * termios, |
tty | 157 | kernel/chr_drv/tty_ioctl.c | struct termios old_termios = *tty->termios; |
tty | 159 | kernel/chr_drv/tty_ioctl.c | i = check_change(tty, channel); |
tty | 163 | kernel/chr_drv/tty_ioctl.c | ((char *)tty->termios)[i]=get_fs_byte(i+(char *)termios); |
tty | 168 | kernel/chr_drv/tty_ioctl.c | if (IS_A_PTY_MASTER(channel)) tty->termios->c_lflag &= ~ECHO; |
tty | 170 | kernel/chr_drv/tty_ioctl.c | if (tty->set_termios) |
tty | 171 | kernel/chr_drv/tty_ioctl.c | (*tty->set_termios)(tty, &old_termios); |
tty | 176 | kernel/chr_drv/tty_ioctl.c | static int get_termio(struct tty_struct * tty, struct termio * termio) |
tty | 184 | kernel/chr_drv/tty_ioctl.c | tmp_termio.c_iflag = tty->termios->c_iflag; |
tty | 185 | kernel/chr_drv/tty_ioctl.c | tmp_termio.c_oflag = tty->termios->c_oflag; |
tty | 186 | kernel/chr_drv/tty_ioctl.c | tmp_termio.c_cflag = tty->termios->c_cflag; |
tty | 187 | kernel/chr_drv/tty_ioctl.c | tmp_termio.c_lflag = tty->termios->c_lflag; |
tty | 188 | kernel/chr_drv/tty_ioctl.c | tmp_termio.c_line = tty->termios->c_line; |
tty | 190 | kernel/chr_drv/tty_ioctl.c | tmp_termio.c_cc[i] = tty->termios->c_cc[i]; |
tty | 199 | kernel/chr_drv/tty_ioctl.c | static int set_termio(struct tty_struct * tty, struct termio * termio, |
tty | 204 | kernel/chr_drv/tty_ioctl.c | struct termios old_termios = *tty->termios; |
tty | 206 | kernel/chr_drv/tty_ioctl.c | i = check_change(tty, channel); |
tty | 214 | kernel/chr_drv/tty_ioctl.c | ~(tty->termios->c_iflag & IXON)) |
tty | 216 | kernel/chr_drv/tty_ioctl.c | tty->status_changed = 1; |
tty | 217 | kernel/chr_drv/tty_ioctl.c | tty->ctrl_status |= TIOCPKT_DOSTOP; |
tty | 221 | kernel/chr_drv/tty_ioctl.c | (tty->termios->c_iflag & IXON)) |
tty | 223 | kernel/chr_drv/tty_ioctl.c | tty->status_changed = 1; |
tty | 224 | kernel/chr_drv/tty_ioctl.c | tty->ctrl_status |= TIOCPKT_NOSTOP; |
tty | 227 | kernel/chr_drv/tty_ioctl.c | *(unsigned short *)&tty->termios->c_iflag = tmp_termio.c_iflag; |
tty | 228 | kernel/chr_drv/tty_ioctl.c | *(unsigned short *)&tty->termios->c_oflag = tmp_termio.c_oflag; |
tty | 229 | kernel/chr_drv/tty_ioctl.c | *(unsigned short *)&tty->termios->c_cflag = tmp_termio.c_cflag; |
tty | 230 | kernel/chr_drv/tty_ioctl.c | *(unsigned short *)&tty->termios->c_lflag = tmp_termio.c_lflag; |
tty | 231 | kernel/chr_drv/tty_ioctl.c | tty->termios->c_line = tmp_termio.c_line; |
tty | 233 | kernel/chr_drv/tty_ioctl.c | tty->termios->c_cc[i] = tmp_termio.c_cc[i]; |
tty | 235 | kernel/chr_drv/tty_ioctl.c | if (tty->set_termios) |
tty | 236 | kernel/chr_drv/tty_ioctl.c | (*tty->set_termios)(tty, &old_termios); |
tty | 241 | kernel/chr_drv/tty_ioctl.c | static int set_window_size(struct tty_struct * tty, struct winsize * ws) |
tty | 248 | kernel/chr_drv/tty_ioctl.c | tmp = (char *) &tty->winsize; |
tty | 258 | kernel/chr_drv/tty_ioctl.c | kill_pg(tty->pgrp, SIGWINCH, 1); |
tty | 262 | kernel/chr_drv/tty_ioctl.c | static int get_window_size(struct tty_struct * tty, struct winsize * ws) |
tty | 274 | kernel/chr_drv/tty_ioctl.c | put_fs_byte(((char *) &tty->winsize)[i], tmp); |
tty | 279 | kernel/chr_drv/tty_ioctl.c | static int tty_set_ldisc(struct tty_struct *tty, int ldisc) |
tty | 285 | kernel/chr_drv/tty_ioctl.c | if (tty->disc == ldisc) |
tty | 289 | kernel/chr_drv/tty_ioctl.c | wait_until_sent(tty); |
tty | 290 | kernel/chr_drv/tty_ioctl.c | flush_input(tty); |
tty | 291 | kernel/chr_drv/tty_ioctl.c | if (ldiscs[tty->disc].close) |
tty | 292 | kernel/chr_drv/tty_ioctl.c | ldiscs[tty->disc].close(tty); |
tty | 295 | kernel/chr_drv/tty_ioctl.c | tty->disc = ldisc; |
tty | 296 | kernel/chr_drv/tty_ioctl.c | if (ldiscs[tty->disc].open) |
tty | 297 | kernel/chr_drv/tty_ioctl.c | return(ldiscs[tty->disc].open(tty)); |
tty | 306 | kernel/chr_drv/tty_ioctl.c | struct tty_struct * tty; |
tty | 319 | kernel/chr_drv/tty_ioctl.c | tty = TTY_TABLE(dev); |
tty | 320 | kernel/chr_drv/tty_ioctl.c | if (!tty) |
tty | 326 | kernel/chr_drv/tty_ioctl.c | termios_tty = tty; |
tty | 336 | kernel/chr_drv/tty_ioctl.c | flush_input(tty); |
tty | 339 | kernel/chr_drv/tty_ioctl.c | wait_until_sent(tty); |
tty | 346 | kernel/chr_drv/tty_ioctl.c | flush_input(tty); |
tty | 349 | kernel/chr_drv/tty_ioctl.c | wait_until_sent(tty); /* fallthrough */ |
tty | 355 | kernel/chr_drv/tty_ioctl.c | tty->stopped = 1; |
tty | 356 | kernel/chr_drv/tty_ioctl.c | TTY_WRITE_FLUSH(tty); |
tty | 359 | kernel/chr_drv/tty_ioctl.c | tty->stopped = 0; |
tty | 360 | kernel/chr_drv/tty_ioctl.c | TTY_WRITE_FLUSH(tty); |
tty | 363 | kernel/chr_drv/tty_ioctl.c | if (STOP_CHAR(tty)) |
tty | 364 | kernel/chr_drv/tty_ioctl.c | put_tty_queue(STOP_CHAR(tty), |
tty | 365 | kernel/chr_drv/tty_ioctl.c | &tty->write_q); |
tty | 368 | kernel/chr_drv/tty_ioctl.c | if (START_CHAR(tty)) |
tty | 369 | kernel/chr_drv/tty_ioctl.c | put_tty_queue(START_CHAR(tty), |
tty | 370 | kernel/chr_drv/tty_ioctl.c | &tty->write_q); |
tty | 376 | kernel/chr_drv/tty_ioctl.c | flush_input(tty); |
tty | 378 | kernel/chr_drv/tty_ioctl.c | flush_output(tty); |
tty | 380 | kernel/chr_drv/tty_ioctl.c | flush_input(tty); |
tty | 381 | kernel/chr_drv/tty_ioctl.c | flush_output(tty); |
tty | 390 | kernel/chr_drv/tty_ioctl.c | if ((current->leader && current->tty < 0 && |
tty | 391 | kernel/chr_drv/tty_ioctl.c | tty->session == 0) || |
tty | 393 | kernel/chr_drv/tty_ioctl.c | current->tty = dev; |
tty | 394 | kernel/chr_drv/tty_ioctl.c | tty->session = current->session; |
tty | 395 | kernel/chr_drv/tty_ioctl.c | tty->pgrp = current->pgrp; |
tty | 405 | kernel/chr_drv/tty_ioctl.c | if ((current->tty < 0) || |
tty | 406 | kernel/chr_drv/tty_ioctl.c | (current->tty != termios_dev) || |
tty | 419 | kernel/chr_drv/tty_ioctl.c | put_fs_long(CHARS(&tty->write_q), |
tty | 426 | kernel/chr_drv/tty_ioctl.c | if (L_CANON(tty) && !tty->secondary.data) |
tty | 429 | kernel/chr_drv/tty_ioctl.c | put_fs_long(CHARS(&tty->secondary), |
tty | 435 | kernel/chr_drv/tty_ioctl.c | return get_window_size(tty,(struct winsize *) arg); |
tty | 439 | kernel/chr_drv/tty_ioctl.c | return set_window_size(tty,(struct winsize *) arg); |
tty | 468 | kernel/chr_drv/tty_ioctl.c | redirect = tty; |
tty | 480 | kernel/chr_drv/tty_ioctl.c | if (MINOR(file->f_rdev) != current->tty) |
tty | 482 | kernel/chr_drv/tty_ioctl.c | current->tty = -1; |
tty | 484 | kernel/chr_drv/tty_ioctl.c | if (tty->pgrp > 0) |
tty | 485 | kernel/chr_drv/tty_ioctl.c | kill_pg(tty->pgrp, SIGHUP, 0); |
tty | 486 | kernel/chr_drv/tty_ioctl.c | tty->pgrp = -1; |
tty | 487 | kernel/chr_drv/tty_ioctl.c | tty->session = 0; |
tty | 493 | kernel/chr_drv/tty_ioctl.c | put_fs_long(tty->disc, (unsigned long *) arg); |
tty | 497 | kernel/chr_drv/tty_ioctl.c | return tty_set_ldisc(tty, arg); |
tty | 508 | kernel/chr_drv/tty_ioctl.c | tty->packet = 1; |
tty | 510 | kernel/chr_drv/tty_ioctl.c | tty->packet = 0; |
tty | 515 | kernel/chr_drv/tty_ioctl.c | if (tty->ioctl) { |
tty | 516 | kernel/chr_drv/tty_ioctl.c | retval = (tty->ioctl)(tty, file, cmd, arg); |
tty | 520 | kernel/chr_drv/tty_ioctl.c | if (ldiscs[tty->disc].ioctl) { |
tty | 521 | kernel/chr_drv/tty_ioctl.c | retval = (ldiscs[tty->disc].ioctl) |
tty | 522 | kernel/chr_drv/tty_ioctl.c | (tty, file, cmd, arg); |
tty | 104 | kernel/chr_drv/vt.c | int vt_ioctl(struct tty_struct *tty, struct file * file, |
tty | 111 | kernel/chr_drv/vt.c | console = tty->line - 1; |
tty | 215 | kernel/chr_drv/vt.c | flush_input(tty); |
tty | 408 | kernel/exit.c | struct tty_struct *tty; |
tty | 410 | kernel/exit.c | if (current->tty >= 0) { |
tty | 411 | kernel/exit.c | tty = TTY_TABLE(current->tty); |
tty | 412 | kernel/exit.c | if (tty) { |
tty | 413 | kernel/exit.c | if (tty->pgrp > 0) |
tty | 414 | kernel/exit.c | kill_pg(tty->pgrp, SIGHUP, 1); |
tty | 415 | kernel/exit.c | tty->pgrp = -1; |
tty | 416 | kernel/exit.c | tty->session = 0; |
tty | 421 | kernel/exit.c | (*p)->tty = -1; |
tty | 496 | kernel/sys.c | current->tty = -1; |