From owner-p4-projects@FreeBSD.ORG Thu Sep 10 16:59:01 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0043D1065679; Thu, 10 Sep 2009 16:59:01 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C541065672 for ; Thu, 10 Sep 2009 16:59:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4EF8FC14 for ; Thu, 10 Sep 2009 16:59:00 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n8AGx0On071007 for ; Thu, 10 Sep 2009 16:59:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n8AGx0HL071005 for perforce@freebsd.org; Thu, 10 Sep 2009 16:59:00 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 10 Sep 2009 16:59:00 GMT Message-Id: <200909101659.n8AGx0HL071005@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 168410 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2009 16:59:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=168410 Change 168410 by hselasky@hselasky_laptop001 on 2009/09/10 16:58:57 USB EHCI: - minor code refactor - expand some "htohc32(temp.sc, 0)" statements to zero. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#33 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#33 (text+ko) ==== @@ -1918,18 +1918,15 @@ 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 @@ } } + 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_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 */ + 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; + } - 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)); - } - } td = xfer->td_transfer_first; qh->qh_qtd.qtd_next = td->qtd_self;