summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhub.c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2015-11-29 16:30:48 +0000
committerkettenis <kettenis@openbsd.org>2015-11-29 16:30:48 +0000
commit0d8ef6c15c4504cfb90fc69f24ca8774ec86a05a (patch)
tree156cb913043d37c617676a8f5ba527d1db4a37b9 /sys/dev/usb/uhub.c
parentClear the UPS_C_PORT_RESET feature when exploring. Apparently xhci(4) super (diff)
downloadwireguard-openbsd-0d8ef6c15c4504cfb90fc69f24ca8774ec86a05a.tar.xz
wireguard-openbsd-0d8ef6c15c4504cfb90fc69f24ca8774ec86a05a.zip
Unconnected xhci(4) super speed ports may come up with the XHCI_PS_WRC,
indicating a warm reset has happened. Communicate this as UPS_C_BH_PORT_RESET to the upper layers and make uhub(4) clear this bit such that we receive further connection status change notifications. Make sure we only do this for super speed (USB 3.0) hubs as high speed (USB 2.0) hubs use the same bit for UPS_C_PORT_L1. Make hotplugging USB 3.0 devices work on my MacBookPro12,1. ok mpi@
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r--sys/dev/usb/uhub.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 8dac9465acd..b73a15dfb1a 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhub.c,v 1.87 2015/11/29 16:16:35 kettenis Exp $ */
+/* $OpenBSD: uhub.c,v 1.88 2015/11/29 16:30:48 kettenis 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 $ */
@@ -425,6 +425,12 @@ uhub_explore(struct usbd_device *dev)
change |= UPS_C_CONNECT_STATUS;
}
+ if (change & UPS_C_BH_PORT_RESET &&
+ sc->sc_hub->speed == USB_SPEED_SUPER) {
+ usbd_clear_port_feature(sc->sc_hub, port,
+ UHF_C_BH_PORT_RESET);
+ }
+
if (change & UPS_C_CONNECT_STATUS) {
if (uhub_port_connect(sc, port, status, change))
continue;