From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7S4H-0004DR-Hm for qemu-devel@nongnu.org; Fri, 31 Aug 2012 10:19:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7S4F-0000R2-C1 for qemu-devel@nongnu.org; Fri, 31 Aug 2012 10:19:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7S4F-0000QI-3b for qemu-devel@nongnu.org; Fri, 31 Aug 2012 10:19:27 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7VEJQZw020075 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 31 Aug 2012 10:19:26 -0400 From: Gerd Hoffmann Date: Fri, 31 Aug 2012 16:19:21 +0200 Message-Id: <1346422762-15877-11-git-send-email-kraxel@redhat.com> In-Reply-To: <1346422762-15877-1-git-send-email-kraxel@redhat.com> References: <1346422762-15877-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH for-1.2 10/11] ehci: Fix interrupt endpoints no longer working List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede From: Hans de Goede One of the recent changes (likely the addition of queuing support) has broken interrupt endpoints, this patch fixes this. Signed-off-by: Hans de Goede --- hw/usb/hcd-ehci.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index eca1431..017342b 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1987,10 +1987,19 @@ static int ehci_state_fetchqtd(EHCIQueue *q) ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH); again = 1; } else if (p != NULL) { - if (p->async == EHCI_ASYNC_INFLIGHT) { + switch (p->async) { + case EHCI_ASYNC_NONE: + /* Previously nacked packet (likely interrupt ep) */ + ehci_set_state(q->ehci, q->async, EST_EXECUTE); + break; + case EHCI_ASYNC_INFLIGHT: + /* Unfinyshed async handled packet, go horizontal */ ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH); - } else { + break; + case EHCI_ASYNC_FINISHED: + /* Should never happen, as this case is caught by fetchqh */ ehci_set_state(q->ehci, q->async, EST_EXECUTING); + break; } again = 1; } else { -- 1.7.1