Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Oct 2009 23:16:00 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r198642 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/controller dev/xen/xenpci
Message-ID:  <200910292316.n9TNG06w014384@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Thu Oct 29 23:16:00 2009
New Revision: 198642
URL: http://svn.freebsd.org/changeset/base/198642

Log:
  MFC r197555
  
   Simplify logic around setting EHCI_QH_DTC and expand some htohc32(temp.sc, 0)
   statements to zero.

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/usb/controller/ehci.c
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/controller/ehci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci.c	Thu Oct 29 23:15:26 2009	(r198641)
+++ stable/8/sys/dev/usb/controller/ehci.c	Thu Oct 29 23:16:00 2009	(r198642)
@@ -1954,18 +1954,15 @@ ehci_setup_standard_chain(struct usb_xfe
 	    EHCI_QH_SET_MPL(xfer->max_packet_size));
 
 	if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
-		qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) |
-		    EHCI_QH_DTC);
+		qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH);
 		if (methods != &ehci_device_intr_methods)
 			qh_endp |= EHCI_QH_SET_NRL(8);
 	} else {
 
 		if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) {
-			qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_FULL) |
-			    EHCI_QH_DTC);
+			qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_FULL);
 		} else {
-			qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_LOW) |
-			    EHCI_QH_DTC);
+			qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_LOW);
 		}
 
 		if (methods == &ehci_device_ctrl_methods) {
@@ -1977,6 +1974,11 @@ ehci_setup_standard_chain(struct usb_xfe
 		}
 	}
 
+	if (temp.auto_data_toggle == 0) {
+		/* software computes the data toggle */
+		qh_endp |= EHCI_QH_DTC;
+	}
+
 	qh->qh_endp = htohc32(temp.sc, qh_endp);
 
 	qh_endphub =
@@ -1987,23 +1989,17 @@ ehci_setup_standard_chain(struct usb_xfe
 	    EHCI_QH_SET_PORT(xfer->xroot->udev->hs_port_no));
 
 	qh->qh_endphub = htohc32(temp.sc, qh_endphub);
-	qh->qh_curqtd = htohc32(temp.sc, 0);
+	qh->qh_curqtd = 0;
 
 	/* fill the overlay qTD */
-	qh->qh_qtd.qtd_status = htohc32(temp.sc, 0);
-
-	if (temp.auto_data_toggle) {
-
-		/* let the hardware compute the data toggle */
 
-		qh->qh_endp &= htohc32(temp.sc, ~EHCI_QH_DTC);
-
-		if (xfer->endpoint->toggle_next) {
-			/* DATA1 is next */
-			qh->qh_qtd.qtd_status |=
-			    htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1));
-		}
+	if (temp.auto_data_toggle && xfer->endpoint->toggle_next) {
+		/* DATA1 is next */
+		qh->qh_qtd.qtd_status = htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1));
+	} else {
+		qh->qh_qtd.qtd_status = 0;
 	}
+
 	td = xfer->td_transfer_first;
 
 	qh->qh_qtd.qtd_next = td->qtd_self;



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