diff options
author | 2014-10-01 08:29:01 +0000 | |
---|---|---|
committer | 2014-10-01 08:29:01 +0000 | |
commit | a7a5b35d1c2f22f27ddb3f51993f3aa9eef7ef80 (patch) | |
tree | f2042c1120c1c779d22a7dd1dfc3dd45e02a5e43 /sys/dev/usb/uhub.c | |
parent | Add the QLogic SCSI/FC drivers. (diff) | |
download | wireguard-openbsd-a7a5b35d1c2f22f27ddb3f51993f3aa9eef7ef80.tar.xz wireguard-openbsd-a7a5b35d1c2f22f27ddb3f51993f3aa9eef7ef80.zip |
Check that the speed of a new device does not exceed its parent's speed
prior to calling usbd_new_device().
This will let us set the specified default Max Packet Size before opening
the control pipe and reduces spaghetti!
ok stsp@
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r-- | sys/dev/usb/uhub.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index f2176ff4413..7e54c5bb811 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhub.c,v 1.73 2014/08/10 13:32:14 mpi Exp $ */ +/* $OpenBSD: uhub.c,v 1.74 2014/10/01 08:29:01 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 $ */ @@ -471,6 +471,13 @@ uhub_explore(struct usbd_device *dev) speed = sc->sc_hub->speed; } + /* + * Reduce the speed, otherwise we won't setup the proper + * transfer methods. + */ + if (speed > sc->sc_hub->speed) + speed = sc->sc_hub->speed; + /* Get device info and set its address. */ err = usbd_new_device(&sc->sc_dev, dev->bus, dev->depth + 1, speed, port, up); |