USB: composite: Add flag to usb_function to hide its interface during enumeration
authorMike Lockwood <lockwood@android.com>
Fri, 11 Dec 2009 16:24:07 +0000 (11:24 -0500)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:02:40 +0000 (12:02 -0800)
Change-Id: Ie999b5190e3e2b6fd23015b8e796cdd178829929

Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/usb/gadget/composite.c
include/linux/usb/composite.h

index 07bb37e..134d3d5 100644 (file)
@@ -271,7 +271,7 @@ static int config_buf(struct usb_configuration *config,
                        descriptors = f->hs_descriptors;
                else
                        descriptors = f->descriptors;
-               if (!descriptors || descriptors[0] == NULL) {
+               if (f->hidden || !descriptors || descriptors[0] == NULL) {
                        for (; f != config->interface[interfaceCount];) {
                                interfaceCount++;
                                c->bNumInterfaces--;
index b78cba4..8f5a89f 100644 (file)
@@ -108,6 +108,7 @@ struct usb_function {
        struct usb_descriptor_header    **hs_descriptors;
 
        struct usb_configuration        *config;
+       int                             hidden;
 
        /* REVISIT:  bind() functions can be marked __init, which
         * makes trouble for section mismatch analysis.  See if