Statistics
| Branch: | Revision:

root / usb-linux.c @ 753d11f2

History | View | Annotate | Download (57.3 kB)

# Date Author Comment
d6791578 09/07/2011 10:58 am Gerd Hoffmann

usb-host: tag as unmigratable

Signed-off-by: Gerd Hoffmann <>

c0e5750b 09/07/2011 10:58 am Gerd Hoffmann

usb-host: endpoint table fixup

USB Devices can have up to 15 IN and 15 OUT endpoints, not 15 endpoints
total. Move from one array to two arrays (one IN, one OUT) to maintain
the endpoint state.

ba9acab9 09/07/2011 10:58 am Gerd Hoffmann

usb-host: constify port

Signed-off-by: Gerd Hoffmann <>

0c402e5a 09/07/2011 10:58 am Gerd Hoffmann

usb-host: parse port in /proc/bus/usb/devices scan

Unfortunaly this is limited to root ports.

Signed-off-by: Gerd Hoffmann <>

9516bb47 09/07/2011 10:58 am Gerd Hoffmann

usb-host: claim port

When configured to pass through a specific host port (using hostbus and
hostport properties), try to claim the port if supported by the kernel.
That will avoid any kernel drivers binding to devices plugged into that
port. It will not stop any userspace apps (such as usb_modeswitch)...

40197c35 09/07/2011 10:50 am Gerd Hoffmann

usb-host: reapurb error report fix

Don't report errors on devices which are in disconnected
and closing state.

9b87e19b 09/07/2011 10:50 am Gerd Hoffmann

usb-host: fix halted endpoints

Two fixes for the price of one ;)

First, reinitialize the endpoint table after device reset.
This is needed anyway as the reset might have switched interfaces.
It also clears the endpoint halted state.

Second the CLEAR_HALT ioctl wants a unsigned int passed in as...

3ee886c5 09/07/2011 10:50 am Gerd Hoffmann

usb-host: limit open retries

Limit the number of times qemu tries to open host devices to three.
Reset error counter when the device goes away, after un-plugging and
re-plugging the device qemu will try again three times.

Signed-off-by: Gerd Hoffmann <>

eb7700bb 09/07/2011 10:50 am Gerd Hoffmann

usb-host: fix configuration tracking.

It is perfectly fine to leave the usb device in unconfigured state
(USBHostDevice->configuration == 0). Just do that and wait for the
guest to explicitly set a configuration. This is closer to what real
hardware does and it also simplifies the device initialization. There...

e6a2f500 09/07/2011 10:50 am Gerd Hoffmann

usb-host: start tracing support

Add a bunch of trace points to usb-linux.c Drop a bunch of DPRINTK's in
favor of the trace points. Also cleanup error reporting a bit while being
at it.

Signed-off-by: Gerd Hoffmann <>

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

b621bab4 08/04/2011 04:51 pm Gerd Hoffmann

usb-host: iovec support

Add full support for iovecs to usb-host. The code can split large
transfers into smaller ones already, we are using this to also split
requests at iovec borders.

Signed-off-by: Gerd Hoffmann <>

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

9e8dd451 07/23/2011 07:26 pm Jan Kiszka

notifier: Pass data argument to callback

This allows to pass additional information to the notifier callback
which is useful if sender and receiver do not share any other distinct
data structure.

Will be used first for the clock reset notifier.

Signed-off-by: Jan Kiszka <>...

fa19bf83 06/23/2011 12:28 pm Hans de Goede

usb: Proper error propagation for usb_device_attach errors

Signed-off-by: Gerd Hoffmann <>

ba3f9bfb 06/23/2011 12:28 pm Hans de Goede

usb: Add a speedmask to devices

This is used to indicate at which speed[s] the device can operate,
so that this can be checked to match the ports capabilities when it gets
attached to a bus.

Note that currently all usb1 emulated device claim to be fullspeed, this...

e4b17767 06/23/2011 12:28 pm Hans de Goede

usb-linux: allow "compatible" high speed devices to connect at fullspeed

Some usb2 highspeed devices, like usb-msd devices, work fine when redirected
to a usb1 virtual controller. Allow this to avoid the new speedhecks causing
regressions for users who do not enable the new experimental ehci code....

ca3a36cf 06/23/2011 11:18 am Gerd Hoffmann

usb-linux: add get_endp()

Add a helper function to get the endpoint data structure
and put it into use.

Signed-off-by: Gerd Hoffmann <>

b81bcd8a 06/23/2011 11:18 am Gerd Hoffmann

usb-linux: make iso urb count contigurable

Add a qdev property for the number of iso urbs which
usb-linux keeps in flight, so it can be configured at
runtime. Make it default to four (old hardcoded value
used to be three).

Signed-off-by: Gerd Hoffmann <>

82887262 06/23/2011 11:18 am Gerd Hoffmann

usb-linux: track inflight iso urb count

Track the number of iso urbs which are currently in flight.
Log a message in case the count goes down to zero. Also
warn in case many urbs are returned at the same time.

Signed-off-by: Gerd Hoffmann <>

3991c35e 06/14/2011 01:56 pm Hans de Goede

usb-linux: Get speed from sysfs rather then from the connectinfo ioctl

The connectinfo ioctl only differentiates between lo speed devices, and
all other speeds, where as we would like to know the real speed. The real
speed is available in sysfs so use that when available....

f264cfbf 06/14/2011 01:56 pm Hans de Goede

usb-linux: Teach about super speed

Signed-off-by: Gerd Hoffmann <>

61c1117f 06/14/2011 01:56 pm Hans de Goede

usb-linux: Don't do perror when errno is not set

Note that "op" also is not set, so before this change these error paths
would feed NULL to perror.

Signed-off-by: Gerd Hoffmann <>

130314f8 06/14/2011 01:56 pm Hans de Goede

usb-linux: Ensure devep != 0

So that we don't index endp_table with a negative index.

Signed-off-by: Gerd Hoffmann <>

97f86166 06/14/2011 01:56 pm Hans de Goede

usb-linux: Don't try to open the same device twice

If a user wants to redirect 2 identical usb sticks, in theory this is
possible by doing:
usb_add host:1234:5678
usb_add host:1234:5678

But this will lead to us trying to open the first stick twice, since we...

1f45a81b 06/14/2011 01:56 pm Gerd Hoffmann

usb-linux: only cleanup in host_close when host_open was successful.

f8ddbfbc 06/14/2011 01:56 pm Hans de Goede

usb-linux: Enlarge buffer for descriptors to 8192 bytes

1024 bytes is way to small, one hd UVC webcam I have over here has so
many resolutions its descriptors take op close to 4k. Hopefully 8k will
be enough for all devices.

Signed-off-by: Gerd Hoffmann <>

41c01ee7 06/14/2011 01:36 pm Gerd Hoffmann

usb-linux: catch ENODEV in more places.

Factor out disconnect code (called when a device disappears) to a
separate function. Add a check for ENODEV errno to a few more places
to make sure we notice disconnects.

Signed-off-by: Gerd Hoffmann <>

9bf0960a 06/08/2011 11:04 am Alexandre Raymond

Fix compilation warning due to missing header for sigaction (followup)

This patch removes all references to signal.h when qemu-common.h is included
as they become redundant.

Signed-off-by: Alexandre Raymond <>
Signed-off-by: Stefan Hajnoczi <>

eb5e680a 05/26/2011 12:55 pm Gerd Hoffmann

usb: move cancel callback to USBDeviceInfo

Remove the cancel callback from the USBPacket struct, move it over
to USBDeviceInfo. Zap usb_defer_packet() which is obsolete now.

Signed-off-by: Gerd Hoffmann <>

50b7963e 05/26/2011 12:55 pm Hans de Goede

usb-linux: use usb_generic_handle_packet()

Make the linux usb host passthrough code use the usb_generic_handle_packet()
function, rather then the curent DYI code. This removes 200 lines of almost
identical code.

Signed-off-by: Hans de Goede <>

5557d820 05/26/2011 12:55 pm Gerd Hoffmann

usb-linux: fix device path aka physical port handling

The device path isn't just a number. It specifies the physical port
the device is connected to and in case the device is connected via
usb hub you'll have two numbers there, like this: "5.1". The first...

9056a297 05/26/2011 12:55 pm Gerd Hoffmann

usb-linux: add hostport property

This patch adds a hostport property which allows to specify the host usb
devices to pass through by bus number and physical port. This means you
can basically hand over one (or more) of the usb plugs on your host to
the guest and whatever device is plugged in there will show up in the...

7a8fc83f 05/26/2011 12:55 pm Gerd Hoffmann

usb-linux: track aurbs in list

This patch adds code to track all async urbs in a linked list,
so we can find them without having to pass around a opaque
pointer to them. Prerequisite for the cleanups.

Signed-off-by: Gerd Hoffmann <>

227ebeb5 05/26/2011 12:55 pm Gerd Hoffmann

usb-linux: walk async urb list in cancel

Lookup async urbs which are to be canceled using the linked list
instead of the direct opaque pointer. There are two reasons we
are doing that: First, to avoid the opaque poiner to the callback,
which is needed for upcoming cleanups. Second, because we might...

71138531 05/26/2011 12:55 pm Gerd Hoffmann

usb-linux: split large xfers

Add support for splitting large transfers into multiple smaller ones.
This is needed for the upcoming EHCI emulation which allows guests
to submit requests up to 20k in size. The linux kernel allows 16k
max size though.

Based on a patch from David Ahern, see...

6dfcdccb 05/26/2011 12:55 pm Gerd Hoffmann

usb-linux: fix max_packet_size for highspeed.

Calculate the max packet size correctly. Only bits 0..11 specify the size,
bits 11+12 specify the number of (highspeed) microframes the endpoint wants
to use.

Signed-off-by: Gerd Hoffmann <>

0225e254 05/09/2011 05:18 pm Stefan Weil

usb-linux: Add missing break statement

cppcheck report:
usb-linux.c:661: warning: Redundant assignment of "len" in switch

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

13a9a0d3 05/04/2011 03:11 pm Gerd Hoffmann

usb: move complete callback to port ops

ed3a328d 05/04/2011 01:25 pm Hans de Goede

usb-linux: introduce a usb_linux_alt_setting function

The next patch in this series introduces multiple ways to get the
alt setting dependent upon usb_fs_type, it is cleaner to put this
into its own function.

Note that this patch also changes the assumed alt setting in case...

c43831fb 05/04/2011 01:25 pm Hans de Goede

usb-linux: Get the alt. setting from sysfs rather then asking the dev

At least one device I have lies when receiving a USB_REQ_GET_INTERFACE,
always returning 0 even if the alternate setting is different. This is
likely caused because in practice this control message is never used as...

060dc841 05/04/2011 01:25 pm Hans de Goede

usb-linux: Add support for buffering iso usb packets

Currently we are submitting iso packets to the host one at a time, as we
receive them from the emulated host controller. This has 2 problems:
1) If we were fast enough to submit every packet in time for the next host host...

a0b5fece 05/04/2011 01:25 pm Hans de Goede

usb-linux: Refuse packets for endpoints which are not in the usb descriptor

If an endpoint is not in the usb descriptor we've no idea what kind of
endpoint it is and thus how to handle it, refuse packages in this case.

Signed-off-by: Hans de Goede <>

975f2998 05/04/2011 01:25 pm Hans de Goede

usb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)

Refuse iso usb packets when then max packet size for the endpoint is 0,
this avoids an abort in usb_host_alloc_iso() caused by trying to qemu_malloc
a 0 bytes large buffer.

3a4854b3 05/04/2011 01:25 pm Hans de Goede

usb-linux: We only need to keep track of 15 endpoints

Currently we reserve room for endpoint data for 16 endpoints, but given
that we only use endpoint data for endpoints 1-15, and always index the
array with the endpoint-number - 1, 15 is enough.

Signed-off-by: Hans de Goede <>

bb6d5498 05/04/2011 01:25 pm Hans de Goede

usb-linux: Add support for buffering iso out usb packets

Extend the iso buffering code to also buffer iso out packets, this
fixes for example using usb speakers with usb redirection.

Signed-off-by: Hans de Goede <>

021730f7 04/16/2011 02:24 pm Brad Hards

usb: initialise data element in Linux USB_DISCONNECT ioctl

This isn't used, but leaving it empty causes valgrind noise.

Signed-off-by: Brad Hards <>
Signed-off-by: Stefan Hajnoczi <>

a0102082 04/16/2011 02:24 pm Brad Hards

usb: fix spelling errors in usb-linux.c

Signed-off-by: Brad Hards <>
Signed-off-by: Stefan Hajnoczi <>

7bd427d8 03/21/2011 10:23 am Paolo Bonzini

change all rt_clock references to use millisecond resolution accessors

This was done with:

sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \
$(git grep -l 'get_clock\>.*rt_clock' )
sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
0f5160d1 11/16/2010 10:35 pm Hans de Goede

usb-linux: Store devpath into USBHostDevice when usb_fs_type == USB_FS_SYS

This allows us to recreate the sysfspath used during scanning later
(which will be used in a later patch in this series).

Signed-off-by: Anthony Liguori <>

71d71bbd 11/16/2010 10:35 pm Hans de Goede

usb-linux: introduce a usb_linux_get_configuration function

The next patch in this series introduces multiple ways to get the
configuration dependent upon usb_fs_type, it is cleaner to put this
into its own function.

Signed-off-by: Anthony Liguori <>

2cc59d8c 11/16/2010 10:35 pm Hans de Goede

usb-linux: Get the active configuration from sysfs rather then asking the dev

Some devices seem to choke on receiving a USB_REQ_GET_CONFIGURATION ctrl msg
(witnessed with a digital picture frame usb id 1908:1320).
When usb_fs_type == USB_FS_SYS, the active configuration can be read directly...

b373a63a 06/30/2010 11:51 pm Shahar Havivi

Return usb device to host on exit

Signed-off-by: Shahar Havivi <>
Acked-by: Gerd Hoffmann <>
Signed-off-by: Aurelien Jarno <>

00ff227a 06/30/2010 11:51 pm Shahar Havivi

Return usb device to host on usb_del command

Signed-off-by: Shahar Havivi <>
Acked-by: Gerd Hoffmann <>
Signed-off-by: Aurelien Jarno <>

2791104c 05/03/2010 08:39 pm David Ahern

Changes to usb-linux to conform to coding style

Signed-off-by: David Ahern <>
Signed-off-by: Anthony Liguori <>

d4c4e6fd 04/25/2010 09:23 pm Blue Swirl

usb: remove dead assignments, spotted by clang analyzer

Value stored is never read.

Signed-off-by: Blue Swirl <>

ddbda432 03/19/2010 10:27 pm Anthony Liguori

Revert "usb-linux: remove unreachable default in switch statement"

This reverts commit 3c9c706c3b66d838942aba53c0d3fdcdf06c7423.

This breaks build (gcc 4.3.2):
CC usb-linux.o
cc1: warnings being treated as errors
/src/qemu/usb-linux.c: In function 'usb_linux_update_endp_table':...

3c9c706c 03/17/2010 05:41 pm Paul Bolle

usb-linux: remove unreachable default in switch statement

Signed-off-by: Paul Bolle <>
Signed-off-by: Anthony Liguori <>

4491e0f3 03/16/2010 05:55 pm Markus Armbruster

usb: Remove disabled monitor_printf() in usb_read_file()

The monitor_printf() reports failure. Printing is wrong, because the
caller tries various arguments, and expects the function to fail for
some or all.

Disabled since commit 26a9e82a. Remove it.

d0f2c4c6 02/07/2010 01:03 am malc

Do not use dprintf

dprintf is already claimed by POSIX1, and on at least one system
is implemented as a macro

[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html

Signed-off-by: malc <>

fd7a446f 02/06/2010 06:14 pm Christian Krause

usb-linux: increase buffer for USB control requests

The WLAN USB stick ZyXEL NWD271N (0586:3417) uses very large
usb control transfers of more than 2048 bytes which won't fit
into the buffer of the ctrl_struct. This results in an error message
"husb: ctrl buffer too small" and a non-working device....

b29a7def 02/05/2010 08:13 pm Paolo Bonzini

usb-linux.c: remove write-only variable

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

9f99cee7 01/26/2010 10:59 pm Kirill A. Shutemov

usb-linux.c: fix warning with _FORTIFY_SOURCE

CC usb-linux.o
cc1: warnings being treated as errors
usb-linux.c: In function 'usb_host_read_file':
usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_result
make: *** [usb-linux.o] Error 1...

beb6f0de 01/20/2010 12:31 am Kevin Wolf

Fix QEMU_WARN_UNUSED_RESULT

Since commit 747bbdf7 QEMU_WARN_UNUSED_RESULT is never defined as it is
conditional on a define from config-host.h which is included only later.
Include that file earlier to get the warnings back.

Reactivating it unfortunately leads to some warnings about unused qdev_init...

eba6fe87 12/18/2009 07:26 pm Gerd Hoffmann

usb-host: check mon before using it.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

0fe6d12e 12/12/2009 03:59 pm Markus Armbruster

qdev: Rename USBDevice member devname to product_desc

It's not a device name, it's the USB product description string.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

06384698 12/12/2009 03:59 pm Markus Armbruster

qdev: Separate USB product description from qdev name

Using the qdev name for the product description makes for inconvenient
qdev names.

Put the product description in new USBDeviceInfo member product_desc.
Make usb_qdev_init() use it. No user or guest visible change, since...

556cd098 12/12/2009 03:59 pm Markus Armbruster

qdev: Replace device names containing whitespace

Device names with whitespace require quoting in the shell and in the
monitor. Some of the offenders are also overly long. Some have a
more convenient alias, some don't.

The place for verbose device names is DeviceInfo member desc. The...

0745eb1e 12/03/2009 11:25 pm Markus Armbruster

Fix recently introduced bugs in -usbdevice host

Commit 26a9e82a has the following flaws:

  • It enabled DEBUG.
  • It referenced two properties by the wrong name in
    usb_host_device_open(), which crashes with "qdev_prop_set: property
    "USB Host Device.bus" not found"....
26a9e82a 10/30/2009 03:39 pm Gerd Hoffmann

usb-host: use qdev for -usbdevice + rework.

Changes:

  • We don't create/delete devices, we attach/detach them instead.
  • The separate autofilter list is gone, we simply walk the list
    of devices directly instead.
  • Autofiltering is done unconditionally now. Non-auto device scan...
dcc7e25f 10/27/2009 07:28 pm Paul Bolle

usb-linux: return USB_RET_STALL on -EPIPE

0) This is an attempt to get an issue in usb-linux.c, for which a patch
was posted about a year ago, finally fixed.

1) Mark Burkley submitted a "EHCI emulation module" for review in in
October 2008 (see:
http://lists.gnu.org/archive/html/qemu-devel/2008-10/msg01326.html). No...

33e66b86 10/07/2009 04:54 pm Markus Armbruster

Check return value of qdev_init()

But do so only where it may actually fail. Leave the rest for the
next commit.

Patchworks-ID: 35167
Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

05a91699 10/07/2009 04:54 pm Markus Armbruster

Unbreak USB autoconnect filters

Commit 22f84e73 added a qdev_init() missing on the path through
usb_host_device_open(), but that broke the path through
usb_host_auto_scan(), which already had one. Remove that one.

Patchworks-ID: 35169
Signed-off-by: Markus Armbruster <>...

22f84e73 09/25/2009 06:40 pm Gerd Hoffmann

unbreak usb pass-through on linux.

Changes: * Re-add the 'dev->fd = fd;' line which the qdev patches dropped
by mistake. * call qdev_init() so the newly created usb device is plugged into
a usb port and thus actually visible to the guest.

Signed-off-by: Gerd Hoffmann <>...

b2e3b6e9 09/12/2009 02:18 am malc

Use proper format conversion specifier when printing size_t value

And untabify this while we are at it.

Signed-off-by: malc <>

c4c0e236 09/11/2009 06:19 pm Jim Paris

usb-linux.c: fix buffer overflow

In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer and
length to the kernel. However, the length was provided by the caller
of dev->handle_packet, and is not checked, so the kernel might provide
too much data and overflow our buffer....

806b6024 09/09/2009 10:55 pm Gerd Hoffmann

qdev/usb: add usb bus support to qdev, convert drivers.

  • Add USBBus. * Add USBDeviceInfo, move device callbacks here. * Add usb-qdev helper functions. * Switch drivers to qdev.

TODO: * make the rest of qemu aware of usb busses and kill the FIXMEs
added by this patch....

a5d2f727 09/09/2009 10:55 pm Gerd Hoffmann

qdev/usb: make qemu aware of usb busses.

Move usb code from vl.c to usb-bus.c and make it use the new data
structures added by qdev conversion. qemu usb core should be able
to handle multiple USB busses just fine now (untested though).

Kill some usb_*_init() legacy functions, use usb_create_simple()...

179da8af 09/07/2009 10:00 pm Blue Swirl

USB: use opaque parameter passing for monitor handle

Signed-off-by: Blue Swirl <>

660f11be 08/01/2009 12:16 am Blue Swirl

Fix Sparse warnings: "Using plain integer as NULL pointer"

Signed-off-by: Blue Swirl <>

55496240 07/10/2009 09:44 pm Mark McLoughlin

Prefer sysfs for USB host devices

Scanning for devices via /sys/bus/usb/devices/ and using them via the
/dev/bus/usb/<bus>/<device> character devices is the prefered method
on modern kernels, so try that first.

When using SELinux and libvirt, qemu will have access to /sys/bus/usb...

d55ebf55 05/22/2009 06:50 pm Jason Wessel

USB serial device support

Add in a workaround to allow the usb serial devices to work with the
usb pass through mechanism. The ioctl() to request an alternate
interface will always return < 0 for a usb-serial device based on the
kernel driver. This means there is no alternate interface end point....

376253ec 03/06/2009 01:01 am aliguori

monitor: Rework API (Jan Kiszka)

Refactor the monitor API and prepare it for decoupled terminals:
term_print functions are renamed to monitor_* and all monitor services
gain a new parameter (mon) that will once refer to the monitor instance
the output is supposed to appear on. However, the argument remains...

1eec614b 02/06/2009 12:06 am aliguori

toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162

b4e237aa 12/28/2008 05:45 pm blueswir1

Suppress a -Werror=format-security warning

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6135 c046a42c-6fe2-441c-8c8c-71466251a162

68063649 11/22/2008 11:03 pm blueswir1

Native BSD host USB support (Juergen Lock, Lonnie Mendez)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5780 c046a42c-6fe2-441c-8c8c-71466251a162

47398b9c 11/22/2008 10:04 pm blueswir1

Use qemu_isfoobar and qemu_towombat versions, based on patch by Christoph Egger

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5774 c046a42c-6fe2-441c-8c8c-71466251a162

e41b3910 10/28/2008 08:22 pm pbrook

Use locally defined structure.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5569 c046a42c-6fe2-441c-8c8c-71466251a162

5be8e1f2 10/25/2008 02:47 pm blueswir1

Silence warnings about unused variables

Signed-off-by: Jan Kiszka <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5535 c046a42c-6fe2-441c-8c8c-71466251a162

f16a0db3 10/21/2008 07:34 pm aliguori

Keep usb host scanning from leaking file descriptors

If the first case does not succeed, then the usb scanning code will leak file
descriptors on every scan.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5509 c046a42c-6fe2-441c-8c8c-71466251a162

22babebb 10/21/2008 07:27 pm aliguori

Fix broken USB support for Linux host (Bjorn Danielsson)

Make "host:" usb devices work again on systems that have the
file /proc/bus/usb/devices. This was broken in r5441 due to
incorrect logic for the USB_FS_SYS case in usb_host_scan().

Signed-off-by: Bjorn Danielsson <>...

0f431527 10/07/2008 11:06 pm aliguori

Add USB sys file-system support (v8) (TJ)

This patch adds support for host USB devices discovered via:

/sys/bus/usb/devices/* and opened from /dev/bus/usb/*/*
/dev/bus/usb/devices and opened from /dev/bus/usb/*/*

in addition to the existing discovery via:...

ac4ffb5a 09/22/2008 06:04 pm aliguori

Don't use sprintf() or strcpy()

They are unsafe. The current code is correct, but to be safer, we should pass
an explicit size.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5290 c046a42c-6fe2-441c-8c8c-71466251a162

d9cf1578 09/15/2008 05:57 pm blueswir1

Define a few structures instead of including a file, add "static"

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5225 c046a42c-6fe2-441c-8c8c-71466251a162

5d0c5750 09/14/2008 04:07 am aliguori

usb: Support for removing device by host addr, improved auto filter syntax (Max Krasnyansky)

This patch adds support for removing USB devices by host address.
Which is usefull for things like libvirtd because there is no easy way to
find guest USB address of the host device....

446ab128 09/14/2008 04:06 am aliguori

husb: Make control transactions asynchronous (Max Krasnyansky)

USB is 99.8% async now :). 0.2% is the three control requests that
we need to execute synchronously. We could off-load that to a thread
or something but it's not worth the pain since those requests are...

0d380648 08/21/2008 10:32 pm aliguori

husb: Fixup printfs and stuff based on the review comments (Max Krasnyansky)

Addressing Anthony's comments regarding printf and stuff.

Anthony, if you you want I can fold this commit and resend
the original patch.

Signed-off-by: Max Krasnyansky <>...

24772c1e 08/21/2008 10:31 pm aliguori

husb: remove disconnect detection timer (Max Krasnyansky)

On top of my previous USB patchset.

Async completion handler can detect device disconnects without polling.
We do not need the timer anymore.

Signed-off-by: Max Krasnyansky <>
Signed-off-by: Anthony Liguori <>...

64838171 08/21/2008 10:31 pm aliguori

husb: rewrite Linux host USB layer, fully async operation (Max Krasnyansky)

This is a follow up to the async UHCI patch. Both BULK and ISOC transactions
are now fully asynchrounous. I left CONTROL synchronous for now, ideally
we want it to be async too and it should not be that hard to do now....

4b096fc9 08/21/2008 10:28 pm aliguori

husb: support for USB host device auto connect (Max Krasnyansky)

QEMU can now automatically grab host USB devices that match the filter.
For now I just extended 'host:X.Y' and 'host:VID:PID' syntax to handle
wildcards. So for example if you do something like...