diff options
author | Joris van Rantwijk <jorispubl@xs4all.nl> | 2007-02-01 20:08:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-16 15:32:18 -0800 |
commit | 253ca923281aec6975ec4028ddbc58e865d8d13d (patch) | |
tree | 837b437f40ecb75174917e0623b6f4e2cdcc6f46 /include/linux/usb | |
parent | b544d7499cc47fc26e9dbacd7b9cabc67d2bdf2e (diff) | |
download | op-kernel-dev-253ca923281aec6975ec4028ddbc58e865d8d13d.zip op-kernel-dev-253ca923281aec6975ec4028ddbc58e865d8d13d.tar.gz |
USB: add flow control to usb-serial generic driver.
I added two fields to struct usb_serial_port to keep track of the
throttle state. Other usb-serial drivers typically use private data for
such things, but the generic driver can not really do that because some
of its code is also used by other drivers (which may have their own
private data needs).
As it is, I am not sure that this patch is useful in all scenarios.
It is certainly helpful for low-bandwidth devices that can hold their
data in response to throttling. But for devices that pump data in
real-time as fast as possible (webcam, A/D converter, etc), throttling
may actually cause more data loss.
From: Joris van Rantwijk <jorispubl@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/serial.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 33dcd85..32acbae 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -54,6 +54,8 @@ * @write_wait: a wait_queue_head_t used by the port. * @work: work queue entry for the line discipline waking up. * @open_count: number of times this port has been opened. + * @throttled: nonzero if the read urb is inactive to throttle the device + * @throttle_req: nonzero if the tty wants to throttle us * * This structure is used by the usb-serial core and drivers for the specific * ports of a device. @@ -88,6 +90,8 @@ struct usb_serial_port { wait_queue_head_t write_wait; struct work_struct work; int open_count; + char throttled; + char throttle_req; struct device dev; }; #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) @@ -269,6 +273,8 @@ extern int usb_serial_generic_write_room (struct usb_serial_port *port); extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); extern void usb_serial_generic_read_bulk_callback (struct urb *urb); extern void usb_serial_generic_write_bulk_callback (struct urb *urb); +extern void usb_serial_generic_throttle (struct usb_serial_port *port); +extern void usb_serial_generic_unthrottle (struct usb_serial_port *port); extern void usb_serial_generic_shutdown (struct usb_serial *serial); extern int usb_serial_generic_register (int debug); extern void usb_serial_generic_deregister (void); |