]> git.karo-electronics.de Git - linux-beck.git/commit
usb: gadget: composite: let USB functions process ctrl reqs in cfg0
authorFelix Hädicke <felixhaedicke@web.de>
Tue, 21 Jun 2016 23:12:08 +0000 (01:12 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 25 Aug 2016 09:13:17 +0000 (12:13 +0300)
commit1a00b457a5482c3822bfc0fd64c088b2dba93e26
tree5fa3a86d38d3d521845a3b93ea9c83ec9d0f34a1
parent54dfce6d07b0391e23d006579bba488de4f7d6aa
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>
drivers/usb/gadget/composite.c
drivers/usb/gadget/function/f_fs.c
drivers/usb/gadget/function/f_printer.c
include/linux/usb/composite.h