Lines Matching refs:tty

18 #include <linux/tty.h>
107 static void xr21v141x_set_line_settings(struct tty_struct *tty,
137 void (*set_line_settings)(struct tty_struct *tty,
438 static int xr_tiocmget(struct tty_struct *tty)
440 struct usb_serial_port *port = tty->driver_data;
492 static int xr_tiocmset(struct tty_struct *tty,
495 struct usb_serial_port *port = tty->driver_data;
508 static int xr_break_ctl(struct tty_struct *tty, int break_state)
510 struct usb_serial_port *port = tty->driver_data;
561 static int xr21v141x_set_baudrate(struct tty_struct *tty, struct usb_serial_port *port)
567 baud = tty->termios.c_ospeed;
622 tty_encode_baud_rate(tty, baud, baud);
627 static void xr_set_flow_mode(struct tty_struct *tty,
661 if (C_CRTSCTS(tty) && C_BAUD(tty) != B0 && !rs485_enabled) {
665 } else if (I_IXON(tty)) {
666 u8 start_char = START_CHAR(tty);
667 u8 stop_char = STOP_CHAR(tty);
684 if (C_BAUD(tty) == B0)
690 static void xr21v141x_set_line_settings(struct tty_struct *tty,
694 struct ktermios *termios = &tty->termios;
698 if (!old_termios || (tty->termios.c_ospeed != old_termios->c_ospeed))
699 xr21v141x_set_baudrate(tty, port);
701 switch (C_CSIZE(tty)) {
711 if (C_CSIZE(tty) == CS7)
725 if (C_PARENB(tty)) {
726 if (C_CMSPAR(tty)) {
727 if (C_PARODD(tty))
732 if (C_PARODD(tty))
739 if (C_CSTOPB(tty))
749 static void xr_cdc_set_line_coding(struct tty_struct *tty,
763 if (tty->termios.c_ospeed)
764 lc->dwDTERate = cpu_to_le32(tty->termios.c_ospeed);
768 if (C_CSTOPB(tty))
773 if (C_PARENB(tty)) {
774 if (C_CMSPAR(tty)) {
775 if (C_PARODD(tty))
780 if (C_PARODD(tty))
790 (C_CSIZE(tty) == CS5 || C_CSIZE(tty) == CS6)) {
791 tty->termios.c_cflag &= ~CSIZE;
793 tty->termios.c_cflag |= old_termios->c_cflag & CSIZE;
795 tty->termios.c_cflag |= CS8;
798 switch (C_CSIZE(tty)) {
846 static int xr_get_rs485_config(struct tty_struct *tty,
849 struct usb_serial_port *port = tty->driver_data;
852 down_read(&tty->termios_rwsem);
854 up_read(&tty->termios_rwsem);
857 up_read(&tty->termios_rwsem);
862 static int xr_set_rs485_config(struct tty_struct *tty,
865 struct usb_serial_port *port = tty->driver_data;
873 down_write(&tty->termios_rwsem);
875 xr_set_flow_mode(tty, port, NULL);
876 up_write(&tty->termios_rwsem);
884 static int xr_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
890 return xr_get_rs485_config(tty, argp);
892 return xr_set_rs485_config(tty, argp);
898 static void xr_set_termios(struct tty_struct *tty,
909 data->type->set_line_settings(tty, port, old_termios);
911 xr_cdc_set_line_coding(tty, port, old_termios);
913 xr_set_flow_mode(tty, port, old_termios);
916 static int xr_open(struct tty_struct *tty, struct usb_serial_port *port)
931 if (tty)
932 xr_set_termios(tty, port, NULL);
934 ret = usb_serial_generic_open(tty, port);