From patchwork Mon Jul 9 10:20:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 169769 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 91E1D2C020A for ; Mon, 9 Jul 2012 20:43:59 +1000 (EST) Received: from localhost ([::1]:38832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoB6B-0004Cj-Ve for incoming@patchwork.ozlabs.org; Mon, 09 Jul 2012 06:21:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoB5A-000276-IV for qemu-devel@nongnu.org; Mon, 09 Jul 2012 06:20:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoB54-0002wS-Ad for qemu-devel@nongnu.org; Mon, 09 Jul 2012 06:20:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoB54-0002vg-1N for qemu-devel@nongnu.org; Mon, 09 Jul 2012 06:20:38 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q69AKaib002214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Jul 2012 06:20:36 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q69AKZx3002786; Mon, 9 Jul 2012 06:20:36 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id A2B74431FA; Mon, 9 Jul 2012 12:20:34 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 9 Jul 2012 12:20:32 +0200 Message-Id: <1341829233-24381-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1341829233-24381-1-git-send-email-kraxel@redhat.com> References: <1341829233-24381-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 8/9] usb: fix interface initialization 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 zero is a valid interface number, so don't use it when resetting the endpoints. Signed-off-by: Gerd Hoffmann --- hw/usb.h | 2 ++ hw/usb/core.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/usb.h b/hw/usb.h index 9cd2f89..7ed8fb8 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -145,6 +145,8 @@ #define USB_ENDPOINT_XFER_INT 3 #define USB_ENDPOINT_XFER_INVALID 255 +#define USB_INTERFACE_INVALID 255 + typedef struct USBBus USBBus; typedef struct USBBusOps USBBusOps; typedef struct USBPort USBPort; diff --git a/hw/usb/core.c b/hw/usb/core.c index fe15be0..0614f76 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -566,8 +566,8 @@ void usb_ep_reset(USBDevice *dev) dev->ep_out[ep].pid = USB_TOKEN_OUT; dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID; dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID; - dev->ep_in[ep].ifnum = 0; - dev->ep_out[ep].ifnum = 0; + dev->ep_in[ep].ifnum = USB_INTERFACE_INVALID; + dev->ep_out[ep].ifnum = USB_INTERFACE_INVALID; dev->ep_in[ep].dev = dev; dev->ep_out[ep].dev = dev; dev->ep_in[ep].pipeline = false;