Date: Wed, 19 Dec 2007 01:52:27 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 131197 for review Message-ID: <200712190152.lBJ1qRI9008859@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131197 Change 131197 by hselasky@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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712190152.lBJ1qRI9008859>