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)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:16 +0000 (17:49 -0700)
Change-Id: Ie999b5190e3e2b6fd23015b8e796cdd178829929

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

index 6fd9f08d90107e1a1200378567c92e8fdba71688..1659a11dc18cb3f3e2131ac87a2b3a636d988528 100644 (file)
@@ -267,7 +267,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 617068134ae8a91cadc1f7ccf42761cf212b5adf..9af8c466d83b179302f059d04629f2a7caa0656f 100644 (file)
@@ -100,6 +100,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