diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-04-30 14:06:13 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-05-03 12:09:48 -0500 |
commit | 54eefd72bfc0ad7cd5cbedba8ef4368bd2bc3329 (patch) | |
tree | 3111ce03e056f4f9de04594f803d412114c94b68 | |
parent | 51336214da6f2eaa7baaa8efa1823377252c1496 (diff) |
lsi: Properly initialize controller state on reset
The LSI controller was lacking a system reset handler. Simply invoke the
existing soft reset handler in this case. This also allows to drop its
explicit invocation during init.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/lsi53c895a.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index ad23ece7a0..85eea150c8 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -2007,6 +2007,13 @@ static void lsi_mmio_mapfunc(PCIDevice *pci_dev, int region_num, cpu_register_physical_memory(addr + 0, 0x400, s->mmio_io_addr); } +static void lsi_scsi_reset(DeviceState *dev) +{ + LSIState *s = DO_UPCAST(LSIState, dev.qdev, dev); + + lsi_soft_reset(s); +} + static void lsi_pre_save(void *opaque) { LSIState *s = opaque; @@ -2147,8 +2154,6 @@ static int lsi_scsi_init(PCIDevice *dev) PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_ram_mapfunc); QTAILQ_INIT(&s->queue); - lsi_soft_reset(s); - scsi_bus_new(&s->bus, &dev->qdev, 1, LSI_MAX_DEVS, lsi_command_complete); if (!dev->qdev.hotplugged) { scsi_bus_legacy_handle_cmdline(&s->bus); @@ -2160,6 +2165,7 @@ static PCIDeviceInfo lsi_info = { .qdev.name = "lsi53c895a", .qdev.alias = "lsi", .qdev.size = sizeof(LSIState), + .qdev.reset = lsi_scsi_reset, .qdev.vmsd = &vmstate_lsi_scsi, .init = lsi_scsi_init, .exit = lsi_scsi_uninit, |