PERFORCE change 131197 for review

Hans Petter Selasky hselasky at FreeBSD.org
Tue Dec 18 17:52:28 PST 2007


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

Change 131197 by hselasky at hselasky_laptop001 on 2007/12/19 01:52:23

	
	Add new control request flag, "USBD_DELAY_STATUS_STAGE",
	that can be used for USB testing and verification.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb.h#27 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#77 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/usb.h#27 (text+ko) ====

@@ -577,6 +577,7 @@
 	int	ucr_flags;
 #define	USBD_USE_POLLING         0x0001	/* internal flag */
 #define	USBD_SHORT_XFER_OK       0x0004	/* allow short reads */
+#define	USBD_DELAY_STATUS_STAGE  0x0010	/* insert delay before STATUS stage */
 	int	ucr_actlen;		/* actual length transferred */
 };
 

==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#77 (text+ko) ====

@@ -3420,6 +3420,12 @@
 		xfer->flags.use_polling = 0;
 	}
 
+	if (flags & USBD_DELAY_STATUS_STAGE) {
+		xfer->flags.manual_status = 1;
+	} else {
+		xfer->flags.manual_status = 0;
+	}
+
 	xfer->timeout = timeout;
 
 	start_ticks = ticks;
@@ -3445,7 +3451,17 @@
 			xfer->nframes = 2;
 		} else {
 			if (xfer->frlengths[0] == 0) {
-				break;
+				if (xfer->flags.manual_status) {
+					/*
+					 * Delay 70 milliseconds
+					 * before doing the status
+					 * stage:
+					 */
+					usbd_pause_mtx(xfer->priv_mtx, 70);
+					xfer->flags.manual_status = 0;
+				} else {
+					break;
+				}
 			}
 			xfer->nframes = 1;
 		}


More information about the p4-projects mailing list