Lines Matching refs:tty
376 struct tty_struct *tty; in rc_receive_exc() local
383 tty = port->tty; in rc_receive_exc()
384 if (tty->flip.count >= TTY_FLIPBUF_SIZE) { in rc_receive_exc()
417 *tty->flip.flag_buf_ptr++ = TTY_BREAK; in rc_receive_exc()
419 do_SAK(tty); in rc_receive_exc()
422 *tty->flip.flag_buf_ptr++ = TTY_PARITY; in rc_receive_exc()
425 *tty->flip.flag_buf_ptr++ = TTY_FRAME; in rc_receive_exc()
428 *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; in rc_receive_exc()
431 *tty->flip.flag_buf_ptr++ = 0; in rc_receive_exc()
433 *tty->flip.char_buf_ptr++ = ch; in rc_receive_exc()
434 tty->flip.count++; in rc_receive_exc()
435 queue_task(&tty->flip.tqueue, &tq_timer); in rc_receive_exc()
441 struct tty_struct *tty; in rc_receive() local
447 tty = port->tty; in rc_receive()
456 if (tty->flip.count >= TTY_FLIPBUF_SIZE) { in rc_receive()
462 *tty->flip.char_buf_ptr++ = rc_in(bp, CD180_RDR); in rc_receive()
463 *tty->flip.flag_buf_ptr++ = 0; in rc_receive()
464 tty->flip.count++; in rc_receive()
466 queue_task(&tty->flip.tqueue, &tq_timer); in rc_receive()
472 struct tty_struct *tty; in rc_transmit() local
479 tty = port->tty; in rc_transmit()
490 || tty->stopped || tty->hw_stopped) { in rc_transmit()
541 struct tty_struct *tty; in rc_check_modem() local
547 tty = port->tty; in rc_check_modem()
564 tty->hw_stopped = 0; in rc_check_modem()
569 tty->hw_stopped = 1; in rc_check_modem()
576 tty->hw_stopped = 0; in rc_check_modem()
581 tty->hw_stopped = 1; in rc_check_modem()
704 struct tty_struct *tty; in rc_change_speed() local
710 if (!(tty = port->tty) || !tty->termios) in rc_change_speed()
717 baud = C_BAUD(tty); in rc_change_speed()
722 port->tty->termios->c_cflag &= ~CBAUDEX; in rc_change_speed()
772 switch (C_CSIZE(tty)) { in rc_change_speed()
787 if (C_CSTOPB(tty)) in rc_change_speed()
791 if (C_PARENB(tty)) { in rc_change_speed()
793 if (C_PARODD(tty)) in rc_change_speed()
795 if (I_INPCK(tty)) in rc_change_speed()
800 if (I_INPCK(tty)) in rc_change_speed()
802 if (I_BRKINT(tty) || I_PARMRK(tty)) in rc_change_speed()
804 if (I_IGNPAR(tty)) in rc_change_speed()
806 if (I_IGNBRK(tty)) { in rc_change_speed()
808 if (I_IGNPAR(tty)) in rc_change_speed()
813 if (C_CRTSCTS(tty)) { in rc_change_speed()
818 tty->hw_stopped = !(rc_in(bp, CD180_MSVR) & (MSVR_CTS|MSVR_DSR)); in rc_change_speed()
825 if (I_IXON(tty)) { in rc_change_speed()
828 if (I_IXANY(tty)) in rc_change_speed()
830 rc_out(bp, CD180_SCHR1, START_CHAR(tty)); in rc_change_speed()
831 rc_out(bp, CD180_SCHR2, STOP_CHAR(tty)); in rc_change_speed()
832 rc_out(bp, CD180_SCHR3, START_CHAR(tty)); in rc_change_speed()
833 rc_out(bp, CD180_SCHR4, STOP_CHAR(tty)); in rc_change_speed()
835 if (!C_CLOCAL(tty)) { in rc_change_speed()
842 if (C_CREAD(tty)) in rc_change_speed()
891 if (port->tty) in rc_setup_port()
892 clear_bit(TTY_IO_ERROR, &port->tty->flags); in rc_setup_port()
908 struct tty_struct *tty; in rc_shutdown_port() local
934 if (!(tty = port->tty) || C_HUPCL(tty)) { in rc_shutdown_port()
949 if (tty) in rc_shutdown_port()
950 set_bit(TTY_IO_ERROR, &tty->flags); in rc_shutdown_port()
969 static int block_til_ready(struct tty_struct *tty, struct file * filp, in block_til_ready() argument
994 if (tty->driver.subtype == RISCOM_TYPE_CALLOUT) { in block_til_ready()
1014 (tty->flags & (1 << TTY_IO_ERROR))) { in block_til_ready()
1025 if (C_CLOCAL(tty)) in block_til_ready()
1084 static int rc_open(struct tty_struct * tty, struct file * filp) in rc_open() argument
1092 board = RC_BOARD(MINOR(tty->device)); in rc_open()
1097 port = rc_port + board * RC_NPORT + RC_PORT(MINOR(tty->device)); in rc_open()
1098 if (rc_paranoia_check(port, tty->device, "rc_open")) in rc_open()
1105 tty->driver_data = port; in rc_open()
1106 port->tty = tty; in rc_open()
1111 if ((error = block_til_ready(tty, filp, port))) in rc_open()
1115 if (tty->driver.subtype == RISCOM_TYPE_NORMAL) in rc_open()
1116 *tty->termios = port->normal_termios; in rc_open()
1118 *tty->termios = port->callout_termios; in rc_open()
1130 static void rc_close(struct tty_struct * tty, struct file * filp) in rc_close() argument
1132 struct riscom_port *port = (struct riscom_port *) tty->driver_data; in rc_close()
1137 if (!port || rc_paranoia_check(port, tty->device, "close")) in rc_close()
1145 if ((tty->count == 1) && (port->count != 1)) { in rc_close()
1165 port->normal_termios = *tty->termios; in rc_close()
1167 port->callout_termios = *tty->termios; in rc_close()
1172 tty->closing = 1; in rc_close()
1174 tty_wait_until_sent(tty, port->closing_wait); in rc_close()
1201 if (tty->driver.flush_buffer) in rc_close()
1202 tty->driver.flush_buffer(tty); in rc_close()
1203 tty_ldisc_flush(tty); in rc_close()
1204 tty->closing = 0; in rc_close()
1206 port->tty = 0; in rc_close()
1220 static int rc_write(struct tty_struct * tty, int from_user, in rc_write() argument
1228 if (!tty) in rc_write()
1231 port = (struct riscom_port *)tty->driver_data; in rc_write()
1233 if (rc_paranoia_check(port, tty->device, "rc_write")) in rc_write()
1293 if (port->xmit_cnt && !tty->stopped && !tty->hw_stopped && in rc_write()
1304 static void rc_put_char(struct tty_struct * tty, unsigned char ch) in rc_put_char() argument
1309 if (!tty) in rc_put_char()
1312 port = (struct riscom_port *)tty->driver_data; in rc_put_char()
1314 if (rc_paranoia_check(port, tty->device, "rc_put_char")) in rc_put_char()
1331 static void rc_flush_chars(struct tty_struct * tty) in rc_flush_chars() argument
1333 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_flush_chars()
1336 if (rc_paranoia_check(port, tty->device, "rc_flush_chars")) in rc_flush_chars()
1339 if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || in rc_flush_chars()
1350 static int rc_write_room(struct tty_struct * tty) in rc_write_room() argument
1352 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_write_room()
1355 if (rc_paranoia_check(port, tty->device, "rc_write_room")) in rc_write_room()
1364 static int rc_chars_in_buffer(struct tty_struct *tty) in rc_chars_in_buffer() argument
1366 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_chars_in_buffer()
1368 if (rc_paranoia_check(port, tty->device, "rc_chars_in_buffer")) in rc_chars_in_buffer()
1374 static void rc_flush_buffer(struct tty_struct *tty) in rc_flush_buffer() argument
1376 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_flush_buffer()
1379 if (rc_paranoia_check(port, tty->device, "rc_flush_buffer")) in rc_flush_buffer()
1386 wake_up_interruptible(&tty->write_wait); in rc_flush_buffer()
1387 tty_wakeup(tty); in rc_flush_buffer()
1534 static int rc_ioctl(struct tty_struct * tty, struct file * filp, in rc_ioctl() argument
1538 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_ioctl()
1541 if (rc_paranoia_check(port, tty->device, "rc_ioctl")) in rc_ioctl()
1546 retval = tty_check_change(tty); in rc_ioctl()
1549 tty_wait_until_sent(tty, 0); in rc_ioctl()
1554 retval = tty_check_change(tty); in rc_ioctl()
1557 tty_wait_until_sent(tty, 0); in rc_ioctl()
1561 return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned int *) arg); in rc_ioctl()
1565 tty->termios->c_cflag = in rc_ioctl()
1566 ((tty->termios->c_cflag & ~CLOCAL) | in rc_ioctl()
1585 static void rc_throttle(struct tty_struct * tty) in rc_throttle() argument
1587 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_throttle()
1591 if (rc_paranoia_check(port, tty->device, "rc_throttle")) in rc_throttle()
1599 if (I_IXOFF(tty)) { in rc_throttle()
1608 static void rc_unthrottle(struct tty_struct * tty) in rc_unthrottle() argument
1610 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_unthrottle()
1614 if (rc_paranoia_check(port, tty->device, "rc_unthrottle")) in rc_unthrottle()
1622 if (I_IXOFF(tty)) { in rc_unthrottle()
1631 static void rc_stop(struct tty_struct * tty) in rc_stop() argument
1633 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_stop()
1637 if (rc_paranoia_check(port, tty->device, "rc_stop")) in rc_stop()
1649 static void rc_start(struct tty_struct * tty) in rc_start() argument
1651 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_start()
1655 if (rc_paranoia_check(port, tty->device, "rc_start")) in rc_start()
1681 struct tty_struct *tty; in do_rc_hangup() local
1683 tty = port->tty; in do_rc_hangup()
1684 if (tty) in do_rc_hangup()
1685 tty_hangup(tty); /* FIXME: module removal race still here */ in do_rc_hangup()
1689 static void rc_hangup(struct tty_struct * tty) in rc_hangup() argument
1691 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_hangup()
1694 if (rc_paranoia_check(port, tty->device, "rc_hangup")) in rc_hangup()
1703 port->tty = 0; in rc_hangup()
1707 static void rc_set_termios(struct tty_struct * tty, struct termios * old_termios) in rc_set_termios() argument
1709 struct riscom_port *port = (struct riscom_port *)tty->driver_data; in rc_set_termios()
1712 if (rc_paranoia_check(port, tty->device, "rc_set_termios")) in rc_set_termios()
1715 if (tty->termios->c_cflag == old_termios->c_cflag && in rc_set_termios()
1716 tty->termios->c_iflag == old_termios->c_iflag) in rc_set_termios()
1724 !(tty->termios->c_cflag & CRTSCTS)) { in rc_set_termios()
1725 tty->hw_stopped = 0; in rc_set_termios()
1726 rc_start(tty); in rc_set_termios()
1738 struct tty_struct *tty; in do_softint() local
1740 if(!(tty = port->tty)) in do_softint()
1744 tty_wakeup(tty); in do_softint()