From owner-p4-projects@FreeBSD.ORG Thu Sep 11 08:06:13 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 67DE01065673; Thu, 11 Sep 2008 08:06:13 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C6FE106564A for ; Thu, 11 Sep 2008 08:06:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 16C798FC0A for ; Thu, 11 Sep 2008 08:06:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m8B86CDp099971 for ; Thu, 11 Sep 2008 08:06:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m8B86ClY099965 for perforce@freebsd.org; Thu, 11 Sep 2008 08:06:12 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 11 Sep 2008 08:06:12 GMT Message-Id: <200809110806.m8B86ClY099965@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 149592 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2008 08:06:13 -0000 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: *