Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74374
b: refs/heads/master
c: f78ba15
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Nov 29, 2007
1 parent 1283a51 commit 110587e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 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: db573b241eb1259f749e88f54105d7fa946cb9b2
refs/heads/master: f78ba15705a5ef36b55c4e3142724e2211cb1733
32 changes: 29 additions & 3 deletions trunk/drivers/usb/serial/keyspan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,12 +1215,14 @@ static int keyspan_chars_in_buffer (struct usb_serial_port *port)

static int keyspan_open (struct usb_serial_port *port, struct file *filp)
{
struct keyspan_port_private *p_priv;
struct keyspan_serial_private *s_priv;
struct usb_serial *serial = port->serial;
struct keyspan_port_private *p_priv;
struct keyspan_serial_private *s_priv;
struct usb_serial *serial = port->serial;
const struct keyspan_device_details *d_details;
int i, err;
int baud_rate, device_port;
struct urb *urb;
unsigned int cflag;

s_priv = usb_get_serial_data(serial);
p_priv = usb_get_serial_port_data(port);
Expand Down Expand Up @@ -1263,6 +1265,30 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
/* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */
}

/* get the terminal config for the setup message now so we don't
* need to send 2 of them */

cflag = port->tty->termios->c_cflag;
device_port = port->number - port->serial->minor;

/* Baud rate calculation takes baud rate as an integer
so other rates can be generated if desired. */
baud_rate = tty_get_baud_rate(port->tty);
/* If no match or invalid, leave as default */
if (baud_rate >= 0
&& d_details->calculate_baud_rate(baud_rate, d_details->baudclk,
NULL, NULL, NULL, device_port) == KEYSPAN_BAUD_RATE_OK) {
p_priv->baud = baud_rate;
}

/* set CTS/RTS handshake etc. */
p_priv->cflag = cflag;
p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none;

keyspan_send_setup(port, 1);
//mdelay(100);
//keyspan_set_termios(port, NULL);

return (0);
}

Expand Down

0 comments on commit 110587e

Please sign in to comment.