Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Aug 2016 10:21:25 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304597 - head/sys/dev/usb/controller
Message-ID:  <201608221021.u7MALP5m070280@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Aug 22 10:21:25 2016
New Revision: 304597
URL: https://svnweb.freebsd.org/changeset/base/304597

Log:
  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
  MFC after:	1 week

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci.c	Mon Aug 22 10:21:09 2016	(r304596)
+++ head/sys/dev/usb/controller/xhci.c	Mon Aug 22 10:21:25 2016	(r304597)
@@ -3867,12 +3867,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);
@@ -4255,6 +4253,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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608221021.u7MALP5m070280>