From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQE0r-00053t-17 for qemu-devel@nongnu.org; Wed, 19 Mar 2014 06:46:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQE0j-0003pQ-LX for qemu-devel@nongnu.org; Wed, 19 Mar 2014 06:46:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQE0j-0003p8-Dg for qemu-devel@nongnu.org; Wed, 19 Mar 2014 06:46:13 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2JAkC7J007570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 19 Mar 2014 06:46:12 -0400 From: Gerd Hoffmann Date: Wed, 19 Mar 2014 11:46:06 +0100 Message-Id: <1395225967-6633-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1395225967-6633-1-git-send-email-kraxel@redhat.com> References: <1395225967-6633-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] usb: add CompatibleID support to msos List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/usb/desc-msos.c | 6 +++++- hw/usb/desc.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/usb/desc-msos.c b/hw/usb/desc-msos.c index ed8d62c..334d1ae 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 2b4fcda..8e8db03 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; }; -- 1.8.3.1