Statistics
| Branch: | Revision:

root / hw / usb-ehci.c @ 4e4fa398

History | View | Annotate | Download (68 kB)

# Date Author Comment
40021f08 01/27/2012 06:50 pm Anthony Liguori

pci: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <>

e855761c 01/27/2012 06:50 pm Anthony Liguori

qdev: prepare source tree for code conversion

These are various small stylistic changes which help make things more
consistent such that the automated conversion script can be simpler.

It's not necessary to agree or disagree with these style changes because all...

25d5de7d 01/17/2012 10:44 am Gerd Hoffmann

usb: link packets to endpoints not devices

Add USBEndpoint for the control endpoint to USBDevices. Link async
packets to the USBEndpoint instead of the USBDevice.

Signed-off-by: Gerd Hoffmann <>

4bf80119 12/12/2011 07:16 pm David Gibson

Remove unnecessary casts from PCI DMA code in usb-ehci

This patch removes some unnecessary casts in the usb-ehci device,
introduced by commit 68d553587c0aa271c3eb2902921b503740d775b6
'usb-ehci: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <>...

335b8d20 11/23/2011 05:24 pm Gerd Hoffmann

usb-ehci: add register names

The mmio register name list only had the names for four port status
registers. We emulate a EHCI adapter with six ports though, the last
two ones are listed as "unknown" in traces. Fix it.

Signed-off-by: Gerd Hoffmann <>

aac882e7 11/23/2011 05:24 pm Gerd Hoffmann

usb-ehci: codestyle fixups

Signed-off-by: Gerd Hoffmann <>

b2467216 11/21/2011 04:32 pm Gerd Hoffmann

ehci: add assert

Coverity thinks q could be NULL there and warns.
I believe it can't be NULL there.
Add assert to prove it.

Signed-off-by: Gerd Hoffmann <>

68d55358 11/01/2011 11:52 pm David Gibson

usb-ehci: Use PCI DMA stub functions

This updates the usb-ehci device emulation to use the explicit PCI DMA
wrapper to initialize its scatter/gathjer structure. This means this
driver should not need further changes when the sglist interface is
extended to support IOMMUs....

e0b8e72d 10/13/2011 01:58 pm Gerd Hoffmann

usb: fix port reset

commit 891fb2cd4592b6fe76106a69e0ca40efbf82726a removed the implicit
detach before (re-)attaching in usb_attach(). Some usb host controllers
used that behavior though to do a port reset by a detach+attach
sequence.

This patch establishes old behavior by adding a new usb_reset() function...

817e0b6f 09/19/2011 09:22 pm Michael S. Tsirkin

pci: interrupt pin documentation update

Fix up some erroneous comments in code:
interrupt pins are named A-D, the
interrupt pin register is always readonly
and isn't zeroed out on reset.

Signed-off-by: Michael S. Tsirkin <>

891fb2cd 09/07/2011 10:58 am Gerd Hoffmann

usb: claim port at device initialization time.

This patch makes qemu assign a port when creating the device, not when
attaching it. For most usb devices this isn't a noticable difference
because they are in attached state all the time.

The change affects usb-host devices which live in detached state while...

2fe80192 09/07/2011 10:58 am Gerd Hoffmann

usb-ehci: handle siTDs

This patch adds code to do minimal siTD handling, which is basically
just following the next pointer. This is good enougth to handle the
inactive siTDs used by FreeBSD. Active siTDs are skipped too as we
don't have split transfer support in qemu, additionally a warning is...

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

e57964f5 08/08/2011 06:22 pm Avi Kivity

ehci: convert to memory API

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

e824b2cc 08/08/2011 06:22 pm Avi Kivity

pci: rename pci_register_bar_region() to pci_register_bar()

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

0ce668bc 08/04/2011 04:51 pm Gerd Hoffmann

ehci: iovec support, remove buffer

Map guest memory and pass on a direct pointer instead of copying
the bits to a indirect buffer. EHCI transfer descriptors can
reference multiple (physical guest) pages so we'll actually start
seeing usb packets wich carry iovec with more than one element....

4f4321c1 08/04/2011 04:51 pm Gerd Hoffmann

usb: use iovecs in USBPacket

Zap data pointer from USBPacket, add a QEMUIOVector instead.
Add a bunch of helper functions to manage USBPacket data.
Switch over users to the new interface.

Note that USBPacket->len was used for two purposes: First to
pass in the buffer size and second to return the number of...

9490fb06 07/20/2011 03:49 pm Gerd Hoffmann

ehci doesn't support migration

Signed-off-by: Gerd Hoffmann <>

3631e6c8 07/05/2011 04:09 pm Hans de Goede

usb: Move (initial) call of usb_port_location to usb_fill_port

Cleanup / preparation patch for companion controller support. Note that
as a "side-effect" this patch also fixes the milkymist-softusb controller
not having a port_location set for its ports....

d47e59b8 07/05/2011 04:09 pm Hans de Goede

usb: Make port wakeup and complete ops take a USBPort instead of a Device

This makes them consistent with the attach and detach ops, and in general
it makes sense to make portops take a port as argument. This also makes
adding support for a companion controller easier / cleaner....

4706ab6c 07/05/2011 04:09 pm Hans de Goede

usb: Replace device_destroy bus op with a child_detach port op

Note this fixes 2 things in one go, first of all the device_destroy bus
op should be a device_detach bus op, as pending async packets from the
device should be cancelled on detach not on destroy....

053f9fcf 07/05/2011 04:09 pm Hans de Goede

usb-ehci: drop unused num-ports state member

Signed-off-by: Hans de Goede <>
Signed-off-by: Gerd Hoffmann <>

c44fd61c 07/05/2011 04:09 pm Hans de Goede

usb-ehci: Connect Status bit is read only, don't allow changing it by the guest

Signed-off-by: Hans de Goede <>
Signed-off-by: Gerd Hoffmann <>

fbf9db64 07/05/2011 04:09 pm Hans de Goede

usb-ehci: cleanup port reset handling

Doing a usb_attach when dev is NULL will just result in the
port detach op getting called even though nothing was connected in
the first place.

Signed-off-by: Hans de Goede <>
Signed-off-by: Gerd Hoffmann <>

fbd97532 07/05/2011 04:09 pm Hans de Goede

usb-ehci: Fix handling of PED and PEDC port status bits

The PED bit should only be set for highspeed devices and the PEDC bit
should not be set on "normal" PED bit changes, only on io errors.

Signed-off-by: Hans de Goede <>
Signed-off-by: Gerd Hoffmann <>

a0a3167a 07/05/2011 04:09 pm Hans de Goede

usb-ehci: Add support for registering companion controllers

Signed-off-by: Hans de Goede <>
Signed-off-by: Gerd Hoffmann <>

5cc194ca 07/05/2011 04:09 pm Gerd Hoffmann

ehci: fix port count.

The ICH4 EHCI controller which we emulate has six ports not four.

Signed-off-by: Gerd Hoffmann <>

3028376e 07/05/2011 04:09 pm Gerd Hoffmann

ehci: add ich9 controller.

Signed-off-by: Gerd Hoffmann <>

16a2dee6 06/23/2011 12:28 pm Gerd Hoffmann

ehci: add freq + maxframes properties

Add properties for the wakeup rate and the max number of frames ehci
will process at once.

The wakeup rate defaults to 1000 which equals the usb frame rate. This
can be reduced to make qemu wake up less often when ehci is active....

adddecb1 06/23/2011 12:28 pm Gerd Hoffmann

ehci: switch to nanoseconds

Make ehci use nanoseconds everywhere.
Simplifies time calculations.

Signed-off-by: Gerd Hoffmann <>

fdba9594 06/22/2011 03:11 pm Anthony Liguori

Merge remote-tracking branch 'mst/for_anthony' into staging

Conflicts:
hw/usb-uhci.c

9047c0b4 06/15/2011 06:32 pm Michael S. Tsirkin

usb-ehci: move device/vendor/class id to qdev

Signed-off-by: Michael S. Tsirkin <>

4001f22f 06/14/2011 01:56 pm Brad Hards

usb: Use defines for serial bus release number register for EHCI

Signed-off-by: Brad Hards <>
Signed-off-by: Gerd Hoffmann <>

07771f6f 06/14/2011 01:56 pm Gerd Hoffmann

usb: cancel async packets on unplug

This patch adds USBBusOps struct with (for now) only a single callback
which is called when a device is about to be destroyed. The USB Host
adapters are implementing this callback and use it to cancel any async
requests which might be in flight before the device actually goes away....

d0539307 06/14/2011 01:56 pm Gerd Hoffmann

usb-ehci: drop EXECUTING checks.

The state machine doesn't stop in EXECUTING state any more when async
packets are in flight, so the checks are not needed any more and can
be dropped.

Also kick out the check for the frame timer. As we don't stop & sleep...

e654887f 06/14/2011 01:56 pm Gerd Hoffmann

usb-ehci: itd handling fixes.

This patch fixes a bunch of issues in the itd descriptor handling.
Most important fix is to handle transfers which cross page borders
correctly by looking up the address of the next page. Luckily the
linux uses physically contigous memory so the data used to hits the...

025b168c 06/14/2011 01:56 pm Gerd Hoffmann

usb-ehci: split trace calls to handle arg count limits

Signed-off-by: Gerd Hoffmann <>

ba7cb5a8 06/14/2011 01:56 pm Gerd Hoffmann

usb-ehci: fix offset writeback in ehci_buffer_rw

Two bugs at once:

First the mask is backwards, so the it used to keeps the offset and
clears the page address, which is not what we need when we update the
offset.

Second the offset calculation is wrong in case head isn't page aligned....

d2bd525f 06/14/2011 01:56 pm Gerd Hoffmann

usb-ehci: fix error handling.

Set the correct bits for nodev, stall and babble errors.
Raise errint irq. Fix state transition from WRITEBACK
to the next state.

Signed-off-by: Gerd Hoffmann <>

8e4faf3d 06/14/2011 01:56 pm Hans de Goede

ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6)

Signed-off-by: Gerd Hoffmann <>

8ac6d699 06/14/2011 01:56 pm Gerd Hoffmann

usb-ehci: multiqueue support

This patch adds support for keeping multiple queues going at the same
time. One slow device will not affect other devices any more.

The patch adds code to manage EHCIQueue structs. It also does a number
of changes to the state machine:...

f2c88dc1 06/14/2011 01:36 pm Gerd Hoffmann

usb-ehci: trace buffer copy

Add a trace point for buffer copies and drop the DPRINTF's.

No change in behavior.

Signed-off-by: Gerd Hoffmann <>

0122f472 06/14/2011 01:36 pm Gerd Hoffmann

usb-ehci: add queue data struct

Add EHCIQueue struct, move the fields needed to track the queue state
into that struct. Pass the new struct instead of ehci state down to
functions which handle the queue state. Lot of variable references have
changed due to that without an actual functional change....

439a97cc 06/14/2011 01:36 pm Gerd Hoffmann

usb-ehci: trace mmio and usbsts

This patch starts adding trace support to ehci. It traces
updates of the status register (USBSTS), mmio access and
controller reset.

It also adds functions to set and clear status register bits
and puts them in use everywhere....

26d53979 06/14/2011 01:36 pm Gerd Hoffmann

usb-ehci: trace state machine changes

Add functions to get and set the current state of the state machine,
add tracepoints there to trace state transitions. Add support for
traceing the queue heads and transfer descriptors as we look at them.

Drop a few DPRINTFs and all DPRINTF_ST lines, they are obsolete now....

dcbd0b5c 06/14/2011 01:36 pm Gerd Hoffmann

usb-ehci: trace port state

Trace usb port operations (attach, detach, reset),
drop a few obsolete DPRINTF's.

No change in behavior.

Signed-off-by: Gerd Hoffmann <>

c4f8e211 06/14/2011 01:36 pm Gerd Hoffmann

usb-ehci: improve mmio tracing

Add a separate tracepoint to log how register values change in response
to a mmio write. Especially useful for registers which have read-only
or clear-on-write bits in them.

No change in behavior.

Signed-off-by: Gerd Hoffmann <>

94527ead 05/26/2011 12:57 pm Gerd Hoffmann

usb: add ehci adapter

This patch finally merges the EHCI host adapter aka USB 2.0 support.

Based on the ehci bits collected @ git://git.kiszka.org/qemu.git ehci

EHCI has a long out-of-tree history. Project was started by Mark
Burkley, with contributions by Niels de Vos. David S. Ahern continued...