aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-03-18 11:01:50 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-04-22 12:40:57 +0200
commit409951f552674a940ec53e3a498514dc42834ccb (patch)
treec6284e84df9e1055ef773d18e9d4bde785ffcb28 /hw/usb
parent2d03b49c3f225994c4b0b46146437d8c887d6774 (diff)
usb: add CompatibleID support to msos
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/desc-msos.c6
-rw-r--r--hw/usb/desc.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/hw/usb/desc-msos.c b/hw/usb/desc-msos.c
index ed8d62cab8..334d1aea8d 100644
--- a/hw/usb/desc-msos.c
+++ b/hw/usb/desc-msos.c
@@ -44,7 +44,7 @@ typedef struct msos_compat_hdr {
typedef struct msos_compat_func {
uint8_t bFirstInterfaceNumber;
uint8_t reserved_1;
- uint8_t compatibleId[8];
+ char compatibleId[8];
uint8_t subCompatibleId[8];
uint8_t reserved_2[6];
} QEMU_PACKED msos_compat_func;
@@ -59,6 +59,10 @@ static int usb_desc_msos_compat(const USBDesc *desc, uint8_t *dest)
func = (void *)(dest + length);
func->bFirstInterfaceNumber = 0;
func->reserved_1 = 0x01;
+ if (desc->msos->CompatibleID) {
+ snprintf(func->compatibleId, sizeof(func->compatibleId),
+ "%s", desc->msos->CompatibleID);
+ }
length += sizeof(*func);
count++;
diff --git a/hw/usb/desc.h b/hw/usb/desc.h
index 2b4fcdae76..8e8db03a0c 100644
--- a/hw/usb/desc.h
+++ b/hw/usb/desc.h
@@ -184,6 +184,7 @@ struct USBDescOther {
};
struct USBDescMSOS {
+ const char *CompatibleID;
const wchar_t *Label;
bool SelectiveSuspendEnabled;
};