Commit graph

24 commits

Author SHA1 Message Date
aliguori 54f254f973 uhci: rewrite UHCI emulator, fully async operation with multiple outstanding transactions (Max Krasnyansky)
This is esentially a re-write of the QEMU UHCI layer. My initial goal
was to support fully async operation with multiple outstanding async
transactions. Along the way I realized that I can greatly simplify
and cleanup the overall logic. There was a lot of duplicate and confusing
code in the UHCI data structure parsing and other places.
We were actually violating UHCI spec in handling async ISOC transaction
(host controller is not supposed to write into the frame pointer).

The reason I wanted to support fully async operation is because current
synchronous version is unusable with most devices exported from host
(via usb-linux.c). Transactions take a long time and the whole VM becomes
slow as hell.

Current async support is very rudimentory and for the most part
non-functional. Single transaction at a time is simply not enough. I have
a device for which XP driver submits both IN and OUT packets at the same
time. IN packet always times out unless OUT packet makes it to the device.
Hence we must be able to process both in order for that device to work.

The new code is backwards compatible and was first tested agains original
synchronous usb-linux.c and builtin usb devices like tablet which is also
synchronous. Rewrite of the usb-linux.c is coming up next.

Async support was tested against various XP versions (ie XP, SP2, SP3) and
a bunch of different USB devices: serial port controllers, mice, keyboard,
JTAG dongles (from Xilinx and Altera).

ISOC support was only lighly tested and needs more work. It's not any worse
than current code though.

UHCI parser changes are probably somewhat hard to review without the
understanding of the UHCI spec.
The async design should be fairly easy to follow. Basically we have a list
of async objects for each pending transfer. Async objects are tagged with
the original TD (transfer descriptor) address and token. We now support
unlimited number of outstanding isoc and one outstanding bulk/intr/ctrl
transfer per QH (queue head). UHCI spec does not have a clear protocol for
the cancelation of the trasfer requests. Driver can yank out TDs on any
frame boundary. In oder to handle that I added somewhat fancy TD validation
logic logic to avoid unnecessary cancelations.

Signed-off-by: Max Krasnyansky <maxk@kernel.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5050 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21 19:30:31 +00:00
ths 60fe76f386 Fix wrong signedness, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-16 03:02:09 +00:00
pbrook 87ecb68bdf Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17 17:14:51 +00:00
bellard 1e4146791b removed unused code
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3609 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-11 19:46:37 +00:00
balrog b9dc033c0d USB iso transfers support for the linux redirector and for UHCI, by Arnon Gilboa.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3328 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-04 22:47:34 +00:00
ths 3b46e62427 find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17 08:09:54 +00:00
ths 5fafdf24ef find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16 21:08:06 +00:00
pbrook 117b3ae6e6 Implement HID idle mode (avoids flooding guest with useless updates).
Fix UHCI NACK bug.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3157 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-09 21:16:01 +00:00
ths afcc3cdfc4 Use the correct PCI IDs for Malta.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2945 c046a42c-6fe2-441c-8c8c-71466251a162
2007-06-06 16:26:14 +00:00
pbrook d537cf6c86 Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-07 18:14:41 +00:00
ths 96217e315d Basic USB device resume (root hub only), by Lonnie Mendez.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2449 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-22 20:21:33 +00:00
ths 8182266352 Fix USB buffer size, by Herbert Xu.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2328 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-17 23:08:17 +00:00
pbrook 4d611c9a2f SCSI and USB async IO support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2107 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-12 01:04:27 +00:00
pbrook 6106487019 Fix USB root hub hotplugging.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1931 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-22 17:17:06 +00:00
pbrook 0d92ed3022 OHCI USB host emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1928 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-21 16:30:15 +00:00
pbrook 502a53952d Rearrange PCI host emulation code.
Add ARM PCI emulation.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1916 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-13 16:11:23 +00:00
bellard 467d409f7e fix for HCHALTED status bit
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1852 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-25 21:01:19 +00:00
bellard 52328140e2 HCHALTED status bit handling (Lonnie Mendez)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1850 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-24 21:38:50 +00:00
pbrook d80cfb3f70 Add missing break statement.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1785 c046a42c-6fe2-441c-8c8c-71466251a162
2006-03-11 21:46:12 +00:00
pbrook 38ca0f6dee Tweak UHCI device settings. Ignore host root hubs.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1779 c046a42c-6fe2-441c-8c8c-71466251a162
2006-03-11 18:03:38 +00:00
bellard 5e9ab4c493 USB reset typo (Lonnie Mendez)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1625 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-19 17:43:37 +00:00
bellard a594cfbf3e USB user interface
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1603 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-06 16:13:29 +00:00
bellard f04308e452 same PCI parameters as PIIX3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1600 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-05 17:22:48 +00:00
bellard bb36d4708b initial USB support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1597 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-05 14:22:28 +00:00