Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Aug 2008 13:50:38 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 146838 for review
Message-ID:  <200808071350.m77DocrN052133@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146838

Change 146838 by hselasky@hselasky_laptop001 on 2008/08/07 13:50:30

	
	The next USB transfer is already started in "usb2_callback_wrapper_sub".
	Remove duplicate code.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#18 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#18 (text+ko) ====

@@ -1926,7 +1926,6 @@
 usb2_transfer_done(struct usb2_xfer *xfer, usb2_error_t error)
 {
 	struct usb2_xfer_queue *pq;
-	uint8_t block;
 
 	mtx_assert(xfer->usb2_mtx, MA_OWNED);
 
@@ -1966,26 +1965,6 @@
 			usb2_command_wrapper(pq, NULL);
 		}
 	}
-	/* figure out if this pipe should be blocked */
-	block = (xfer->error &&
-	    (xfer->error != USB_ERR_CANCELLED) &&
-	    (xfer->flags.pipe_bof));
-
-	if (!block) {
-		pq = &(xfer->pipe->pipe_q);
-		if (pq->curr == xfer) {
-			/* start the next USB transfer, if any */
-			usb2_command_wrapper(pq, NULL);
-
-			if (pq->curr || TAILQ_FIRST(&(pq->head))) {
-				/* there is another USB transfer waiting */
-			} else {
-				/* this is the last USB transfer */
-				/* clear isochronous sync flag */
-				xfer->pipe->is_synced = 0;
-			}
-		}
-	}
 	/* keep some statistics */
 	if (xfer->error) {
 		xfer->udev->bus->stats_err.uds_requests
@@ -2345,6 +2324,14 @@
 	 */
 	if (pipe->pipe_q.curr == xfer) {
 		usb2_command_wrapper(&(pipe->pipe_q), NULL);
+
+		if (pipe->pipe_q.curr || TAILQ_FIRST(&(pipe->pipe_q.head))) {
+			/* there is another USB transfer waiting */
+		} else {
+			/* this is the last USB transfer */
+			/* clear isochronous sync flag */
+			xfer->pipe->is_synced = 0;
+		}
 	}
 done:
 	return (0);
@@ -2360,6 +2347,10 @@
 usb2_command_wrapper(struct usb2_xfer_queue *pq, struct usb2_xfer *xfer)
 {
 	if (xfer) {
+		/*
+		 * If the transfer is not already processing,
+		 * queue it!
+		 */
 		if (pq->curr != xfer) {
 			usb2_transfer_enqueue(pq, xfer);
 			if (pq->curr != NULL) {



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