From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLaLv-0004iy-6a for qemu-devel@nongnu.org; Mon, 16 Sep 2013 11:04:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLaLo-0002Pl-Hr for qemu-devel@nongnu.org; Mon, 16 Sep 2013 11:04:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLaLo-0002PI-AV for qemu-devel@nongnu.org; Mon, 16 Sep 2013 11:04:32 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8GF4UgD017490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Sep 2013 11:04:31 -0400 From: Hans de Goede Date: Mon, 16 Sep 2013 17:04:27 +0200 Message-Id: <1379343867-4285-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH] xhci: Fix number of streams allocated when using streams List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org 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 --- 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