PERFORCE change 149592 for review

Hans Petter Selasky hselasky at FreeBSD.org
Thu Sep 11 08:06:13 UTC 2008


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

Change 149592 by hselasky at hselasky_laptop001 on 2008/09/11 08:05:36

	
	Add support for nframes == 0, in case of clearing and setting stall.

Affected files ...

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

Differences ...

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

@@ -1336,6 +1336,20 @@
 	/* sanity check */
 
 	if (xfer->nframes == 0) {
+		if (xfer->flags.stall_pipe) {
+			/*
+			 * Special case - want to stall without transferring
+			 * any data:
+			 */
+			DPRINTF("xfer=%p nframes=0: stall "
+			    "or clear stall!\n", xfer);
+			mtx_lock(xfer->usb2_mtx);
+			xfer->flags_int.can_cancel_immed = 1;
+			/* start the transfer */
+			usb2_command_wrapper(&xfer->pipe->pipe_q, xfer);
+			mtx_unlock(xfer->usb2_mtx);
+			return;
+		}
 		mtx_lock(xfer->usb2_mtx);
 		usb2_transfer_done(xfer, USB_ERR_INVAL);
 		mtx_unlock(xfer->usb2_mtx);
@@ -2141,6 +2155,13 @@
 			return;
 		}
 	}
+	/* Set or clear stall complete - special case */
+	if (xfer->nframes == 0) {
+		/* we are complete */
+		xfer->aframes = 0;
+		usb2_transfer_done(xfer, 0);
+		return;
+	}
 	/*
 	 * Handled cases:
 	 *


More information about the p4-projects mailing list