Statistics
| Branch: | Revision:

root / hw / usb-bus.c @ 145aebec

History | View | Annotate | Download (11.5 kB)

# Date Author Comment
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 <>

eb3b58f9 07/08/2011 12:26 pm Jes Sorensen

usb_register_port(): do not set port->opaque and port->index twice

Signed-off-by: Jes Sorensen <>
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....

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

usb: Add a register_companion USB bus op.

This is a preparation patch for adding support for USB companion controllers.

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

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

090ac642 07/05/2011 04:09 pm Hans de Goede

usb: Add a usb_fill_port helper function

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

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

usb-bus: Don't allow speed mismatch while attaching devices

Signed-off-by: Gerd Hoffmann <>

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

usb-bus: Don't allow attaching a device to a bus with no free ports

Signed-off-by: Gerd Hoffmann <>

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

usb: Proper error propagation for usb_device_attach errors

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

290d26d2 06/14/2011 01:56 pm Hans de Goede

usb-bus: Add knowledge of USB_SPEED_SUPER to usb_speed helper

Signed-off-by: Gerd Hoffmann <>

290a5c60 06/14/2011 01:56 pm Hans de Goede

usb-bus: Don't detach non attached devices on device exit

This causes an "Error: tried to detach unattached usb device " to be printed,
this can happen when deleting ie a usb host qdev, which did not
get attached (because a device matching the filter never got plugged in)....

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