PERFORCE change 127024 for review

Hans Petter Selasky hselasky at FreeBSD.org
Sun Sep 30 08:45:35 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=127024

Change 127024 by hselasky at 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 {


More information about the p4-projects mailing list