]> err.no Git - linux-2.6/commitdiff
[PATCH] USB: otg hub support is optional
authorDavid Brownell <david-b@pacbell.net>
Sun, 2 Apr 2006 18:18:09 +0000 (10:18 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Apr 2006 18:12:23 +0000 (11:12 -0700)
USB OTG devices are not required to support external hubs.  This adds a
configuration option to disable that support.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/Kconfig
drivers/usb/core/hub.c

index ff03184da403b1bf015277f9993bd500ba73ca32..a08787e253aaa17176cf786621765a39fced7c4e 100644 (file)
@@ -99,4 +99,11 @@ config USB_OTG_WHITELIST
          normal Linux-USB hosts do (other than the warning), and is
          convenient for many stages of product development.
 
+config USB_OTG_BLACKLIST_HUB
+       bool "Disable external hubs"
+       depends on USB_OTG
+       help
+         If you say Y here, then Linux will refuse to enumerate
+         external hubs.  OTG hosts are allowed to reduce hardware
+         and software costs by not supporting external hubs.
 
index 3c76f7e17c0c4a88f84924c7770d3917c7d9c6ff..0c87f73f29332d9bbf71e688b97acaa5ac4a668f 100644 (file)
@@ -836,6 +836,13 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
        desc = intf->cur_altsetting;
        hdev = interface_to_usbdev(intf);
 
+#ifdef CONFIG_USB_OTG_BLACKLIST_HUB
+       if (hdev->parent) {
+               dev_warn(&intf->dev, "ignoring external hub\n");
+               return -ENODEV;
+       }
+#endif
+
        /* Some hubs have a subclass of 1, which AFAICT according to the */
        /*  specs is not defined, but it works */
        if ((desc->desc.bInterfaceSubClass != 0) &&