Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326036
b: refs/heads/master
c: f9dfbeb
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Sep 14, 2012
1 parent e107aef commit ec6a0ad
Show file tree
Hide file tree
Showing 2 changed files with 26 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: dfa1c31564404284d4faa694c157192cd64cf6a4
refs/heads/master: f9dfbebb8b39b692474a30e9430073577dd88d7c
43 changes: 25 additions & 18 deletions trunk/drivers/usb/serial/digi_acceleport.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,15 @@ static void digi_wakeup_write(struct usb_serial_port *port)
static int digi_write_oob_command(struct usb_serial_port *port,
unsigned char *buf, int count, int interruptible)
{

int ret = 0;
int len;
struct usb_serial_port *oob_port = (struct usb_serial_port *)((struct digi_serial *)(usb_get_serial_data(port->serial)))->ds_oob_port;
struct digi_port *oob_priv = usb_get_serial_port_data(oob_port);
unsigned long flags = 0;

dbg("digi_write_oob_command: TOP: port=%d, count=%d", oob_priv->dp_port_num, count);
dev_dbg(&port->dev,
"digi_write_oob_command: TOP: port=%d, count=%d\n",
oob_priv->dp_port_num, count);

spin_lock_irqsave(&oob_priv->dp_port_lock, flags);
while (count > 0) {
Expand Down Expand Up @@ -467,7 +468,7 @@ static int digi_write_inb_command(struct usb_serial_port *port,
unsigned char *data = port->write_urb->transfer_buffer;
unsigned long flags = 0;

dbg("digi_write_inb_command: TOP: port=%d, count=%d",
dev_dbg(&port->dev, "digi_write_inb_command: TOP: port=%d, count=%d\n",
priv->dp_port_num, count);

if (timeout)
Expand Down Expand Up @@ -549,7 +550,8 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
unsigned long flags = 0;


dbg("digi_set_modem_signals: TOP: port=%d, modem_signals=0x%x",
dev_dbg(&port->dev,
"digi_set_modem_signals: TOP: port=%d, modem_signals=0x%x\n",
port_priv->dp_port_num, modem_signals);

spin_lock_irqsave(&oob_priv->dp_port_lock, flags);
Expand Down Expand Up @@ -687,6 +689,7 @@ static void digi_set_termios(struct tty_struct *tty,
struct usb_serial_port *port, struct ktermios *old_termios)
{
struct digi_port *priv = usb_get_serial_port_data(port);
struct device *dev = &port->dev;
unsigned int iflag = tty->termios->c_iflag;
unsigned int cflag = tty->termios->c_cflag;
unsigned int old_iflag = old_termios->c_iflag;
Expand All @@ -697,7 +700,9 @@ static void digi_set_termios(struct tty_struct *tty,
int i = 0;
speed_t baud;

dbg("digi_set_termios: TOP: port=%d, iflag=0x%x, old_iflag=0x%x, cflag=0x%x, old_cflag=0x%x", priv->dp_port_num, iflag, old_iflag, cflag, old_cflag);
dev_dbg(dev,
"digi_set_termios: TOP: port=%d, iflag=0x%x, old_iflag=0x%x, cflag=0x%x, old_cflag=0x%x\n",
priv->dp_port_num, iflag, old_iflag, cflag, old_cflag);

/* set baud rate */
baud = tty_get_baud_rate(tty);
Expand Down Expand Up @@ -773,7 +778,8 @@ static void digi_set_termios(struct tty_struct *tty,
case CS7: arg = DIGI_WORD_SIZE_7; break;
case CS8: arg = DIGI_WORD_SIZE_8; break;
default:
dbg("digi_set_termios: can't handle word size %d",
dev_dbg(dev,
"digi_set_termios: can't handle word size %d\n",
(cflag&CSIZE));
break;
}
Expand Down Expand Up @@ -866,7 +872,7 @@ static void digi_set_termios(struct tty_struct *tty,
}
ret = digi_write_oob_command(port, buf, i, 1);
if (ret != 0)
dbg("digi_set_termios: write oob failed, ret=%d", ret);
dev_dbg(dev, "digi_set_termios: write oob failed, ret=%d\n", ret);
tty_encode_baud_rate(tty, baud, baud);
}

Expand Down Expand Up @@ -922,7 +928,8 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
unsigned char *data = port->write_urb->transfer_buffer;
unsigned long flags = 0;

dbg("digi_write: TOP: port=%d, count=%d, in_interrupt=%ld",
dev_dbg(&port->dev,
"digi_write: TOP: port=%d, count=%d, in_interrupt=%ld\n",
priv->dp_port_num, count, in_interrupt());

/* copy user data (which can sleep) before getting spin lock */
Expand Down Expand Up @@ -981,7 +988,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
dev_err_console(port,
"%s: usb_submit_urb failed, ret=%d, port=%d\n",
__func__, ret, priv->dp_port_num);
dbg("digi_write: returning %d", ret);
dev_dbg(&port->dev, "digi_write: returning %d\n", ret);
return ret;

}
Expand Down Expand Up @@ -1012,7 +1019,7 @@ static void digi_write_bulk_callback(struct urb *urb)

/* handle oob callback */
if (priv->dp_port_num == serial_priv->ds_oob_port_num) {
dbg("digi_write_bulk_callback: oob callback");
dev_dbg(&port->dev, "digi_write_bulk_callback: oob callback\n");
spin_lock(&priv->dp_port_lock);
priv->dp_write_urb_in_use = 0;
wake_up_interruptible(&port->write_wait);
Expand Down Expand Up @@ -1066,7 +1073,7 @@ static int digi_write_room(struct tty_struct *tty)
room = port->bulk_out_size - 2 - priv->dp_out_buf_len;

spin_unlock_irqrestore(&priv->dp_port_lock, flags);
dbg("digi_write_room: port=%d, room=%d", priv->dp_port_num, room);
dev_dbg(&port->dev, "digi_write_room: port=%d, room=%d\n", priv->dp_port_num, room);
return room;

}
Expand All @@ -1077,12 +1084,12 @@ static int digi_chars_in_buffer(struct tty_struct *tty)
struct digi_port *priv = usb_get_serial_port_data(port);

if (priv->dp_write_urb_in_use) {
dbg("digi_chars_in_buffer: port=%d, chars=%d",
dev_dbg(&port->dev, "digi_chars_in_buffer: port=%d, chars=%d\n",
priv->dp_port_num, port->bulk_out_size - 2);
/* return(port->bulk_out_size - 2); */
return 256;
} else {
dbg("digi_chars_in_buffer: port=%d, chars=%d",
dev_dbg(&port->dev, "digi_chars_in_buffer: port=%d, chars=%d\n",
priv->dp_port_num, priv->dp_out_buf_len);
return priv->dp_out_buf_len;
}
Expand Down Expand Up @@ -1120,7 +1127,7 @@ static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)

ret = digi_write_oob_command(port, buf, 8, 1);
if (ret != 0)
dbg("digi_open: write oob failed, ret=%d", ret);
dev_dbg(&port->dev, "digi_open: write oob failed, ret=%d\n", ret);

/* set termios settings */
if (tty) {
Expand Down Expand Up @@ -1180,7 +1187,7 @@ static void digi_close(struct usb_serial_port *port)

ret = digi_write_oob_command(port, buf, 20, 0);
if (ret != 0)
dbg("digi_close: write oob failed, ret=%d", ret);
dev_dbg(&port->dev, "digi_close: write oob failed, ret=%d\n", ret);

/* wait for final commands on oob port to complete */
prepare_to_wait(&priv->dp_flush_wait, &wait,
Expand Down Expand Up @@ -1448,9 +1455,9 @@ static int digi_read_inb_callback(struct urb *urb)
tty_kref_put(tty);

if (opcode == DIGI_CMD_RECEIVE_DISABLE)
dbg("%s: got RECEIVE_DISABLE", __func__);
dev_dbg(&port->dev, "%s: got RECEIVE_DISABLE\n", __func__);
else if (opcode != DIGI_CMD_RECEIVE_DATA)
dbg("%s: unknown opcode: %d", __func__, opcode);
dev_dbg(&port->dev, "%s: unknown opcode: %d\n", __func__, opcode);

return throttled ? 1 : 0;

Expand Down Expand Up @@ -1484,7 +1491,7 @@ static int digi_read_oob_callback(struct urb *urb)
status = ((unsigned char *)urb->transfer_buffer)[i++];
val = ((unsigned char *)urb->transfer_buffer)[i++];

dbg("digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d",
dev_dbg(&port->dev, "digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d\n",
opcode, line, status, val);

if (status != 0 || line >= serial->type->num_ports)
Expand Down

0 comments on commit ec6a0ad

Please sign in to comment.