From 36dfe324fd4b5efd9ef1a5b4c352bbb158952e24 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 24 Oct 2012 18:14:07 +0200 Subject: 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 Signed-off-by: Gerd Hoffmann --- hw/usb/bus.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hw/usb/bus.c') diff --git a/hw/usb/bus.c b/hw/usb/bus.c index b649360..8066291 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -181,6 +181,14 @@ void usb_device_set_interface(USBDevice *dev, int interface, } } +void usb_device_flush_ep_queue(USBDevice *dev, USBEndpoint *ep) +{ + USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); + if (klass->flush_ep_queue) { + klass->flush_ep_queue(dev, ep); + } +} + static int usb_qdev_init(DeviceState *qdev) { USBDevice *dev = USB_DEVICE(qdev); -- cgit v1.1