static void xhci_reset(DeviceState *dev)

{

    XHCIState *xhci = XHCI(dev);

    int i;



    trace_usb_xhci_reset();

    if (!(xhci->usbsts & USBSTS_HCH)) {

        DPRINTF("xhci: reset while running!\n");

    }



    xhci->usbcmd = 0;

    xhci->usbsts = USBSTS_HCH;

    xhci->dnctrl = 0;

    xhci->crcr_low = 0;

    xhci->crcr_high = 0;

    xhci->dcbaap_low = 0;

    xhci->dcbaap_high = 0;

    xhci->config = 0;



    for (i = 0; i < xhci->numslots; i++) {

        xhci_disable_slot(xhci, i+1);

    }



    for (i = 0; i < xhci->numports; i++) {

        xhci_port_update(xhci->ports + i, 0);

    }



    for (i = 0; i < xhci->numintrs; i++) {

        xhci->intr[i].iman = 0;

        xhci->intr[i].imod = 0;

        xhci->intr[i].erstsz = 0;

        xhci->intr[i].erstba_low = 0;

        xhci->intr[i].erstba_high = 0;

        xhci->intr[i].erdp_low = 0;

        xhci->intr[i].erdp_high = 0;

        xhci->intr[i].msix_used = 0;



        xhci->intr[i].er_ep_idx = 0;

        xhci->intr[i].er_pcs = 1;

        xhci->intr[i].er_full = 0;

        xhci->intr[i].ev_buffer_put = 0;

        xhci->intr[i].ev_buffer_get = 0;

    }



    xhci->mfindex_start = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);

    xhci_mfwrap_update(xhci);

}

static void xhci_reset(DeviceState *dev)

{

    XHCIState *xhci = XHCI(dev);

    int i;



    trace_usb_xhci_reset();

    if (!(xhci->usbsts & USBSTS_HCH)) {

        DPRINTF("xhci: reset while running!\n");

    }



    xhci->usbcmd = 0;

    xhci->usbsts = USBSTS_HCH;

    xhci->dnctrl = 0;

    xhci->crcr_low = 0;

    xhci->crcr_high = 0;

    xhci->dcbaap_low = 0;

    xhci->dcbaap_high = 0;

    xhci->config = 0;



    for (i = 0; i < xhci->numslots; i++) {

        xhci_disable_slot(xhci, i+1);

    }



    for (i = 0; i < xhci->numports; i++) {

        xhci_port_update(xhci->ports + i, 0);

    }



    for (i = 0; i < xhci->numintrs; i++) {

        xhci->intr[i].iman = 0;

        xhci->intr[i].imod = 0;

        xhci->intr[i].erstsz = 0;

        xhci->intr[i].erstba_low = 0;

        xhci->intr[i].erstba_high = 0;

        xhci->intr[i].erdp_low = 0;

        xhci->intr[i].erdp_high = 0;

        xhci->intr[i].msix_used = 0;



        xhci->intr[i].er_ep_idx = 0;

        xhci->intr[i].er_pcs = 1;

        xhci->intr[i].er_full = 0;

        xhci->intr[i].ev_buffer_put = 0;

        xhci->intr[i].ev_buffer_get = 0;

    }



    xhci->mfindex_start = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);

    xhci_mfwrap_update(xhci);

}

        xhci->intr[i].er_full = 0;
static void FUNC_0(DeviceState *VAR_0)

{

    XHCIState *xhci = XHCI(VAR_0);

    int VAR_1;



    trace_usb_xhci_reset();

    if (!(xhci->usbsts & USBSTS_HCH)) {

        DPRINTF("xhci: reset while running!\n");

    }



    xhci->usbcmd = 0;

    xhci->usbsts = USBSTS_HCH;

    xhci->dnctrl = 0;

    xhci->crcr_low = 0;

    xhci->crcr_high = 0;

    xhci->dcbaap_low = 0;

    xhci->dcbaap_high = 0;

    xhci->config = 0;



    for (VAR_1 = 0; VAR_1 < xhci->numslots; VAR_1++) {

        xhci_disable_slot(xhci, VAR_1+1);

    }



    for (VAR_1 = 0; VAR_1 < xhci->numports; VAR_1++) {

        xhci_port_update(xhci->ports + VAR_1, 0);

    }



    for (VAR_1 = 0; VAR_1 < xhci->numintrs; VAR_1++) {

        xhci->intr[VAR_1].iman = 0;

        xhci->intr[VAR_1].imod = 0;

        xhci->intr[VAR_1].erstsz = 0;

        xhci->intr[VAR_1].erstba_low = 0;

        xhci->intr[VAR_1].erstba_high = 0;

        xhci->intr[VAR_1].erdp_low = 0;

        xhci->intr[VAR_1].erdp_high = 0;

        xhci->intr[VAR_1].msix_used = 0;



        xhci->intr[VAR_1].er_ep_idx = 0;

        xhci->intr[VAR_1].er_pcs = 1;

        xhci->intr[VAR_1].er_full = 0;

        xhci->intr[VAR_1].ev_buffer_put = 0;

        xhci->intr[VAR_1].ev_buffer_get = 0;

    }



    xhci->mfindex_start = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);

    xhci_mfwrap_update(xhci);

}

static void FUNC_0(DeviceState *VAR_0)
{ XHCIState *xhci = XHCI(VAR_0); int VAR_1; trace_usb_xhci_reset(); if (!(xhci->usbsts & USBSTS_HCH)) { DPRINTF("xhci: reset while running!\n"); } xhci->usbcmd = 0; xhci->usbsts = USBSTS_HCH; xhci->dnctrl = 0; xhci->crcr_low = 0; xhci->crcr_high = 0; xhci->dcbaap_low = 0; xhci->dcbaap_high = 0; xhci->config = 0; for (VAR_1 = 0; VAR_1 < xhci->numslots; VAR_1++) { xhci_disable_slot(xhci, VAR_1+1); } for (VAR_1 = 0; VAR_1 < xhci->numports; VAR_1++) { xhci_port_update(xhci->ports + VAR_1, 0); } for (VAR_1 = 0; VAR_1 < xhci->numintrs; VAR_1++) { xhci->intr[VAR_1].iman = 0; xhci->intr[VAR_1].imod = 0; xhci->intr[VAR_1].erstsz = 0; xhci->intr[VAR_1].erstba_low = 0; xhci->intr[VAR_1].erstba_high = 0; xhci->intr[VAR_1].erdp_low = 0; xhci->intr[VAR_1].erdp_high = 0; xhci->intr[VAR_1].msix_used = 0; xhci->intr[VAR_1].er_ep_idx = 0; xhci->intr[VAR_1].er_pcs = 1; xhci->intr[VAR_1].er_full = 0; xhci->intr[VAR_1].ev_buffer_put = 0; xhci->intr[VAR_1].ev_buffer_get = 0; } xhci->mfindex_start = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); xhci_mfwrap_update(xhci); }