From e099ad4b7e9ca7debdd624a0d465a33198a6844f Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 24 Oct 2012 09:38:08 +0200 Subject: 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 --- hw/usb/hcd-xhci.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw') 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); -- cgit v1.2.3