Statistics
| Branch: | Revision:

root / hw / usb / host-linux.c @ a8aec295

History | View | Annotate | Download (54.4 kB)

# Date Author Comment
c7e775e4 05/12/2013 12:25 pm Dong Xu Wang

remove double semicolons

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Michael Tokarev <>

2b2325ff 04/16/2013 01:04 pm Gerd Hoffmann

use libusb for usb-host

Reimplement usb-host on top of libusb.
Reasons to do this:

(1) Largely rewritten from scratch, nice opportunity to kill historical
cruft.
(2) Offload usbfs handling to libusb.
(3) Have a single portable code base instead of bsd + linux variants....
4075975d 02/19/2013 01:30 pm Gerd Hoffmann

usb-host: move legacy cmd line bits

The code handling the "-usbdevice host:..." legacy command line
syntax is moved to the new hw/usb/host-legacy.c file.

Signed-off-by: Gerd Hoffmann <>

1a3973b3 02/19/2013 01:30 pm Gerd Hoffmann

usb-host: remove usb_host_device_close

Nobody implements that anyway.

Signed-off-by: Gerd Hoffmann <>

84f2d0ea 01/17/2013 02:24 pm Wenchao Xia

HMP: add QDict to info callback handler

This patch change all info call back function to take
additional QDict * parameter, which allow those command
take parameter. Now it is set to NULL at default case.

Signed-off-by: Wenchao Xia <>...

46635308 01/14/2013 01:47 pm Markus Armbruster

usb-host: Drop superfluous null test from usb_host_auto_scan()

Coverity points out that port is later passed to usb_host_open(),
which dereferences it. It actually can't be null: it always points to
usb_host_scan()'s auto port[]. Drop the superfluous port == NULL...

03607847 01/14/2013 01:47 pm Markus Armbruster

usb-host: Initialize dev->port the obviously safe way

Coverity worries the strcpy() could overrun the destination. It
can't, because the source always points to usb_host_scan()'s auto
port[], which has the same size. Use pstrcpy() anyway, to hush the
checker....

8c43a6f0 01/10/2013 11:11 pm Andreas Färber

Make all static TypeInfos const

Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all
types natively through QEMU Object Model), TypeInfo as used in
the common, non-iterative pattern is no longer amended with information
and should therefore be const....

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

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

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

83c9089e 12/19/2012 09:31 am Paolo Bonzini

monitor: move include files to include/monitor/

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...

537e8f1a 11/16/2012 12:27 pm Jan Kiszka

usb: host-linux: Ignore parsing errors of the device descriptors

The Linux is more tolerant here as well: Just stop parsing the device
descriptors when an error is detected but do not reset what was found
so far. This allows to run buggy devices with partially invalid...

8c908fca 11/16/2012 12:27 pm Gerd Hoffmann

usb-host: update tracing

Now that we have separate status and length fields in USBPacket
update the completion tracepoint to log both.

Signed-off-by: Gerd Hoffmann <>

71e0aa39 11/16/2012 12:27 pm Gerd Hoffmann

usb-host: fix splitted transfers

USBPacket->actual_length wasn't updated correctly for USBPackets
splitted into multiple urbs. Fix it.

Signed-off-by: Gerd Hoffmann <>

c06c68c9 11/16/2012 12:27 pm Gerd Hoffmann

usb-host: scan for usb devices when the vm starts

Commit a844ed842d9a9d929645c09ae0f52f753d7a02e0 leads to usb-host
detecting devices not right after qemu startup because the guest
isn't running yet. Instead they are found on the first of the
regular usb device poll runs. Which is too late for seabios to see...

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...

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...

63587e31 09/12/2012 09:09 am Gerd Hoffmann

usb-host: allow emulated (non-async) control requests without USBPacket

xhci needs this for USB_REQ_SET_ADDRESS due to the way
usb addressing is handled by the xhci hardware.

Signed-off-by: Gerd Hoffmann <>

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 <>

c32da151 07/09/2012 12:59 pm Gerd Hoffmann

usb-host: add trace events for iso xfers

Replace iso transfer fprintf's with trace points. Also rename existing
tracepoints so they all match usb_host_iso_*.

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 <>

a844ed84 06/20/2012 03:46 pm Gerd Hoffmann

usb-host: attach only to running guest

Signed-off-by: Gerd Hoffmann <>

a229c053 06/20/2012 03:46 pm Gerd Hoffmann

usb-host: live migration support

Signed-off-by: Gerd Hoffmann <>

a2498f76 05/14/2012 11:22 am Gerd Hoffmann

usb-host: handle guest-issued clear halt

Most important here is to update our internal endpoint state so we know
the endpoint isn't in halted state any more. Without this usb-host
tries to clear halt again with the next data transfer submitted. Doing
this twice is (a) not correct and (b) confuses some usb devices,...

818d59dc 04/26/2012 01:21 pm Gerd Hoffmann

usb-host: don't dereference invalid iovecs

usb-host assumes the first iovec element is always valid.
In case of a zero-length packet this isn't true though.

Signed-off-by: Gerd Hoffmann <>

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

usb-host: fix zero-length packets

usb-host optimizes away zero-length packets by not entering the
processing loop at all. Which isn't correct, we should submit a
zero-length urb to the host devicein that case. This patch makes
sure we run the processing loop at least once....

96dd9aac 04/17/2012 11:23 am Gerd Hoffmann

usb-host: rewrite usb_linux_update_endp_table

This patch carries a complete rewrite of the usb descriptor parser.
Changes / improvements:

  • We are using the USBDescriptor struct instead of hard-coded offsets
    now to access descriptor data.
  • (debug) printfs are all gone, tracepoints have been added instead....
65bb3a5c 04/17/2012 11:23 am Gerd Hoffmann

Add bootindex support to usb-host and usb-redir

When passing through a usb pendrive seabios will present it in the F12
boot menu and will happily boot from it.

This patch adds bootorder support so you can even make it the default
boot device.

Signed-off-by: Gerd Hoffmann <>

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

usb-host: trace emulated requests

Add tracepoint to track completion of emulated control requests.

Signed-off-by: Gerd Hoffmann <>

6aebe407 04/17/2012 11:23 am Gerd Hoffmann

usb-host: trace canceled requests

Add tracepoints to track canceled requests.

Signed-off-by: Gerd Hoffmann <>

19b89252 04/17/2012 11:23 am Gerd Hoffmann

usb-host: add usb packet to request tracepoints

Add pointer to USBPacket to all tracepoints tracking requests to make it
easier to identify them when multiple requests are in flight.

Signed-off-by: Gerd Hoffmann <>

39c20577 04/17/2012 11:23 am Gerd Hoffmann

usb-host: add property to turn off pipelining

Add a property to usb-host to disable the bulk endpoint pipelining.

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...