summaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-11-17 11:03:53 +0100
committerGerd Hoffmann <kraxel@redhat.com>2011-01-11 15:56:00 +0100
commit37fb59d3032687b6f0d94c307bd0a846e0ca1fe0 (patch)
tree1538cef5e0c1abc4a5fca8850a01460b2bfe6bc2 /hw/usb.h
parent5d0d62feee8aa75525207ef24919c0522651a432 (diff)
usb: data structs and helpers for usb descriptors.
This patch adds hw/usb-desc.[ch] files. They carry data structures for various usb descriptors and helper functions to generate usb packets from the structures. The intention is to have a internal representation of the device desription which is more usable than the current char array blobs, so we can have common code handle common usb device emulation using the device description. The usage of this infrastructure is optional for usb drivers as there are cases such as pass-through where it probably isn't very useful. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 0b32d77e6f..a29b6d6d8f 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -128,6 +128,14 @@ typedef struct USBDevice USBDevice;
typedef struct USBDeviceInfo USBDeviceInfo;
typedef struct USBPacket USBPacket;
+typedef struct USBDesc USBDesc;
+typedef struct USBDescID USBDescID;
+typedef struct USBDescDevice USBDescDevice;
+typedef struct USBDescConfig USBDescConfig;
+typedef struct USBDescIface USBDescIface;
+typedef struct USBDescEndpoint USBDescEndpoint;
+typedef struct USBDescOther USBDescOther;
+
/* definition of a USB device */
struct USBDevice {
DeviceState qdev;
@@ -190,6 +198,7 @@ struct USBDeviceInfo {
int (*handle_data)(USBDevice *dev, USBPacket *p);
const char *product_desc;
+ const USBDesc *usb_desc;
/* handle legacy -usbdevice command line options */
const char *usbdevice_name;