Revision 16a2dee6 hw/usb-ehci.c

b/hw/usb-ehci.c
373 373
    target_phys_addr_t mem_base;
374 374
    int mem;
375 375
    int num_ports;
376

  
377
    /* properties */
378
    uint32_t freq;
379
    uint32_t maxframes;
380

  
376 381
    /*
377 382
     *  EHCI spec version 1.0 Section 2.3
378 383
     *  Host Controller Operational Registers
......
2048 2053

  
2049 2054

  
2050 2055
    t_now = qemu_get_clock_ns(vm_clock);
2051
    expire_time = t_now + (get_ticks_per_sec() / FRAME_TIMER_FREQ);
2056
    expire_time = t_now + (get_ticks_per_sec() / ehci->freq);
2052 2057
    if (expire_time == t_now) {
2053 2058
        expire_time++;
2054 2059
    }
......
2073 2078
            ehci->sofv &= 0x000003ff;
2074 2079
        }
2075 2080

  
2076
        if (frames - i > 10) {
2081
        if (frames - i > ehci->maxframes) {
2077 2082
            skipped_frames++;
2078 2083
        } else {
2079 2084
            ehci_advance_periodic_state(ehci);
......
2146 2151
    .device_id    = PCI_DEVICE_ID_INTEL_82801D,
2147 2152
    .revision     = 0x10,
2148 2153
    .class_id     = PCI_CLASS_SERIAL_USB,
2154
    .qdev.props   = (Property[]) {
2155
        DEFINE_PROP_UINT32("freq",      EHCIState, freq, FRAME_TIMER_FREQ),
2156
        DEFINE_PROP_UINT32("maxframes", EHCIState, maxframes, 128),
2157
        DEFINE_PROP_END_OF_LIST(),
2158
    },
2149 2159
};
2150 2160

  
2151 2161
static int usb_ehci_initfn(PCIDevice *dev)

Also available in: Unified diff