Date: Thu, 11 Sep 2008 08:06:12 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 149592 for review Message-ID: <200809110806.m8B86ClY099965@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149592 Change 149592 by hselasky@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: *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809110806.m8B86ClY099965>