aboutsummaryrefslogtreecommitdiff
path: root/disas.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-10-08 21:58:06 +0200
committerGerd Hoffmann <kraxel@redhat.com>2013-10-22 16:28:48 +0200
commit5af35d7feccaa7d26b72c6c3d14116421d736b36 (patch)
treec126ab9a151044c10e305b4834c958b395b92fd4 /disas.c
parentfc8ead74674b7129e8f31c2595c76658e5622197 (diff)
downloadqemu-5af35d7feccaa7d26b72c6c3d14116421d736b36.zip
qemu-5af35d7feccaa7d26b72c6c3d14116421d736b36.tar.gz
qemu-5af35d7feccaa7d26b72c6c3d14116421d736b36.tar.bz2
usb-host-libusb: Fix reset handling
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>
Diffstat (limited to 'disas.c')
0 files changed, 0 insertions, 0 deletions