summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/composite.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index cb28d4302781..26b30db9770c 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -38,6 +38,14 @@
#include <linux/usb/gadget.h>
#include <linux/switch.h>
+/*
+ * USB function drivers should return USB_GADGET_DELAYED_STATUS if they
+ * wish to delay the data/status stages of the control transfer till they
+ * are ready. The control transfer will then be kept from completing till
+ * all the function drivers that requested for USB_GADGET_DELAYED_STAUS
+ * invoke usb_composite_setup_continue().
+ */
+#define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */
struct usb_composite_dev;
struct usb_configuration;
@@ -300,7 +308,7 @@ struct usb_composite_driver {
extern int usb_composite_register(struct usb_composite_driver *);
extern void usb_composite_unregister(struct usb_composite_driver *);
-
+extern void usb_composite_setup_continue(struct usb_composite_dev *cdev);
/**
* struct usb_composite_device - represents one composite usb gadget
@@ -354,7 +362,12 @@ struct usb_composite_dev {
*/
unsigned deactivations;
- /* protects at least deactivation count */
+ /* the composite driver won't complete the control transfer's
+ * data/status stages till delayed_status is zero.
+ */
+ int delayed_status;
+
+ /* protects deactivations and delayed_status counts*/
spinlock_t lock;
/* switch indicating connected/disconnected state */