summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/usb/usb_hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/dev/usb/usb_hub.c')
-rw-r--r--freebsd/sys/dev/usb/usb_hub.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/freebsd/sys/dev/usb/usb_hub.c b/freebsd/sys/dev/usb/usb_hub.c
index d27728e9..b7d5b597 100644
--- a/freebsd/sys/dev/usb/usb_hub.c
+++ b/freebsd/sys/dev/usb/usb_hub.c
@@ -2264,6 +2264,11 @@ usb_needs_explore(struct usb_bus *bus, uint8_t do_probe)
DPRINTF("\n");
+ if (cold != 0) {
+ DPRINTF("Cold\n");
+ return;
+ }
+
if (bus == NULL) {
DPRINTF("No bus pointer!\n");
return;
@@ -2329,6 +2334,26 @@ usb_needs_explore_all(void)
}
/*------------------------------------------------------------------------*
+ * usb_needs_explore_init
+ *
+ * This function will ensure that the USB controllers are not enumerated
+ * until the "cold" variable is cleared.
+ *------------------------------------------------------------------------*/
+static void
+usb_needs_explore_init(void *arg)
+{
+ /*
+ * The cold variable should be cleared prior to this function
+ * being called:
+ */
+ if (cold == 0)
+ usb_needs_explore_all();
+ else
+ DPRINTFN(-1, "Cold variable is still set!\n");
+}
+SYSINIT(usb_needs_explore_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, usb_needs_explore_init, NULL);
+
+/*------------------------------------------------------------------------*
* usb_bus_power_update
*
* This function will ensure that all USB devices on the given bus are