Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82250
b: refs/heads/master
c: 537699e
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Feb 1, 2008
1 parent f2bce08 commit e83aee5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65d063ab21feea8cf65d64fba50a5c4fa7bfd6be
refs/heads/master: 537699ef53f8b97546f0845bf51a49c9ab114a13
31 changes: 13 additions & 18 deletions trunk/drivers/usb/serial/ti_usb_3410_5052.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static int ti_open(struct usb_serial_port *port, struct file *file)
}
}

ti_set_termios(port, NULL);
ti_set_termios(port, port->tty->termios);

dbg("%s - sending TI_OPEN_PORT", __FUNCTION__);
status = ti_command_out_sync(tdev, TI_OPEN_PORT,
Expand Down Expand Up @@ -618,7 +618,7 @@ static int ti_open(struct usb_serial_port *port, struct file *file)
usb_clear_halt(dev, port->write_urb->pipe);
usb_clear_halt(dev, port->read_urb->pipe);

ti_set_termios(port, NULL);
ti_set_termios(port, port->tty->termios);

dbg("%s - sending TI_OPEN_PORT (2)", __FUNCTION__);
status = ti_command_out_sync(tdev, TI_OPEN_PORT,
Expand Down Expand Up @@ -897,24 +897,11 @@ static void ti_set_termios(struct usb_serial_port *port,

dbg("%s - port %d", __FUNCTION__, port->number);

if (!tty || !tty->termios) {
dbg("%s - no tty or termios", __FUNCTION__);
return;
}

cflag = tty->termios->c_cflag;
iflag = tty->termios->c_iflag;

if (old_termios && cflag == old_termios->c_cflag
&& iflag == old_termios->c_iflag) {
dbg("%s - nothing to change", __FUNCTION__);
return;
}

dbg("%s - clfag %08x, iflag %08x", __FUNCTION__, cflag, iflag);

if (old_termios)
dbg("%s - old clfag %08x, old iflag %08x", __FUNCTION__, old_termios->c_cflag, old_termios->c_iflag);
dbg("%s - cflag %08x, iflag %08x", __FUNCTION__, cflag, iflag);
dbg("%s - old clfag %08x, old iflag %08x", __FUNCTION__, old_termios->c_cflag, old_termios->c_iflag);

if (tport == NULL)
return;
Expand Down Expand Up @@ -948,6 +935,9 @@ static void ti_set_termios(struct usb_serial_port *port,
break;
}

/* CMSPAR isn't supported by this driver */
tty->termios->c_cflag &= ~CMSPAR;

if (cflag & PARENB) {
if (cflag & PARODD) {
config->wFlags |= TI_UART_ENABLE_PARITY_CHECKING;
Expand Down Expand Up @@ -990,12 +980,17 @@ static void ti_set_termios(struct usb_serial_port *port,
}

baud = tty_get_baud_rate(tty);
if (!baud) baud = 9600;
if (!baud)
baud = 9600;
if (tport->tp_tdev->td_is_3410)
config->wBaudRate = (__u16)((923077 + baud/2) / baud);
else
config->wBaudRate = (__u16)((461538 + baud/2) / baud);

/* FIXME: Should calculate resulting baud here and report it back */
if ((cflag & CBAUD) != B0)
tty_encode_baud_rate(tty, baud, baud);

dbg("%s - BaudRate=%d, wBaudRate=%d, wFlags=0x%04X, bDataBits=%d, bParity=%d, bStopBits=%d, cXon=%d, cXoff=%d, bUartMode=%d",
__FUNCTION__, baud, config->wBaudRate, config->wFlags, config->bDataBits, config->bParity, config->bStopBits, config->cXon, config->cXoff, config->bUartMode);

Expand Down

0 comments on commit e83aee5

Please sign in to comment.