summaryrefslogtreecommitdiff
path: root/hw/usb/hcd-xhci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-10-24 09:38:08 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-10-25 14:35:55 +0200
commite099ad4b7e9ca7debdd624a0d465a33198a6844f (patch)
treee7065b4b369df30962dfd6404d4658b9a7e0f7b8 /hw/usb/hcd-xhci.c
parent3f973ee84ef51e448566c08ec5cfe746c9640269 (diff)
downloadqemu-e099ad4b7e9ca7debdd624a0d465a33198a6844f.tar.gz
xhci: allow disabling interrupters
For secondary interrupters this is explicitly allowed in the specs. For the primary interrupter behavior is undefined, lets be friendly and allow disabling too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-xhci.c')
-rw-r--r--hw/usb/hcd-xhci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index d8d1226a5b..bd8d4a5b39 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -964,6 +964,12 @@ static void xhci_er_reset(XHCIState *xhci, int v)
XHCIInterrupter *intr = &xhci->intr[v];
XHCIEvRingSeg seg;
+ if (intr->erstsz == 0) {
+ /* disabled */
+ intr->er_start = 0;
+ intr->er_size = 0;
+ return;
+ }
/* cache the (sole) event ring segment location */
if (intr->erstsz != 1) {
fprintf(stderr, "xhci: invalid value for ERSTSZ: %d\n", intr->erstsz);