Statistics
| Branch: | Revision:

root / hw / usb-bus.c @ e9b382b0

History | View | Annotate | Download (10 kB)

# Date Author Comment
ea87e95f 01/24/2011 06:23 pm Blue Swirl

usb-bus: use snprintf

Avoid this warning from OpenBSD linker:
LINK i386-softmmu/qemu
../usb-bus.o(.text+0x27c): In function `usb_get_fw_dev_path':
/src/qemu/hw/usb-bus.c:294: warning: sprintf() is often misused,
please use snprintf()

Signed-off-by: Blue Swirl <>...

c1ecb40a 01/24/2011 06:21 pm Gerd Hoffmann

usb core: add migration support

Yes, seriously. There is no migration support at all for usb devices.
They loose state, especially the device address, and stop responding
because of that. Oops.

Luckily there is so much broken usb hardware out there that the guest...

ace1318b 01/12/2011 12:40 pm Gerd Hoffmann

usb: zap pdev from usbport

It isn't needed any more.

Signed-off-by: Gerd Hoffmann <>

70d31cb2 01/12/2011 12:37 pm Gerd Hoffmann

usb: rewrite fw path, fix numbering

This patch rewrites the firmware path code to use the physical port
location tracking just added to the qemu usb core. It also fixes the
port numbering to start with "1" in the firmware path.

Signed-off-by: Gerd Hoffmann <>

5f69076b 01/11/2011 06:27 pm Gerd Hoffmann

usb: add port property.

This allows to explictily set the physical port where you want to
plug the usb device. Example:

-device usb-tablet,bus=usb.0,port=2

With explicit port addressing qemu can and will not automagically add
USB Hubs. This means that:...

c7a2196a 01/11/2011 06:24 pm Gerd Hoffmann

usb: keep track of physical port address.

Add a path string to USBPort. Add usb_port_location() function to set
the physical location of the usb port. Update all drivers implementing
usb ports to call it. Update the monitor commands to print it. Wind it...

843d4e0c 01/11/2011 06:15 pm Gerd Hoffmann

usb: add speed mask to ports

Add a field to usb ports indicating the speed(s) they are
able to handle.

Signed-off-by: Gerd Hoffmann <>

0d86d2be 01/11/2011 06:01 pm Gerd Hoffmann

usb: create USBPortOps, move attach there.

Create USBPortOps struct, move the attach function to that struct.

Signed-off-by: Gerd Hoffmann <>

132a3f55 01/11/2011 04:56 pm Gerd Hoffmann

usb descriptors: add settable strings.

This patch allows to set usb descriptor strings per device instance.

Signed-off-by: Gerd Hoffmann <>

ab28ccc0 12/11/2010 11:32 pm Gleb Natapov

Record which USBDevice USBPort belongs too.

Ports on root hub will have NULL here. This is needed to reconstruct
path from device to its root hub to build device path.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

cdedd006 12/11/2010 11:32 pm Gleb Natapov

Add get_fw_dev_path callback for usb bus.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

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

98f22dc1 04/02/2010 01:12 pm TeLeMan

usb-bus: fix no params

After commit 702f3e0fb52c124c07f215426eeadb70a716643f, the params is
nerver NULL. It should check *params instead of params to determine
whether the params is empty.

Signed-off-by: TeLeMan <>
Signed-off-by: Aurelien Jarno <>

702f3e0f 03/17/2010 05:42 pm Jan Kiszka

Avoid crash on '-usbdevice <device>' without parameters

Many usbdevice_init implementors assume params is non-NULL.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

1ecda02b 03/16/2010 05:58 pm Markus Armbruster

error: Replace qemu_error() by error_report()

error_report() terminates the message with a newline. Strip it it
from its arguments.

This fixes a few error messages lacking a newline:
net_handle_fd_param()'s "No file descriptor named %s found", and
tap_open()'s "vnet_hdr=1 requested, but no kernel support for...

d44168ff 02/25/2010 03:29 pm Paul Brook

Fix -usbdevice crash

If -usbdevice is used on a machine with no USB busses, usb_create
will fail and return NULL. Patch below handles this failure gracefully
rather than crashing when we try to init the device.

Signed-off-by: Paul Brook <>

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

66a6593a 10/30/2009 03:39 pm Gerd Hoffmann

usb: print attached status in info qtree

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

61e094c0 10/30/2009 03:39 pm Gerd Hoffmann

usb: make attach optional.

Add a auto_attach field to USBDevice, which is enabled by default.
USB drivers can clear this field in case they do not want the device
being attached (i.e. plugged into a usb port) automatically after
successfull init().

Use cases (see next patches):...

0958b4cc 10/30/2009 03:39 pm Gerd Hoffmann

usb core: use qdev for -usbdevice

This patchs adds infrastructure to handle -usbdevice via qdev callbacks.
USBDeviceInfo gets a name field (for the -usbdevice driver name) and a
callback for -usbdevice parameter parsing.

The new usbdevice_create() function walks the qdev driver list and looks...

e23a1b33 10/07/2009 04:54 pm Markus Armbruster

New qdev_init_nofail()

Like qdev_init(), but terminate program via hw_error() instead of
returning an error value.

Use it instead of qdev_init() where terminating the program on failure
is okay, either because it's during machine construction, or because...

a8e662b5 10/05/2009 05:32 pm Gerd Hoffmann

usb: hook unplug into qdev, cleanups + fixes.

Hook into DeviceInfo->exit().

handle_destroy() must not free the state struct, this is handled
by the new usb_qdev_exit() function now.

qdev_free(usb_device) works now.

Fix usb hub to qdev_free() all connected devices on unplug....

ef816d83 10/05/2009 05:32 pm Gerd Hoffmann

usb: hotplug windup

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

b2317837 10/05/2009 05:32 pm Gerd Hoffmann

switch usb bus to inplace allocation.

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

72cf2d4f 09/12/2009 10:36 am Blue Swirl

Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...

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