static int ehci_state_executing(EHCIQueue *q)

{

    EHCIPacket *p = QTAILQ_FIRST(&q->packets);



    assert(p != NULL);

    assert(p->qtdaddr == q->qtdaddr);



    ehci_execute_complete(q);



    // 4.10.3

    if (!q->async) {

        int transactCtr = get_field(q->qh.epcap, QH_EPCAP_MULT);

        transactCtr--;

        set_field(&q->qh.epcap, transactCtr, QH_EPCAP_MULT);

        // 4.10.3, bottom of page 82, should exit this state when transaction

        // counter decrements to 0

    }



    /* 4.10.5 */

    if (p->usb_status == USB_RET_NAK) {

        ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH);

    } else {

        ehci_set_state(q->ehci, q->async, EST_WRITEBACK);

    }



    ehci_flush_qh(q);

    return 1;

}

static int ehci_state_executing(EHCIQueue *q)

{

    EHCIPacket *p = QTAILQ_FIRST(&q->packets);



    assert(p != NULL);

    assert(p->qtdaddr == q->qtdaddr);



    ehci_execute_complete(q);



    

    if (!q->async) {

        int transactCtr = get_field(q->qh.epcap, QH_EPCAP_MULT);

        transactCtr--;

        set_field(&q->qh.epcap, transactCtr, QH_EPCAP_MULT);

        , bottom of page 82, should exit this state when transaction

        

    }



    

    if (p->usb_status == USB_RET_NAK) {

        ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH);

    } else {

        ehci_set_state(q->ehci, q->async, EST_WRITEBACK);

    }



    ehci_flush_qh(q);

    return 1;

}

    if (!q->async) {         int transactCtr = get_field(q->qh.epcap, QH_EPCAP_MULT);     if (!q->async) {         int transactCtr = get_field(q->qh.epcap, QH_EPCAP_MULT);         transactCtr--;         set_field(&q->qh.epcap, transactCtr, QH_EPCAP_MULT);
static int FUNC_0(EHCIQueue *VAR_0)

{

    EHCIPacket *p = QTAILQ_FIRST(&VAR_0->packets);



    assert(p != NULL);

    assert(p->qtdaddr == VAR_0->qtdaddr);



    ehci_execute_complete(VAR_0);



    

    if (!VAR_0->async) {

        int VAR_1 = get_field(VAR_0->qh.epcap, QH_EPCAP_MULT);

        VAR_1--;

        set_field(&VAR_0->qh.epcap, VAR_1, QH_EPCAP_MULT);

        , bottom of page 82, should exit this state when transaction

        

    }



    

    if (p->usb_status == USB_RET_NAK) {

        ehci_set_state(VAR_0->ehci, VAR_0->async, EST_HORIZONTALQH);

    } else {

        ehci_set_state(VAR_0->ehci, VAR_0->async, EST_WRITEBACK);

    }



    ehci_flush_qh(VAR_0);

    return 1;

}

static int FUNC_0(EHCIQueue *VAR_0)
{ EHCIPacket *p = QTAILQ_FIRST(&VAR_0->packets); assert(p != NULL); assert(p->qtdaddr == VAR_0->qtdaddr); ehci_execute_complete(VAR_0); if (!VAR_0->async) { int VAR_1 = get_field(VAR_0->qh.epcap, QH_EPCAP_MULT); VAR_1--; set_field(&VAR_0->qh.epcap, VAR_1, QH_EPCAP_MULT); , bottom of page 82, should exit this state when transaction
} if (p->usb_status == USB_RET_NAK) { ehci_set_state(VAR_0->ehci, VAR_0->async, EST_HORIZONTALQH); } else { ehci_set_state(VAR_0->ehci, VAR_0->async, EST_WRITEBACK); } ehci_flush_qh(VAR_0); return 1; }