static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,

                          int num_ports, int devfn,

                          qemu_irq irq, enum ohci_type type,

                          const char *name, uint32_t localmem_base)

{

    int i;



    if (usb_frame_time == 0) {

#ifdef OHCI_TIME_WARP

        usb_frame_time = get_ticks_per_sec();

        usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000);

#else

        usb_frame_time = muldiv64(1, get_ticks_per_sec(), 1000);

        if (get_ticks_per_sec() >= USB_HZ) {

            usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ);

        } else {

            usb_bit_time = 1;

        }

#endif

        dprintf("usb-ohci: usb_bit_time=%" PRId64 " usb_frame_time=%" PRId64 "\n",

                usb_frame_time, usb_bit_time);

    }



    ohci->mem = cpu_register_io_memory(ohci_readfn, ohci_writefn, ohci);

    ohci->localmem_base = localmem_base;

    ohci->name = name;



    ohci->irq = irq;

    ohci->type = type;



    usb_bus_new(&ohci->bus, dev);

    ohci->num_ports = num_ports;

    for (i = 0; i < num_ports; i++) {

        usb_register_port(&ohci->bus, &ohci->rhport[i].port, ohci, i, ohci_attach);

    }



    ohci->async_td = 0;

    qemu_register_reset(ohci_reset, ohci);

    ohci_reset(ohci);

}

static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,

                          int num_ports, int devfn,

                          qemu_irq irq, enum ohci_type type,

                          const char *name, uint32_t localmem_base)

{

    int i;



    if (usb_frame_time == 0) {

#ifdef OHCI_TIME_WARP

        usb_frame_time = get_ticks_per_sec();

        usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000);

#else

        usb_frame_time = muldiv64(1, get_ticks_per_sec(), 1000);

        if (get_ticks_per_sec() >= USB_HZ) {

            usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ);

        } else {

            usb_bit_time = 1;

        }

#endif

        dprintf("usb-ohci: usb_bit_time=%" PRId64 " usb_frame_time=%" PRId64 "\n",

                usb_frame_time, usb_bit_time);

    }



    ohci->mem = cpu_register_io_memory(ohci_readfn, ohci_writefn, ohci);

    ohci->localmem_base = localmem_base;

    ohci->name = name;



    ohci->irq = irq;

    ohci->type = type;



    usb_bus_new(&ohci->bus, dev);

    ohci->num_ports = num_ports;

    for (i = 0; i < num_ports; i++) {

        usb_register_port(&ohci->bus, &ohci->rhport[i].port, ohci, i, ohci_attach);

    }



    ohci->async_td = 0;

    qemu_register_reset(ohci_reset, ohci);

    ohci_reset(ohci);

}

static void FUNC_0(OHCIState *VAR_0, DeviceState *VAR_1,

                          int VAR_2, int VAR_3,

                          qemu_irq VAR_4, enum ohci_type VAR_5,

                          const char *VAR_6, uint32_t VAR_7)

{

    int VAR_8;



    if (usb_frame_time == 0) {

#ifdef OHCI_TIME_WARP

        usb_frame_time = get_ticks_per_sec();

        usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000);

#else

        usb_frame_time = muldiv64(1, get_ticks_per_sec(), 1000);

        if (get_ticks_per_sec() >= USB_HZ) {

            usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ);

        } else {

            usb_bit_time = 1;

        }

#endif

        dprintf("usb-VAR_0: usb_bit_time=%" PRId64 " usb_frame_time=%" PRId64 "\n",

                usb_frame_time, usb_bit_time);

    }



    VAR_0->mem = cpu_register_io_memory(ohci_readfn, ohci_writefn, VAR_0);

    VAR_0->VAR_7 = VAR_7;

    VAR_0->VAR_6 = VAR_6;



    VAR_0->VAR_4 = VAR_4;

    VAR_0->VAR_5 = VAR_5;



    usb_bus_new(&VAR_0->bus, VAR_1);

    VAR_0->VAR_2 = VAR_2;

    for (VAR_8 = 0; VAR_8 < VAR_2; VAR_8++) {

        usb_register_port(&VAR_0->bus, &VAR_0->rhport[VAR_8].port, VAR_0, VAR_8, ohci_attach);

    }



    VAR_0->async_td = 0;

    qemu_register_reset(ohci_reset, VAR_0);

    ohci_reset(VAR_0);

}

static void FUNC_0(OHCIState *VAR_0, DeviceState *VAR_1,
int VAR_2, int VAR_3,
qemu_irq VAR_4, enum ohci_type VAR_5,
const char *VAR_6, uint32_t VAR_7)
{ int VAR_8; if (usb_frame_time == 0) { #ifdef OHCI_TIME_WARP
usb_frame_time = get_ticks_per_sec(); usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000); #else
usb_frame_time = muldiv64(1, get_ticks_per_sec(), 1000); if (get_ticks_per_sec() >= USB_HZ) { usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ); } else { usb_bit_time = 1; } #endif
dprintf("usb-VAR_0: usb_bit_time=%" PRId64 " usb_frame_time=%" PRId64 "\n",
usb_frame_time, usb_bit_time); } VAR_0->mem = cpu_register_io_memory(ohci_readfn, ohci_writefn, VAR_0); VAR_0->VAR_7 = VAR_7; VAR_0->VAR_6 = VAR_6; VAR_0->VAR_4 = VAR_4; VAR_0->VAR_5 = VAR_5; usb_bus_new(&VAR_0->bus, VAR_1); VAR_0->VAR_2 = VAR_2; for (VAR_8 = 0; VAR_8 < VAR_2; VAR_8++) { usb_register_port(&VAR_0->bus, &VAR_0->rhport[VAR_8].port, VAR_0, VAR_8, ohci_attach); } VAR_0->async_td = 0; qemu_register_reset(ohci_reset, VAR_0); ohci_reset(VAR_0); }