svn commit: r304993 - stable/10/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Mon Aug 29 08:42:38 UTC 2016


Author: hselasky
Date: Mon Aug 29 08:42:37 2016
New Revision: 304993
URL: https://svnweb.freebsd.org/changeset/base/304993

Log:
  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

Modified:
  stable/10/sys/dev/usb/controller/xhci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/controller/xhci.c
==============================================================================
--- stable/10/sys/dev/usb/controller/xhci.c	Mon Aug 29 08:39:53 2016	(r304992)
+++ stable/10/sys/dev/usb/controller/xhci.c	Mon Aug 29 08:42:37 2016	(r304993)
@@ -3873,12 +3873,10 @@ xhci_configure_reset_endpoint(struct usb
 
 	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_devi
 
 		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) {


More information about the svn-src-stable-10 mailing list