summary refs log tree commit diff stats
path: root/hw/usb.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-08-30 13:21:27 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-01-13 10:25:44 +0100
commit1de14d43e29b8f1fff8bcbf18f300adeb3eabc1d (patch)
tree206e160d56c1380a4cbb71e3e2f93854ab7fb87e /hw/usb.h
parent65360511a2eeab8b671722df6634dd674cc4a5d6 (diff)
downloadfocaccia-qemu-1de14d43e29b8f1fff8bcbf18f300adeb3eabc1d.tar.gz
focaccia-qemu-1de14d43e29b8f1fff8bcbf18f300adeb3eabc1d.zip
usb: track altsetting in USBDevice
Also handle {GET,SET}_INTERFACE in common code (usb-desc.c).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 1ef53a102f..1496f7694c 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -161,6 +161,9 @@ struct USBDescString {
     QLIST_ENTRY(USBDescString) next;
 };
 
+#define USB_MAX_ENDPOINTS  15
+#define USB_MAX_INTERFACES 16
+
 /* definition of a USB device */
 struct USBDevice {
     DeviceState qdev;
@@ -191,7 +194,9 @@ struct USBDevice {
 
     int configuration;
     int ninterfaces;
+    int altsetting[USB_MAX_INTERFACES];
     const USBDescConfig *config;
+    const USBDescIface  *ifaces[USB_MAX_INTERFACES];
 };
 
 struct USBDeviceInfo {
@@ -244,6 +249,9 @@ struct USBDeviceInfo {
      */
     int (*handle_data)(USBDevice *dev, USBPacket *p);
 
+    void (*set_interface)(USBDevice *dev, int interface,
+                          int alt_old, int alt_new);
+
     const char *product_desc;
     const USBDesc *usb_desc;