diff options
author | 2015-06-22 10:29:18 +0000 | |
---|---|---|
committer | 2015-06-22 10:29:18 +0000 | |
commit | fb72199c69b34c0729b0f87db405f81d4f866411 (patch) | |
tree | 7a9ec4ae89faf4411f0f6652919978393f49cfeb /sys/dev/usb/uhub.c | |
parent | rtrequest1(9) error code path cleanup. (diff) | |
download | wireguard-openbsd-fb72199c69b34c0729b0f87db405f81d4f866411.tar.xz wireguard-openbsd-fb72199c69b34c0729b0f87db405f81d4f866411.zip |
Make xhci(4)'s root hub report the same status bits as physical USB3 hubs.
There's not bit to indicate the speed of a USB3.0 device attached to a hub
port so do not abuse the PORT_TEST bit. Instead make the xhci(4) root hub
report the PORT_POWER_SS bit when appropriate and use it to determin the
speed of a new device.
While here make the root hub report the link state and config error, from
FreeBSD.
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r-- | sys/dev/usb/uhub.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 340064c1ab5..ce8d0c82d70 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhub.c,v 1.84 2015/06/15 16:46:21 mpi Exp $ */ +/* $OpenBSD: uhub.c,v 1.85 2015/06/22 10:29:18 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 $ */ @@ -460,14 +460,14 @@ uhub_explore(struct usbd_device *dev) continue; } /* Get port status again, it might have changed during reset */ - err = usbd_get_port_status(dev, port, &up->status); - if (err) { - DPRINTF("%s: get port %d status failed, error=%s\n", - sc->sc_dev.dv_xname, port, usbd_errstr(err)); + if (usbd_get_port_status(dev, port, &up->status)) continue; - } + status = UGETW(up->status.wPortStatus); change = UGETW(up->status.wPortChange); + DPRINTF("%s: port %d status=0x%04x change=0x%04x\n", + sc->sc_dev.dv_xname, port, status, change); + if (!(status & UPS_CURRENT_CONNECT_STATUS)) { /* Nothing connected, just ignore it. */ DPRINTF("%s: port %d, device disappeared after reset\n", @@ -482,9 +482,7 @@ uhub_explore(struct usbd_device *dev) if ((status & UPS_PORT_POWER) == 0) status &= ~UPS_PORT_POWER_SS; - if (status & UPS_SUPER_SPEED) - speed = USB_SPEED_SUPER; - else if (status & UPS_HIGH_SPEED) + if (status & UPS_HIGH_SPEED) speed = USB_SPEED_HIGH; else if (status & UPS_LOW_SPEED) speed = USB_SPEED_LOW; |