Revision d0539307
b/hw/usb-ehci.c | ||
---|---|---|
1437 | 1437 |
int again = 0; |
1438 | 1438 |
uint32_t entry = ehci_get_fetch_addr(ehci, async); |
1439 | 1439 |
|
1440 |
#if EHCI_DEBUG == 0 |
|
1441 |
if (qemu_get_clock_ns(vm_clock) / 1000 >= ehci->frame_end_usec) { |
|
1442 |
if (async) { |
|
1443 |
DPRINTF("FETCHENTRY: FRAME timer elapsed, exit state machine\n"); |
|
1444 |
goto out; |
|
1445 |
} else { |
|
1446 |
DPRINTF("FETCHENTRY: WARNING " |
|
1447 |
"- frame timer elapsed during periodic\n"); |
|
1448 |
} |
|
1449 |
} |
|
1450 |
#endif |
|
1451 | 1440 |
if (entry < 0x1000) { |
1452 | 1441 |
DPRINTF("fetchentry: entry invalid (0x%08x)\n", entry); |
1453 | 1442 |
ehci_set_state(ehci, async, EST_ACTIVE); |
... | ... | |
1952 | 1941 |
} |
1953 | 1942 |
|
1954 | 1943 |
ehci_set_state(ehci, async, EST_WAITLISTHEAD); |
1955 |
/* fall through */ |
|
1956 |
|
|
1957 |
case EST_FETCHENTRY: |
|
1958 |
/* fall through */ |
|
1959 |
|
|
1960 |
case EST_EXECUTING: |
|
1961 | 1944 |
ehci_advance_state(ehci, async); |
1962 | 1945 |
break; |
1963 | 1946 |
|
... | ... | |
2010 | 1993 |
ehci_advance_state(ehci, async); |
2011 | 1994 |
break; |
2012 | 1995 |
|
2013 |
case EST_EXECUTING: |
|
2014 |
DPRINTF("PERIODIC state adv for executing\n"); |
|
2015 |
ehci_advance_state(ehci, async); |
|
2016 |
break; |
|
2017 |
|
|
2018 | 1996 |
default: |
2019 | 1997 |
/* this should only be due to a developer mistake */ |
2020 | 1998 |
fprintf(stderr, "ehci: Bad periodic state %d. " |
... | ... | |
2063 | 2041 |
if (frames - i > 10) { |
2064 | 2042 |
skipped_frames++; |
2065 | 2043 |
} else { |
2066 |
// TODO could this cause periodic frames to get skipped if async |
|
2067 |
// active? |
|
2068 |
if (ehci_get_state(ehci, 1) != EST_EXECUTING) { |
|
2069 |
ehci_advance_periodic_state(ehci); |
|
2070 |
} |
|
2044 |
ehci_advance_periodic_state(ehci); |
|
2071 | 2045 |
} |
2072 | 2046 |
|
2073 | 2047 |
ehci->last_run_usec += FRAME_TIMER_USEC; |
... | ... | |
2082 | 2056 |
/* Async is not inside loop since it executes everything it can once |
2083 | 2057 |
* called |
2084 | 2058 |
*/ |
2085 |
if (ehci_get_state(ehci, 0) != EST_EXECUTING) { |
|
2086 |
ehci_advance_async_state(ehci); |
|
2087 |
} |
|
2059 |
ehci_advance_async_state(ehci); |
|
2088 | 2060 |
|
2089 | 2061 |
qemu_mod_timer(ehci->frame_timer, expire_time); |
2090 | 2062 |
} |
Also available in: Unified diff