From patchwork Sat May 28 15:47:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin O'Connor X-Patchwork-Id: 97803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 783E0B6F84 for ; Sun, 29 May 2011 01:47:29 +1000 (EST) Received: from localhost ([::1]:34863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQLjZ-0001fO-GM for incoming@patchwork.ozlabs.org; Sat, 28 May 2011 11:47:25 -0400 Received: from eggs.gnu.org ([140.186.70.92]:36861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQLjT-0001fJ-1Z for qemu-devel@nongnu.org; Sat, 28 May 2011 11:47:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQLjR-00051E-T9 for qemu-devel@nongnu.org; Sat, 28 May 2011 11:47:19 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:37204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQLjR-000518-R9 for qemu-devel@nongnu.org; Sat, 28 May 2011 11:47:17 -0400 Received: by qwj8 with SMTP id 8so1492570qwj.4 for ; Sat, 28 May 2011 08:47:16 -0700 (PDT) Received: by 10.229.10.76 with SMTP id o12mr2406281qco.62.1306597636578; Sat, 28 May 2011 08:47:16 -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 u15sm1734396qcq.24.2011.05.28.08.47.15 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 May 2011 08:47:16 -0700 (PDT) Date: Sat, 28 May 2011 11:47:15 -0400 From: Kevin O'Connor To: qemu-devel@nongnu.org Message-ID: <20110528154715.GA27635@morn.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.45 Cc: Gerd Hoffmann Subject: [Qemu-devel] [RESEND][PATCH 1/2] Fix USB mouse Set_Protocol behavior X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: 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 --- 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 89c293c..268669b 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -779,13 +779,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;