PERFORCE change 131461 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Dec 23 01:12:23 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=131461
Change 131461 by hselasky at hselasky_laptop001 on 2007/12/23 09:11:41
o Add some more debug prints printing
out the different cases in the
"usbd_callback_wrapper()".
o Clear "manual_status" when the
end of the control transfer has been
reached in USB device side mode.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#83 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#83 (text+ko) ====
@@ -2246,6 +2246,8 @@
/* check first recurse flag */
if (!xfer->flags_int.recursed_1) {
+ PRINTFN(2, ("case 2 not recursed\n"));
+
mtx_unlock(xfer->usb_mtx);
mtx_assert(xfer->usb_mtx, MA_NOTOWNED);
@@ -2259,11 +2261,15 @@
* Reversal, LOR
*/
dropped_usb_mtx = 1;
+ } else {
+ PRINTFN(2, ("case 2 recursed\n"));
}
} else {
if (context == USBD_CONTEXT_CALLBACK) {
/* case 4 */
+ PRINTFN(2, ("case 4\n"));
+
/*
* During possible unlocked periods,
* the USB transfer can have been
@@ -2283,6 +2289,8 @@
} else {
/* case 1 or case 3 */
+ PRINTFN(2, ("case 1\n"));
+
/*
* By clearing the "usb_thread"
* variable we are signalling that a
@@ -2305,6 +2313,8 @@
* 5) HW interrupt done callback or other source.
*/
+ PRINTFN(2, ("case 5\n"));
+
/*
* We have to postpone the callback due to the fact we
* will have a Lock Order Reversal, LOR, if we try to
@@ -3035,7 +3045,6 @@
/* reset frame stuff */
xfer->frlengths[0] = 0;
- xfer->frlengths[1] = 0;
usbd_set_frame_offset(xfer, 0, 0);
usbd_set_frame_offset(xfer, sizeof(req), 1);
@@ -3064,6 +3073,10 @@
wValue = UGETW(req.wValue);
wIndex = UGETW(req.wIndex);
+ PRINTFN(2, ("req 0x%02x 0x%02x 0x%04x 0x%04x "
+ "off=0x%x rem=0x%x\n", req.bmRequestType,
+ req.bRequest, wValue, wIndex, off, rem));
+
/* demultiplex the control request */
switch (req.bmRequestType) {
@@ -3311,6 +3324,10 @@
usbd_copy_in(xfer->frbuffers + 1, 0, ptr, max_len);
}
xfer->frlengths[1] = max_len;
+ } else {
+ /* the end is reached, send status */
+ xfer->flags.manual_status = 0;
+ xfer->frlengths[1] = 0;
}
return (0); /* success */
More information about the p4-projects
mailing list