From 87908f29251e89b773b8b3c39acb4291ea300955 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sun, 2 Apr 2006 10:18:09 -0800 Subject: [PATCH] --- yaml --- r: 25742 b: refs/heads/master c: 89ccbdc91bc5a433fa256c0136fbe181d7c5d474 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/Kconfig | 7 +++++++ trunk/drivers/usb/core/hub.c | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f92b5a277a0a..ed375c5cf6a5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4d45e21867bee51e3bb42e95bc2929231d7c8192 +refs/heads/master: 89ccbdc91bc5a433fa256c0136fbe181d7c5d474 diff --git a/trunk/drivers/usb/core/Kconfig b/trunk/drivers/usb/core/Kconfig index ff03184da403..a08787e253aa 100644 --- a/trunk/drivers/usb/core/Kconfig +++ b/trunk/drivers/usb/core/Kconfig @@ -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. diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 3c76f7e17c0c..0c87f73f2933 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -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) &&