aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/core.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-10-24 18:14:07 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-10-25 09:08:09 +0200
commit36dfe324fd4b5efd9ef1a5b4c352bbb158952e24 (patch)
treef465ff1788bc9a0e31810095a470aa1f45e5d6db /hw/usb/core.c
parentd0ff81b871af3c6cf31c807dfdd480b9d1032780 (diff)
usb: Add USB_RET_ADD_TO_QUEUE packet result code
This can be used by usb-device code which wishes to process an entire endpoint queue at once, to do this the usb-device code returns USB_RET_ADD_TO_QUEUE from its handle_data class method and defines a flush_ep_queue class method to call when the hcd is done queuing up packets. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/core.c')
-rw-r--r--hw/usb/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/usb/core.c b/hw/usb/core.c
index e2e31ca439..014e3ac090 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -393,6 +393,10 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
if (ret == USB_RET_ASYNC) {
usb_packet_set_state(p, USB_PACKET_ASYNC);
QTAILQ_INSERT_TAIL(&p->ep->queue, p, queue);
+ } else if (ret == USB_RET_ADD_TO_QUEUE) {
+ usb_packet_set_state(p, USB_PACKET_QUEUED);
+ QTAILQ_INSERT_TAIL(&p->ep->queue, p, queue);
+ ret = USB_RET_ASYNC;
} else {
/*
* When pipelining is enabled usb-devices must always return async,