Commit 52328140e2892c0f7033f6857f1a96da1680bf79

Authored by bellard
1 parent 135e73c5

HCHALTED status bit handling (Lonnie Mendez)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1850 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 5 additions and 0 deletions
hw/usb-uhci.c
... ... @@ -174,6 +174,9 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
174 174 if ((val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
175 175 /* start frame processing */
176 176 qemu_mod_timer(s->frame_timer, qemu_get_clock(vm_clock));
  177 + s->status &= ~UHCI_STS_HCHALTED;
  178 + } else if (!(val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
  179 + s->status |= UHCI_STS_HCHALTED;
177 180 }
178 181 if (val & UHCI_CMD_GRESET) {
179 182 UHCIPort *port;
... ... @@ -528,6 +531,8 @@ static void uhci_frame_timer(void *opaque)
528 531  
529 532 if (!(s->cmd & UHCI_CMD_RS)) {
530 533 qemu_del_timer(s->frame_timer);
  534 + /* set hchalted bit in status - UHCI11D 2.1.2 */
  535 + s->status |= UHCI_STS_HCHALTED;
531 536 return;
532 537 }
533 538 frame_addr = s->fl_base_addr + ((s->frnum & 0x3ff) << 2);
... ...