From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GYw-0005ba-7I for qemu-devel@nongnu.org; Wed, 07 Mar 2012 08:06:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5GYb-0008GV-Qx for qemu-devel@nongnu.org; Wed, 07 Mar 2012 08:05:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GYb-0008FR-Iz for qemu-devel@nongnu.org; Wed, 07 Mar 2012 08:05:29 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q27D5SNH010257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 7 Mar 2012 08:05:28 -0500 From: Gerd Hoffmann Date: Wed, 7 Mar 2012 14:05:15 +0100 Message-Id: <1331125520-13467-16-git-send-email-kraxel@redhat.com> In-Reply-To: <1331125520-13467-1-git-send-email-kraxel@redhat.com> References: <1331125520-13467-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 15/20] usb: queue can have async packets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann This can happen today in case the ->complete() callback queues up the next packet. Also we'll support pipelining soon, which allows to have multiple packets per queue in flight (aka ASYNC) state. Signed-off-by: Gerd Hoffmann --- hw/usb.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/usb.c b/hw/usb.c index 57fc5e3..fc41d62 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -356,6 +356,9 @@ void usb_packet_complete(USBDevice *dev, USBPacket *p) while (!QTAILQ_EMPTY(&ep->queue)) { p = QTAILQ_FIRST(&ep->queue); + if (p->state == USB_PACKET_ASYNC) { + break; + } assert(p->state == USB_PACKET_QUEUED); ret = usb_process_one(p); if (ret == USB_RET_ASYNC) { -- 1.7.1