static int ehci_state_writeback(EHCIQueue *q, int async)

{

    int again = 0;



    /*  Write back the QTD from the QH area */

    ehci_trace_qtd(q, NLPTR_GET(q->qtdaddr), (EHCIqtd*) &q->qh.next_qtd);

    put_dwords(NLPTR_GET(q->qtdaddr),(uint32_t *) &q->qh.next_qtd,

                sizeof(EHCIqtd) >> 2);



    /*

     * EHCI specs say go horizontal here.

     *

     * We can also advance the queue here for performance reasons.  We

     * need to take care to only take that shortcut in case we've

     * processed the qtd just written back without errors, i.e. halt

     * bit is clear.

     */

    if (q->qh.token & QTD_TOKEN_HALT) {

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

        again = 1;

    } else {

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

        again = 1;

    }

    return again;

}

static int ehci_state_writeback(EHCIQueue *q, int async)

{

    int again = 0;



    

    ehci_trace_qtd(q, NLPTR_GET(q->qtdaddr), (EHCIqtd*) &q->qh.next_qtd);

    put_dwords(NLPTR_GET(q->qtdaddr),(uint32_t *) &q->qh.next_qtd,

                sizeof(EHCIqtd) >> 2);



    















    if (q->qh.token & QTD_TOKEN_HALT) {

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

        again = 1;

    } else {

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

        again = 1;

    }

    return again;

}

static int FUNC_0(EHCIQueue *VAR_0, int VAR_1)

{

    int VAR_2 = 0;



    

    ehci_trace_qtd(VAR_0, NLPTR_GET(VAR_0->qtdaddr), (EHCIqtd*) &VAR_0->qh.next_qtd);

    put_dwords(NLPTR_GET(VAR_0->qtdaddr),(uint32_t *) &VAR_0->qh.next_qtd,

                sizeof(EHCIqtd) >> 2);



    















    if (VAR_0->qh.token & QTD_TOKEN_HALT) {

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

        VAR_2 = 1;

    } else {

        ehci_set_state(VAR_0->ehci, VAR_1, EST_ADVANCEQUEUE);

        VAR_2 = 1;

    }

    return VAR_2;

}

static int FUNC_0(EHCIQueue *VAR_0, int VAR_1)
{ int VAR_2 = 0; ehci_trace_qtd(VAR_0, NLPTR_GET(VAR_0->qtdaddr), (EHCIqtd*) &VAR_0->qh.next_qtd); put_dwords(NLPTR_GET(VAR_0->qtdaddr),(uint32_t *) &VAR_0->qh.next_qtd,
sizeof(EHCIqtd) >> 2); if (VAR_0->qh.token & QTD_TOKEN_HALT) { ehci_set_state(VAR_0->ehci, VAR_1, EST_HORIZONTALQH); VAR_2 = 1; } else { ehci_set_state(VAR_0->ehci, VAR_1, EST_ADVANCEQUEUE); VAR_2 = 1; } return VAR_2; }