diff options
author | 2014-11-07 13:56:29 +0000 | |
---|---|---|
committer | 2014-11-07 13:56:29 +0000 | |
commit | 7af21e63aedc7bf141a1ed5d3e03dc6b776f77c1 (patch) | |
tree | 8835b0fd4340c02150560fdab60febb9531eef61 /sys/dev/usb/uhub.c | |
parent | Remove the sslv2 option since LibreSSL has no SSLv2 support (however retain (diff) | |
download | wireguard-openbsd-7af21e63aedc7bf141a1ed5d3e03dc6b776f77c1.tar.xz wireguard-openbsd-7af21e63aedc7bf141a1ed5d3e03dc6b776f77c1.zip |
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.c | 17 |
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); |