USB: composite: Add flag to usb_function to hide its interface during enumeration
Mike Lockwood [Fri, 11 Dec 2009 16:24:07 +0000 (11:24 -0500)]
Change-Id: Ie999b5190e3e2b6fd23015b8e796cdd178829929

Signed-off-by: Mike Lockwood <lockwood@android.com>
Change-Id: Ie84b8a1bf8e81458716b9ae21002d1e6cc6ffffa
Reviewed-on: http://git-master/r/110670
Reviewed-by: Prashant Malani <pmalani@nvidia.com>
Tested-by: Prashant Malani <pmalani@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bo Yan <byan@nvidia.com>
Tested-by: Bo Yan <byan@nvidia.com>

drivers/usb/gadget/composite.c
include/linux/usb/composite.h

index 95bcccb..b718ea4 100644 (file)
@@ -395,7 +395,7 @@ static int config_buf(struct usb_configuration *config,
                        descriptors = f->descriptors;
                }
 
-               if (!descriptors || descriptors[0] == NULL) {
+               if (f->hidden || !descriptors || descriptors[0] == NULL) {
                        for (; f != config->interface[interfaceCount];) {
                                interfaceCount++;
                                c->bNumInterfaces--;
index 6938a86..585d710 100644 (file)
@@ -117,6 +117,7 @@ struct usb_function {
        struct usb_descriptor_header    **ss_descriptors;
 
        struct usb_configuration        *config;
+       int                             hidden;
 
        /* REVISIT:  bind() functions can be marked __init, which
         * makes trouble for section mismatch analysis.  See if