diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2009-05-11 16:24:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:45 -0400 |
commit | 715b1dc01fe44537e8fce9566e4bb48d6821d84b (patch) | |
tree | b1fc0b5c61a7317e7104468afddad544fb3fc34c /include/linux/usb/serial.h | |
parent | b0cda8c5f7b652c6c27bcb3891d174534d2f1a91 (diff) |
USB: usb_debug, usb_generic_serial: implement multi urb write
The usb_debug driver, when used as the console, will always fail to
insert the carriage return and new line sequence as well as randomly
drop console output. This is a result of only having the single
write_urb and that the tty layer will have a lock that prevents the
processing of the back to back urb requests.
The solution is to allow more than one urb to be outstanding and have
a slightly deeper transmit queue. The idea and some code is borrowed
from the ftdi_sio usb driver.
The generic usb serial driver was modified so as to allow the classic
method of 1 write urb, or a multi write urb scheme with N allowed
outstanding urbs where N is controlled by max_in_flight_urbs. When
max_in_flight_urbs in a "struct usb_serial_driver" is non zero the
multi write urb scheme will be used.
The size of 4000 was selected for the usb_debug driver so that the
driver lowers possibility of losing the queued console messages during
the kernel startup.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb/serial.h')
-rw-r--r-- | include/linux/usb/serial.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 8cdfed738fe4..e2938fd179e2 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -91,6 +91,9 @@ struct usb_serial_port { | |||
91 | int write_urb_busy; | 91 | int write_urb_busy; |
92 | __u8 bulk_out_endpointAddress; | 92 | __u8 bulk_out_endpointAddress; |
93 | 93 | ||
94 | int tx_bytes_flight; | ||
95 | int urbs_in_flight; | ||
96 | |||
94 | wait_queue_head_t write_wait; | 97 | wait_queue_head_t write_wait; |
95 | struct work_struct work; | 98 | struct work_struct work; |
96 | char throttled; | 99 | char throttled; |
@@ -207,6 +210,7 @@ struct usb_serial_driver { | |||
207 | struct device_driver driver; | 210 | struct device_driver driver; |
208 | struct usb_driver *usb_driver; | 211 | struct usb_driver *usb_driver; |
209 | struct usb_dynids dynids; | 212 | struct usb_dynids dynids; |
213 | int max_in_flight_urbs; | ||
210 | 214 | ||
211 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); | 215 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); |
212 | int (*attach)(struct usb_serial *serial); | 216 | int (*attach)(struct usb_serial *serial); |