aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/desc.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-04-18 07:55:56 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-18 07:55:56 -0500
commitb26d712ecc9558fcd2a77a0b677a18d4919228bd (patch)
treeeba6143f8eb14f300ef20da401e54389315e6163 /hw/usb/desc.h
parent6b034aa138716a515c88f7894940d5d0aff2f3ed (diff)
parentc7020c974073ba9c0110d45361720a29ff6b2f59 (diff)
downloadqemu-b26d712ecc9558fcd2a77a0b677a18d4919228bd.zip
qemu-b26d712ecc9558fcd2a77a0b677a18d4919228bd.tar.gz
qemu-b26d712ecc9558fcd2a77a0b677a18d4919228bd.tar.bz2
Merge remote-tracking branch 'kraxel/usb.46' into staging
* kraxel/usb.46: (21 commits) usb-ehci: drop assert() usb-redir: Notify our peer when we reject a device due to a speed mismatch usb-ehci: Drop unused sofv value usb-host: rewrite usb_linux_update_endp_table usb: use USBDescriptor for endpoint descriptors. usb: use USBDescriptor for interface descriptors. usb: use USBDescriptor for config descriptors. usb: use USBDescriptor for device qualifier descriptors. usb: add USBDescriptor, use for device descriptors. usb-ehci: frindex always is a 14 bits counter usb-ehci: fix ehci_child_detach usb-hub: add tracepoints usb_packet_set_state: handle p->ep == NULL usb-host: add property to turn off pipelining usb-host: add usb packet to request tracepoints usb-host: trace canceled requests usb-host: trace emulated requests Add bootindex support to usb-host and usb-redir usb-uhci: queuing fix usb-uhci: stop queue filling when we find a in-flight td ...
Diffstat (limited to 'hw/usb/desc.h')
-rw-r--r--hw/usb/desc.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/hw/usb/desc.h b/hw/usb/desc.h
index d6e07ea..d164e8f 100644
--- a/hw/usb/desc.h
+++ b/hw/usb/desc.h
@@ -3,6 +3,69 @@
#include <inttypes.h>
+/* binary representation */
+typedef struct USBDescriptor {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ union {
+ struct {
+ uint8_t bcdUSB_lo;
+ uint8_t bcdUSB_hi;
+ uint8_t bDeviceClass;
+ uint8_t bDeviceSubClass;
+ uint8_t bDeviceProtocol;
+ uint8_t bMaxPacketSize0;
+ uint8_t idVendor_lo;
+ uint8_t idVendor_hi;
+ uint8_t idProduct_lo;
+ uint8_t idProduct_hi;
+ uint8_t bcdDevice_lo;
+ uint8_t bcdDevice_hi;
+ uint8_t iManufacturer;
+ uint8_t iProduct;
+ uint8_t iSerialNumber;
+ uint8_t bNumConfigurations;
+ } device;
+ struct {
+ uint8_t bcdUSB_lo;
+ uint8_t bcdUSB_hi;
+ uint8_t bDeviceClass;
+ uint8_t bDeviceSubClass;
+ uint8_t bDeviceProtocol;
+ uint8_t bMaxPacketSize0;
+ uint8_t bNumConfigurations;
+ uint8_t bReserved;
+ } device_qualifier;
+ struct {
+ uint8_t wTotalLength_lo;
+ uint8_t wTotalLength_hi;
+ uint8_t bNumInterfaces;
+ uint8_t bConfigurationValue;
+ uint8_t iConfiguration;
+ uint8_t bmAttributes;
+ uint8_t bMaxPower;
+ } config;
+ struct {
+ uint8_t bInterfaceNumber;
+ uint8_t bAlternateSetting;
+ uint8_t bNumEndpoints;
+ uint8_t bInterfaceClass;
+ uint8_t bInterfaceSubClass;
+ uint8_t bInterfaceProtocol;
+ uint8_t iInterface;
+ } interface;
+ struct {
+ uint8_t bEndpointAddress;
+ uint8_t bmAttributes;
+ uint8_t wMaxPacketSize_lo;
+ uint8_t wMaxPacketSize_hi;
+ uint8_t bInterval;
+ uint8_t bRefresh; /* only audio ep */
+ uint8_t bSynchAddress; /* only audio ep */
+ } endpoint;
+ } u;
+} QEMU_PACKED USBDescriptor;
+
struct USBDescID {
uint16_t idVendor;
uint16_t idProduct;