USB: composite: Allow configurations to handle unhandled setup requests

Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Joe Swantek
2009-12-15 07:17:40 -05:00
committed by Colin Cross
parent c7ba16ae1a
commit 292b1bcfc8

View File

@@ -983,6 +983,25 @@ unknown:
value = c->setup(c, ctrl);
}
/* If the vendor request is not processed (value < 0),
* call all device registered configure setup callbacks
* to process it.
* This is used to handle the following cases:
* - vendor request is for the device and arrives before
* setconfiguration.
* - Some devices are required to handle vendor request before
* setconfiguration such as MTP, USBNET.
*/
if (value < 0) {
struct usb_configuration *cfg;
list_for_each_entry(cfg, &cdev->configs, list) {
if (cfg && cfg->setup)
value = cfg->setup(cfg, ctrl);
}
}
goto done;
}