Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146264
b: refs/heads/master
c: 5fcf62b
h: refs/heads/master
v: v3
  • Loading branch information
Olivier Bornet authored and Linus Torvalds committed Jun 11, 2009
1 parent ba0fd8e commit fc1ebb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 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: 852e99d22f2231d232c45216b027565e3bae7add
refs/heads/master: 5fcf62b0f1f24ee25931636216f28bc87448a60f
29 changes: 13 additions & 16 deletions trunk/drivers/usb/serial/iuu_phoenix.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,32 +650,33 @@ static int iuu_bulk_write(struct usb_serial_port *port)
unsigned long flags;
int result;
int i;
int buf_len;
char *buf_ptr = port->write_urb->transfer_buffer;
dbg("%s - enter", __func__);

spin_lock_irqsave(&priv->lock, flags);
*buf_ptr++ = IUU_UART_ESC;
*buf_ptr++ = IUU_UART_TX;
*buf_ptr++ = priv->writelen;

memcpy(buf_ptr, priv->writebuf,
priv->writelen);
memcpy(buf_ptr, priv->writebuf, priv->writelen);
buf_len = priv->writelen;
priv->writelen = 0;
spin_unlock_irqrestore(&priv->lock, flags);
if (debug == 1) {
for (i = 0; i < priv->writelen; i++)
for (i = 0; i < buf_len; i++)
sprintf(priv->dbgbuf + i*2 ,
"%02X", priv->writebuf[i]);
priv->dbgbuf[priv->writelen+i*2] = 0;
priv->dbgbuf[buf_len+i*2] = 0;
dbg("%s - writing %i chars : %s", __func__,
priv->writelen, priv->dbgbuf);
buf_len, priv->dbgbuf);
}
usb_fill_bulk_urb(port->write_urb, port->serial->dev,
usb_sndbulkpipe(port->serial->dev,
port->bulk_out_endpointAddress),
port->write_urb->transfer_buffer, priv->writelen + 3,
port->write_urb->transfer_buffer, buf_len + 3,
iuu_rxcmd, port);
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
spin_lock_irqsave(&priv->lock, flags);
priv->writelen = 0;
spin_unlock_irqrestore(&priv->lock, flags);
usb_serial_port_softint(port);
return result;
}
Expand Down Expand Up @@ -769,14 +770,10 @@ static int iuu_uart_write(struct tty_struct *tty, struct usb_serial_port *port,
return -ENOMEM;

spin_lock_irqsave(&priv->lock, flags);
if (priv->writelen > 0) {
/* buffer already filled but not commited */
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}

/* fill the buffer */
memcpy(priv->writebuf, buf, count);
priv->writelen = count;
memcpy(priv->writebuf + priv->writelen, buf, count);
priv->writelen += count;
spin_unlock_irqrestore(&priv->lock, flags);

return count;
Expand Down

0 comments on commit fc1ebb4

Please sign in to comment.