diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-03-17 18:00:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:33 -0400 |
commit | bbcb2b907415a90334521a31a8767cd77462c716 (patch) | |
tree | 8ee895f4ee3352a7f57c52c5e99119bc6838edac /include/linux/usb/serial.h | |
parent | 317149c655defedfaf432143b86a720cfc12a424 (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.h | 5 |
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) | |||
179 | * @id_table: pointer to a list of usb_device_id structures that define all | 179 | * @id_table: pointer to a list of usb_device_id structures that define all |
180 | * of the devices this structure can support. | 180 | * of the devices this structure can support. |
181 | * @num_ports: the number of different ports this device will have. | 181 | * @num_ports: the number of different ports this device will have. |
182 | * @bulk_in_size: bytes to allocate for bulk-in buffer (0 = end-point size) | ||
183 | * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size) | ||
182 | * @calc_num_ports: pointer to a function to determine how many ports this | 184 | * @calc_num_ports: pointer to a function to determine how many ports this |
183 | * device has dynamically. It will be called after the probe() | 185 | * device has dynamically. It will be called after the probe() |
184 | * callback is called, but before attach() | 186 | * callback is called, but before attach() |
@@ -223,6 +225,9 @@ struct usb_serial_driver { | |||
223 | struct usb_dynids dynids; | 225 | struct usb_dynids dynids; |
224 | int max_in_flight_urbs; | 226 | int max_in_flight_urbs; |
225 | 227 | ||
228 | size_t bulk_in_size; | ||
229 | size_t bulk_out_size; | ||
230 | |||
226 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); | 231 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); |
227 | int (*attach)(struct usb_serial *serial); | 232 | int (*attach)(struct usb_serial *serial); |
228 | int (*calc_num_ports) (struct usb_serial *serial); | 233 | int (*calc_num_ports) (struct usb_serial *serial); |