aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/Kconfig7
-rw-r--r--drivers/usb/core/hub.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index ff03184da403..a08787e253aa 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -99,4 +99,11 @@ config USB_OTG_WHITELIST
99 normal Linux-USB hosts do (other than the warning), and is 99 normal Linux-USB hosts do (other than the warning), and is
100 convenient for many stages of product development. 100 convenient for many stages of product development.
101 101
102config USB_OTG_BLACKLIST_HUB
103 bool "Disable external hubs"
104 depends on USB_OTG
105 help
106 If you say Y here, then Linux will refuse to enumerate
107 external hubs. OTG hosts are allowed to reduce hardware
108 and software costs by not supporting external hubs.
102 109
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 3c76f7e17c0c..0c87f73f2933 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -836,6 +836,13 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
836 desc = intf->cur_altsetting; 836 desc = intf->cur_altsetting;
837 hdev = interface_to_usbdev(intf); 837 hdev = interface_to_usbdev(intf);
838 838
839#ifdef CONFIG_USB_OTG_BLACKLIST_HUB
840 if (hdev->parent) {
841 dev_warn(&intf->dev, "ignoring external hub\n");
842 return -ENODEV;
843 }
844#endif
845
839 /* Some hubs have a subclass of 1, which AFAICT according to the */ 846 /* Some hubs have a subclass of 1, which AFAICT according to the */
840 /* specs is not defined, but it works */ 847 /* specs is not defined, but it works */
841 if ((desc->desc.bInterfaceSubClass != 0) && 848 if ((desc->desc.bInterfaceSubClass != 0) &&