mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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>
This commit is contained in:
parent
317149c655
commit
bbcb2b9074
5 changed files with 16 additions and 71 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue