summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-08-29 08:42:37 +0000
committerhselasky <hselasky@FreeBSD.org>2016-08-29 08:42:37 +0000
commit3fd67a157f82b3228fd64e4e834c21276b6ae01b (patch)
treed1e834c16fbd4307b0d29f9cefc05f917121ce79 /sys/dev/usb
parentc058f89f159ec8b3fa8ba18b416d961ef92ca783 (diff)
downloadFreeBSD-src-3fd67a157f82b3228fd64e4e834c21276b6ae01b.zip
FreeBSD-src-3fd67a157f82b3228fd64e4e834c21276b6ae01b.tar.gz
MFC r304597:
Fix for invalid use of bits in input context. Basically split configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and xhci_cmd_configure_ep() respectivly. This resolves some errors when using XHCI under QEMU and gets is more in line with the XHCI specification. PR: 212021
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/controller/xhci.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 0b708b8..ce6953c 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -3873,12 +3873,10 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
xhci_configure_mask(udev, (1U << epno) | 1U, 0);
- err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
-
- if (err != 0)
- DPRINTF("Could not configure endpoint %u\n", epno);
-
- err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
+ if (epno > 1)
+ err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
+ else
+ err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
if (err != 0)
DPRINTF("Could not configure endpoint %u\n", epno);
@@ -4261,6 +4259,10 @@ xhci_device_state_change(struct usb_device *udev)
sc->sc_hw.devs[index].state = XHCI_ST_ADDRESSED;
+ /* set configure mask to slot only */
+ xhci_configure_mask(udev, 1, 0);
+
+ /* deconfigure all endpoints, except EP0 */
err = xhci_cmd_configure_ep(sc, 0, 1, index);
if (err) {
OpenPOWER on IntegriCloud