usb: add CompatibleID support to msos

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2014-03-18 11:01:50 +01:00
parent 2d03b49c3f
commit 409951f552
2 changed files with 6 additions and 1 deletions

View File

@ -44,7 +44,7 @@ typedef struct msos_compat_hdr {
typedef struct msos_compat_func { typedef struct msos_compat_func {
uint8_t bFirstInterfaceNumber; uint8_t bFirstInterfaceNumber;
uint8_t reserved_1; uint8_t reserved_1;
uint8_t compatibleId[8]; char compatibleId[8];
uint8_t subCompatibleId[8]; uint8_t subCompatibleId[8];
uint8_t reserved_2[6]; uint8_t reserved_2[6];
} QEMU_PACKED msos_compat_func; } 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 = (void *)(dest + length);
func->bFirstInterfaceNumber = 0; func->bFirstInterfaceNumber = 0;
func->reserved_1 = 0x01; func->reserved_1 = 0x01;
if (desc->msos->CompatibleID) {
snprintf(func->compatibleId, sizeof(func->compatibleId),
"%s", desc->msos->CompatibleID);
}
length += sizeof(*func); length += sizeof(*func);
count++; count++;

View File

@ -184,6 +184,7 @@ struct USBDescOther {
}; };
struct USBDescMSOS { struct USBDescMSOS {
const char *CompatibleID;
const wchar_t *Label; const wchar_t *Label;
bool SelectiveSuspendEnabled; bool SelectiveSuspendEnabled;
}; };