static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report)

{

    int killed = 0;



    if (report && (t->running_async || t->running_retry)) {

        t->status = report;

        xhci_xfer_report(t);

    }



    if (t->running_async) {

        usb_cancel_packet(&t->packet);

        t->running_async = 0;

        killed = 1;

    }

    if (t->running_retry) {

        XHCIEPContext *epctx = t->xhci->slots[t->slotid-1].eps[t->epid-1];

        if (epctx) {

            epctx->retry = NULL;

            timer_del(epctx->kick_timer);

        }

        t->running_retry = 0;

        killed = 1;

    }

    g_free(t->trbs);



    t->trbs = NULL;

    t->trb_count = t->trb_alloced = 0;



    return killed;

}

static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report)

{

    int killed = 0;



    if (report && (t->running_async || t->running_retry)) {

        t->status = report;

        xhci_xfer_report(t);

    }



    if (t->running_async) {

        usb_cancel_packet(&t->packet);

        t->running_async = 0;

        killed = 1;

    }

    if (t->running_retry) {

        XHCIEPContext *epctx = t->xhci->slots[t->slotid-1].eps[t->epid-1];

        if (epctx) {

            epctx->retry = NULL;

            timer_del(epctx->kick_timer);

        }

        t->running_retry = 0;

        killed = 1;

    }

    g_free(t->trbs);



    t->trbs = NULL;

    t->trb_count = t->trb_alloced = 0;



    return killed;

}

static int FUNC_0(XHCITransfer *VAR_0, TRBCCode VAR_1)

{

    int VAR_2 = 0;



    if (VAR_1 && (VAR_0->running_async || VAR_0->running_retry)) {

        VAR_0->status = VAR_1;

        xhci_xfer_report(VAR_0);

    }



    if (VAR_0->running_async) {

        usb_cancel_packet(&VAR_0->packet);

        VAR_0->running_async = 0;

        VAR_2 = 1;

    }

    if (VAR_0->running_retry) {

        XHCIEPContext *epctx = VAR_0->xhci->slots[VAR_0->slotid-1].eps[VAR_0->epid-1];

        if (epctx) {

            epctx->retry = NULL;

            timer_del(epctx->kick_timer);

        }

        VAR_0->running_retry = 0;

        VAR_2 = 1;

    }

    g_free(VAR_0->trbs);



    VAR_0->trbs = NULL;

    VAR_0->trb_count = VAR_0->trb_alloced = 0;



    return VAR_2;

}

static int FUNC_0(XHCITransfer *VAR_0, TRBCCode VAR_1)
{ int VAR_2 = 0; if (VAR_1 && (VAR_0->running_async || VAR_0->running_retry)) { VAR_0->status = VAR_1; xhci_xfer_report(VAR_0); } if (VAR_0->running_async) { usb_cancel_packet(&VAR_0->packet); VAR_0->running_async = 0; VAR_2 = 1; } if (VAR_0->running_retry) { XHCIEPContext *epctx = VAR_0->xhci->slots[VAR_0->slotid-1].eps[VAR_0->epid-1]; if (epctx) { epctx->retry = NULL; timer_del(epctx->kick_timer); } VAR_0->running_retry = 0; VAR_2 = 1; } g_free(VAR_0->trbs); VAR_0->trbs = NULL; VAR_0->trb_count = VAR_0->trb_alloced = 0; return VAR_2; }