summaryrefslogtreecommitdiffstats
path: root/include/linux/usb/composite.h
diff options
context:
space:
mode:
authorFelix Hädicke2016-06-22 01:12:08 +0200
committerFelipe Balbi2016-08-25 11:13:17 +0200
commit1a00b457a5482c3822bfc0fd64c088b2dba93e26 (patch)
tree5fa3a86d38d3d521845a3b93ea9c83ec9d0f34a1 /include/linux/usb/composite.h
parentusb: gadget: f_fs: handle control requests not directed to interface or endpoint (diff)
downloadkernel-qcow2-linux-1a00b457a5482c3822bfc0fd64c088b2dba93e26.tar.gz
kernel-qcow2-linux-1a00b457a5482c3822bfc0fd64c088b2dba93e26.tar.xz
kernel-qcow2-linux-1a00b457a5482c3822bfc0fd64c088b2dba93e26.zip
usb: gadget: composite: let USB functions process ctrl reqs in cfg0
It can sometimes be necessary for gadget drivers to process non-standard control requests, which host devices can send without having sent USB_REQ_SET_CONFIGURATION. Therefore, the req_match() usb_function method is enhanced with the new parameter "config0". When a USB configuration is active, this parameter is false. When a non-core control request is processed in composite_setup(), without an active configuration, req_match() of the USB functions of all available configurations which implement this function, is called with config0=true. Then the control request gets processed by the first usb_function instance whose req_match() returns true. Signed-off-by: Felix Hädicke <felixhaedicke@web.de> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r--include/linux/usb/composite.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 2b81b24eb5aa..4616a49a1c2e 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -220,7 +220,8 @@ struct usb_function {
int (*setup)(struct usb_function *,
const struct usb_ctrlrequest *);
bool (*req_match)(struct usb_function *,
- const struct usb_ctrlrequest *);
+ const struct usb_ctrlrequest *,
+ bool config0);
void (*suspend)(struct usb_function *);
void (*resume)(struct usb_function *);