From owner-svn-src-head@FreeBSD.ORG Mon Sep 28 07:09:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6492106566B; Mon, 28 Sep 2009 07:09:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA998FC13; Mon, 28 Sep 2009 07:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S79HRG046213; Mon, 28 Sep 2009 07:09:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S79HwK046211; Mon, 28 Sep 2009 07:09:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280709.n8S79HwK046211@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197555 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2009 07:09:17 -0000 Author: thompsa Date: Mon Sep 28 07:09:17 2009 New Revision: 197555 URL: http://svn.freebsd.org/changeset/base/197555 Log: Simplify logic around setting EHCI_QH_DTC and expand some htohc32(temp.sc, 0) statements to zero. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Sep 28 07:06:47 2009 (r197554) +++ head/sys/dev/usb/controller/ehci.c Mon Sep 28 07:09:17 2009 (r197555) @@ -1918,18 +1918,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) { @@ -1941,6 +1938,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 = @@ -1951,23 +1953,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;