]> git.proxmox.com Git - qemu.git/commitdiff
usb-uhci: fix irq handling on error.
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 8 Jul 2011 15:28:11 +0000 (17:28 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 22 Jul 2011 11:36:31 +0000 (13:36 +0200)
Spec on UHCI_STS_USBERR: "If the TD on which the error interrupt
occurred also had its IOC bit set, both this bit and Bit 0 are set."

Make UHCI emulation do that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-uhci.c

index 2ef4c5b747f56541ae23b7f008a1822e2701a62d..da74c57c626b5ef61761a8002d4d68d7f8b367b8 100644 (file)
@@ -730,6 +730,9 @@ out:
         td->ctrl |= TD_CTRL_STALL;
         td->ctrl &= ~TD_CTRL_ACTIVE;
         s->status |= UHCI_STS_USBERR;
+        if (td->ctrl & TD_CTRL_IOC) {
+            *int_mask |= 0x01;
+        }
         uhci_update_irq(s);
         return 1;
 
@@ -737,6 +740,9 @@ out:
         td->ctrl |= TD_CTRL_BABBLE | TD_CTRL_STALL;
         td->ctrl &= ~TD_CTRL_ACTIVE;
         s->status |= UHCI_STS_USBERR;
+        if (td->ctrl & TD_CTRL_IOC) {
+            *int_mask |= 0x01;
+        }
         uhci_update_irq(s);
         /* frame interrupted */
         return -1;