diff options
Diffstat (limited to 'drivers/usb/gadget/function/u_fs.h')
-rw-r--r-- | drivers/usb/gadget/function/u_fs.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/u_fs.h b/drivers/usb/gadget/function/u_fs.h index cd128e31f808..60139854e0b1 100644 --- a/drivers/usb/gadget/function/u_fs.h +++ b/drivers/usb/gadget/function/u_fs.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/usb/composite.h> | 19 | #include <linux/usb/composite.h> |
20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/workqueue.h> | ||
22 | 23 | ||
23 | #ifdef VERBOSE_DEBUG | 24 | #ifdef VERBOSE_DEBUG |
24 | #ifndef pr_vdebug | 25 | #ifndef pr_vdebug |
@@ -93,6 +94,26 @@ enum ffs_state { | |||
93 | FFS_ACTIVE, | 94 | FFS_ACTIVE, |
94 | 95 | ||
95 | /* | 96 | /* |
97 | * Function is visible to host, but it's not functional. All | ||
98 | * setup requests are stalled and transfers on another endpoints | ||
99 | * are refused. All epfiles, except ep0, are deleted so there | ||
100 | * is no way to perform any operations on them. | ||
101 | * | ||
102 | * This state is set after closing all functionfs files, when | ||
103 | * mount parameter "no_disconnect=1" has been set. Function will | ||
104 | * remain in deactivated state until filesystem is umounted or | ||
105 | * ep0 is opened again. In the second case functionfs state will | ||
106 | * be reset, and it will be ready for descriptors and strings | ||
107 | * writing. | ||
108 | * | ||
109 | * This is useful only when functionfs is composed to gadget | ||
110 | * with another function which can perform some critical | ||
111 | * operations, and it's strongly desired to have this operations | ||
112 | * completed, even after functionfs files closure. | ||
113 | */ | ||
114 | FFS_DEACTIVATED, | ||
115 | |||
116 | /* | ||
96 | * All endpoints have been closed. This state is also set if | 117 | * All endpoints have been closed. This state is also set if |
97 | * we encounter an unrecoverable error. The only | 118 | * we encounter an unrecoverable error. The only |
98 | * unrecoverable error is situation when after reading strings | 119 | * unrecoverable error is situation when after reading strings |
@@ -251,6 +272,10 @@ struct ffs_data { | |||
251 | kgid_t gid; | 272 | kgid_t gid; |
252 | } file_perms; | 273 | } file_perms; |
253 | 274 | ||
275 | struct eventfd_ctx *ffs_eventfd; | ||
276 | bool no_disconnect; | ||
277 | struct work_struct reset_work; | ||
278 | |||
254 | /* | 279 | /* |
255 | * The endpoint files, filled by ffs_epfiles_create(), | 280 | * The endpoint files, filled by ffs_epfiles_create(), |
256 | * destroyed by ffs_epfiles_destroy(). | 281 | * destroyed by ffs_epfiles_destroy(). |