svn commit: r261872 - head/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Fri Feb 14 07:17:37 UTC 2014


Author: hselasky
Date: Fri Feb 14 07:17:36 2014
New Revision: 261872
URL: http://svnweb.freebsd.org/changeset/base/261872

Log:
  Fix minor logical error in the XHCI driver. Set correct SETUP packet
  direction value.
  
  MFC after:	2 days
  Reported by:	Horse Ma <HMa at wyse.com>

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

Modified: head/sys/dev/usb/controller/xhci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci.c	Fri Feb 14 05:25:15 2014	(r261871)
+++ head/sys/dev/usb/controller/xhci.c	Fri Feb 14 07:17:36 2014	(r261872)
@@ -1759,7 +1759,8 @@ restart:
 			/* check wLength */
 			if (td->td_trb[0].qwTrb0 &
 			   htole64(XHCI_TRB_0_WLENGTH_MASK)) {
-				if (td->td_trb[0].qwTrb0 & htole64(1))
+				if (td->td_trb[0].qwTrb0 &
+				    htole64(XHCI_TRB_0_DIR_IN_MASK))
 					dword |= XHCI_TRB_3_TRT_IN;
 				else
 					dword |= XHCI_TRB_3_TRT_OUT;

Modified: head/sys/dev/usb/controller/xhci.h
==============================================================================
--- head/sys/dev/usb/controller/xhci.h	Fri Feb 14 05:25:15 2014	(r261871)
+++ head/sys/dev/usb/controller/xhci.h	Fri Feb 14 07:17:36 2014	(r261872)
@@ -192,6 +192,7 @@ struct xhci_stream_ctx {
 
 struct xhci_trb {
 	volatile uint64_t	qwTrb0;
+#define	XHCI_TRB_0_DIR_IN_MASK		(0x80ULL << 0)
 #define	XHCI_TRB_0_WLENGTH_MASK		(0xFFFFULL << 48)
 	volatile uint32_t	dwTrb2;
 #define	XHCI_TRB_2_ERROR_GET(x)		(((x) >> 24) & 0xFF)


More information about the svn-src-all mailing list