summaryrefslogtreecommitdiff
path: root/hw/usb/host-libusb.c
AgeCommit message (Collapse)AuthorFilesLines
2014-02-14qdev: Remove hex8/32/64 property typesPaolo Bonzini1-2/+2
Replace them with uint8/32/64. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-10-22usb-host-libusb: Detach kernel drivers earlierHans de Goede1-2/+5
If we detach the kernel drivers on the first set_config, then they will be still attached when the device gets its initial reset. Causing the drivers to re-initialize the device after the reset, dirtying the device state. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-10-22usb-host-libusb: Configuration 0 may be a valid configurationHans de Goede1-5/+4
Quoting from: linux/Documentation/ABI/stable/sysfs-bus-usb: Note that some devices, in violation of the USB spec, have a configuration with a value equal to 0. Writing 0 to bConfigurationValue for these devices will install that configuration, rather then unconfigure the device. So don't compare the configuration value against 0 to check for unconfigured devices, instead check for a LIBUSB_ERROR_NOT_FOUND return from libusb_get_active_config_descriptor(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-10-22usb-host-libusb: Fix reset handlingHans de Goede1-6/+4
The guest will issue an initial device reset when the device is attached, but since the current usb-host-libusb code only actually does the reset when udev->configuration != 0, and on attach the device is not yet configured, the reset gets ignored. This means that the device gets passed to the guest in an unknown state, which is not good. The udev->configuration check is there because of the release / claim interfaces done around the libusb_device_reset call, but these are not necessary. If interfaces are claimed when libusb_device_reset gets called libusb will release + reclaim them itself. The usb_host_ep_update call also is not necessary. If the reset succeeds the original config and interface alt settings will be restored. Last if the reset fails, that means the device has either disconnected or morphed into an another device and has been completely re-enumerated, so it is treated by the host as a new device and our handle is invalid, so on reset failure we need to call usb_host_nodev(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-08-22aio / timers: Switch entire codebase to the new timer APIAlex Bligh1-3/+3
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-29devices: Associate devices to their logical categoryMarcel Apfelbaum1-0/+1
The category will be used to sort the devices displayed in the command line help. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-24usb-host-libusb: set USB_DEV_FLAG_IS_HOSTGerd Hoffmann1-0/+1
... like host-{linux,bsd}.c do. Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-06-24usb/host-libusb: Fix building with libusb git master codeHans de Goede1-0/+4
The next libusb release will deprecate libusb_get_port_path, and since we compile with -Werror, this breaks the build. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-06-03host-libusb: Correct test for USB packet stateEd Maste1-1/+1
USB_RET_ASYNC is -6, so inflight was always false. Signed-off-by: Ed Maste <emaste@freebsd.org> Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-05-07usb-host: add usb_host_full_speed_compatGerd Hoffmann1-3/+37
Alloes to pass through usb2 devices on usb1 host controllers if possible. Brings the libusb implementation to feature-parity with the linux usbfs code, so the usb-host implementation in 1.5 (libusb) doesn't regress compared to 1.4 (usbfs). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-05-07usb-host: live migration support for the libusb versionGerd Hoffmann1-5/+49
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-23usb-host: raise libusbx minimum version to 1.0.13Gerd Hoffmann1-5/+0
Allows to remove one FIXME. Makes LIBUSB_LOG_LEVEL_WARNING build errors go away. And starting with that version libusb has a LIBUSBX_API_VERSION define which allows to easily #ifdef version dependencies should that need arrive in the future. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16use libusb for usb-hostGerd Hoffmann1-0/+1449
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. (4) Bring usb-host support to any platform supported by libusbx. For now this goes side-by-side to the existing code. That is only to simplify regression testing though, at the end of the day I want remove the old code and support libusb exclusively. Merge early in 1.5 cycle, remove the old code after 1.5 release or something like this. Thanks to qdev the old and new code can coexist nicely on linux. Just use "-device usb-host-linux" to use the old linux driver instead of the libusb one (which takes over the "usb-host" name). The bsd driver isn't qdev'ified so it isn't that easy for bsd. I didn't bother making it runtime switchable, so you have to rebuild qemu with --disable-libusb to get back the old code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>