Commit 89ccbdc9 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman
Browse files

[PATCH] USB: otg hub support is optional



USB OTG devices are not required to support external hubs.  This adds a
configuration option to disable that support.

Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4d45e218
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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.
+7 −0
Original line number Diff line number Diff line
@@ -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) &&