mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
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 <kraxel@redhat.com>
This commit is contained in:
parent
7c308b7e38
commit
eb9d4673e3
1 changed files with 3 additions and 0 deletions
3
hw/usb.c
3
hw/usb.c
|
@ -356,6 +356,9 @@ void usb_packet_complete(USBDevice *dev, USBPacket *p)
|
||||||
|
|
||||||
while (!QTAILQ_EMPTY(&ep->queue)) {
|
while (!QTAILQ_EMPTY(&ep->queue)) {
|
||||||
p = QTAILQ_FIRST(&ep->queue);
|
p = QTAILQ_FIRST(&ep->queue);
|
||||||
|
if (p->state == USB_PACKET_ASYNC) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
assert(p->state == USB_PACKET_QUEUED);
|
assert(p->state == USB_PACKET_QUEUED);
|
||||||
ret = usb_process_one(p);
|
ret = usb_process_one(p);
|
||||||
if (ret == USB_RET_ASYNC) {
|
if (ret == USB_RET_ASYNC) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue