summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpirofti <pirofti@openbsd.org>2014-07-12 15:30:43 +0000
committerpirofti <pirofti@openbsd.org>2014-07-12 15:30:43 +0000
commit3839e626fd9acaedbf008209bf8e40beb42d449e (patch)
tree3f31ae84650b6d03d0414c3d2bc86138fb84a3c7
parentxbase has its own cpp now so it doesn't depend on comp anymore. (diff)
downloadwireguard-openbsd-3839e626fd9acaedbf008209bf8e40beb42d449e.tar.xz
wireguard-openbsd-3839e626fd9acaedbf008209bf8e40beb42d449e.zip
Add support for Get Hub Descriptor requests.
-rw-r--r--sys/arch/octeon/dev/octhci.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/arch/octeon/dev/octhci.c b/sys/arch/octeon/dev/octhci.c
index c90833e5678..a7a0679c188 100644
--- a/sys/arch/octeon/dev/octhci.c
+++ b/sys/arch/octeon/dev/octhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octhci.c,v 1.8 2014/07/12 14:37:17 pirofti Exp $ */
+/* $OpenBSD: octhci.c,v 1.9 2014/07/12 15:30:43 pirofti Exp $ */
/*
* Copyright (c) 2014 Paul Irofti <pirofti@openbsd.org>
@@ -843,21 +843,14 @@ octhci_root_ctrl_start(struct usbd_xfer *xfer)
err = USBD_IOERROR;
goto ret;
}
- /* v = XREAD4(sc, XHCI_HCCPARAMS); */
hubd = octhci_hubd;
hubd.bNbrPorts = sc->sc_noport;
-#if 0
- USETW(hubd.wHubCharacteristics,
- (XHCI_HCC_PPC(v) ? UHD_PWR_INDIVIDUAL : UHD_PWR_GANGED) |
- (XHCI_HCC_PIND(v) ? UHD_PORT_IND : 0));
- hubd.bPwrOn2PwrGood = 10; /* xHCI section 5.4.9 */
- for (i = 1; i <= sc->sc_noport; i++) {
- v = XOREAD4(sc, XHCI_PORTSC(i));
- if (v & XHCI_PS_DR)
- hubd.DeviceRemovable[i / 8] |= 1U << (i % 8);
- }
-#endif
- hubd.bDescLength = USB_HUB_DESCRIPTOR_SIZE + i;
+
+ /* Taken from the SDK Root Hub example */
+ USETW(hubd.wHubCharacteristics, UHD_OC_INDIVIDUAL);
+ hubd.bPwrOn2PwrGood = 1;
+ hubd.bDescLength = USB_HUB_DESCRIPTOR_SIZE;
+
l = min(len, hubd.bDescLength);
totlen = l;
memcpy(buf, &hubd, l);