From owner-p4-projects@FreeBSD.ORG Sun Sep 30 15:45:34 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 87D4D16A46B; Sun, 30 Sep 2007 15:45:34 +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 1A7CD16A420 for ; Sun, 30 Sep 2007 15:45:34 +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 1188013C46E for ; Sun, 30 Sep 2007 15:45:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l8UFjYbr005349 for ; Sun, 30 Sep 2007 15:45:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l8UFjXpi005346 for perforce@freebsd.org; Sun, 30 Sep 2007 15:45:33 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 30 Sep 2007 15:45:33 GMT Message-Id: <200709301545.l8UFjXpi005346@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 127024 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: Sun, 30 Sep 2007 15:45:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=127024 Change 127024 by hselasky@hselasky_laptop001 on 2007/09/30 15:44:38 1) Fix a small bug where the system would continue to scan the TD's even if the last one was stalled. 2) Optimise: Setting up the "td" variable two times in a row for non-isoc transfers does not make sense. 3) Add a comment. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/uhci.c#32 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/uhci.c#32 (text+ko) ==== @@ -1145,6 +1145,8 @@ } if (status & UHCI_TD_STALLED) { + /* the transfer is finished */ + td = NULL; break; } @@ -1340,12 +1342,12 @@ DPRINTFN(15, ("xfer=%p checking transfer\n", xfer)); - td = xfer->td_transfer_last; - if(xfer->pipe->methods == &uhci_device_isoc_methods) { /* isochronous transfer */ + td = xfer->td_transfer_last; + usbd_page_dma_exit(td->page); status = le32toh(td->td_status); usbd_page_dma_enter(td->page); @@ -1669,6 +1671,8 @@ len_old = temp->len; precompute = 1; + /* software is used to detect short incoming transfers */ + if ((temp->td_token & htole32(UHCI_TD_PID)) == htole32(UHCI_TD_PID_IN)) { temp->td_status |= htole32(UHCI_TD_SPD); } else {