From patchwork Fri Mar 2 13:19:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 144263 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 3953DB6EE8 for ; Sat, 3 Mar 2012 00:55:05 +1100 (EST) Received: from localhost ([::1]:57282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3SPo-0000I2-7Y for incoming@patchwork.ozlabs.org; Fri, 02 Mar 2012 08:20:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3SOv-00068P-0b for qemu-devel@nongnu.org; Fri, 02 Mar 2012 08:20:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3SOV-0007tS-U2 for qemu-devel@nongnu.org; Fri, 02 Mar 2012 08:20:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3SOV-0007sk-MI for qemu-devel@nongnu.org; Fri, 02 Mar 2012 08:19:35 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q22DJYxQ003630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Mar 2012 08:19:34 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q22DJXN9025594; Fri, 2 Mar 2012 08:19:33 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id C258542240; Fri, 2 Mar 2012 14:19:31 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 2 Mar 2012 14:19:29 +0100 Message-Id: <1330694370-1078-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1330694370-1078-1-git-send-email-kraxel@redhat.com> References: <1330694370-1078-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 6/7] xhci: fix control xfers 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 Use the new, direct control transfer submission method instead of bypassing the usb core by calling usb_device_handle_control directly. The later fails for async control transfers. This patch gets xhci + usb-host combo going. --- hw/usb-xhci.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c index fc5b542..8305489 100644 --- a/hw/usb-xhci.c +++ b/hw/usb-xhci.c @@ -1470,8 +1470,8 @@ static USBDevice *xhci_find_device(XHCIPort *port, uint8_t addr) static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) { XHCITRB *trb_setup, *trb_status; - uint8_t bmRequestType, bRequest; - uint16_t wValue, wLength, wIndex; + uint8_t bmRequestType; + uint16_t wLength; XHCIPort *port; USBDevice *dev; int ret; @@ -1508,9 +1508,6 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) } bmRequestType = trb_setup->parameter; - bRequest = trb_setup->parameter >> 8; - wValue = trb_setup->parameter >> 16; - wIndex = trb_setup->parameter >> 32; wLength = trb_setup->parameter >> 48; if (xfer->data && xfer->data_alloced < wLength) { @@ -1537,12 +1534,12 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) xfer->iso_xfer = false; xhci_setup_packet(xfer, dev); + xfer->packet.parameter = trb_setup->parameter; if (!xfer->in_xfer) { xhci_xfer_data(xfer, xfer->data, wLength, 0, 1, 0); } - ret = usb_device_handle_control(dev, &xfer->packet, - (bmRequestType << 8) | bRequest, - wValue, wIndex, wLength, xfer->data); + + ret = usb_handle_packet(dev, &xfer->packet); xhci_complete_packet(xfer, ret); if (!xfer->running_async && !xfer->running_retry) {