static void ehci_async_complete_packet(USBPort *port, USBPacket *packet)

{

    EHCIQueue *q;

    EHCIState *s = port->opaque;

    uint32_t portsc = s->portsc[port->index];



    if (portsc & PORTSC_POWNER) {

        USBPort *companion = s->companion_ports[port->index];

        companion->ops->complete(companion, packet);

        return;

    }



    q = container_of(packet, EHCIQueue, packet);

    trace_usb_ehci_queue_action(q, "wakeup");

    assert(q->async == EHCI_ASYNC_INFLIGHT);

    q->async = EHCI_ASYNC_FINISHED;

    q->usb_status = packet->len;

}

static void ehci_async_complete_packet(USBPort *port, USBPacket *packet)

{

    EHCIQueue *q;

    EHCIState *s = port->opaque;

    uint32_t portsc = s->portsc[port->index];



    if (portsc & PORTSC_POWNER) {

        USBPort *companion = s->companion_ports[port->index];

        companion->ops->complete(companion, packet);

        return;

    }



    q = container_of(packet, EHCIQueue, packet);

    trace_usb_ehci_queue_action(q, "wakeup");

    assert(q->async == EHCI_ASYNC_INFLIGHT);

    q->async = EHCI_ASYNC_FINISHED;

    q->usb_status = packet->len;

}

    q->usb_status = packet->len;
static void FUNC_0(USBPort *VAR_0, USBPacket *VAR_1)

{

    EHCIQueue *q;

    EHCIState *s = VAR_0->opaque;

    uint32_t portsc = s->portsc[VAR_0->index];



    if (portsc & PORTSC_POWNER) {

        USBPort *companion = s->companion_ports[VAR_0->index];

        companion->ops->complete(companion, VAR_1);

        return;

    }



    q = container_of(VAR_1, EHCIQueue, VAR_1);

    trace_usb_ehci_queue_action(q, "wakeup");

    assert(q->async == EHCI_ASYNC_INFLIGHT);

    q->async = EHCI_ASYNC_FINISHED;

    q->usb_status = VAR_1->len;

}

static void FUNC_0(USBPort *VAR_0, USBPacket *VAR_1)
{ EHCIQueue *q; EHCIState *s = VAR_0->opaque; uint32_t portsc = s->portsc[VAR_0->index]; if (portsc & PORTSC_POWNER) { USBPort *companion = s->companion_ports[VAR_0->index]; companion->ops->complete(companion, VAR_1); return; } q = container_of(VAR_1, EHCIQueue, VAR_1); trace_usb_ehci_queue_action(q, "wakeup"); assert(q->async == EHCI_ASYNC_INFLIGHT); q->async = EHCI_ASYNC_FINISHED; q->usb_status = VAR_1->len; }