summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-03-02 12:51:19 +0100
committerJohan Hovold <johan@kernel.org>2017-03-16 10:33:41 +0100
commit92e6b2c675e1d247317ec41a078f49aaade7f716 (patch)
treef46b544b30899fa6c0f160b28987cd85db53a845 /include
parent8520ac0d70d6c1709bf6768cb79f3b75115def09 (diff)
downloadlinux-92e6b2c675e1d247317ec41a078f49aaade7f716.tar.gz
linux-92e6b2c675e1d247317ec41a078f49aaade7f716.tar.bz2
linux-92e6b2c675e1d247317ec41a078f49aaade7f716.zip
USB: serial: add endpoint sanity check to core
Allow drivers to specify a minimum number of endpoints per type, which USB serial core will verify after subdriver probe has returned (where the current alternate setting may have been changed). Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/serial.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index ee4394d8932f..f1b8a8493762 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -188,6 +188,10 @@ 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.
+ * @num_bulk_in: minimum number of bulk-in endpoints
+ * @num_bulk_out: minimum number of bulk-out endpoints
+ * @num_interrupt_in: minimum number of interrupt-in endpoints
+ * @num_interrupt_out: minimum number of interrupt-out endpoints
* @bulk_in_size: minimum number of 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)
@@ -235,6 +239,11 @@ struct usb_serial_driver {
unsigned char num_ports;
+ unsigned char num_bulk_in;
+ unsigned char num_bulk_out;
+ unsigned char num_interrupt_in;
+ unsigned char num_interrupt_out;
+
size_t bulk_in_size;
size_t bulk_out_size;