Received: from eggs.gnu.org ([2001:4830:134:3::10]:41116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMadt-0006ji-Lw for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:35:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMadi-0002ZD-UZ for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:35:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMadi-0002Yx-Nr for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:35:10 -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 r8J9Z9PG008213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Sep 2013 05:35:09 -0400 From: Gerd Hoffmann Date: Thu, 19 Sep 2013 11:34:53 +0200 Message-Id: <1379583298-7524-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1379583298-7524-1-git-send-email-kraxel@redhat.com> References: <1379583298-7524-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/7] xhci: Fix number of streams allocated when using streams List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede According to the xhci spec the total number of streams is 2 ^ (MaxPStreams + 1), and this is also how the Linux xhci driver uses this field. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index f02231d..69d9144 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1138,7 +1138,7 @@ static void xhci_reset_streams(XHCIEPContext *epctx) static void xhci_alloc_streams(XHCIEPContext *epctx, dma_addr_t base) { assert(epctx->pstreams == NULL); - epctx->nr_pstreams = 2 << epctx->max_pstreams; + epctx->nr_pstreams = 2 << (epctx->max_pstreams + 1); epctx->pstreams = xhci_alloc_stream_contexts(epctx->nr_pstreams, base); } -- 1.8.3.1