summaryrefslogtreecommitdiff
path: root/include/linux/usb/serial.h
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2010-03-17 23:00:37 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 13:21:33 -0700
commitbbcb2b907415a90334521a31a8767cd77462c716 (patch)
tree8ee895f4ee3352a7f57c52c5e99119bc6838edac /include/linux/usb/serial.h
parent317149c655defedfaf432143b86a720cfc12a424 (diff)
USB: serial: allow drivers to define bulk buffer sizes
Allow drivers to define custom bulk in/out buffer sizes in struct usb_serial_driver. If not set, fall back to the default buffer size which matches the endpoint size. Three drivers are currently freeing the pre-allocated buffers and allocating larger ones to achieve this at port probe (ftdi_sio) or even at port open (ipaq and iuu_phoenix), which needless to say is suboptimal. Signed-off-by: Johan Hovold <jhovold@gmail.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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index b7682fed1d9c..ab311dab3383 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -179,6 +179,8 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data)
* @id_table: pointer to a list of usb_device_id structures that define all
* of the devices this structure can support.
* @num_ports: the number of different ports this device will have.
+ * @bulk_in_size: bytes to allocate for bulk-in buffer (0 = end-point size)
+ * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size)
* @calc_num_ports: pointer to a function to determine how many ports this
* device has dynamically. It will be called after the probe()
* callback is called, but before attach()
@@ -223,6 +225,9 @@ struct usb_serial_driver {
struct usb_dynids dynids;
int max_in_flight_urbs;
+ size_t bulk_in_size;
+ size_t bulk_out_size;
+
int (*probe)(struct usb_serial *serial, const struct usb_device_id *id);
int (*attach)(struct usb_serial *serial);
int (*calc_num_ports) (struct usb_serial *serial);