Revision 4b63a0df hw/usb/hcd-ehci.c

b/hw/usb/hcd-ehci.c
489 489
    [CONFIGFLAG]        = "CONFIGFLAG",
490 490
};
491 491

  
492
static int ehci_state_executing(EHCIQueue *q);
493
static int ehci_state_writeback(EHCIQueue *q);
494

  
492 495
static const char *nr2str(const char **n, size_t len, uint32_t nr)
493 496
{
494 497
    if (nr < len && n[nr] != NULL) {
......
750 753
        usb_packet_unmap(&p->packet, &p->sgl);
751 754
        qemu_sglist_destroy(&p->sgl);
752 755
    }
756
    if (p->async == EHCI_ASYNC_FINISHED) {
757
        int state = ehci_get_state(p->queue->ehci, p->queue->async);
758
        /* This is a normal, but rare condition (cancel racing completion) */
759
        fprintf(stderr, "EHCI: Warning packet completed but not processed\n");
760
        ehci_state_executing(p->queue);
761
        ehci_state_writeback(p->queue);
762
        ehci_set_state(p->queue->ehci, p->queue->async, state);
763
        /* state_writeback recurses into us with async == EHCI_ASYNC_NONE!! */
764
        return;
765
    }
753 766
    QTAILQ_REMOVE(&p->queue->packets, p, next);
754 767
    usb_packet_cleanup(&p->packet);
755 768
    g_free(p);

Also available in: Unified diff