summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2014-07-12 15:30:44 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2014-07-12 15:30:44 +0000
commit82912d55e5f69fd3f07a8660904704be9749aa96 (patch)
tree3c17139dc218a9fa7a63f8ddbfc60b6d265a6693 /sys
parente01b303c588f45fcb9dc2844ecaacbe49a394c74 (diff)
Add support for Get Hub Descriptor requests.
Diffstat (limited to 'sys')
-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);