aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2015-07-31 10:00:13 -0400
committerFelipe Balbi <balbi@ti.com>2015-08-04 13:24:05 -0400
commitcc476b42a39d5a66d94f46cade972dcb8ee278df (patch)
tree6c374e93e6f2a4e6aa16f561a52e20bc31570cc5 /include/linux/usb
parent0f4315a8f1a73f130bbc5dde134b704ea6dda56c (diff)
usb: gadget: encapsulate endpoint claiming mechanism
So far it was necessary for usb functions to set ep->driver_data in endpoint obtained from autoconfig to non-null value, to indicate that endpoint is claimed by function (in autoconfig it was checked if endpoint has set this field to non-null value, and if it has, it was assumed that it is claimed). It could cause bugs because if some function doesn't set this field autoconfig could return the same endpoint more than one time. To help to avoid such bugs this patch adds claimed flag to struct usb_ep, and encapsulates endpoint claiming mechanism inside usb_ep_autoconfig_ss() and usb_ep_autoconfig_reset(), so now usb functions don't need to perform any additional actions to mark endpoint obtained from autoconfig as claimed. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/gadget.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 353a72096dda..68fb5e8b18c3 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -173,6 +173,7 @@ struct usb_ep {
173 const char *name; 173 const char *name;
174 const struct usb_ep_ops *ops; 174 const struct usb_ep_ops *ops;
175 struct list_head ep_list; 175 struct list_head ep_list;
176 bool claimed;
176 unsigned maxpacket:16; 177 unsigned maxpacket:16;
177 unsigned maxpacket_limit:16; 178 unsigned maxpacket_limit:16;
178 unsigned max_streams:16; 179 unsigned max_streams:16;