aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-11-19 14:36:57 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-11-26 09:21:17 +0100
commit3b444eadf7726d976be4ac89e8e742cb7eb7a5ee (patch)
tree49d68c050f8edd656364d6891d7ac6dd293bbdcb /hw/usb
parent04b300f85fafd2d6a92ec0a766f0035e9bc5835c (diff)
usb: Add usb_device_alloc/free_streams
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/bus.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index ca329bef29..09848c6320 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -203,6 +203,24 @@ void usb_device_ep_stopped(USBDevice *dev, USBEndpoint *ep)
}
}
+int usb_device_alloc_streams(USBDevice *dev, USBEndpoint **eps, int nr_eps,
+ int streams)
+{
+ USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev);
+ if (klass->alloc_streams) {
+ return klass->alloc_streams(dev, eps, nr_eps, streams);
+ }
+ return 0;
+}
+
+void usb_device_free_streams(USBDevice *dev, USBEndpoint **eps, int nr_eps)
+{
+ USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev);
+ if (klass->free_streams) {
+ klass->free_streams(dev, eps, nr_eps);
+ }
+}
+
static int usb_qdev_init(DeviceState *qdev)
{
USBDevice *dev = USB_DEVICE(qdev);