Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337823
b: refs/heads/master
c: 7028035
h: refs/heads/master
i:
  337821: 5e9503c
  337819: 8c88057
  337815: ca83169
  337807: c8a2c0f
  337791: 1b7bc67
v: v3
  • Loading branch information
YAMANE Toshiaki authored and Greg Kroah-Hartman committed Nov 13, 2012
1 parent 87abaaa commit b5c49f8
Show file tree
Hide file tree
Showing 2 changed files with 24 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: 04e9d11beb49538458af005f703cb666fc1d3ccf
refs/heads/master: 7028035d513ea7c1cc532c0f2b0e0808ebe5ccf6
39 changes: 23 additions & 16 deletions trunk/drivers/staging/serqt_usb2/serqt_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,12 +1473,32 @@ static void qt_throttle(struct tty_struct *tty)
mutex_unlock(&qt_port->lock);
}

static void qt_submit_urb_from_unthrottle(struct usb_serial_port *port,
struct usb_serial *serial)
{
int result;

/* Start reading from the device */
usb_fill_bulk_urb(port->read_urb, serial->dev,
usb_rcvbulkpipe(serial->dev,
port->bulk_in_endpointAddress),
port->read_urb->transfer_buffer,
port->read_urb->transfer_buffer_length,
qt_read_bulk_callback, port);

result = usb_submit_urb(port->read_urb, GFP_ATOMIC);

if (result)
dev_err(&port->dev,
"%s - failed restarting read urb, error %d\n",
__func__, result);
}

static void qt_unthrottle(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct usb_serial *serial = get_usb_serial(port, __func__);
struct quatech_port *qt_port;
unsigned int result;

if (!serial)
return;
Expand All @@ -1494,21 +1514,8 @@ static void qt_unthrottle(struct tty_struct *tty)
dev_dbg(&port->dev, "%s - qt_port->RxHolding = 0\n", __func__);

/* if we have a bulk endpoint, start it up */
if ((serial->num_bulk_in) && (qt_port->ReadBulkStopped == 1)) {
/* Start reading from the device */
usb_fill_bulk_urb(port->read_urb, serial->dev,
usb_rcvbulkpipe(serial->dev,
port->bulk_in_endpointAddress),
port->read_urb->transfer_buffer,
port->read_urb->
transfer_buffer_length,
qt_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
dev_err(&port->dev,
"%s - failed restarting read urb, error %d\n",
__func__, result);
}
if ((serial->num_bulk_in) && (qt_port->ReadBulkStopped == 1))
qt_submit_urb_from_unthrottle(port, serial);
}
mutex_unlock(&qt_port->lock);
}
Expand Down

0 comments on commit b5c49f8

Please sign in to comment.