Lines Matching defs:tty

44 #include <linux/tty.h>
504 /* tty callbacks */
506 static int open(struct tty_struct *tty, struct file * filp);
507 static void close(struct tty_struct *tty, struct file * filp);
508 static void hangup(struct tty_struct *tty);
509 static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
511 static int write(struct tty_struct *tty, const unsigned char *buf, int count);
512 static int put_char(struct tty_struct *tty, unsigned char ch);
513 static void send_xchar(struct tty_struct *tty, char ch);
514 static void wait_until_sent(struct tty_struct *tty, int timeout);
515 static int write_room(struct tty_struct *tty);
516 static void flush_chars(struct tty_struct *tty);
517 static void flush_buffer(struct tty_struct *tty);
518 static void tx_hold(struct tty_struct *tty);
519 static void tx_release(struct tty_struct *tty);
521 static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
522 static int chars_in_buffer(struct tty_struct *tty);
523 static void throttle(struct tty_struct * tty);
524 static void unthrottle(struct tty_struct * tty);
525 static int set_break(struct tty_struct *tty, int break_state);
547 static int tiocmget(struct tty_struct *tty);
548 static int tiocmset(struct tty_struct *tty,
550 static int set_break(struct tty_struct *tty, int break_state);
558 static int block_til_ready(struct tty_struct *tty, struct file * filp,SLMP_INFO *info);
697 static void ldisc_receive_buf(struct tty_struct *tty,
701 if (!tty)
703 ld = tty_ldisc_ref(tty);
706 ld->ops->receive_buf(tty, data, flags, count);
711 /* tty callbacks */
713 static int install(struct tty_driver *driver, struct tty_struct *tty)
716 int line = tty->index;
727 if (sanity_check(info, tty->name, "open"))
736 tty->driver_data = info;
738 return tty_port_install(&info->port, driver, tty);
743 static int open(struct tty_struct *tty, struct file *filp)
745 SLMP_INFO *info = tty->driver_data;
749 info->port.tty = tty;
753 __FILE__,__LINE__,tty->driver->name, info->port.count);
773 retval = block_til_ready(tty, filp, info);
788 if (tty->count == 1)
789 info->port.tty = NULL; /* tty layer will release tty struct */
800 static void close(struct tty_struct *tty, struct file *filp)
802 SLMP_INFO * info = tty->driver_data;
804 if (sanity_check(info, tty->name, "close"))
811 if (tty_port_close_start(&info->port, tty, filp) == 0)
816 wait_until_sent(tty, info->timeout);
818 flush_buffer(tty);
819 tty_ldisc_flush(tty);
823 tty_port_close_end(&info->port, tty);
824 info->port.tty = NULL;
828 tty->driver->name, info->port.count);
834 static void hangup(struct tty_struct *tty)
836 SLMP_INFO *info = tty->driver_data;
843 if (sanity_check(info, tty->name, "hangup"))
847 flush_buffer(tty);
852 info->port.tty = NULL;
862 static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)
864 SLMP_INFO *info = tty->driver_data;
869 tty->driver->name );
874 if ((old_termios->c_cflag & CBAUD) && !C_BAUD(tty)) {
882 if (!(old_termios->c_cflag & CBAUD) && C_BAUD(tty)) {
884 if (!C_CRTSCTS(tty) || !tty_throttled(tty))
892 if (old_termios->c_cflag & CRTSCTS && !C_CRTSCTS(tty)) {
893 tty->hw_stopped = 0;
894 tx_release(tty);
902 * tty pointer to tty information structure
908 static int write(struct tty_struct *tty,
912 SLMP_INFO *info = tty->driver_data;
919 if (sanity_check(info, tty->name, "write"))
972 if (info->tx_count && !tty->stopped && !tty->hw_stopped) {
988 static int put_char(struct tty_struct *tty, unsigned char ch)
990 SLMP_INFO *info = tty->driver_data;
999 if (sanity_check(info, tty->name, "put_char"))
1025 static void send_xchar(struct tty_struct *tty, char ch)
1027 SLMP_INFO *info = tty->driver_data;
1034 if (sanity_check(info, tty->name, "send_xchar"))
1049 static void wait_until_sent(struct tty_struct *tty, int timeout)
1051 SLMP_INFO * info = tty->driver_data;
1061 if (sanity_check(info, tty->name, "wait_until_sent"))
1115 static int write_room(struct tty_struct *tty)
1117 SLMP_INFO *info = tty->driver_data;
1120 if (sanity_check(info, tty->name, "write_room"))
1140 static void flush_chars(struct tty_struct *tty)
1142 SLMP_INFO *info = tty->driver_data;
1149 if (sanity_check(info, tty->name, "flush_chars"))
1152 if (info->tx_count <= 0 || tty->stopped || tty->hw_stopped ||
1179 static void flush_buffer(struct tty_struct *tty)
1181 SLMP_INFO *info = tty->driver_data;
1188 if (sanity_check(info, tty->name, "flush_buffer"))
1196 tty_wakeup(tty);
1201 static void tx_hold(struct tty_struct *tty)
1203 SLMP_INFO *info = tty->driver_data;
1206 if (sanity_check(info, tty->name, "tx_hold"))
1221 static void tx_release(struct tty_struct *tty)
1223 SLMP_INFO *info = tty->driver_data;
1226 if (sanity_check(info, tty->name, "tx_release"))
1243 * tty pointer to tty instance data
1249 static int ioctl(struct tty_struct *tty,
1252 SLMP_INFO *info = tty->driver_data;
1259 if (sanity_check(info, tty->name, "ioctl"))
1263 if (tty_io_error(tty))
1306 static int get_icount(struct tty_struct *tty,
1309 SLMP_INFO *info = tty->driver_data;
1425 static int chars_in_buffer(struct tty_struct *tty)
1427 SLMP_INFO *info = tty->driver_data;
1429 if (sanity_check(info, tty->name, "chars_in_buffer"))
1441 static void throttle(struct tty_struct * tty)
1443 SLMP_INFO *info = tty->driver_data;
1450 if (sanity_check(info, tty->name, "throttle"))
1453 if (I_IXOFF(tty))
1454 send_xchar(tty, STOP_CHAR(tty));
1456 if (C_CRTSCTS(tty)) {
1466 static void unthrottle(struct tty_struct * tty)
1468 SLMP_INFO *info = tty->driver_data;
1475 if (sanity_check(info, tty->name, "unthrottle"))
1478 if (I_IXOFF(tty)) {
1482 send_xchar(tty, START_CHAR(tty));
1485 if (C_CRTSCTS(tty)) {
1496 static int set_break(struct tty_struct *tty, int break_state)
1499 SLMP_INFO * info = tty->driver_data;
1506 if (sanity_check(info, tty->name, "set_break"))
1633 /* arbitrate between network and tty opens */
2030 struct tty_struct *tty = info->port.tty;
2036 if (tty)
2037 tty_wakeup(tty);
2080 struct tty_struct *tty = info->port.tty;
2100 /* process break detection if tty control
2106 if (tty && (info->port.flags & ASYNC_SAK))
2107 do_SAK(tty);
2165 /* discard char if tty control flags say so */
2246 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) {
2301 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) {
2458 if (info->port.tty)
2459 tty_hangup(info->port.tty);
2465 if ( info->port.tty ) {
2466 if (info->port.tty->hw_stopped) {
2470 info->port.tty->hw_stopped = 0;
2479 info->port.tty->hw_stopped = 1;
2644 if (info->port.tty)
2645 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
2680 if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) {
2687 if (info->port.tty)
2688 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
2721 if (info->netcount || (info->port.tty && info->port.tty->termios.c_cflag & CREAD) )
2734 if (!info->port.tty)
2741 cflag = info->port.tty->termios.c_cflag;
2785 * allow tty settings to override, otherwise keep the
2789 info->params.data_rate = tty_get_baud_rate(info->port.tty);
2801 /* process tty input control flags */
2804 if (I_INPCK(info->port.tty))
2806 if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
2808 if (I_IGNPAR(info->port.tty))
2810 if (I_IGNBRK(info->port.tty)) {
2815 if (I_IGNPAR(info->port.tty))
3170 static int tiocmget(struct tty_struct *tty)
3172 SLMP_INFO *info = tty->driver_data;
3195 static int tiocmset(struct tty_struct *tty,
3198 SLMP_INFO *info = tty->driver_data;
3249 static int block_til_ready(struct tty_struct *tty, struct file *filp,
3261 __FILE__,__LINE__, tty->driver->name );
3263 if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) {
3270 if (C_CLOCAL(tty))
3285 __FILE__,__LINE__, tty->driver->name, port->count );
3293 if (C_BAUD(tty) && tty_port_initialized(port))
3315 __FILE__,__LINE__, tty->driver->name, port->count );
3317 tty_unlock(tty);
3319 tty_lock(tty);
3330 __FILE__,__LINE__, tty->driver->name, port->count );
3900 printk("%s(%d) failed to unregister tty driver err=%d\n",
3982 printk("%s %s, tty major#%d\n",
4823 struct tty_struct *tty = info->port.tty;
4964 ldisc_receive_buf(tty,info->tmp_rx_buf,
5230 struct tty_struct *oldtty = info->port.tty;
5234 info->port.tty = NULL;
5278 info->port.tty = oldtty;