From patchwork Sun Apr 17 11:29:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaac Lozano <109lozanoi@gmail.com> X-Patchwork-Id: 8862711 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70864BF29F for ; Sun, 17 Apr 2016 11:27:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A13F20166 for ; Sun, 17 Apr 2016 11:27:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 037A52015A for ; Sun, 17 Apr 2016 11:27:39 +0000 (UTC) Received: from localhost ([::1]:44681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arkra-0007ul-4y for patchwork-qemu-devel@patchwork.kernel.org; Sun, 17 Apr 2016 07:27:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <109lozanoi@gmail.com>) id 1arkrS-0007mz-Eb for qemu-devel@nongnu.org; Sun, 17 Apr 2016 07:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <109lozanoi@gmail.com>) id 1arkrO-0005Np-EJ for qemu-devel@nongnu.org; Sun, 17 Apr 2016 07:27:30 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:34712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <109lozanoi@gmail.com>) id 1arkrO-0005Nj-74 for qemu-devel@nongnu.org; Sun, 17 Apr 2016 07:27:26 -0400 Received: by mail-pa0-x22b.google.com with SMTP id r5so14359986pag.1 for ; Sun, 17 Apr 2016 04:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PpdYILAxdsMLw5HwZLhCu4zbFfKyp4tvmfYAdw3uxng=; b=JReUhKo//mXF6TBbO0/9rmc/tyw7fhcsHzh/2hpsFyM9YiiFyliqVTUy7VckXL1PJL 5ldnG32TNceW9MsZQF1DSeUK4qD7akOIPeUhy1jLVVCVPdwTp2Cav4AxsUyIULOv/9Eq gM53rLN09GetvKO6cEdgv7zpTfZ7W5yNRG9vCx6FpZYxVQ9S66IFT8no8+Fswx4+JY19 hwshNFZ7jOHbXWSrVDrKE7uzkBiLPXIMN6lVQxgXm2vDQNB+MfjxvJX5sc0JeFa4lGs7 zL9EEhdtBtypqsvNffTkxJKPQ5RT5VJSWk34lf3zWqPpUbz5FxhtO89nS8Wr/PLgTRob wkCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PpdYILAxdsMLw5HwZLhCu4zbFfKyp4tvmfYAdw3uxng=; b=mWdDfmr0ScwbdbQQP3uhXAlGEoQgJM6K2Yb6eEvr4vFCKIUPAlqOn2RzHuq5tpWQ2J I9wxA6XZN2OaZruwHLNiXdYvOJfq+kdQT3qneNVFmIl6I3LUH0fJt+VGg9ZAQrJMlrpU n4jdc/0llsM6CdO10xmJarwxR8C9laEYBHuT27izvsIDmygn99ZFj5kzQAsBzhJbYiXd w2ClAVASwnDDTYfFrTCxB1rIoC2fUVE0tGIrCS9YYfS7yog6JLj/rTiKZfC28JtT9dCC 6SfMzDaidlyl6woQ+r9GhGAgUEdXi2B4Rixl1y8xBrf5fOXHxFaCi3KwtP2gd6+iO6GO TLrA== X-Gm-Message-State: AOPr4FXS1RZ2Q1+6Pj+WPVnTTTgX30qHEpg1c6M4jS0A8IwEbWLTsNa+YAJ3wWdsltM2ug== X-Received: by 10.66.251.10 with SMTP id zg10mr42157337pac.1.1460892445196; Sun, 17 Apr 2016 04:27:25 -0700 (PDT) Received: from Phobos.localdomain (c-98-244-0-41.hsd1.ca.comcast.net. [98.244.0.41]) by smtp.gmail.com with ESMTPSA id 188sm860048pfu.83.2016.04.17.04.27.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Apr 2016 04:27:24 -0700 (PDT) From: Isaac Lozano <109lozanoi@gmail.com> To: qemu-devel@nongnu.org Date: Sun, 17 Apr 2016 04:29:53 -0700 Message-Id: <1460892593-5908-1-git-send-email-109lozanoi@gmail.com> X-Mailer: git-send-email 2.8.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::22b Subject: [Qemu-devel] [PATCH] usb-mtp: fix usb_mtp_get_device_info so that libmtp on the guest doesn't complain X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Isaac Lozano <109lozanoi@gmail.com>, kraxel@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_HI, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If an application uses libmtp on the guest system, it will complain with the warning message: LIBMTP WARNING: VendorExtensionID: ffffffff LIBMTP WARNING: VendorExtensionDesc: (null) LIBMTP WARNING: this typically means the device is PTP (i.e. a camera) but not a MTP device at all. Trying to continue anyway. This is because libmtp expects a MTP Vendor Extension ID of 0x00000006 and a MTP Version of 0x0064. These numbers are taken from Microsoft's MTP Vendor Extension Identification Message page and are what most physical devices show. Signed-off-by: Isaac Lozano <109lozanoi@gmail.com> Reviewed-by: Stefan Hajnoczi --- hw/usb/dev-mtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index bda84a6..1be85ae 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -788,8 +788,8 @@ static MTPData *usb_mtp_get_device_info(MTPState *s, MTPControl *c) trace_usb_mtp_op_get_device_info(s->dev.addr); usb_mtp_add_u16(d, 100); - usb_mtp_add_u32(d, 0xffffffff); - usb_mtp_add_u16(d, 0x0101); + usb_mtp_add_u32(d, 0x00000006); + usb_mtp_add_u16(d, 0x0064); usb_mtp_add_wstr(d, L""); usb_mtp_add_u16(d, 0x0000);