[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 32/37] ehci: update status bits in ehci_set_state
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 32/37] ehci: update status bits in ehci_set_state |
Date: |
Thu, 7 Jun 2012 11:31:21 +0200 |
Update the status register in the ehci_set_state function, to make sure
the guest-visible register is in sync with our internal schedule state.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index d9c0f0f..0a550f9 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -591,9 +591,19 @@ static void ehci_set_state(EHCIState *s, int async, int
state)
if (async) {
trace_usb_ehci_state("async", state2str(state));
s->astate = state;
+ if (s->astate == EST_INACTIVE) {
+ ehci_clear_usbsts(s, USBSTS_ASS);
+ } else {
+ ehci_set_usbsts(s, USBSTS_ASS);
+ }
} else {
trace_usb_ehci_state("periodic", state2str(state));
s->pstate = state;
+ if (s->pstate == EST_INACTIVE) {
+ ehci_clear_usbsts(s, USBSTS_PSS);
+ } else {
+ ehci_set_usbsts(s, USBSTS_PSS);
+ }
}
}
@@ -2170,14 +2180,12 @@ static void ehci_advance_async_state(EHCIState *ehci)
if (!ehci_async_enabled(ehci)) {
break;
}
- ehci_set_usbsts(ehci, USBSTS_ASS);
ehci_set_state(ehci, async, EST_ACTIVE);
// No break, fall through to ACTIVE
case EST_ACTIVE:
if (!ehci_async_enabled(ehci)) {
ehci_queues_rip_all(ehci, async);
- ehci_clear_usbsts(ehci, USBSTS_ASS);
ehci_set_state(ehci, async, EST_INACTIVE);
break;
}
@@ -2229,7 +2237,6 @@ static void ehci_advance_periodic_state(EHCIState *ehci)
switch(ehci_get_state(ehci, async)) {
case EST_INACTIVE:
if (!(ehci->frindex & 7) && ehci_periodic_enabled(ehci)) {
- ehci_set_usbsts(ehci, USBSTS_PSS);
ehci_set_state(ehci, async, EST_ACTIVE);
// No break, fall through to ACTIVE
} else
@@ -2238,7 +2245,6 @@ static void ehci_advance_periodic_state(EHCIState *ehci)
case EST_ACTIVE:
if (!(ehci->frindex & 7) && !ehci_periodic_enabled(ehci)) {
ehci_queues_rip_all(ehci, async);
- ehci_clear_usbsts(ehci, USBSTS_PSS);
ehci_set_state(ehci, async, EST_INACTIVE);
break;
}
--
1.7.1
- [Qemu-devel] [PATCH 28/37] ehci: schedule async bh on async packet completion, (continued)
- [Qemu-devel] [PATCH 28/37] ehci: schedule async bh on async packet completion, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 25/37] ehci: tweak queue initialization, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 08/37] usb-storage: remove MSDState->residue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 03/37] uhci: make bandwidth tunable, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 17/37] xhci: trace: endpoints, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 29/37] ehci: kick async schedule on wakeup, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 05/37] uhci: zap uhci_pre_save, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 30/37] ehci: fix reset, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 04/37] uhci: fix trace format strings, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 09/37] usb-storage: add usb_msd_packet_complete(), Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 32/37] ehci: update status bits in ehci_set_state,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 27/37] ehci: move async schedule to bottom half, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 01/37] uhci: fix bandwidth management, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 22/37] ehci: cache USBDevice in EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 10/37] usb-storage: add scsi_off, remove scsi_buf, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 06/37] uhci: fix irq routing, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 18/37] xhci: trace: transfers, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 26/37] ehci: add async field to EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 12/37] xhci: Clean up reset function, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 21/37] ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 11/37] usb-storage: migration support, Gerd Hoffmann, 2012/06/07