From patchwork Mon Aug 2 15:30:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin O'Connor X-Patchwork-Id: 60543 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0AA46B6EF0 for ; Tue, 3 Aug 2010 01:31:54 +1000 (EST) Received: from localhost ([127.0.0.1]:42703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfwzW-0000Jt-U6 for incoming@patchwork.ozlabs.org; Mon, 02 Aug 2010 11:31:50 -0400 Received: from [140.186.70.92] (port=46753 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ofwy6-0008KF-ID for qemu-devel@nongnu.org; Mon, 02 Aug 2010 11:30:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ofwy5-00010A-8k for qemu-devel@nongnu.org; Mon, 02 Aug 2010 11:30:22 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:42262) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ofwy5-0000zv-6g for qemu-devel@nongnu.org; Mon, 02 Aug 2010 11:30:21 -0400 Received: by qyk31 with SMTP id 31so61390qyk.4 for ; Mon, 02 Aug 2010 08:30:20 -0700 (PDT) Received: by 10.229.189.16 with SMTP id dc16mr187802qcb.216.1280763019619; Mon, 02 Aug 2010 08:30:19 -0700 (PDT) Received: from localhost (207-172-165-101.c3-0.avec-ubr1.nyr-avec.ny.cable.rcn.com [207.172.165.101]) by mx.google.com with ESMTPS id t21sm187148qcs.32.2010.08.02.08.30.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Aug 2010 08:30:18 -0700 (PDT) Date: Mon, 2 Aug 2010 11:30:16 -0400 From: Kevin O'Connor To: qemu-devel@nongnu.org Message-ID: <20100802153016.GA9031@morn.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCHv2] Fix USB mouse Set_Protocol behavior X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The QEMU USB mouse claims to support the "boot" protocol (bInterfaceSubClass is 1). However, the mouse rejects the Set_Protocol command. The qemu mouse does support the "boot" protocol specification, so a simple fix is to enable the Set_Protocol request. Signed-off-by: Kevin O'Connor --- Changes v1->v2: Add signed-off-by line. --- hw/usb-hid.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb-hid.c b/hw/usb-hid.c index 882d933..d54823d 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -791,13 +791,13 @@ static int usb_hid_handle_control(USBDevice *dev, int request, int value, goto fail; break; case GET_PROTOCOL: - if (s->kind != USB_KEYBOARD) + if (s->kind != USB_KEYBOARD && s->kind != USB_MOUSE) goto fail; ret = 1; data[0] = s->protocol; break; case SET_PROTOCOL: - if (s->kind != USB_KEYBOARD) + if (s->kind != USB_KEYBOARD && s->kind != USB_MOUSE) goto fail; ret = 0; s->protocol = value;