Lines Matching defs:tty

14  * The port is registered with the tty driver as minor device 64, and
38 tty->name, (info->tport.flags), serial_driver->refcount,info->count,tty->count,s)
60 #include <linux/tty.h>
112 static void change_speed(struct tty_struct *tty, struct serial_state *info,
114 static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
151 * This routines are called before setting or resetting tty->stopped.
155 static void rs_stop(struct tty_struct *tty)
157 struct serial_state *info = tty->driver_data;
172 static void rs_start(struct tty_struct *tty)
174 struct serial_state *info = tty->driver_data;
278 do_SAK(info->tport.tty);
312 || info->tport.tty->stopped
313 || info->tport.tty->hw_stopped) {
328 tty_wakeup(info->tport.tty);
375 if (port->tty)
376 tty_hangup(port->tty);
380 if (port->tty->hw_stopped) {
385 port->tty->hw_stopped = 0;
392 tty_wakeup(port->tty);
400 port->tty->hw_stopped = 1;
433 if (!info->tport.tty)
452 if (!info->tport.tty)
478 static int startup(struct tty_struct *tty, struct serial_state *info)
513 set_bit(TTY_IO_ERROR, &tty->flags);
528 if (C_BAUD(tty))
532 clear_bit(TTY_IO_ERROR, &tty->flags);
538 change_speed(tty, info, NULL);
553 static void shutdown(struct tty_struct *tty, struct serial_state *info)
593 if (C_HUPCL(tty))
597 set_bit(TTY_IO_ERROR, &tty->flags);
608 static void change_speed(struct tty_struct *tty, struct serial_state *info,
617 cflag = tty->termios.c_cflag;
638 baud = tty_get_baud_rate(tty);
653 /* FIXME: Will need updating for new tty in the end */
654 tty->termios.c_cflag &= ~CBAUD;
655 tty->termios.c_cflag |= (old_termios->c_cflag & CBAUD);
656 baud = tty_get_baud_rate(tty);
696 if (I_INPCK(tty))
698 if (I_BRKINT(tty) || I_PARMRK(tty))
705 if (I_IGNPAR(tty))
707 if (I_IGNBRK(tty)) {
713 if (I_IGNPAR(tty))
741 static int rs_put_char(struct tty_struct *tty, unsigned char ch)
746 info = tty->driver_data;
765 static void rs_flush_chars(struct tty_struct *tty)
767 struct serial_state *info = tty->driver_data;
771 || tty->stopped
772 || tty->hw_stopped
786 static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count)
789 struct serial_state *info = tty->driver_data;
815 && !tty->stopped
816 && !tty->hw_stopped
830 static int rs_write_room(struct tty_struct *tty)
832 struct serial_state *info = tty->driver_data;
837 static int rs_chars_in_buffer(struct tty_struct *tty)
839 struct serial_state *info = tty->driver_data;
844 static void rs_flush_buffer(struct tty_struct *tty)
846 struct serial_state *info = tty->driver_data;
852 tty_wakeup(tty);
859 static void rs_send_xchar(struct tty_struct *tty, char ch)
861 struct serial_state *info = tty->driver_data;
887 * This routine is called by the upper-layer tty layer to signal that
891 static void rs_throttle(struct tty_struct * tty)
893 struct serial_state *info = tty->driver_data;
896 printk("throttle %s ....\n", tty_name(tty));
899 if (I_IXOFF(tty))
900 rs_send_xchar(tty, STOP_CHAR(tty));
902 if (C_CRTSCTS(tty))
910 static void rs_unthrottle(struct tty_struct * tty)
912 struct serial_state *info = tty->driver_data;
915 printk("unthrottle %s ....\n", tty_name(tty));
918 if (I_IXOFF(tty)) {
922 rs_send_xchar(tty, START_CHAR(tty));
924 if (C_CRTSCTS(tty))
937 static int get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
939 struct serial_state *state = tty->driver_data;
941 tty_lock(tty);
942 ss->line = tty->index;
950 tty_unlock(tty);
954 static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
956 struct serial_state *state = tty->driver_data;
961 tty_lock(tty);
966 tty_unlock(tty);
977 tty_unlock(tty);
987 tty_unlock(tty);
1009 dev_warn_ratelimited(tty->dev, "use of SPD flags is deprecated\n");
1010 change_speed(tty, state, NULL);
1013 retval = startup(tty, state);
1014 tty_unlock(tty);
1045 static int rs_tiocmget(struct tty_struct *tty)
1047 struct serial_state *info = tty->driver_data;
1051 if (tty_io_error(tty))
1065 static int rs_tiocmset(struct tty_struct *tty, unsigned int set,
1068 struct serial_state *info = tty->driver_data;
1071 if (tty_io_error(tty))
1091 static int rs_break(struct tty_struct *tty, int break_state)
1111 static int rs_get_icount(struct tty_struct *tty,
1114 struct serial_state *info = tty->driver_data;
1136 static int rs_ioctl(struct tty_struct *tty,
1139 struct serial_state *info = tty->driver_data;
1148 if (tty_io_error(tty))
1205 static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1207 struct serial_state *info = tty->driver_data;
1209 unsigned int cflag = tty->termios.c_cflag;
1211 change_speed(tty, info, old_termios);
1224 if (!C_CRTSCTS(tty) || !tty_throttled(tty))
1232 if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) {
1233 tty->hw_stopped = 0;
1234 rs_start(tty);
1244 if (!(old_termios->c_cflag & CLOCAL) && C_CLOCAL(tty))
1259 static void rs_close(struct tty_struct *tty, struct file * filp)
1261 struct serial_state *state = tty->driver_data;
1264 if (tty_port_close_start(port, tty, filp) == 0)
1287 rs_wait_until_sent(tty, state->timeout);
1289 shutdown(tty, state);
1290 rs_flush_buffer(tty);
1292 tty_ldisc_flush(tty);
1293 port->tty = NULL;
1295 tty_port_close_end(port, tty);
1301 static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
1303 struct serial_state *info = tty->driver_data;
1361 static void rs_hangup(struct tty_struct *tty)
1363 struct serial_state *info = tty->driver_data;
1365 rs_flush_buffer(tty);
1366 shutdown(tty, info);
1369 info->tport.tty = NULL;
1377 * initialization for the tty structure.
1379 static int rs_open(struct tty_struct *tty, struct file * filp)
1381 struct serial_state *info = rs_table + tty->index;
1386 port->tty = tty;
1387 tty->driver_data = info;
1388 tty->port = port;
1392 retval = startup(tty, info);
1397 return tty_port_block_til_ready(port, tty, filp);