summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uhub.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-07 13:56:30 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-07 13:56:30 +0000
commit6c3e06d00bfaec15e6ff4c5b2b4d4989861e61e9 (patch)
treecc02b4e1518386af416f977bcc55aacf6ebd6116 /sys/dev/usb/uhub.c
parentf7a9764f365f980562c4cb7323052a2ac6ce883c (diff)
Give Super-Speed hubs a chance to route USB 3.0 transfers.
Without knowing their depth, hubs couldn't find the bits correspdonding to their downstream port in the route-string. Now USB 3.0 devices just work(tm) anywhere in your hub chain. This commit would not have been possible without the cheese provided by miod@ at #HAMoween.
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r--sys/dev/usb/uhub.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 7bb3c30a0cb..fa4d5d710d1 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhub.c,v 1.75 2014/11/01 14:44:08 mpi Exp $ */
+/* $OpenBSD: uhub.c,v 1.76 2014/11/07 13:56:29 mpi Exp $ */
/* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
@@ -140,6 +140,21 @@ uhub_attach(struct device *parent, struct device *self, void *aux)
return;
}
+ /*
+ * Super-Speed hubs need to know their depth to be able to
+ * parse the bits of the route-string that correspond to
+ * their downstream port number.
+ *
+ * This does no apply to root hubs.
+ */
+ if (dev->depth != 0 && dev->speed == USB_SPEED_SUPER) {
+ if (usbd_set_hub_depth(dev, dev->depth - 1)) {
+ printf("%s: unable to set HUB depth\n",
+ sc->sc_dev.dv_xname);
+ return;
+ }
+ }
+
/* Get hub descriptor. */
if (dev->speed == USB_SPEED_SUPER) {
err = usbd_get_hub_ss_descriptor(dev, &hd.ss, 1);