Commit c8075ac370e08190271ed7b6b1b81e45160d4c2b

Authored by Gleb Natapov
Committed by Blue Swirl
1 parent bc26e55a

Register usb-uhci reset function.

The device is not reset on system reset currently.
Without this patch RHEL4.8 hangs after reboot if -usbdevice table
is in use.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Showing 1 changed file with 4 additions and 1 deletions
hw/usb-uhci.c
... ... @@ -319,8 +319,9 @@ static void uhci_update_irq(UHCIState *s)
319 319 qemu_set_irq(s->dev.irq[3], level);
320 320 }
321 321  
322   -static void uhci_reset(UHCIState *s)
  322 +static void uhci_reset(void *opaque)
323 323 {
  324 + UHCIState *s = opaque;
324 325 uint8_t *pci_conf;
325 326 int i;
326 327 UHCIPort *port;
... ... @@ -1093,6 +1094,7 @@ void usb_uhci_piix3_init(PCIBus *bus, int devfn)
1093 1094 }
1094 1095 s->frame_timer = qemu_new_timer(vm_clock, uhci_frame_timer, s);
1095 1096  
  1097 + qemu_register_reset(uhci_reset, 0, s);
1096 1098 uhci_reset(s);
1097 1099  
1098 1100 /* Use region 4 for consistency with real hardware. BSD guests seem
... ... @@ -1127,6 +1129,7 @@ void usb_uhci_piix4_init(PCIBus *bus, int devfn)
1127 1129 }
1128 1130 s->frame_timer = qemu_new_timer(vm_clock, uhci_frame_timer, s);
1129 1131  
  1132 + qemu_register_reset(uhci_reset, 0, s);
1130 1133 uhci_reset(s);
1131 1134  
1132 1135 /* Use region 4 for consistency with real hardware. BSD guests seem
... ...