tty: move the termios object into the tty
This will let us sort out a whole pile of tty related races. The alternative would be to keep points and refcount the termios objects. However 1. They are tiny anyway 2. Many devices don't use the stored copies 3. We can remove a pty special case Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
6d31a88cb2
commit
adc8d746ca
@@ -191,11 +191,11 @@ static void kobil_release(struct usb_serial *serial)
|
||||
static void kobil_init_termios(struct tty_struct *tty)
|
||||
{
|
||||
/* Default to echo off and other sane device settings */
|
||||
tty->termios->c_lflag = 0;
|
||||
tty->termios->c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE);
|
||||
tty->termios->c_iflag = IGNBRK | IGNPAR | IXOFF;
|
||||
tty->termios.c_lflag = 0;
|
||||
tty->termios.c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE);
|
||||
tty->termios.c_lflag = IGNBRK | IGNPAR | IXOFF;
|
||||
/* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */
|
||||
tty->termios->c_oflag &= ~ONLCR;
|
||||
tty->termios.c_oflag &= ~ONLCR;
|
||||
}
|
||||
|
||||
static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
@@ -581,14 +581,14 @@ static void kobil_set_termios(struct tty_struct *tty,
|
||||
struct kobil_private *priv;
|
||||
int result;
|
||||
unsigned short urb_val = 0;
|
||||
int c_cflag = tty->termios->c_cflag;
|
||||
int c_cflag = tty->termios.c_cflag;
|
||||
speed_t speed;
|
||||
|
||||
priv = usb_get_serial_port_data(port);
|
||||
if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
|
||||
priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
|
||||
/* This device doesn't support ioctl calls */
|
||||
*tty->termios = *old;
|
||||
tty->termios = *old;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ static void kobil_set_termios(struct tty_struct *tty,
|
||||
urb_val |= SUSBCR_SPASB_EvenParity;
|
||||
} else
|
||||
urb_val |= SUSBCR_SPASB_NoParity;
|
||||
tty->termios->c_cflag &= ~CMSPAR;
|
||||
tty->termios.c_cflag &= ~CMSPAR;
|
||||
tty_encode_baud_rate(tty, speed, speed);
|
||||
|
||||
result = usb_control_msg(port->serial->dev,
|
||||
|
Reference in New Issue
Block a user