aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-10-30 17:04:29 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-10-30 17:04:29 +0000
commitf33f43bd86beb94ae1be14a62dc89cbeb4a665bb (patch)
treefbe5c32f91c47ca42f68919ea183a1ed61f25df7 /hw
parent3c1d9a15be679afd3fb9173a242827ff2d43af8f (diff)
parenta65e4ef90f0fb437b8e74e250a6f94aa4ecfa25c (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20141028-1' into staging
Fixes for libcacard (usb smartcard emulation), xhci and uhci. # gpg: Signature made Tue 28 Oct 2014 10:39:52 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-20141028-1: uhci: remove useless DEBUG xhci: add property to turn on/off streams support libcacard: don't free sign buffer while sign op is pending libcacard: Lock NSS cert db when selecting an applet on an emulated card libcacard: introduce new vcard_emul_logout Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/hcd-uhci.c3
-rw-r--r--hw/usb/hcd-xhci.c15
2 files changed, 12 insertions, 6 deletions
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 5b88f3070f..4a4215d332 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -35,9 +35,6 @@
#include "trace.h"
#include "qemu/main-loop.h"
-//#define DEBUG
-//#define DEBUG_DUMP_DATA
-
#define FRAME_TIMER_FREQ 1000
#define FRAME_MAX_LOOPS 256
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index a27c9d37fa..2930b72c1d 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -459,6 +459,7 @@ struct XHCIState {
uint32_t numintrs;
uint32_t numslots;
uint32_t flags;
+ uint32_t max_pstreams_mask;
/* Operational Registers */
uint32_t usbcmd;
@@ -500,6 +501,7 @@ enum xhci_flags {
XHCI_FLAG_USE_MSI_X,
XHCI_FLAG_SS_FIRST,
XHCI_FLAG_FORCE_PCIE_ENDCAP,
+ XHCI_FLAG_ENABLE_STREAMS,
};
static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
@@ -1384,7 +1386,7 @@ static void xhci_init_epctx(XHCIEPContext *epctx,
epctx->pctx = pctx;
epctx->max_psize = ctx[1]>>16;
epctx->max_psize *= 1+((ctx[1]>>8)&0xff);
- epctx->max_pstreams = (ctx[0] >> 10) & 0xf;
+ epctx->max_pstreams = (ctx[0] >> 10) & epctx->xhci->max_pstreams_mask;
epctx->lsa = (ctx[0] >> 15) & 1;
if (epctx->max_pstreams) {
xhci_alloc_streams(epctx, dequeue);
@@ -2956,9 +2958,9 @@ static uint64_t xhci_cap_read(void *ptr, hwaddr reg, unsigned size)
break;
case 0x10: /* HCCPARAMS */
if (sizeof(dma_addr_t) == 4) {
- ret = 0x00087000;
+ ret = 0x00080000 | (xhci->max_pstreams_mask << 12);
} else {
- ret = 0x00087001;
+ ret = 0x00080001 | (xhci->max_pstreams_mask << 12);
}
break;
case 0x14: /* DBOFF */
@@ -3590,6 +3592,11 @@ static int usb_xhci_initfn(struct PCIDevice *dev)
if (xhci->numslots < 1) {
xhci->numslots = 1;
}
+ if (xhci_get_flag(xhci, XHCI_FLAG_ENABLE_STREAMS)) {
+ xhci->max_pstreams_mask = 7; /* == 256 primary streams */
+ } else {
+ xhci->max_pstreams_mask = 0;
+ }
xhci->mfwrap_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, xhci_mfwrap_timer, xhci);
@@ -3853,6 +3860,8 @@ static Property xhci_properties[] = {
XHCIState, flags, XHCI_FLAG_SS_FIRST, true),
DEFINE_PROP_BIT("force-pcie-endcap", XHCIState, flags,
XHCI_FLAG_FORCE_PCIE_ENDCAP, false),
+ DEFINE_PROP_BIT("streams", XHCIState, flags,
+ XHCI_FLAG_ENABLE_STREAMS, true),
DEFINE_PROP_UINT32("intrs", XHCIState, numintrs, MAXINTRS),
DEFINE_PROP_UINT32("slots", XHCIState, numslots, MAXSLOTS),
DEFINE_PROP_UINT32("p2", XHCIState, numports_2, 4),