From: Gerd Hoffmann Date: Tue, 28 Feb 2012 14:36:06 +0000 (+0100) Subject: usb: queue can have async packets X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=eb9d4673e3594baaa857a4c033fc7c21f4ea904b;p=qemu.git usb: queue can have async packets 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 --- diff --git a/hw/usb.c b/hw/usb.c index 57fc5e3cfd..fc41d62438 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) {