diff options
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r-- | include/linux/usb/composite.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 882a084a8411..b78cba466d3d 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -37,6 +37,14 @@ | |||
37 | #include <linux/usb/ch9.h> | 37 | #include <linux/usb/ch9.h> |
38 | #include <linux/usb/gadget.h> | 38 | #include <linux/usb/gadget.h> |
39 | 39 | ||
40 | /* | ||
41 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they | ||
42 | * wish to delay the data/status stages of the control transfer till they | ||
43 | * are ready. The control transfer will then be kept from completing till | ||
44 | * all the function drivers that requested for USB_GADGET_DELAYED_STAUS | ||
45 | * invoke usb_composite_setup_continue(). | ||
46 | */ | ||
47 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ | ||
40 | 48 | ||
41 | struct usb_configuration; | 49 | struct usb_configuration; |
42 | 50 | ||
@@ -285,6 +293,7 @@ struct usb_composite_driver { | |||
285 | extern int usb_composite_probe(struct usb_composite_driver *driver, | 293 | extern int usb_composite_probe(struct usb_composite_driver *driver, |
286 | int (*bind)(struct usb_composite_dev *cdev)); | 294 | int (*bind)(struct usb_composite_dev *cdev)); |
287 | extern void usb_composite_unregister(struct usb_composite_driver *driver); | 295 | extern void usb_composite_unregister(struct usb_composite_driver *driver); |
296 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | ||
288 | 297 | ||
289 | 298 | ||
290 | /** | 299 | /** |
@@ -342,7 +351,12 @@ struct usb_composite_dev { | |||
342 | */ | 351 | */ |
343 | unsigned deactivations; | 352 | unsigned deactivations; |
344 | 353 | ||
345 | /* protects at least deactivation count */ | 354 | /* the composite driver won't complete the control transfer's |
355 | * data/status stages till delayed_status is zero. | ||
356 | */ | ||
357 | int delayed_status; | ||
358 | |||
359 | /* protects deactivations and delayed_status counts*/ | ||
346 | spinlock_t lock; | 360 | spinlock_t lock; |
347 | }; | 361 | }; |
348 | 362 | ||