aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-10-16 11:39:29 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-12 11:01:54 -0800
commitc9d503370f240934f3c1c5da4c6c2452a7d05db2 (patch)
tree92803ca7729f1ef26bc69542c96ee29850fd1815 /include/linux/usb.h
parentUSB: Export generic USB device driver functions (diff)
downloadwireguard-linux-c9d503370f240934f3c1c5da4c6c2452a7d05db2.tar.xz
wireguard-linux-c9d503370f240934f3c1c5da4c6c2452a7d05db2.zip
USB: Make it possible to "subclass" usb_device_driver
The kernel currenly has only 2 usb_device_drivers, one generic one, one that completely replaces the generic one to make USB devices usable over a network. Use the newly exported generic driver functions when a driver declares to want them run, in addition to its own code. This makes it possible to write drivers that extend the generic USB driver. Note that this patch is not enough for another driver to automatically get selected. Signed-off-by: Bastien Nocera <hadess@hadess.net> Acked-by: Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/20191016093933.693-3-hadess@hadess.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index e656e7b4b1e4..94bd3b48a485 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1228,6 +1228,9 @@ struct usb_driver {
* @drvwrap: Driver-model core structure wrapper.
* @supports_autosuspend: if set to 0, the USB core will not allow autosuspend
* for devices bound to this driver.
+ * @generic_subclass: if set to 1, the generic USB driver's probe, disconnect,
+ * resume and suspend functions will be called in addition to the driver's
+ * own, so this part of the setup does not need to be replicated.
*
* USB drivers must provide all the fields listed above except drvwrap.
*/
@@ -1242,6 +1245,7 @@ struct usb_device_driver {
const struct attribute_group **dev_groups;
struct usbdrv_wrap drvwrap;
unsigned int supports_autosuspend:1;
+ unsigned int generic_subclass:1;
};
#define to_usb_device_driver(d) container_of(d, struct usb_device_driver, \
drvwrap.driver)