Statistics
| Branch: | Revision:

root / hw / usb / core.c @ afd347ab

History | View | Annotate | Download (21.6 kB)

# Date Author Comment
6735d433 01/07/2013 01:57 pm Hans de Goede

usb: Fix usb_ep_find_packet_by_id

usb_ep_find_packet_by_id mistakenly only checks the first packet and if that
is not a match, keeps trying the first packet! This patch fixes this.

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

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

be41efde 12/04/2012 03:41 pm Hans de Goede

usb: Don't allow USB_RET_ASYNC for interrupt packets

It is tempting to use USB_RET_ASYNC for interrupt packets, rather then the
current NAK + polling approach, but this causes issues for migration, as
an async completed packet will not getting written back to guest memory until...

9a77a0f5 11/08/2012 07:41 pm Hans de Goede

usb: split packet result into actual_length + status

Since with the ehci and xhci controllers a single packet can be larger
then maxpacketsize, it is possible for the result of a single packet
to be both having transferred some data as well as the transfer to have...

a552a966 11/01/2012 04:17 pm Hans de Goede

usb: Add packet combining functions

Currently we only do pipelining for output endpoints, since to properly
support short-not-ok semantics we can only have one outstanding input
packet. Since the ehci and uhci controllers have a limited per td packet
size guests will split large input transfers to into multiple packets,...

0cae7b1a 10/25/2012 10:08 am Hans de Goede

usb: Move clearing of queue on halt to the core

hcds which queue up more then one packet at once (uhci, ehci and xhci),
must clear the queue after an error which has caused the queue to halt.

Currently this is handled as a special case inside the hcd code, this...

6ba43f1f 10/25/2012 10:08 am Hans de Goede

usb: Move short-not-ok handling to the core

After a short-not-ok packet ending short, we should not advance the queue.
Move enforcing this to the core, rather then handling it in the hcd code.

This may result in the queue now actually containing multiple input packets...

a6fb2ddb 10/25/2012 10:08 am Hans de Goede

usb: Add an int_req flag to USBPacket

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

aaac7434 10/25/2012 10:08 am Hans de Goede

usb: Enforce iso endpoints never returing USB_RET_ASYNC

ehci was already testing for this, and we depend in various places
on no devices doing this, so lets move the check for this to the
usb core.

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

d0ff81b8 10/25/2012 10:08 am Hans de Goede

usb: Rename __usb_packet_complete to usb_packet_complete_one

And make it available for use outside of core.c

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

36dfe324 10/25/2012 10:08 am Hans de Goede

usb: Add USB_RET_ADD_TO_QUEUE packet result code

This can be used by usb-device code which wishes to process an entire endpoint
queue at once, to do this the usb-device code returns USB_RET_ADD_TO_QUEUE
from its handle_data class method and defines a flush_ep_queue class method...

c13a9e61 09/11/2012 08:42 am Hans de Goede

usb-core: Add a usb_ep_find_packet_by_id() helper function

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

9c1f6765 09/11/2012 08:42 am Hans de Goede

usb-core: Allow the first packet of a pipelined ep to complete immediately

This can happen with usb-redir live-migration when the packet gets re-queued
after the migration and the original queuing from the migration source side
has already finished.

Signed-off-by: Hans de Goede <>...

cc409974 09/11/2012 08:42 am Hans de Goede

usb-core: Don't set packet state to complete on a nak

This way the hcd can re-use the same packet to retry without needing
to re-init it.

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

e983395d 08/31/2012 12:57 pm Gerd Hoffmann

usb: unique packet ids

This patch adds IDs to usb packets. Those IDs are (a) supposed to be
unique for the lifecycle of a packet (from packet setup until the packet
is either completed or canceled) and (b) stable across migration.

uhci, ohci, ehci and xhci use the guest physical address of the transfer...

0132b4b6 08/31/2012 12:55 pm Hans de Goede

usb: Halt ep queue en cancel pending packets on a packet error

For controllers which queue up more then 1 packet at a time, we must halt the
ep queue, and inside the controller code cancel all pending packets on an
error.

There are multiple reasons for this:...

c19537a1 08/16/2012 09:39 am Gerd Hoffmann

usb: async control xfer fixup

Need to clear p->result after copying setup data using usb_packet_copy()
because we'll reuse the USBPacket for the data transfer.

Signed-off-by: Gerd Hoffmann <>

23797df3 07/09/2012 08:35 pm Anthony Liguori

Merge remote-tracking branch 'mjt/mjt-iov2' into staging

  • mjt/mjt-iov2:
    rewrite iov_send_recv() and move it to iov.c
    cleanup qemu_co_sendv(), qemu_co_recvv() and friends
    export iov_send_recv() and use it in iov_send() and iov_recv()
    rename qemu_sendv to iov_send, change proto and move declarations to iov.h...
7c37e6a4 07/09/2012 12:59 pm Gerd Hoffmann

usb: fix interface initialization

zero is a valid interface number, so don't use it when resetting the
endpoints.

Signed-off-by: Gerd Hoffmann <>

19deaa08 07/09/2012 12:59 pm Gerd Hoffmann

usb: split endpoint init and reset

Create a new usb_ep_reset() function to reset endpoint state, without
re-initialiting the queues, so we don't unlink in-flight packets just
because usb-host has to re-parse the descriptor tables.

Signed-off-by: Gerd Hoffmann <>

dcf6f5e1 06/07/2012 07:43 pm Michael Tokarev

change iov_* function prototypes to be more appropriate

Reorder arguments to be more natural, readable and
consistent with other iov_* functions, and change
argument names, from:
iov_from_buf(iov, iov_cnt, buf, iov_off, size)
to
iov_from_buf(iov, iov_cnt, offset, buf, bytes)...

0cc6a0f1 04/26/2012 01:21 pm Gerd Hoffmann

usb-ehci: add missing usb_packet_init() call

Signed-off-by: Gerd Hoffmann <>

f5bf14bf 04/17/2012 11:23 am Gerd Hoffmann

usb_packet_set_state: handle p->ep == NULL

usb_packet_set_state can be called with p->ep = NULL. The tracepoint
there tries to log endpoint information, which leads to a segfault.
This patch makes usb_packet_set_state handle the NULL pointer properly.

Signed-off-by: Gerd Hoffmann <>

f1ae32a1 03/13/2012 11:15 am Gerd Hoffmann

usb: the big rename

Reorganize usb source files. Create a new hw/usb/ directory and move
all usb source code to that place. Also make filenames a bit more
descriptive. Host adapters are prefixed with "hch-" now, usb device
emulations are prefixed with "dev-". Fixup paths Makefile and include...

5ac2731c 03/13/2012 11:15 am Gerd Hoffmann

usb: improve packet state sanity checks

Add a new function to check whenever the packet state is as expected,
log more informations in case it isn't.

Signed-off-by: Gerd Hoffmann <>