aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-uhci.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-21 19:33:09 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-21 19:33:09 +0000
commit6f382b5ec020fea83e0faa409b912135d06c287c (patch)
treef9db19dd96255507f387fecc4933bc994ff614cb /hw/usb-uhci.c
parent0d380648582e081ffb873b29717cf6611a517daf (diff)
uhci: fixes for save/load-vm (Max Krasnyansky)
For some reason we were not registering save/load-vm handler for piix3 flavor of UHCI and hence save/load was broken. Async transactions need to be canceled when we save the VM because there is no way we can save/restore all that state. Since we do not mess the original TD/QH the driver will simply resubmit the transfers. Tested with Windows XP-SP2 running under QEMU/KQEMU. Signed-off-by: Max Krasnyansky <maxk@kernel.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5054 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/usb-uhci.c')
-rw-r--r--hw/usb-uhci.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index c6e7751c5c..1b15074fc3 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -310,6 +310,8 @@ static void uhci_reset(UHCIState *s)
int i;
UHCIPort *port;
+ dprintf("uhci: full reset\n");
+
pci_conf = s->dev.config;
pci_conf[0x6a] = 0x01; /* usb clock */
@@ -331,13 +333,14 @@ static void uhci_reset(UHCIState *s)
uhci_async_cancel_all(s);
}
-#if 1
static void uhci_save(QEMUFile *f, void *opaque)
{
UHCIState *s = opaque;
uint8_t num_ports = NB_PORTS;
int i;
+ uhci_async_cancel_all(s);
+
pci_device_save(&s->dev, f);
qemu_put_8s(f, &num_ports);
@@ -383,7 +386,6 @@ static int uhci_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
-#endif
static void uhci_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
{
@@ -1009,6 +1011,8 @@ static void uhci_frame_timer(void *opaque)
qemu_del_timer(s->frame_timer);
/* set hchalted bit in status - UHCI11D 2.1.2 */
s->status |= UHCI_STS_HCHALTED;
+
+ dprintf("uhci: halted\n");
return;
}
@@ -1082,6 +1086,8 @@ void usb_uhci_piix3_init(PCIBus *bus, int devfn)
to rely on this. */
pci_register_io_region(&s->dev, 4, 0x20,
PCI_ADDRESS_SPACE_IO, uhci_map);
+
+ register_savevm("uhci", 0, 1, uhci_save, uhci_load, s);
}
void usb_uhci_piix4_init(PCIBus *bus, int devfn)