summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2014-07-12 16:43:32 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2014-07-12 16:43:32 +0000
commitd3977a40290d1168c90924d29c764e0beb2b49e2 (patch)
tree268da75c607cf485dc32ff429cf2d790fadad907 /sys
parent5efd2bf1e892940ced2a58412c0c4e008fc7b02f (diff)
Implement Set Port Feature request support.
Port reset doesn't need the spl dance, as discussed with mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/octeon/dev/octhci.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/arch/octeon/dev/octhci.c b/sys/arch/octeon/dev/octhci.c
index 7cdd7b03ace..7656f2d9af6 100644
--- a/sys/arch/octeon/dev/octhci.c
+++ b/sys/arch/octeon/dev/octhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octhci.c,v 1.10 2014/07/12 15:53:44 pirofti Exp $ */
+/* $OpenBSD: octhci.c,v 1.11 2014/07/12 16:43:31 pirofti Exp $ */
/*
* Copyright (c) 2014 Paul Irofti <pirofti@openbsd.org>
@@ -931,21 +931,33 @@ octhci_root_ctrl_start(struct usbd_xfer *xfer)
switch (value) {
case UHF_PORT_ENABLE:
+ /* The application can't set the enable bit */
break;
case UHF_PORT_SUSPEND:
DPRINTFN(6, ("suspend port %u (LPM=%u)\n", index, i));
+ octhci_regc_set(sc, USBC_HPRT_OFFSET,
+ USBC_HPRT_PRTSUSP);
break;
case UHF_PORT_RESET:
DPRINTFN(6, ("reset port %d\n", index));
+ /* Start reset sequence. */
+ octhci_regc_set(sc, USBC_HPRT_OFFSET, USBC_HPRT_PRTRST);
+ /* Wait for reset to complete. */
+ usb_delay_ms(&sc->sc_bus, USB_PORT_ROOT_RESET_DELAY);
+ if (sc->sc_bus.dying) {
+ err = USBD_IOERROR;
+ goto ret;
+ }
+ /* Terminate reset sequence. */
+ octhci_regc_clear(sc, USBC_HPRT_OFFSET,
+ USBC_HPRT_PRTRST);
break;
case UHF_PORT_POWER:
DPRINTFN(3, ("set port power %d\n", index));
+ octhci_regc_set(sc, USBC_HPRT_OFFSET, USBC_HPRT_PRTPWR);
break;
case UHF_PORT_INDICATOR:
DPRINTFN(3, ("set port indicator %d\n", index));
-
- break;
- case UHF_C_PORT_RESET:
break;
default:
err = USBD_IOERROR;